diff --git a/.fernignore b/.fernignore index 194ddca6a..7f69f590a 100644 --- a/.fernignore +++ b/.fernignore @@ -9,7 +9,6 @@ src/index.ts src/errors/SquareError.ts src/core/index.ts src/core/crypto -src/core/json.ts tests/unit/error.test.ts tests/unit/fetcher/stream-wrappers/webpack.test.ts tests/integration diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa882cbcb..bb43fde64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: uses: actions/setup-node@v3 - name: Compile - run: yarn && yarn test + run: yarn && yarn test:unit publish: needs: [ compile ] diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml new file mode 100644 index 000000000..184f4aaa5 --- /dev/null +++ b/.mock/definition/__package__.yml @@ -0,0 +1,35610 @@ +types: + AchDetails: + docs: >- + ACH-specific details about `BANK_ACCOUNT` type payments with the + `transfer_type` of `ACH`. + properties: + routing_number: + type: optional> + docs: The routing number for the bank account. + validation: + maxLength: 50 + account_number_suffix: + type: optional> + docs: The last few digits of the bank account number. + validation: + minLength: 1 + maxLength: 4 + account_type: + type: optional> + docs: >- + The type of the bank account performing the transfer. The account type + can be `CHECKING`, + + `SAVINGS`, or `UNKNOWN`. + validation: + maxLength: 50 + source: + openapi: openapi/openapi.json + AcceptDisputeResponse: + docs: Defines the fields in an `AcceptDispute` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + dispute: + type: optional + docs: Details about the accepted dispute. + source: + openapi: openapi/openapi.json + AcceptedPaymentMethods: + properties: + apple_pay: + type: optional> + docs: Whether Apple Pay is accepted at checkout. + google_pay: + type: optional> + docs: Whether Google Pay is accepted at checkout. + cash_app_pay: + type: optional> + docs: Whether Cash App Pay is accepted at checkout. + afterpay_clearpay: + type: optional> + docs: Whether Afterpay/Clearpay is accepted at checkout. + source: + openapi: openapi/openapi.json + AccumulateLoyaltyPointsResponse: + docs: >- + Represents an + [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) + response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + event: + type: optional + docs: >- + The resulting loyalty event. Starting in Square version 2022-08-17, + this field is no longer returned. + events: + type: optional> + docs: >- + The resulting loyalty events. If the purchase qualifies for points, + the `ACCUMULATE_POINTS` event + + is always included. When using the Orders API, the + `ACCUMULATE_PROMOTION_POINTS` event is included + + if the purchase also qualifies for a loyalty promotion. + source: + openapi: openapi/openapi.json + ActionCancelReason: + enum: + - BUYER_CANCELED + - SELLER_CANCELED + - TIMED_OUT + source: + openapi: openapi/openapi.json + ActivityType: + enum: + - ADJUSTMENT + - APP_FEE_REFUND + - APP_FEE_REVENUE + - AUTOMATIC_SAVINGS + - AUTOMATIC_SAVINGS_REVERSED + - CHARGE + - DEPOSIT_FEE + - DEPOSIT_FEE_REVERSED + - DISPUTE + - ESCHEATMENT + - FEE + - FREE_PROCESSING + - HOLD_ADJUSTMENT + - INITIAL_BALANCE_CHANGE + - MONEY_TRANSFER + - MONEY_TRANSFER_REVERSAL + - OPEN_DISPUTE + - OTHER + - OTHER_ADJUSTMENT + - PAID_SERVICE_FEE + - PAID_SERVICE_FEE_REFUND + - REDEMPTION_CODE + - REFUND + - RELEASE_ADJUSTMENT + - RESERVE_HOLD + - RESERVE_RELEASE + - RETURNED_PAYOUT + - SQUARE_CAPITAL_PAYMENT + - SQUARE_CAPITAL_REVERSED_PAYMENT + - SUBSCRIPTION_FEE + - SUBSCRIPTION_FEE_PAID_REFUND + - SUBSCRIPTION_FEE_REFUND + - TAX_ON_FEE + - THIRD_PARTY_FEE + - THIRD_PARTY_FEE_REFUND + - PAYOUT + - AUTOMATIC_BITCOIN_CONVERSIONS + - AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED + - CREDIT_CARD_REPAYMENT + - CREDIT_CARD_REPAYMENT_REVERSED + - LOCAL_OFFERS_CASHBACK + - LOCAL_OFFERS_FEE + - PERCENTAGE_PROCESSING_ENROLLMENT + - PERCENTAGE_PROCESSING_DEACTIVATION + - PERCENTAGE_PROCESSING_REPAYMENT + - PERCENTAGE_PROCESSING_REPAYMENT_REVERSED + - PROCESSING_FEE + - PROCESSING_FEE_REFUND + - UNDO_PROCESSING_FEE_REFUND + - GIFT_CARD_LOAD_FEE + - GIFT_CARD_LOAD_FEE_REFUND + - UNDO_GIFT_CARD_LOAD_FEE_REFUND + - BALANCE_FOLDERS_TRANSFER + - BALANCE_FOLDERS_TRANSFER_REVERSED + - GIFT_CARD_POOL_TRANSFER + - GIFT_CARD_POOL_TRANSFER_REVERSED + - SQUARE_PAYROLL_TRANSFER + - SQUARE_PAYROLL_TRANSFER_REVERSED + source: + openapi: openapi/openapi.json + AddGroupToCustomerResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [AddGroupToCustomer](api-endpoint:Customers-AddGroupToCustomer) endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + AdditionalRecipient: + docs: >- + Represents an additional recipient (other than the merchant) receiving a + portion of this tender. + properties: + location_id: + type: string + docs: >- + The location ID for a recipient (other than the merchant) receiving a + portion of this tender. + validation: + minLength: 1 + maxLength: 50 + description: + type: optional> + docs: The description of the additional recipient. + validation: + maxLength: 100 + amount_money: + type: Money + docs: The amount of money distributed to the recipient. + receivable_id: + type: optional> + docs: >- + The unique ID for the RETIRED `AdditionalRecipientReceivable` object. + This field should be empty for any `AdditionalRecipient` objects + created after the retirement. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + Address: + docs: >- + Represents a postal address in a country. + + For more information, see [Working with + Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + properties: + address_line_1: + type: optional> + docs: >- + The first line of the address. + + + Fields that start with `address_line` provide the address's most + specific + + details, like street number, street name, and building name. They do + *not* + + provide less specific details like city, state/province, or country + (these + + details are provided in other fields). + address_line_2: + type: optional> + docs: The second line of the address, if any. + address_line_3: + type: optional> + docs: The third line of the address, if any. + locality: + type: optional> + docs: >- + The city or town of the address. For a full list of field meanings by + country, see [Working with + Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + sublocality: + type: optional> + docs: A civil region within the address's `locality`, if any. + sublocality_2: + type: optional> + docs: A civil region within the address's `sublocality`, if any. + sublocality_3: + type: optional> + docs: A civil region within the address's `sublocality_2`, if any. + administrative_district_level_1: + type: optional> + docs: >- + A civil entity within the address's country. In the US, this + + is the state. For a full list of field meanings by country, see + [Working with + Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + administrative_district_level_2: + type: optional> + docs: |- + A civil entity within the address's `administrative_district_level_1`. + In the US, this is the county. + administrative_district_level_3: + type: optional> + docs: |- + A civil entity within the address's `administrative_district_level_2`, + if any. + postal_code: + type: optional> + docs: >- + The address's postal code. For a full list of field meanings by + country, see [Working with + Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + country: + type: optional + docs: >- + The address's country, in the two-letter format of ISO 3166. For + example, `US` or `FR`. + + See [Country](#type-country) for possible values + first_name: + type: optional> + docs: Optional first name when it's representing recipient. + last_name: + type: optional> + docs: Optional last name when it's representing recipient. + source: + openapi: openapi/openapi.json + AdjustLoyaltyPointsResponse: + docs: >- + Represents an + [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + event: + type: optional + docs: The resulting event data for the adjustment. + source: + openapi: openapi/openapi.json + AfterpayDetails: + docs: Additional details about Afterpay payments. + properties: + email_address: + type: optional> + docs: Email address on the buyer's Afterpay account. + validation: + maxLength: 255 + source: + openapi: openapi/openapi.json + ApplicationDetails: + docs: Details about the application that took the payment. + properties: + square_product: + type: optional + docs: >- + The Square product, such as Square Point of Sale (POS), + + Square Invoices, or Square Virtual Terminal. + + See [ExternalSquareProduct](#type-externalsquareproduct) for possible + values + application_id: + type: optional> + docs: >- + The Square ID assigned to the application used to take the payment. + + Application developers can use this information to identify payments + that + + their application processed. + + For example, if a developer uses a custom application to process + payments, + + this field contains the application ID from the Developer Dashboard. + + If a seller uses a [Square App + Marketplace](https://developer.squareup.com/docs/app-marketplace) + + application to process payments, the field contains the corresponding + application ID. + source: + openapi: openapi/openapi.json + ApplicationDetailsExternalSquareProduct: + enum: + - APPOINTMENTS + - ECOMMERCE_API + - INVOICES + - ONLINE_STORE + - OTHER + - RESTAURANTS + - RETAIL + - SQUARE_POS + - TERMINAL_API + - VIRTUAL_TERMINAL + docs: A list of products to return to external callers. + source: + openapi: openapi/openapi.json + ApplicationType: literal<"TERMINAL_API"> + AppointmentSegment: + docs: Defines an appointment segment of a booking. + properties: + duration_minutes: + type: optional> + docs: The time span in minutes of an appointment segment. + validation: + max: 1500 + service_variation_id: + type: optional> + docs: >- + The ID of the [CatalogItemVariation](entity:CatalogItemVariation) + object representing the service booked in this segment. + validation: + maxLength: 36 + team_member_id: + type: string + docs: >- + The ID of the [TeamMember](entity:TeamMember) object representing the + team member booked in this segment. + validation: + minLength: 1 + maxLength: 32 + service_variation_version: + type: optional> + docs: >- + The current version of the item variation representing the service + booked in this segment. + intermission_minutes: + type: optional + docs: >- + Time between the end of this segment and the beginning of the + subsequent segment. + access: read-only + any_team_member: + type: optional + docs: >- + Whether the customer accepts any team member, instead of a specific + one, to serve this segment. + access: read-only + resource_ids: + type: optional> + docs: >- + The IDs of the seller-accessible resources used for this appointment + segment. + access: read-only + source: + openapi: openapi/openapi.json + ArchivedState: + enum: + - ARCHIVED_STATE_NOT_ARCHIVED + - ARCHIVED_STATE_ARCHIVED + - ARCHIVED_STATE_ALL + docs: |- + Defines the values for the `archived_state` query expression + used in [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + to return the archived, not archived or either type of catalog items. + source: + openapi: openapi/openapi.json + Availability: + docs: >- + Defines an appointment slot that encapsulates the appointment segments, + location and starting time available for booking. + properties: + start_at: + type: optional> + docs: >- + The RFC 3339 timestamp specifying the beginning time of the slot + available for booking. + location_id: + type: optional + docs: The ID of the location available for booking. + validation: + maxLength: 32 + access: read-only + appointment_segments: + type: optional>> + docs: The list of appointment segments available for booking + source: + openapi: openapi/openapi.json + BankAccount: + docs: >- + Represents a bank account. For more information about + + linking a bank account to a Square account, see + + [Bank Accounts + API](https://developer.squareup.com/docs/bank-accounts-api). + properties: + id: + type: string + docs: The unique, Square-issued identifier for the bank account. + validation: + minLength: 1 + maxLength: 30 + account_number_suffix: + type: string + docs: The last few digits of the account number. + validation: + minLength: 1 + country: + type: Country + docs: |- + The ISO 3166 Alpha-2 country code where the bank account is based. + See [Country](#type-country) for possible values + currency: + type: Currency + docs: >- + The 3-character ISO 4217 currency code indicating the operating + + currency of the bank account. For example, the currency code for US + dollars + + is `USD`. + + See [Currency](#type-currency) for possible values + account_type: + type: BankAccountType + docs: |- + The financial purpose of the associated bank account. + See [BankAccountType](#type-bankaccounttype) for possible values + holder_name: + type: string + docs: |- + Name of the account holder. This name must match the name + on the targeted bank account record. + validation: + minLength: 1 + primary_bank_identification_number: + type: string + docs: >- + Primary identifier for the bank. For more information, see + + [Bank Accounts + API](https://developer.squareup.com/docs/bank-accounts-api). + validation: + maxLength: 40 + secondary_bank_identification_number: + type: optional> + docs: >- + Secondary identifier for the bank. For more information, see + + [Bank Accounts + API](https://developer.squareup.com/docs/bank-accounts-api). + validation: + maxLength: 40 + debit_mandate_reference_id: + type: optional> + docs: >- + Reference identifier that will be displayed to UK bank account owners + + when collecting direct debit authorization. Only required for UK bank + accounts. + reference_id: + type: optional> + docs: >- + Client-provided identifier for linking the banking account to an + entity + + in a third-party system (for example, a bank account number or a user + identifier). + location_id: + type: optional> + docs: The location to which the bank account belongs. + status: + type: BankAccountStatus + docs: |- + Read-only. The current verification status of this BankAccount object. + See [BankAccountStatus](#type-bankaccountstatus) for possible values + creditable: + type: boolean + docs: >- + Indicates whether it is possible for Square to send money to this bank + account. + debitable: + type: boolean + docs: |- + Indicates whether it is possible for Square to take money from this + bank account. + fingerprint: + type: optional> + docs: >- + A Square-assigned, unique identifier for the bank account based on the + + account information. The account fingerprint can be used to compare + account + + entries and determine if the they represent the same real-world bank + account. + version: + type: optional + docs: The current version of the `BankAccount`. + bank_name: + type: optional> + docs: |- + Read only. Name of actual financial institution. + For example "Bank of America". + validation: + maxLength: 100 + source: + openapi: openapi/openapi.json + BankAccountCreatedEvent: + docs: |- + Published when you link an external bank account to a Square + account in the Seller Dashboard. Square sets the initial status to + `VERIFICATION_IN_PROGRESS` and publishes the event. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"bank_account.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + BankAccountCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"bank_account"`. + id: + type: optional + docs: ID of the affected bank account. + object: + type: optional + docs: An object containing the created bank account. + source: + openapi: openapi/openapi.json + BankAccountCreatedEventObject: + properties: + bank_account: + type: optional + docs: The created bank account. + source: + openapi: openapi/openapi.json + BankAccountDisabledEvent: + docs: |- + Published when Square sets the status of a + [BankAccount](entity:BankAccount) to `DISABLED`. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"bank_account.disabled"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was disabled, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + BankAccountDisabledEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"bank_account"`. + id: + type: optional + docs: ID of the affected bank account. + object: + type: optional + docs: An object containing the disabled bank account. + source: + openapi: openapi/openapi.json + BankAccountDisabledEventObject: + properties: + bank_account: + type: optional + docs: The disabled bank account. + source: + openapi: openapi/openapi.json + BankAccountPaymentDetails: + docs: Additional details about BANK_ACCOUNT type payments. + properties: + bank_name: + type: optional> + docs: The name of the bank associated with the bank account. + validation: + maxLength: 100 + transfer_type: + type: optional> + docs: The type of the bank transfer. The type can be `ACH` or `UNKNOWN`. + validation: + maxLength: 50 + account_ownership_type: + type: optional> + docs: |- + The ownership type of the bank account performing the transfer. + The type can be `INDIVIDUAL`, `COMPANY`, or `ACCOUNT_TYPE_UNKNOWN`. + validation: + maxLength: 50 + fingerprint: + type: optional> + docs: |- + Uniquely identifies the bank account for this seller and can be used + to determine if payments are from the same bank account. + validation: + maxLength: 255 + country: + type: optional> + docs: >- + The two-letter ISO code representing the country the bank account is + located in. + validation: + minLength: 2 + maxLength: 2 + statement_description: + type: optional> + docs: The statement description as sent to the bank. + validation: + maxLength: 1000 + ach_details: + type: optional + docs: >- + ACH-specific information about the transfer. The information is only + populated + + if the `transfer_type` is `ACH`. + errors: + type: optional>> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + BankAccountStatus: + enum: + - VERIFICATION_IN_PROGRESS + - VERIFIED + - DISABLED + docs: Indicates the current verification status of a `BankAccount` object. + source: + openapi: openapi/openapi.json + BankAccountType: + enum: + - CHECKING + - SAVINGS + - INVESTMENT + - OTHER + - BUSINESS_CHECKING + docs: Indicates the financial purpose of the bank account. + source: + openapi: openapi/openapi.json + BankAccountVerifiedEvent: + docs: |- + Published when Square sets the status of a + [BankAccount](entity:BankAccount) to `VERIFIED`. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"bank_account.verified"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was verified, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + BankAccountVerifiedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"bank_account"`. + id: + type: optional + docs: ID of the affected bank account. + object: + type: optional + docs: An object containing the verified bank account. + source: + openapi: openapi/openapi.json + BankAccountVerifiedEventObject: + properties: + bank_account: + type: optional + docs: The verified bank account. + source: + openapi: openapi/openapi.json + BatchChangeInventoryRequest: + properties: + idempotency_key: + type: string + docs: >- + A client-supplied, universally unique identifier (UUID) for the + + request. + + + See + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + in the + + [API Development 101](https://developer.squareup.com/docs/buildbasics) + section for more + + information. + validation: + minLength: 1 + maxLength: 128 + changes: + type: optional>> + docs: >- + The set of physical counts and inventory adjustments to be made. + + Changes are applied based on the client-supplied timestamp and may be + sent + + out of order. + ignore_unchanged_counts: + type: optional> + docs: >- + Indicates whether the current physical count should be ignored if + + the quantity is unchanged since the last physical count. Default: + `true`. + source: + openapi: openapi/openapi.json + BatchChangeInventoryResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + counts: + type: optional> + docs: The current counts for all objects referenced in the request. + changes: + type: optional> + docs: Changes created for the request. + source: + openapi: openapi/openapi.json + BatchDeleteCatalogObjectsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + deleted_object_ids: + type: optional> + docs: The IDs of all CatalogObjects deleted by this request. + deleted_at: + type: optional + docs: >- + The database + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + of this deletion in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + source: + openapi: openapi/openapi.json + BatchGetCatalogObjectsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + objects: + type: optional> + docs: A list of [CatalogObject](entity:CatalogObject)s returned. + related_objects: + type: optional> + docs: >- + A list of [CatalogObject](entity:CatalogObject)s referenced by the + object in the `objects` field. + source: + openapi: openapi/openapi.json + BatchRetrieveInventoryChangesRequest: + properties: + catalog_object_ids: + type: optional>> + docs: |- + The filter to return results by `CatalogObject` ID. + The filter is only applicable when set. The default value is null. + location_ids: + type: optional>> + docs: |- + The filter to return results by `Location` ID. + The filter is only applicable when set. The default value is null. + types: + type: optional>> + docs: >- + The filter to return results by `InventoryChangeType` values other + than `TRANSFER`. + + The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. + states: + type: optional>> + docs: |- + The filter to return `ADJUSTMENT` query results by + `InventoryState`. This filter is only applied when set. + The default value is null. + updated_after: + type: optional> + docs: |- + The filter to return results with their `calculated_at` value + after the given time as specified in an RFC 3339 timestamp. + The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). + updated_before: + type: optional> + docs: >- + The filter to return results with their `created_at` or + `calculated_at` value + + strictly before the given time as specified in an RFC 3339 timestamp. + + The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for the original + query. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + limit: + type: optional> + docs: The number of [records](entity:InventoryChange) to return. + validation: + min: 1 + max: 1000 + source: + openapi: openapi/openapi.json + BatchGetInventoryChangesResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + changes: + type: optional> + docs: |- + The current calculated inventory changes for the requested objects + and locations. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + source: + openapi: openapi/openapi.json + BatchGetInventoryCountsRequest: + properties: + catalog_object_ids: + type: optional>> + docs: |- + The filter to return results by `CatalogObject` ID. + The filter is applicable only when set. The default is null. + location_ids: + type: optional>> + docs: |- + The filter to return results by `Location` ID. + This filter is applicable only when set. The default is null. + updated_after: + type: optional> + docs: |- + The filter to return results with their `calculated_at` value + after the given time as specified in an RFC 3339 timestamp. + The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for the original + query. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + states: + type: optional>> + docs: >- + The filter to return results by `InventoryState`. The filter is only + applicable when set. + + Ignored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`. + + The default is null. + limit: + type: optional> + docs: The number of [records](entity:InventoryCount) to return. + validation: + min: 1 + max: 1000 + source: + openapi: openapi/openapi.json + BatchGetInventoryCountsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + counts: + type: optional> + docs: |- + The current calculated inventory counts for the requested objects + and locations. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + source: + openapi: openapi/openapi.json + BatchGetOrdersResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `BatchRetrieveOrders` endpoint. + properties: + orders: + type: optional> + docs: >- + The requested orders. This will omit any requested orders that do not + exist. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchUpsertCatalogObjectsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + objects: + type: optional> + docs: The created successfully created CatalogObjects. + updated_at: + type: optional + docs: >- + The database + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + of this update in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + id_mappings: + type: optional> + docs: The mapping between client and server IDs for this upsert. + source: + openapi: openapi/openapi.json + Booking: + docs: >- + Represents a booking as a time-bound service contract for a seller's staff + member to provide a specified service + + at a given location to a requesting customer in one or more appointment + segments. + properties: + id: + type: optional + docs: A unique ID of this object representing a booking. + validation: + maxLength: 36 + access: read-only + version: + type: optional + docs: The revision number for the booking used for optimistic concurrency. + status: + type: optional + docs: >- + The status of the booking, describing where the booking stands with + respect to the booking state machine. + + See [BookingStatus](#type-bookingstatus) for possible values + created_at: + type: optional + docs: The RFC 3339 timestamp specifying the creation time of this booking. + access: read-only + updated_at: + type: optional + docs: >- + The RFC 3339 timestamp specifying the most recent update time of this + booking. + access: read-only + start_at: + type: optional> + docs: The RFC 3339 timestamp specifying the starting time of this booking. + location_id: + type: optional> + docs: >- + The ID of the [Location](entity:Location) object representing the + location where the booked service is provided. Once set when the + booking is created, its value cannot be changed. + validation: + maxLength: 32 + customer_id: + type: optional> + docs: >- + The ID of the [Customer](entity:Customer) object representing the + customer receiving the booked service. + validation: + maxLength: 192 + customer_note: + type: optional> + docs: >- + The free-text field for the customer to supply notes about the + booking. For example, the note can be preferences that cannot be + expressed by supported attributes of a relevant + [CatalogObject](entity:CatalogObject) instance. + validation: + maxLength: 4096 + seller_note: + type: optional> + docs: >- + The free-text field for the seller to supply notes about the booking. + For example, the note can be preferences that cannot be expressed by + supported attributes of a specific + [CatalogObject](entity:CatalogObject) instance. + + This field should not be visible to customers. + validation: + maxLength: 4096 + appointment_segments: + type: optional>> + docs: A list of appointment segments for this booking. + transition_time_minutes: + type: optional + docs: >- + Additional time at the end of a booking. + + Applications should not make this field visible to customers of a + seller. + access: read-only + all_day: + type: optional + docs: Whether the booking is of a full business day. + access: read-only + location_type: + type: optional + docs: >- + The type of location where the booking is held. + + See + [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) + for possible values + creator_details: + type: optional + docs: Information about the booking creator. + source: + type: optional + docs: >- + The source of the booking. + + Access to this field requires seller-level permissions. + + See [BookingBookingSource](#type-bookingbookingsource) for possible + values + address: + type: optional
+ docs: Stores a customer address if the location type is `CUSTOMER_LOCATION`. + source: + openapi: openapi/openapi.json + BookingBookingSource: + enum: + - FIRST_PARTY_MERCHANT + - FIRST_PARTY_BUYER + - THIRD_PARTY_BUYER + - API + docs: Supported sources a booking was created from. + source: + openapi: openapi/openapi.json + BookingCreatedEvent: + docs: >- + Published when a booking is created. + + + To receive this event with buyer-level permissions, you must have + `APPOINTMENTS_READ` set for the OAuth scope. + + To receive this event with seller-level permissions, you must have + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"booking.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + BookingCreatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"booking"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the created booking. + source: + openapi: openapi/openapi.json + BookingCreatedEventObject: + properties: + booking: + type: optional + docs: The created booking. + source: + openapi: openapi/openapi.json + BookingCreatorDetails: + docs: Information about a booking creator. + properties: + creator_type: + type: optional + docs: >- + The seller-accessible type of the creator of the booking. + + See + [BookingCreatorDetailsCreatorType](#type-bookingcreatordetailscreatortype) + for possible values + team_member_id: + type: optional + docs: >- + The ID of the team member who created the booking, when the booking + creator is of the `TEAM_MEMBER` type. + + Access to this field requires seller-level permissions. + validation: + maxLength: 32 + access: read-only + customer_id: + type: optional + docs: >- + The ID of the customer who created the booking, when the booking + creator is of the `CUSTOMER` type. + + Access to this field requires seller-level permissions. + validation: + maxLength: 192 + access: read-only + source: + openapi: openapi/openapi.json + BookingCreatorDetailsCreatorType: + enum: + - TEAM_MEMBER + - CUSTOMER + docs: Supported types of a booking creator. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionOwnedCreatedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + is created by the subscribing application. Subscribe to this event to be + notified + + when your application creates a booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.owned.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionOwnedDeletedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + is deleted by the subscribing application. Subscribe to this event to be + notified + + when your application deletes a booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionOwnedUpdatedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + is updated by the subscribing application. Subscribe to this event to be + notified + + when your application updates a booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionVisibleCreatedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + with the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is created. + + An application that subscribes to this event is notified when a booking + custom attribute definition is created + + by any application for which the subscribing application has read access + to the booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.visible.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionVisibleDeletedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + with the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is deleted. + + An application that subscribes to this event is notified when a booking + custom attribute definition is deleted + + by any application for which the subscribing application has read access + to the booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDefinitionVisibleUpdatedEvent: + docs: >- + Published when a booking [custom attribute + definition](entity:CustomAttributeDefinition) + + with the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is updated. + + An application that subscribes to this event is notified when a booking + custom attribute definition is updated + + by any application for which the subscribing application has read access + to the booking custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute_definition.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeDeleteRequest: + docs: >- + Represents an individual delete request in a + [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) + + request. An individual request contains a booking ID, the custom attribute + to delete, and an optional idempotency key. + properties: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + validation: + minLength: 1 + maxLength: 36 + key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match the + `key` of a + + custom attribute definition in the Square seller account. If the + requesting application is not + + the definition owner, you must use the qualified key. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + BookingCustomAttributeDeleteResponse: + docs: >- + Represents a response for an individual upsert request in a + [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) + operation. + properties: + booking_id: + type: optional + docs: >- + The ID of the [booking](entity:Booking) associated with the custom + attribute. + errors: + type: optional> + docs: Any errors that occurred while processing the individual request. + source: + openapi: openapi/openapi.json + BookingCustomAttributeOwnedDeletedEvent: + docs: >- + Published when a booking [custom attribute](entity:CustomAttribute) + + associated with a [custom attribute + definition](entity:CustomAttributeDefinition) that is + + owned by the subscribing application is deleted. + + Subscribe to this event to be notified + + when your application deletes a booking custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeOwnedUpdatedEvent: + docs: >- + Published when a booking [custom attribute](entity:CustomAttribute) + + is updated by the subscribing application. Subscribe to this event to be + notified + + when your application updates a booking custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeUpsertRequest: + docs: >- + Represents an individual upsert request in a + [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) + + request. An individual request contains a booking ID, the custom attribute + to create or update, + + and an optional idempotency key. + properties: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + validation: + minLength: 1 + maxLength: 36 + custom_attribute: + type: CustomAttribute + docs: >- + The custom attribute to create or update, with following fields: + + + - `key`. This key must match the `key` of a custom attribute + definition in the Square seller + + account. If the requesting application is not the definition owner, + you must provide the qualified key. + + + - `value`. This value must conform to the `schema` specified by the + definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for update operations, include this optional field in the + request and set the + + value to the current version of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this individual upsert request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + source: + openapi: openapi/openapi.json + BookingCustomAttributeUpsertResponse: + docs: >- + Represents a response for an individual upsert request in a + [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) + operation. + properties: + booking_id: + type: optional + docs: >- + The ID of the [booking](entity:Booking) associated with the custom + attribute. + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred while processing the individual request. + source: + openapi: openapi/openapi.json + BookingCustomAttributeVisibleDeletedEvent: + docs: >- + Published when a booking [custom attribute](entity:CustomAttribute) with + + the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is deleted. + + An application that subscribes to this event is notified when a booking + custom attribute is deleted + + by any application for which the subscribing application has read access + to the booking custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingCustomAttributeVisibleUpdatedEvent: + docs: >- + Published when a booking [custom attribute](entity:CustomAttribute) + + with the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is updated. + + An application that subscribes to this event is notified when a booking + custom attribute is updated + + by any application for which the subscribing application has read access + to the booking custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"booking.custom_attribute.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + BookingStatus: + enum: + - PENDING + - CANCELLED_BY_CUSTOMER + - CANCELLED_BY_SELLER + - DECLINED + - ACCEPTED + - NO_SHOW + docs: Supported booking statuses. + source: + openapi: openapi/openapi.json + BookingUpdatedEvent: + docs: >- + Published when a booking is updated or cancelled. + + + To receive this event with buyer-level permissions, you must have + `APPOINTMENTS_READ` set for the OAuth scope. + + To receive this event with seller-level permissions, you must have + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"booking.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + BookingUpdatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"booking"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the updated booking. + source: + openapi: openapi/openapi.json + BookingUpdatedEventObject: + properties: + booking: + type: optional + docs: The updated booking. + source: + openapi: openapi/openapi.json + Break: + docs: A record of a team member's break on a [timecard](entity:Timecard). + properties: + id: + type: optional + docs: The UUID for this object. + start_at: + type: string + docs: >- + RFC 3339; follows the same timezone information as the + [timecard](entity:Timecard). Precision up to + + the minute is respected; seconds are truncated. + validation: + minLength: 1 + end_at: + type: optional> + docs: >- + RFC 3339; follows the same timezone information as the + [timecard](entity:Timecard). Precision up to + + the minute is respected; seconds are truncated. + break_type_id: + type: string + docs: The [BreakType](entity:BreakType) that this break was templated on. + validation: + minLength: 1 + name: + type: string + docs: A human-readable name. + validation: + minLength: 1 + expected_duration: + type: string + docs: |- + Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of + the break. + + Example for break expected duration of 15 minutes: PT15M + validation: + minLength: 1 + is_paid: + type: boolean + docs: |- + Whether this break counts towards time worked for compensation + purposes. + source: + openapi: openapi/openapi.json + BreakType: + docs: >- + A template for a type of [break](entity:Break) that can be added to a + + [timecard](entity:Timecard), including the expected duration and paid + status. + properties: + id: + type: optional + docs: The UUID for this object. + validation: + maxLength: 255 + location_id: + type: string + docs: The ID of the business location this type of break applies to. + validation: + minLength: 1 + break_name: + type: string + docs: |- + A human-readable name for this type of break. The name is displayed to + team members in Square products. + validation: + minLength: 1 + expected_duration: + type: string + docs: |- + Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of + this break. Precision less than minutes is truncated. + + Example for break expected duration of 15 minutes: PT15M + validation: + minLength: 1 + is_paid: + type: boolean + docs: |- + Whether this break counts towards time worked for compensation + purposes. + version: + type: optional + docs: >- + Used for resolving concurrency issues. The request fails if the + version + + provided does not match the server version at the time of the request. + If a value is not + + provided, Square's servers execute a "blind" write; potentially + + overwriting another writer's data. + created_at: + type: optional + docs: A read-only timestamp in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: A read-only timestamp in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + BulkCreateCustomerData: + docs: >- + Defines the customer data provided in individual create requests for a + + [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) + operation. + properties: + given_name: + type: optional> + docs: >- + The given name (that is, the first name) associated with the customer + profile. + validation: + maxLength: 300 + family_name: + type: optional> + docs: >- + The family name (that is, the last name) associated with the customer + profile. + validation: + maxLength: 300 + company_name: + type: optional> + docs: A business name associated with the customer profile. + validation: + maxLength: 500 + nickname: + type: optional> + docs: A nickname for the customer profile. + validation: + maxLength: 100 + email_address: + type: optional> + docs: The email address associated with the customer profile. + validation: + maxLength: 254 + address: + type: optional
+ docs: >- + The physical address associated with the customer profile. For maximum + length constraints, + + see [Customer + addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address). + + The `first_name` and `last_name` fields are ignored if they are + present in the request. + phone_number: + type: optional> + docs: >- + The phone number associated with the customer profile. The phone + number must be valid + + and can contain 9–16 digits, with an optional `+` prefix and country + code. For more information, + + see [Customer phone + numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + reference_id: + type: optional> + docs: |- + An optional second ID used to associate the customer profile with an + entity in another system. + validation: + maxLength: 100 + note: + type: optional> + docs: A custom note associated with the customer profile. + birthday: + type: optional> + docs: >- + The birthday associated with the customer profile, in `YYYY-MM-DD` or + `MM-DD` format. + + For example, specify `1998-09-21` for September 21, 1998, or `09-21` + for September 21. + + Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the + specified birth year or + + `0000` if a birth year is not specified. + tax_ids: + type: optional + docs: >- + The tax ID associated with the customer profile. This field is + available only for + + customers of sellers in EU countries or the United Kingdom. For more + information, see + + [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + source: + openapi: openapi/openapi.json + BulkCreateCustomersResponse: + docs: >- + Defines the fields included in the response body from the + + [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) + endpoint. + properties: + responses: + type: optional> + docs: >- + A map of responses that correspond to individual create requests, + represented by + + key-value pairs. + + + Each key is the idempotency key that was provided for a create request + and each value + + is the corresponding response. + + If the request succeeds, the value is the new customer profile. + + If the request fails, the value contains any errors that occurred + during the request. + errors: + type: optional> + docs: Any top-level errors that prevented the bulk operation from running. + source: + openapi: openapi/openapi.json + BatchCreateTeamMembersResponse: + docs: >- + Represents a response from a bulk create request containing the created + `TeamMember` objects or error messages. + properties: + team_members: + type: optional> + docs: >- + The successfully created `TeamMember` objects. Each key is the + `idempotency_key` that maps to the `CreateTeamMemberRequest`. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchCreateVendorsResponse: + docs: >- + Represents an output from a call to + [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + responses: + type: optional> + docs: >- + A set of [CreateVendorResponse](entity:CreateVendorResponse) objects + encapsulating successfully created [Vendor](entity:Vendor) + + objects or error responses for failed attempts. The set is represented + by + + a collection of idempotency-key/`Vendor`-object or + idempotency-key/error-object pairs. The idempotency keys correspond to + those specified + + in the input. + source: + openapi: openapi/openapi.json + BulkDeleteBookingCustomAttributesResponse: + docs: >- + Represents a + [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + delete request. + properties: + values: + type: optional> + docs: >- + A map of responses that correspond to individual delete requests. Each + response has the + + same ID as the corresponding request and contains `booking_id` and + `errors` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkDeleteCustomersResponse: + docs: >- + Defines the fields included in the response body from the + + [BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) + endpoint. + properties: + responses: + type: optional> + docs: >- + A map of responses that correspond to individual delete requests, + represented by + + key-value pairs. + + + Each key is the customer ID that was specified for a delete request + and each value + + is the corresponding response. + + If the request succeeds, the value is an empty object (`{ }`). + + If the request fails, the value contains any errors that occurred + during the request. + errors: + type: optional> + docs: Any top-level errors that prevented the bulk operation from running. + source: + openapi: openapi/openapi.json + BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest: + docs: >- + Represents an individual delete request in a + [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) + + request. An individual request contains an optional ID of the associated + custom attribute definition + + and optional key of the associated custom attribute definition. + properties: + key: + type: optional + docs: >- + The key of the associated custom attribute definition. + + Represented as a qualified key if the requesting app is not the + definition owner. + validation: + pattern: ^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$ + access: read-only + source: + openapi: openapi/openapi.json + BulkDeleteLocationCustomAttributesResponse: + docs: >- + Represents a + [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + delete request. + properties: + values: + type: >- + map + docs: >- + A map of responses that correspond to individual delete requests. Each + response has the + + same key as the corresponding request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse: + docs: >- + Represents an individual delete response in a + [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) + + request. + properties: + location_id: + type: optional + docs: The ID of the location associated with the custom attribute. + errors: + type: optional> + docs: >- + Errors that occurred while processing the individual + LocationCustomAttributeDeleteRequest request + source: + openapi: openapi/openapi.json + BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest: + docs: >- + Represents an individual delete request in a + [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) + + request. An individual request contains an optional ID of the associated + custom attribute definition + + and optional key of the associated custom attribute definition. + properties: + key: + type: optional + docs: >- + The key of the associated custom attribute definition. + + Represented as a qualified key if the requesting app is not the + definition owner. + validation: + pattern: ^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$ + access: read-only + source: + openapi: openapi/openapi.json + BulkDeleteMerchantCustomAttributesResponse: + docs: >- + Represents a + [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + delete request. + properties: + values: + type: >- + map + docs: >- + A map of responses that correspond to individual delete requests. Each + response has the + + same key as the corresponding request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse: + docs: >- + Represents an individual delete response in a + [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) + + request. + properties: + errors: + type: optional> + docs: >- + Errors that occurred while processing the individual + MerchantCustomAttributeDeleteRequest request + source: + openapi: openapi/openapi.json + BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute: + docs: Represents one delete within the bulk operation. + properties: + key: + type: optional + docs: >- + The key of the custom attribute to delete. This key must match the + key + + of an existing custom attribute definition. + validation: + pattern: ^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$ + minLength: 1 + access: read-only + order_id: + type: string + docs: The ID of the target [order](entity:Order). + validation: + minLength: 1 + maxLength: 255 + source: + openapi: openapi/openapi.json + BulkDeleteOrderCustomAttributesResponse: + docs: Represents a response from deleting one or more order custom attributes. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + values: + type: map + docs: >2- + A map of responses that correspond to individual delete requests. Each response has the same ID + as the corresponding request and contains either a `custom_attribute` + or an `errors` field. + source: + openapi: openapi/openapi.json + BulkPublishScheduledShiftsData: + docs: >- + Represents options for an individual publish request in a + + [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) + + operation, provided as the value in a key-value pair. + properties: + version: + type: optional + docs: >- + The current version of the scheduled shift, used to enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control. If the provided version doesn't match the server version, the + request fails. + + If omitted, Square executes a blind write, potentially overwriting + data from another publish request. + source: + openapi: openapi/openapi.json + BulkPublishScheduledShiftsResponse: + docs: >- + Represents a + [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) + response. + + Either `scheduled_shifts` or `errors` is present in the response. + properties: + responses: + type: optional> + docs: >- + A map of key-value pairs that represent responses for individual + publish requests. + + The order of responses might differ from the order in which the + requests were provided. + + + - Each key is the scheduled shift ID that was specified for a publish + request. + + - Each value is the corresponding response. If the request succeeds, + the value is the + + published scheduled shift. If the request fails, the value is an + `errors` array containing + + any errors that occurred while processing the request. + errors: + type: optional> + docs: >- + Any top-level errors that prevented the bulk operation from + succeeding. + source: + openapi: openapi/openapi.json + BulkRetrieveBookingsResponse: + docs: Response payload for bulk retrieval of bookings. + properties: + bookings: + type: optional> + docs: >- + Requested bookings returned as a map containing `booking_id` as the + key and `RetrieveBookingResponse` as the value. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkRetrieveChannelsRequestConstants: literal<"MAX_BATCH_SIZE"> + BulkRetrieveChannelsResponse: + docs: >- + Defines the fields that are included in the request body for the + + [BulkRetrieveChannels](api-endpoint:Channels-BulkRetrieveChannels) + endpoint. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + responses: + type: optional> + docs: |- + A map of channel IDs to channel responses which tell whether + retrieval for a specific channel is success or not. + Channel response of a success retrieval would contain channel info + whereas channel response of a failed retrieval would have error info. + source: + openapi: openapi/openapi.json + BulkRetrieveCustomersResponse: + docs: >- + Defines the fields included in the response body from the + + [BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) + endpoint. + properties: + responses: + type: optional> + docs: >- + A map of responses that correspond to individual retrieve requests, + represented by + + key-value pairs. + + + Each key is the customer ID that was specified for a retrieve request + and each value + + is the corresponding response. + + If the request succeeds, the value is the requested customer profile. + + If the request fails, the value contains any errors that occurred + during the request. + errors: + type: optional> + docs: Any top-level errors that prevented the bulk operation from running. + source: + openapi: openapi/openapi.json + BulkRetrieveTeamMemberBookingProfilesResponse: + docs: >- + Response payload for the + [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) + endpoint. + properties: + team_member_booking_profiles: + type: optional> + docs: >- + The returned team members' booking profiles, as a map with + `team_member_id` as the key and + [TeamMemberBookingProfile](entity:TeamMemberBookingProfile) the value. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchGetVendorsResponse: + docs: >- + Represents an output from a call to + [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + responses: + type: optional> + docs: >- + The set of [RetrieveVendorResponse](entity:RetrieveVendorResponse) + objects encapsulating successfully retrieved [Vendor](entity:Vendor) + + objects or error responses for failed attempts. The set is represented + by + + a collection of `Vendor`-ID/`Vendor`-object or + `Vendor`-ID/error-object pairs. + source: + openapi: openapi/openapi.json + BulkSwapPlanResponse: + docs: |- + Defines output parameters in a response of the + [BulkSwapPlan](api-endpoint:Subscriptions-BulkSwapPlan) endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + affected_subscriptions: + type: optional + docs: The number of affected subscriptions. + source: + openapi: openapi/openapi.json + BulkUpdateCustomerData: + docs: >- + Defines the customer data provided in individual update requests for a + + [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) + operation. + properties: + given_name: + type: optional> + docs: >- + The given name (that is, the first name) associated with the customer + profile. + validation: + maxLength: 300 + family_name: + type: optional> + docs: >- + The family name (that is, the last name) associated with the customer + profile. + validation: + maxLength: 300 + company_name: + type: optional> + docs: A business name associated with the customer profile. + validation: + maxLength: 500 + nickname: + type: optional> + docs: A nickname for the customer profile. + validation: + maxLength: 100 + email_address: + type: optional> + docs: The email address associated with the customer profile. + validation: + maxLength: 254 + address: + type: optional
+ docs: >- + The physical address associated with the customer profile. For maximum + length constraints, + + see [Customer + addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address). + + The `first_name` and `last_name` fields are ignored if they are + present in the request. + phone_number: + type: optional> + docs: >- + The phone number associated with the customer profile. The phone + number must be valid + + and can contain 9–16 digits, with an optional `+` prefix and country + code. For more information, + + see [Customer phone + numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + reference_id: + type: optional> + docs: |- + An optional second ID used to associate the customer profile with an + entity in another system. + validation: + maxLength: 100 + note: + type: optional> + docs: An custom note associates with the customer profile. + birthday: + type: optional> + docs: >- + The birthday associated with the customer profile, in `YYYY-MM-DD` or + `MM-DD` format. + + For example, specify `1998-09-21` for September 21, 1998, or `09-21` + for September 21. + + Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the + specified birth year or + + `0000` if a birth year is not specified. + tax_ids: + type: optional + docs: >- + The tax ID associated with the customer profile. This field is + available only for + + customers of sellers in EU countries or the United Kingdom. For more + information, see + + [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + version: + type: optional + docs: >- + The current version of the customer profile. + + + As a best practice, you should include this field to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control. + source: + openapi: openapi/openapi.json + BulkUpdateCustomersResponse: + docs: >- + Defines the fields included in the response body from the + + [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) + endpoint. + properties: + responses: + type: optional> + docs: >- + A map of responses that correspond to individual update requests, + represented by + + key-value pairs. + + + Each key is the customer ID that was specified for an update request + and each value + + is the corresponding response. + + If the request succeeds, the value is the updated customer profile. + + If the request fails, the value contains any errors that occurred + during the request. + errors: + type: optional> + docs: Any top-level errors that prevented the bulk operation from running. + source: + openapi: openapi/openapi.json + BatchUpdateTeamMembersResponse: + docs: >- + Represents a response from a bulk update request containing the updated + `TeamMember` objects or error messages. + properties: + team_members: + type: optional> + docs: >- + The successfully updated `TeamMember` objects. Each key is the + `team_member_id` that maps to the `UpdateTeamMemberRequest`. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchUpdateVendorsResponse: + docs: >- + Represents an output from a call to + [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors). + properties: + errors: + type: optional> + docs: Errors encountered when the request fails. + responses: + type: optional> + docs: >- + A set of [UpdateVendorResponse](entity:UpdateVendorResponse) objects + encapsulating successfully created [Vendor](entity:Vendor) + + objects or error responses for failed attempts. The set is represented + by a collection of `Vendor`-ID/`UpdateVendorResponse`-object or + + `Vendor`-ID/error-object pairs. + source: + openapi: openapi/openapi.json + BulkUpsertBookingCustomAttributesResponse: + docs: >- + Represents a + [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + upsert request. + properties: + values: + type: optional> + docs: >- + A map of responses that correspond to individual upsert requests. Each + response has the + + same ID as the corresponding request and contains either a + `booking_id` and `custom_attribute` or an `errors` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest: + docs: >- + Represents an individual upsert request in a + [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + + request. An individual request contains a customer ID, the custom + attribute to create or update, + + and an optional idempotency key. + properties: + customer_id: + type: string + docs: The ID of the target [customer profile](entity:Customer). + validation: + minLength: 1 + custom_attribute: + type: CustomAttribute + docs: >- + The custom attribute to create or update, with following fields: + + + - `key`. This key must match the `key` of a custom attribute + definition in the Square seller + + account. If the requesting application is not the definition owner, + you must provide the qualified key. + + + - `value`. This value must conform to the `schema` specified by the + definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for update operations, include this optional field in the + request and set the + + value to the current version of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this individual upsert request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + source: + openapi: openapi/openapi.json + BatchUpsertCustomerCustomAttributesResponse: + docs: >- + Represents a + [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + upsert request. + properties: + values: + type: >- + optional> + docs: >- + A map of responses that correspond to individual upsert requests. Each + response has the + + same ID as the corresponding request and contains either a + `customer_id` and `custom_attribute` or an `errors` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse: + docs: >- + Represents a response for an individual upsert request in a + [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + operation. + properties: + customer_id: + type: optional + docs: The ID of the customer profile associated with the custom attribute. + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred while processing the individual request. + source: + openapi: openapi/openapi.json + BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest: + docs: >- + Represents an individual upsert request in a + [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + + request. An individual request contains a location ID, the custom + attribute to create or update, + + and an optional idempotency key. + properties: + location_id: + type: string + docs: The ID of the target [location](entity:Location). + validation: + minLength: 1 + custom_attribute: + type: CustomAttribute + docs: >- + The custom attribute to create or update, with following fields: + + - `key`. This key must match the `key` of a custom attribute + definition in the Square seller + + account. If the requesting application is not the definition owner, + you must provide the qualified key. + + - `value`. This value must conform to the `schema` specified by the + definition. + + For more information, see [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).. + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, specify the current version of the custom attribute. + + If this is not important for your application, `version` can be set to + -1. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this individual upsert request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + source: + openapi: openapi/openapi.json + BulkUpsertLocationCustomAttributesResponse: + docs: >- + Represents a + [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + upsert request. + properties: + values: + type: >- + optional> + docs: >- + A map of responses that correspond to individual upsert requests. Each + response has the + + same ID as the corresponding request and contains either a + `location_id` and `custom_attribute` or an `errors` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse: + docs: >- + Represents a response for an individual upsert request in a + [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + operation. + properties: + location_id: + type: optional + docs: The ID of the location associated with the custom attribute. + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred while processing the individual request. + source: + openapi: openapi/openapi.json + BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest: + docs: >- + Represents an individual upsert request in a + [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + + request. An individual request contains a merchant ID, the custom + attribute to create or update, + + and an optional idempotency key. + properties: + merchant_id: + type: string + docs: The ID of the target [merchant](entity:Merchant). + validation: + minLength: 1 + custom_attribute: + type: CustomAttribute + docs: >- + The custom attribute to create or update, with following fields: + + - `key`. This key must match the `key` of a custom attribute + definition in the Square seller + + account. If the requesting application is not the definition owner, + you must provide the qualified key. + + - `value`. This value must conform to the `schema` specified by the + definition. + + For more information, see [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). + + - The version field must match the current version of the custom + attribute definition to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + If this is not important for your application, version can be set to + -1. For any other values, the request fails with a BAD_REQUEST error. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this individual upsert request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + source: + openapi: openapi/openapi.json + BulkUpsertMerchantCustomAttributesResponse: + docs: >- + Represents a + [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + response, + + which contains a map of responses that each corresponds to an individual + upsert request. + properties: + values: + type: >- + optional> + docs: >- + A map of responses that correspond to individual upsert requests. Each + response has the + + same ID as the corresponding request and contains either a + `merchant_id` and `custom_attribute` or an `errors` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse: + docs: >- + Represents a response for an individual upsert request in a + [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + operation. + properties: + merchant_id: + type: optional + docs: The ID of the merchant associated with the custom attribute. + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred while processing the individual request. + source: + openapi: openapi/openapi.json + BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute: + docs: Represents one upsert within the bulk operation. + properties: + custom_attribute: + type: CustomAttribute + docs: >- + The custom attribute to create or update, with the following fields: + + + - `value`. This value must conform to the `schema` specified by the + definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include this optional field and specify the current version + of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + order_id: + type: string + docs: The ID of the target [order](entity:Order). + validation: + minLength: 1 + maxLength: 255 + source: + openapi: openapi/openapi.json + BulkUpsertOrderCustomAttributesResponse: + docs: Represents a response from a bulk upsert of order custom attributes. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + values: + type: map + docs: ' A map of responses that correspond to individual upsert operations for custom attributes.' + source: + openapi: openapi/openapi.json + BusinessAppointmentSettings: + docs: >- + The service appointment settings, including where and how the service is + provided. + properties: + location_types: + type: >- + optional>> + docs: >- + Types of the location allowed for bookings. + + See + [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) + for possible values + alignment_time: + type: optional + docs: >- + The time unit of the service duration for bookings. + + See + [BusinessAppointmentSettingsAlignmentTime](#type-businessappointmentsettingsalignmenttime) + for possible values + min_booking_lead_time_seconds: + type: optional> + docs: >- + The minimum lead time in seconds before a service can be booked. A + booking must be created at least this amount of time before its + starting time. + max_booking_lead_time_seconds: + type: optional> + docs: >- + The maximum lead time in seconds before a service can be booked. A + booking must be created at most this amount of time before its + starting time. + any_team_member_booking_enabled: + type: optional> + docs: >- + Indicates whether a customer can choose from all available time slots + and have a staff member assigned + + automatically (`true`) or not (`false`). + multiple_service_booking_enabled: + type: optional> + docs: >- + Indicates whether a customer can book multiple services in a single + online booking. + max_appointments_per_day_limit_type: + type: optional + docs: >- + Indicates whether the daily appointment limit applies to team members + or to + + business locations. + + See + [BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType](#type-businessappointmentsettingsmaxappointmentsperdaylimittype) + for possible values + max_appointments_per_day_limit: + type: optional> + docs: >- + The maximum number of daily appointments per team member or per + location. + cancellation_window_seconds: + type: optional> + docs: >- + The cut-off time in seconds for allowing clients to cancel or + reschedule an appointment. + cancellation_fee_money: + type: optional + docs: The flat-fee amount charged for a no-show booking. + cancellation_policy: + type: optional + docs: >- + The cancellation policy adopted by the seller. + + See + [BusinessAppointmentSettingsCancellationPolicy](#type-businessappointmentsettingscancellationpolicy) + for possible values + cancellation_policy_text: + type: optional> + docs: The free-form text of the seller's cancellation policy. + validation: + maxLength: 65536 + skip_booking_flow_staff_selection: + type: optional> + docs: >- + Indicates whether customers has an assigned staff member (`true`) or + can select s staff member of their choice (`false`). + source: + openapi: openapi/openapi.json + BusinessAppointmentSettingsAlignmentTime: + enum: + - SERVICE_DURATION + - QUARTER_HOURLY + - HALF_HOURLY + - HOURLY + docs: Time units of a service duration for bookings. + source: + openapi: openapi/openapi.json + BusinessAppointmentSettingsBookingLocationType: + enum: + - BUSINESS_LOCATION + - CUSTOMER_LOCATION + - PHONE + docs: Supported types of location where service is provided. + source: + openapi: openapi/openapi.json + BusinessAppointmentSettingsCancellationPolicy: + enum: + - CANCELLATION_TREATED_AS_NO_SHOW + - CUSTOM_POLICY + docs: The category of the seller’s cancellation policy. + source: + openapi: openapi/openapi.json + BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType: + enum: + - PER_TEAM_MEMBER + - PER_LOCATION + docs: Types of daily appointment limits. + source: + openapi: openapi/openapi.json + BusinessBookingProfile: + docs: >- + A seller's business booking profile, including booking policy, appointment + settings, etc. + properties: + seller_id: + type: optional> + docs: The ID of the seller, obtainable using the Merchants API. + validation: + maxLength: 32 + created_at: + type: optional + docs: The RFC 3339 timestamp specifying the booking's creation time. + access: read-only + booking_enabled: + type: optional> + docs: Indicates whether the seller is open for booking. + customer_timezone_choice: + type: optional + docs: >- + The choice of customer's time zone information of a booking. + + The Square online booking site and all notifications to customers uses + either the seller location’s time zone + + or the time zone the customer chooses at booking. + + See + [BusinessBookingProfileCustomerTimezoneChoice](#type-businessbookingprofilecustomertimezonechoice) + for possible values + booking_policy: + type: optional + docs: >- + The policy for the seller to automatically accept booking requests + (`ACCEPT_ALL`) or not (`REQUIRES_ACCEPTANCE`). + + See + [BusinessBookingProfileBookingPolicy](#type-businessbookingprofilebookingpolicy) + for possible values + allow_user_cancel: + type: optional> + docs: >- + Indicates whether customers can cancel or reschedule their own + bookings (`true`) or not (`false`). + business_appointment_settings: + type: optional + docs: Settings for appointment-type bookings. + support_seller_level_writes: + type: optional> + docs: >- + Indicates whether the seller's subscription to Square Appointments + supports creating, updating or canceling an appointment through the + API (`true`) or not (`false`) using seller permission. + source: + openapi: openapi/openapi.json + BusinessBookingProfileBookingPolicy: + enum: + - ACCEPT_ALL + - REQUIRES_ACCEPTANCE + docs: Policies for accepting bookings. + source: + openapi: openapi/openapi.json + BusinessBookingProfileCustomerTimezoneChoice: + enum: + - BUSINESS_LOCATION_TIMEZONE + - CUSTOMER_CHOICE + docs: Choices of customer-facing time zone used for bookings. + source: + openapi: openapi/openapi.json + BusinessHours: + docs: The hours of operation for a location. + properties: + periods: + type: optional>> + docs: >- + The list of time periods during which the business is open. There can + be at most 10 periods per day. + source: + openapi: openapi/openapi.json + BusinessHoursPeriod: + docs: Represents a period of time during which a business location is open. + properties: + day_of_week: + type: optional + docs: |- + The day of the week for this time period. + See [DayOfWeek](#type-dayofweek) for possible values + start_local_time: + type: optional> + docs: >- + The start time of a business hours period, specified in local time + using partial-time + + RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 + in the morning. + + Note that the seconds value is always :00, but it is appended for + conformance to the RFC. + end_local_time: + type: optional> + docs: >- + The end time of a business hours period, specified in local time using + partial-time + + RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 + in the evening. + + Note that the seconds value is always :00, but it is appended for + conformance to the RFC. + source: + openapi: openapi/openapi.json + BuyNowPayLaterDetails: + docs: Additional details about a Buy Now Pay Later payment type. + properties: + brand: + type: optional> + docs: |- + The brand used for the Buy Now Pay Later payment. + The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`. + validation: + maxLength: 50 + afterpay_details: + type: optional + docs: >- + Details about an Afterpay payment. These details are only populated if + the `brand` is + + `AFTERPAY`. + clearpay_details: + type: optional + docs: >- + Details about a Clearpay payment. These details are only populated if + the `brand` is + + `CLEARPAY`. + source: + openapi: openapi/openapi.json + CalculateLoyaltyPointsResponse: + docs: >- + Represents a + [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) + response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + points: + type: optional + docs: >- + The number of points that the buyer can earn from the base loyalty + program. + promotion_points: + type: optional + docs: >- + The number of points that the buyer can earn from a loyalty promotion. + To be eligible + + to earn promotion points, the purchase must first qualify for program + points. When `order_id` + + is not provided in the request, this value is always 0. + source: + openapi: openapi/openapi.json + CalculateOrderResponse: + properties: + order: + type: optional + docs: The calculated version of the order provided in the request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CancelBookingResponse: + properties: + booking: + type: optional + docs: The booking that was cancelled. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + CancelInvoiceResponse: + docs: The response returned by the `CancelInvoice` request. + properties: + invoice: + type: optional + docs: The canceled invoice. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + CancelLoyaltyPromotionResponse: + docs: >- + Represents a + [CancelLoyaltyPromotion](api-endpoint:Loyalty-CancelLoyaltyPromotion) + response. + + Either `loyalty_promotion` or `errors` is present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_promotion: + type: optional + docs: The canceled loyalty promotion. + source: + openapi: openapi/openapi.json + CancelPaymentByIdempotencyKeyResponse: + docs: >- + Defines the response returned by + + [CancelPaymentByIdempotencyKey](api-endpoint:Payments-CancelPaymentByIdempotencyKey). + + On success, `errors` is empty. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CancelPaymentResponse: + docs: >- + Defines the response returned by + [CancelPayment](api-endpoint:Payments-CancelPayment). + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + payment: + type: optional + docs: The successfully canceled `Payment` object. + source: + openapi: openapi/openapi.json + CancelSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [CancelSubscription](api-endpoint:Subscriptions-CancelSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: >- + The specified subscription scheduled for cancellation according to the + action created by the request. + actions: + type: optional> + docs: A list of a single `CANCEL` action scheduled for the subscription. + source: + openapi: openapi/openapi.json + CancelTerminalActionResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + action: + type: optional + docs: The canceled `TerminalAction` + source: + openapi: openapi/openapi.json + CancelTerminalCheckoutResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + checkout: + type: optional + docs: The canceled `TerminalCheckout`. + source: + openapi: openapi/openapi.json + CancelTerminalRefundResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refund: + type: optional + docs: The updated `TerminalRefund`. + source: + openapi: openapi/openapi.json + CancelTransferOrderResponse: + docs: Response for canceling a transfer order + properties: + transfer_order: + type: optional + docs: The updated transfer order with status changed to CANCELED + errors: + type: optional> + docs: Any errors that occurred during the request + source: + openapi: openapi/openapi.json + CaptureTransactionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) + endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + Card: + docs: |- + Represents the payment details of a card to be used for payments. These + details are determined by the payment token generated by Web Payments SDK. + properties: + id: + type: optional + docs: Unique ID for this card. Generated by Square. + validation: + maxLength: 64 + access: read-only + card_brand: + type: optional + docs: |- + The card's brand. + See [CardBrand](#type-cardbrand) for possible values + last_4: + type: optional + docs: The last 4 digits of the card number. + validation: + maxLength: 4 + access: read-only + exp_month: + type: optional> + docs: >- + The expiration month of the associated card as an integer between 1 + and 12. + exp_year: + type: optional> + docs: The four-digit year of the card's expiration date. + cardholder_name: + type: optional> + docs: The name of the cardholder. + validation: + maxLength: 96 + billing_address: + type: optional
+ docs: >- + The billing address for this card. `US` postal codes can be provided + as a 5-digit zip code + + or 9-digit ZIP+4 (example: `12345-6789`). For a full list of field + meanings by country, see + + [Working with + Addresses](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-addresses). + fingerprint: + type: optional + docs: >- + Intended as a Square-assigned identifier, based + + on the card number, to identify the card across multiple locations + within a + + single application. + validation: + maxLength: 255 + access: read-only + customer_id: + type: optional> + docs: >- + **Required** The ID of a [customer](entity:Customer) to be associated + with the card. + merchant_id: + type: optional + docs: The ID of the merchant associated with the card. + access: read-only + reference_id: + type: optional> + docs: >- + An optional user-defined reference ID that associates this card with + + another entity in an external system. For example, a customer ID from + an + + external customer management system. + validation: + maxLength: 128 + enabled: + type: optional + docs: Indicates whether or not a card can be used for payments. + access: read-only + card_type: + type: optional + docs: >- + The type of the card. + + The Card object includes this field only in response to Payments API + calls. + + See [CardType](#type-cardtype) for possible values + prepaid_type: + type: optional + docs: |- + Indicates whether the card is prepaid or not. + See [CardPrepaidType](#type-cardprepaidtype) for possible values + bin: + type: optional + docs: >- + The first six digits of the card number, known as the Bank + Identification Number (BIN). Only the Payments API + + returns this field. + validation: + maxLength: 6 + access: read-only + version: + type: optional + docs: >- + Current version number of the card. Increments with each card update. + Requests to update an + + existing Card object will be rejected unless the version in the + request matches the current + + version for the Card. + card_co_brand: + type: optional + docs: >- + The card's co-brand if available. For example, an Afterpay virtual + card would have a + + co-brand of AFTERPAY. + + See [CardCoBrand](#type-cardcobrand) for possible values + issuer_alert: + type: optional + docs: >- + An alert from the issuing bank about the card status. Alerts can + indicate whether + + future charges to the card are likely to fail. For more information, + see + + [Manage Card on File + Declines](https://developer.squareup.com/docs/cards-api/manage-card-on-file-declines). + + + This field is present only if there's an active issuer alert. + + See [IssuerAlert](#type-issueralert) for possible values + issuer_alert_at: + type: optional + docs: >- + The timestamp of when the current issuer alert was received and + processed, in + + RFC 3339 format. + + + This field is present only if there's an active issuer alert. + access: read-only + hsa_fsa: + type: optional + docs: >- + Indicates whether the card is linked to a Health Savings Account (HSA) + or Flexible + + Spending Account (FSA), based on the card BIN. + access: read-only + source: + openapi: openapi/openapi.json + CardAutomaticallyUpdatedEvent: + docs: >- + Published when Square automatically updates the expiration date or + + primary account number (PAN) of a [card](entity:Card) or adds or removes + an issuer alert. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"card.automatically_updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CardAutomaticallyUpdatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"card"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the automatically updated card. + source: + openapi: openapi/openapi.json + CardAutomaticallyUpdatedEventObject: + properties: + card: + type: optional + docs: The automatically updated card. + source: + openapi: openapi/openapi.json + CardBrand: + enum: + - OTHER_BRAND + - VISA + - MASTERCARD + - AMERICAN_EXPRESS + - DISCOVER + - DISCOVER_DINERS + - JCB + - CHINA_UNIONPAY + - SQUARE_GIFT_CARD + - SQUARE_CAPITAL_CARD + - INTERAC + - EFTPOS + - FELICA + - EBT + docs: Indicates a card's brand, such as `VISA` or `MASTERCARD`. + source: + openapi: openapi/openapi.json + CardCoBrand: + enum: + - UNKNOWN + - AFTERPAY + - CLEARPAY + docs: Indicates the brand for a co-branded card. + source: + openapi: openapi/openapi.json + CardCreatedEvent: + docs: Published when a [card](entity:Card) is created or imported. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"card.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CardCreatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"card"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the created card. + source: + openapi: openapi/openapi.json + CardCreatedEventObject: + properties: + card: + type: optional + docs: The created card. + source: + openapi: openapi/openapi.json + CardDisabledEvent: + docs: Published when a [card](entity:Card) is disabled. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"card.disabled"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CardDisabledEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"card"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the disabled card. + source: + openapi: openapi/openapi.json + CardDisabledEventObject: + properties: + card: + type: optional + docs: The disabled card. + source: + openapi: openapi/openapi.json + CardForgottenEvent: + docs: Published when a [card](entity:Card) is GDPR forgotten or vaulted. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"card.forgotten"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CardForgottenEventCard: + properties: + id: + type: optional + docs: Unique ID for this card. Generated by Square. + validation: + maxLength: 64 + access: read-only + customer_id: + type: optional> + docs: >- + The ID of a customer created using the Customers API associated with + the card. + enabled: + type: optional> + docs: Indicates whether or not a card can be used for payments. + reference_id: + type: optional> + docs: >- + An optional user-defined reference ID that associates this card with + + another entity in an external system. For example, a customer ID from + an + + external customer management system. + version: + type: optional + docs: >- + Current version number of the card. Increments with each card update. + Requests to update an + + existing Card object will be rejected unless the version in the + request matches the current + + version for the Card. + merchant_id: + type: optional> + docs: The ID of the merchant associated with the card. + source: + openapi: openapi/openapi.json + CardForgottenEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"card"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the forgotten card. + source: + openapi: openapi/openapi.json + CardForgottenEventObject: + properties: + card: + type: optional + docs: The forgotten card. + source: + openapi: openapi/openapi.json + CardIssuerAlert: + type: literal<"ISSUER_ALERT_CARD_CLOSED"> + docs: Indicates the type of issuer alert for a [card on file](entity:Card). + CardPaymentDetails: + docs: >- + Reflects the current status of a card payment. Contains only + non-confidential information. + properties: + status: + type: optional + docs: >- + The card payment's current state. The state can be AUTHORIZED, + CAPTURED, VOIDED, or + + FAILED. + validation: + maxLength: 50 + access: read-only + card: + type: optional + docs: The credit card's non-confidential details. + entry_method: + type: optional + docs: >- + The method used to enter the card's details for the payment. The + method can be + + `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. + validation: + maxLength: 50 + access: read-only + cvv_status: + type: optional + docs: >- + The status code returned from the Card Verification Value (CVV) check. + The code can be + + `CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`. + validation: + maxLength: 50 + access: read-only + avs_status: + type: optional + docs: >- + The status code returned from the Address Verification System (AVS) + check. The code can be + + `AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`. + validation: + maxLength: 50 + access: read-only + auth_result_code: + type: optional + docs: >- + The status code returned by the card issuer that describes the + payment's + + authorization status. + validation: + maxLength: 10 + access: read-only + application_identifier: + type: optional + docs: >- + For EMV payments, the application ID identifies the EMV application + used for the payment. + validation: + maxLength: 32 + access: read-only + application_name: + type: optional + docs: >- + For EMV payments, the human-readable name of the EMV application used + for the payment. + validation: + maxLength: 16 + access: read-only + application_cryptogram: + type: optional + docs: For EMV payments, the cryptogram generated for the payment. + validation: + maxLength: 16 + access: read-only + verification_method: + type: optional + docs: >- + For EMV payments, the method used to verify the cardholder's identity. + The method can be + + `PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`. + validation: + maxLength: 50 + access: read-only + verification_results: + type: optional + docs: >- + For EMV payments, the results of the cardholder verification. The + result can be + + `SUCCESS`, `FAILURE`, or `UNKNOWN`. + validation: + maxLength: 50 + access: read-only + statement_description: + type: optional + docs: >- + The statement description sent to the card networks. + + + Note: The actual statement description varies and is likely to be + truncated and appended with + + additional information on a per issuer basis. + validation: + maxLength: 50 + access: read-only + device_details: + type: optional + docs: |- + __Deprecated__: Use `Payment.device_details` instead. + + Details about the device that took the payment. + card_payment_timeline: + type: optional + docs: The timeline for card payments. + refund_requires_card_presence: + type: optional + docs: |- + Whether the card must be physically present for the payment to + be refunded. If set to `true`, the card must be present. + access: read-only + errors: + type: optional> + docs: Information about errors encountered during the request. + access: read-only + source: + openapi: openapi/openapi.json + CardPaymentTimeline: + docs: The timeline for card payments. + properties: + authorized_at: + type: optional> + docs: The timestamp when the payment was authorized, in RFC 3339 format. + captured_at: + type: optional> + docs: The timestamp when the payment was captured, in RFC 3339 format. + voided_at: + type: optional> + docs: The timestamp when the payment was voided, in RFC 3339 format. + source: + openapi: openapi/openapi.json + CardPrepaidType: + enum: + - UNKNOWN_PREPAID_TYPE + - NOT_PREPAID + - PREPAID + docs: Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. + source: + openapi: openapi/openapi.json + CardType: + enum: + - UNKNOWN_CARD_TYPE + - CREDIT + - DEBIT + docs: Indicates a card's type, such as `CREDIT` or `DEBIT`. + source: + openapi: openapi/openapi.json + CardUpdatedEvent: + docs: >- + Published when a [card](entity:Card) is updated by the seller in the + Square Dashboard. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: The type of this event. The value is `"card.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CardUpdatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"card"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the updated card. + source: + openapi: openapi/openapi.json + CardUpdatedEventObject: + properties: + card: + type: optional + docs: The updated card. + source: + openapi: openapi/openapi.json + CashAppDetails: + docs: >- + Additional details about `WALLET` type payments with the `brand` of + `CASH_APP`. + properties: + buyer_full_name: + type: optional> + docs: The name of the Cash App account holder. + validation: + maxLength: 255 + buyer_country_code: + type: optional> + docs: >- + The country of the Cash App account holder, in ISO 3166-1-alpha-2 + format. + + + For possible values, see [Country](entity:Country). + validation: + minLength: 2 + maxLength: 2 + buyer_cashtag: + type: optional + docs: $Cashtag of the Cash App account holder. + validation: + minLength: 1 + maxLength: 21 + access: read-only + source: + openapi: openapi/openapi.json + CashDrawerDevice: + properties: + id: + type: optional + docs: The device Square-issued ID + name: + type: optional> + docs: The device merchant-specified name. + source: + openapi: openapi/openapi.json + CashDrawerEventType: + enum: + - NO_SALE + - CASH_TENDER_PAYMENT + - OTHER_TENDER_PAYMENT + - CASH_TENDER_CANCELLED_PAYMENT + - OTHER_TENDER_CANCELLED_PAYMENT + - CASH_TENDER_REFUND + - OTHER_TENDER_REFUND + - PAID_IN + - PAID_OUT + docs: |- + The types of events on a CashDrawerShift. + Each event type represents an employee action on the actual cash drawer + represented by a CashDrawerShift. + source: + openapi: openapi/openapi.json + CashDrawerShift: + docs: >- + This model gives the details of a cash drawer shift. + + The cash_payment_money, cash_refund_money, cash_paid_in_money, + + and cash_paid_out_money fields are all computed by summing their + respective + + event types. + properties: + id: + type: optional + docs: The shift unique ID. + state: + type: optional + docs: >- + The shift current state. + + See [CashDrawerShiftState](#type-cashdrawershiftstate) for possible + values + opened_at: + type: optional> + docs: The time when the shift began, in ISO 8601 format. + ended_at: + type: optional> + docs: The time when the shift ended, in ISO 8601 format. + closed_at: + type: optional> + docs: The time when the shift was closed, in ISO 8601 format. + description: + type: optional> + docs: The free-form text description of a cash drawer by an employee. + opened_cash_money: + type: optional + docs: |- + The amount of money in the cash drawer at the start of the shift. + The amount must be greater than or equal to zero. + cash_payment_money: + type: optional + docs: >- + The amount of money added to the cash drawer from cash payments. + + This is computed by summing all events with the types + CASH_TENDER_PAYMENT and + + CASH_TENDER_CANCELED_PAYMENT. The amount is always greater than or + equal to + + zero. + cash_refunds_money: + type: optional + docs: >- + The amount of money removed from the cash drawer from cash refunds. + + It is computed by summing the events of type CASH_TENDER_REFUND. The + amount + + is always greater than or equal to zero. + cash_paid_in_money: + type: optional + docs: >- + The amount of money added to the cash drawer for reasons other than + cash + + payments. It is computed by summing the events of type PAID_IN. The + amount is + + always greater than or equal to zero. + cash_paid_out_money: + type: optional + docs: >- + The amount of money removed from the cash drawer for reasons other + than + + cash refunds. It is computed by summing the events of type PAID_OUT. + The amount + + is always greater than or equal to zero. + expected_cash_money: + type: optional + docs: >- + The amount of money that should be in the cash drawer at the end of + the + + shift, based on the shift's other money amounts. + + This can be negative if employees have not correctly recorded all the + events + + on the cash drawer. + + cash_paid_out_money is a summation of amounts from cash_payment_money + (zero + + or positive), cash_refunds_money (zero or negative), + cash_paid_in_money (zero + + or positive), and cash_paid_out_money (zero or negative) event types. + closed_cash_money: + type: optional + docs: |- + The amount of money found in the cash drawer at the end of the shift + by an auditing employee. The amount should be positive. + device: + type: optional + docs: >- + The device running Square Point of Sale that was connected to the cash + drawer. + created_at: + type: optional + docs: The shift start time in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The shift updated at time in RFC 3339 format. + access: read-only + location_id: + type: optional + docs: The ID of the location the cash drawer shift belongs to. + access: read-only + team_member_ids: + type: optional> + docs: >- + The IDs of all team members that were logged into Square Point of Sale + at any + + point while the cash drawer shift was open. + access: read-only + opening_team_member_id: + type: optional + docs: The ID of the team member that started the cash drawer shift. + access: read-only + ending_team_member_id: + type: optional + docs: The ID of the team member that ended the cash drawer shift. + access: read-only + closing_team_member_id: + type: optional + docs: >- + The ID of the team member that closed the cash drawer shift by + auditing + + the cash drawer contents. + access: read-only + source: + openapi: openapi/openapi.json + CashDrawerShiftEvent: + properties: + id: + type: optional + docs: The unique ID of the event. + event_type: + type: optional + docs: >- + The type of cash drawer shift event. + + See [CashDrawerEventType](#type-cashdrawereventtype) for possible + values + event_money: + type: optional + docs: >- + The amount of money that was added to or removed from the cash drawer + + in the event. The amount can be positive (for added money) + + or zero (for other tender type payments). The addition or removal of + money can be determined by + + by the event type. + created_at: + type: optional + docs: The event time in RFC 3339 format. + access: read-only + description: + type: optional> + docs: |- + An optional description of the event, entered by the employee that + created the event. + team_member_id: + type: optional + docs: The ID of the team member that created the event. + access: read-only + source: + openapi: openapi/openapi.json + CashDrawerShiftState: + enum: + - OPEN + - ENDED + - CLOSED + docs: The current state of a cash drawer shift. + source: + openapi: openapi/openapi.json + CashDrawerShiftSummary: + docs: >- + The summary of a closed cash drawer shift. + + This model contains only the money counted to start a cash drawer shift, + counted + + at the end of the shift, and the amount that should be in the drawer at + shift + + end based on summing all cash drawer shift events. + properties: + id: + type: optional + docs: The shift unique ID. + state: + type: optional + docs: >- + The shift current state. + + See [CashDrawerShiftState](#type-cashdrawershiftstate) for possible + values + opened_at: + type: optional> + docs: The shift start time in ISO 8601 format. + ended_at: + type: optional> + docs: The shift end time in ISO 8601 format. + closed_at: + type: optional> + docs: The shift close time in ISO 8601 format. + description: + type: optional> + docs: An employee free-text description of a cash drawer shift. + opened_cash_money: + type: optional + docs: |- + The amount of money in the cash drawer at the start of the shift. This + must be a positive amount. + expected_cash_money: + type: optional + docs: >- + The amount of money that should be in the cash drawer at the end of + the + + shift, based on the cash drawer events on the shift. + + The amount is correct if all shift employees accurately recorded their + + cash drawer shift events. Unrecorded events and events with the wrong + amount + + result in an incorrect expected_cash_money amount that can be + negative. + closed_cash_money: + type: optional + docs: >- + The amount of money found in the cash drawer at the end of the shift + by + + an auditing employee. The amount must be greater than or equal to + zero. + created_at: + type: optional + docs: The shift start time in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The shift updated at time in RFC 3339 format. + access: read-only + location_id: + type: optional + docs: The ID of the location the cash drawer shift belongs to. + access: read-only + source: + openapi: openapi/openapi.json + CashPaymentDetails: + docs: >- + Stores details about a cash payment. Contains only non-confidential + information. For more information, see + + [Take Cash + Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). + properties: + buyer_supplied_money: + type: Money + docs: The amount and currency of the money supplied by the buyer. + change_back_money: + type: optional + docs: |- + The amount of change due back to the buyer. + This read-only field is calculated + from the `amount_money` and `buyer_supplied_money` fields. + source: + openapi: openapi/openapi.json + CatalogAvailabilityPeriod: + docs: Represents a time period of availability. + properties: + start_local_time: + type: optional> + docs: >- + The start time of an availability period, specified in local time + using partial-time + + RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 + in the morning. + + Note that the seconds value is always :00, but it is appended for + conformance to the RFC. + end_local_time: + type: optional> + docs: >- + The end time of an availability period, specified in local time using + partial-time + + RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 + in the evening. + + Note that the seconds value is always :00, but it is appended for + conformance to the RFC. + day_of_week: + type: optional + docs: |- + The day of the week for this availability period. + See [DayOfWeek](#type-dayofweek) for possible values + source: + openapi: openapi/openapi.json + CatalogCategory: + docs: A category to which a `CatalogItem` instance belongs. + properties: + name: + type: optional> + docs: >- + The category name. This is a searchable attribute for use in + applicable query filters, and its value length is of Unicode code + points. + validation: + maxLength: 255 + image_ids: + type: optional>> + docs: >- + The IDs of images associated with this `CatalogCategory` instance. + + Currently these images are not displayed by Square, but are free to be + displayed in 3rd party applications. + category_type: + type: optional + docs: >- + The type of the category. + + See [CatalogCategoryType](#type-catalogcategorytype) for possible + values + parent_category: + type: optional + docs: The ID of the parent category of this category instance. + is_top_level: + type: optional> + docs: >- + Indicates whether a category is a top level category, which does not + have any parent_category. + channels: + type: optional>> + docs: >- + A list of IDs representing channels, such as a Square Online site, + where the category can be made visible. + availability_period_ids: + type: optional>> + docs: >- + The IDs of the `CatalogAvailabilityPeriod` objects associated with the + category. + online_visibility: + type: optional> + docs: >- + Indicates whether the category is visible (`true`) or hidden (`false`) + on all of the seller's Square Online sites. + root_category: + type: optional + docs: The top-level category in a category hierarchy. + access: read-only + ecom_seo_data: + type: optional + docs: The SEO data for a seller's Square Online store. + path_to_root: + type: optional>> + docs: >- + The path from the category to its root category. The first node of the + path is the parent of the category + + and the last is the root category. The path is empty if the category + is a root category. + source: + openapi: openapi/openapi.json + CatalogCategoryType: + enum: + - REGULAR_CATEGORY + - MENU_CATEGORY + - KITCHEN_CATEGORY + docs: Indicates the type of a category. + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinition: + docs: >- + Contains information defining a custom attribute. Custom attributes are + + intended to store additional information about a catalog object or to + associate a + + catalog object with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable information, + card details, etc.). + + [Read more about custom + attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) + properties: + type: + type: CatalogCustomAttributeDefinitionType + docs: >- + The type of this custom attribute. Cannot be modified after creation. + + Required. + + See + [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) + for possible values + name: + type: string + docs: >2- + The name of this definition for API and seller-facing UI purposes. + The name must be unique within the (merchant, application) pair. + Required. + + May not be empty and may not exceed 255 characters. Can be modified + after creation. + validation: + minLength: 1 + maxLength: 255 + description: + type: optional> + docs: >- + Seller-oriented description of the meaning of this Custom Attribute, + + any constraints that the seller should observe, etc. May be displayed + as a tooltip in Square UIs. + validation: + maxLength: 255 + source_application: + type: optional + docs: |- + __Read only.__ Contains information about the application that + created this custom attribute definition. + allowed_object_types: + docs: >- + The set of `CatalogObject` types that this custom atttribute may be + applied to. + + Currently, only `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, + and `CATEGORY` are allowed. At least one type must be included. + + See [CatalogObjectType](#type-catalogobjecttype) for possible values + type: list + seller_visibility: + type: optional + docs: >- + The visibility of a custom attribute in seller-facing UIs (including + Square Point + + of Sale applications and Square Dashboard). May be modified. + + See + [CatalogCustomAttributeDefinitionSellerVisibility](#type-catalogcustomattributedefinitionsellervisibility) + for possible values + app_visibility: + type: optional + docs: >- + The visibility of a custom attribute to applications other than the + application + + that created the attribute. + + See + [CatalogCustomAttributeDefinitionAppVisibility](#type-catalogcustomattributedefinitionappvisibility) + for possible values + string_config: + type: optional + docs: Optionally, populated when `type` = `STRING`, unset otherwise. + number_config: + type: optional + docs: Optionally, populated when `type` = `NUMBER`, unset otherwise. + selection_config: + type: optional + docs: Populated when `type` is set to `SELECTION`, unset otherwise. + custom_attribute_usage_count: + type: optional + docs: >- + The number of custom attributes that reference this + + custom attribute definition. Set by the server in response to a + ListCatalog + + request with `include_counts` set to `true`. If the actual count is + greater + + than 100, `custom_attribute_usage_count` will be set to `100`. + access: read-only + key: + type: optional> + docs: >- + The name of the desired custom attribute key that can be used to + access + + the custom attribute value on catalog objects. Cannot be modified + after the + + custom attribute definition has been created. + + Must be between 1 and 60 characters, and may only contain the + characters `[a-zA-Z0-9_-]`. + validation: + pattern: ^[a-zA-Z0-9_-]*$ + minLength: 1 + maxLength: 60 + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionAppVisibility: + enum: + - APP_VISIBILITY_HIDDEN + - APP_VISIBILITY_READ_ONLY + - APP_VISIBILITY_READ_WRITE_VALUES + docs: >- + Defines the visibility of a custom attribute to applications other than + their + + creating application. + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionNumberConfig: + properties: + precision: + type: optional> + docs: |- + An integer between 0 and 5 that represents the maximum number of + positions allowed after the decimal in number custom attribute values + For example: + + - if the precision is 0, the quantity can be 1, 2, 3, etc. + - if the precision is 1, the quantity can be 0.1, 0.2, etc. + - if the precision is 2, the quantity can be 0.01, 0.12, etc. + + Default: 5 + validation: + max: 5 + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionSelectionConfig: + docs: >- + Configuration associated with `SELECTION`-type custom attribute + definitions. + properties: + max_allowed_selections: + type: optional> + docs: >- + The maximum number of selections that can be set. The maximum value + for this + + attribute is 100. The default value is 1. The value can be modified, + but changing the value will not + + affect existing custom attribute values on objects. Clients need to + + handle custom attributes with more selected values than allowed by + this limit. + validation: + max: 100 + allowed_selections: + type: >- + optional>> + docs: >- + The set of valid `CatalogCustomAttributeSelections`. Up to a maximum + of 100 + + selections can be defined. Can be modified. + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection: + docs: A named selection for this `SELECTION`-type custom attribute definition. + properties: + uid: + type: optional> + docs: Unique ID set by Square. + name: + type: string + docs: Selection name, unique within `allowed_selections`. + validation: + minLength: 1 + maxLength: 255 + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionSellerVisibility: + enum: + - SELLER_VISIBILITY_HIDDEN + - SELLER_VISIBILITY_READ_WRITE_VALUES + docs: |- + Defines the visibility of a custom attribute to sellers in Square + client applications, Square APIs or in Square UIs (including Square Point + of Sale applications and Square Dashboard). + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionStringConfig: + docs: >- + Configuration associated with Custom Attribute Definitions of type + `STRING`. + properties: + enforce_uniqueness: + type: optional> + docs: >- + If true, each Custom Attribute instance associated with this Custom + Attribute + + Definition must have a unique value within the seller's catalog. For + + example, this may be used for a value like a SKU that should not be + + duplicated within a seller's catalog. May not be modified after the + + definition has been created. + source: + openapi: openapi/openapi.json + CatalogCustomAttributeDefinitionType: + enum: + - STRING + - BOOLEAN + - NUMBER + - SELECTION + docs: Defines the possible types for a custom attribute. + source: + openapi: openapi/openapi.json + CatalogCustomAttributeValue: + docs: >- + An instance of a custom attribute. Custom attributes can be defined and + + added to `ITEM` and `ITEM_VARIATION` type catalog objects. + + [Read more about custom + attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes). + properties: + name: + type: optional> + docs: The name of the custom attribute. + string_value: + type: optional> + docs: >- + The string value of the custom attribute. Populated if `type` = + `STRING`. + custom_attribute_definition_id: + type: optional + docs: >- + The id of the + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + this value belongs to. + access: read-only + type: + type: optional + docs: >- + A copy of type from the associated `CatalogCustomAttributeDefinition`. + + See + [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) + for possible values + number_value: + type: optional> + docs: >- + Populated if `type` = `NUMBER`. Contains a string + + representation of a decimal number, using a `.` as the decimal + separator. + boolean_value: + type: optional> + docs: A `true` or `false` value. Populated if `type` = `BOOLEAN`. + selection_uid_values: + type: optional>> + docs: >- + One or more choices from `allowed_selections`. Populated if `type` = + `SELECTION`. + key: + type: optional + docs: >- + If the associated `CatalogCustomAttributeDefinition` object is defined + by another application, this key is prefixed by the defining + application ID. + + For example, if the CatalogCustomAttributeDefinition has a key + attribute of "cocoa_brand" and the defining application ID is + "abcd1234", this key is "abcd1234:cocoa_brand" + + when the application making the request is different from the + application defining the custom attribute definition. Otherwise, the + key is simply "cocoa_brand". + access: read-only + source: + openapi: openapi/openapi.json + CatalogDiscount: + docs: A discount applicable to items. + properties: + name: + type: optional> + docs: >- + The discount name. This is a searchable attribute for use in + applicable query filters, and its value length is of Unicode code + points. + validation: + maxLength: 255 + discount_type: + type: optional + docs: >- + Indicates whether the discount is a fixed amount or percentage, or + entered at the time of sale. + + See [CatalogDiscountType](#type-catalogdiscounttype) for possible + values + percentage: + type: optional> + docs: >- + The percentage of the discount as a string representation of a decimal + number, using a `.` as the decimal + + separator and without a `%` sign. A value of `7.5` corresponds to + `7.5%`. Specify a percentage of `0` if `discount_type` + + is `VARIABLE_PERCENTAGE`. + + + Do not use this field for amount-based or variable discounts. + amount_money: + type: optional + docs: >- + The amount of the discount. Specify an amount of `0` if + `discount_type` is `VARIABLE_AMOUNT`. + + + Do not use this field for percentage-based or variable discounts. + pin_required: + type: optional> + docs: >- + Indicates whether a mobile staff member needs to enter their PIN to + apply the + + discount to a payment in the Square Point of Sale app. + label_color: + type: optional> + docs: >- + The color of the discount display label in the Square Point of Sale + app. This must be a valid hex color code. + modify_tax_basis: + type: optional + docs: >- + Indicates whether this discount should reduce the price used to + calculate tax. + + + Most discounts should use `MODIFY_TAX_BASIS`. However, in some + circumstances taxes must + + be calculated based on an item's price, ignoring a particular + discount. For example, + + in many US jurisdictions, a manufacturer coupon or instant rebate + reduces the price a + + customer pays but does not reduce the sale price used to calculate how + much sales tax is + + due. In this case, the discount representing that manufacturer coupon + should have + + `DO_NOT_MODIFY_TAX_BASIS` for this field. + + + If you are unsure whether you need to use this field, consult your tax + professional. + + See + [CatalogDiscountModifyTaxBasis](#type-catalogdiscountmodifytaxbasis) + for possible values + maximum_amount_money: + type: optional + docs: >- + For a percentage discount, the maximum absolute value of the discount. + For example, if a + + 50% discount has a `maximum_amount_money` of $20, a $100 purchase will + yield a $20 discount, + + not a $50 discount. + source: + openapi: openapi/openapi.json + CatalogDiscountModifyTaxBasis: + enum: + - MODIFY_TAX_BASIS + - DO_NOT_MODIFY_TAX_BASIS + source: + openapi: openapi/openapi.json + CatalogDiscountType: + enum: + - FIXED_PERCENTAGE + - FIXED_AMOUNT + - VARIABLE_PERCENTAGE + - VARIABLE_AMOUNT + docs: How to apply a CatalogDiscount to a CatalogItem. + source: + openapi: openapi/openapi.json + CatalogEcomSeoData: + docs: SEO data for for a seller's Square Online store. + properties: + page_title: + type: optional> + docs: The SEO title used for the Square Online store. + page_description: + type: optional> + docs: The SEO description used for the Square Online store. + permalink: + type: optional> + docs: The SEO permalink used for the Square Online store. + source: + openapi: openapi/openapi.json + CatalogIdMapping: + docs: >- + A mapping between a temporary client-supplied ID and a permanent + server-generated ID. + + + When calling + [UpsertCatalogObject](api-endpoint:Catalog-UpsertCatalogObject) or + + [BatchUpsertCatalogObjects](api-endpoint:Catalog-BatchUpsertCatalogObjects) + to + + create a [CatalogObject](entity:CatalogObject) instance, you can supply + + a temporary ID for the to-be-created object, especially when the object is + to be referenced + + elsewhere in the same request body. This temporary ID can be any string + unique within + + the call, but must be prefixed by "#". + + + After the request is submitted and the object created, a permanent + server-generated ID is assigned + + to the new object. The permanent ID is unique across the Square catalog. + properties: + client_object_id: + type: optional> + docs: >- + The client-supplied temporary `#`-prefixed ID for a new + `CatalogObject`. + object_id: + type: optional> + docs: The permanent ID for the CatalogObject created by the server. + source: + openapi: openapi/openapi.json + CatalogImage: + docs: >- + An image file to use in Square catalogs. It can be associated with + + `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and + `CatalogModifierList` objects. + + Only the images on items and item variations are exposed in Dashboard. + + Only the first image on an item is displayed in Square Point of Sale + (SPOS). + + Images on items and variations are displayed through Square Online Store. + + Images on other object types are for use by 3rd party application + developers. + properties: + name: + type: optional> + docs: >- + The internal name to identify this image in calls to the Square API. + + This is a searchable attribute for use in applicable query filters + + using the + [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). + + It is not unique and should not be shown in a buyer facing context. + url: + type: optional> + docs: >- + The URL of this image, generated by Square after an image is uploaded + + using the + [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) + endpoint. + + To modify the image, use the UpdateCatalogImage endpoint. Do not + change the URL field. + caption: + type: optional> + docs: >- + A caption that describes what is shown in the image. Displayed in the + + Square Online Store. This is a searchable attribute for use in + applicable query filters + + using the + [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). + photo_studio_order_id: + type: optional> + docs: >- + The immutable order ID for this image object created by the Photo + Studio service in Square Online Store. + source: + openapi: openapi/openapi.json + CatalogInfoResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + limits: + type: optional + docs: Limits that apply to this API. + standard_unit_description_group: + type: optional + docs: Names and abbreviations for standard units. + source: + openapi: openapi/openapi.json + CatalogInfoResponseLimits: + properties: + batch_upsert_max_objects_per_batch: + type: optional> + docs: >- + The maximum number of objects that may appear within a single batch in + a + + `/v2/catalog/batch-upsert` request. + batch_upsert_max_total_objects: + type: optional> + docs: |- + The maximum number of objects that may appear across all batches in a + `/v2/catalog/batch-upsert` request. + batch_retrieve_max_object_ids: + type: optional> + docs: >- + The maximum number of object IDs that may appear in a + `/v2/catalog/batch-retrieve` + + request. + search_max_page_limit: + type: optional> + docs: |- + The maximum number of results that may be returned in a page of a + `/v2/catalog/search` response. + batch_delete_max_object_ids: + type: optional> + docs: |- + The maximum number of object IDs that may be included in a single + `/v2/catalog/batch-delete` request. + update_item_taxes_max_item_ids: + type: optional> + docs: |- + The maximum number of item IDs that may be included in a single + `/v2/catalog/update-item-taxes` request. + update_item_taxes_max_taxes_to_enable: + type: optional> + docs: >- + The maximum number of tax IDs to be enabled that may be included in a + single + + `/v2/catalog/update-item-taxes` request. + update_item_taxes_max_taxes_to_disable: + type: optional> + docs: >- + The maximum number of tax IDs to be disabled that may be included in a + single + + `/v2/catalog/update-item-taxes` request. + update_item_modifier_lists_max_item_ids: + type: optional> + docs: |- + The maximum number of item IDs that may be included in a single + `/v2/catalog/update-item-modifier-lists` request. + update_item_modifier_lists_max_modifier_lists_to_enable: + type: optional> + docs: >- + The maximum number of modifier list IDs to be enabled that may be + included in + + a single `/v2/catalog/update-item-modifier-lists` request. + update_item_modifier_lists_max_modifier_lists_to_disable: + type: optional> + docs: >- + The maximum number of modifier list IDs to be disabled that may be + included in + + a single `/v2/catalog/update-item-modifier-lists` request. + source: + openapi: openapi/openapi.json + CatalogItem: + docs: >- + A [CatalogObject](entity:CatalogObject) instance of the `ITEM` type, also + referred to as an item, in the catalog. + properties: + name: + type: optional> + docs: >- + The item's name. This is a searchable attribute for use in applicable + query filters, its value must not be empty, and the length is of + Unicode code points. + validation: + maxLength: 512 + description: + type: optional> + docs: >- + The item's description. This is a searchable attribute for use in + applicable query filters, and its value length is of Unicode code + points. + + + Deprecated at 2022-07-20, this field is planned to retire in 6 months. + You should migrate to use `description_html` to set the description + + of the [CatalogItem](entity:CatalogItem) instance. The `description` + and `description_html` field values are kept in sync. If you try to + + set the both fields, the `description_html` text value overwrites the + `description` value. Updates in one field are also reflected in the + other, + + except for when you use an early version before Square API 2022-07-20 + and `description_html` is set to blank, setting the `description` + value to null + + does not nullify `description_html`. + validation: + maxLength: 4096 + abbreviation: + type: optional> + docs: >- + The text of the item's display label in the Square Point of Sale app. + Only up to the first five characters of the string are used. + + This attribute is searchable, and its value length is of Unicode code + points. + validation: + maxLength: 24 + label_color: + type: optional> + docs: >- + The color of the item's display label in the Square Point of Sale app. + This must be a valid hex color code. + is_taxable: + type: optional> + docs: >- + Indicates whether the item is taxable (`true`) or non-taxable + (`false`). Default is `true`. + category_id: + type: optional> + docs: >- + The ID of the item's category, if any. Deprecated since 2023-12-13. + Use `CatalogItem.categories`, instead. + tax_ids: + type: optional>> + docs: >- + A set of IDs indicating the taxes enabled for + + this item. When updating an item, any taxes listed here will be added + to the item. + + Taxes may also be added to or deleted from an item using + `UpdateItemTaxes`. + modifier_list_info: + type: optional>> + docs: >- + A set of `CatalogItemModifierListInfo` objects + + representing the modifier lists that apply to this item, along with + the overrides and min + + and max limits that are specific to this item. Modifier lists + + may also be added to or deleted from an item using + `UpdateItemModifierLists`. + variations: + type: optional>> + docs: >- + A list of [CatalogItemVariation](entity:CatalogItemVariation) objects + for this item. An item must have + + at least one variation. + product_type: + type: optional + docs: >- + The product type of the item. Once set, the `product_type` value + cannot be modified. + + + Items of the `LEGACY_SQUARE_ONLINE_SERVICE` and + `LEGACY_SQUARE_ONLINE_MEMBERSHIP` product types can be updated + + but cannot be created using the API. + + See [CatalogItemProductType](#type-catalogitemproducttype) for + possible values + skip_modifier_screen: + type: optional> + docs: >- + If `false`, the Square Point of Sale app will present the + `CatalogItem`'s + + details screen immediately, allowing the merchant to choose + `CatalogModifier`s + + before adding the item to the cart. This is the default behavior. + + + If `true`, the Square Point of Sale app will immediately add the item + to the cart with the pre-selected + + modifiers, and merchants can edit modifiers by drilling down onto the + item's details. + + + Third-party clients are encouraged to implement similar behaviors. + item_options: + type: optional>> + docs: |- + List of item options IDs for this item. Used to manage and group item + variations in a specified order. + + Maximum: 6 item options. + ecom_uri: + type: optional> + docs: >- + Deprecated. A URI pointing to a published e-commerce product page for + the Item. + ecom_image_uris: + type: optional>> + docs: >- + Deprecated. A comma-separated list of encoded URIs pointing to a set + of published e-commerce images for the Item. + image_ids: + type: optional>> + docs: |- + The IDs of images associated with this `CatalogItem` instance. + These images will be shown to customers in Square Online Store. + The first image will show up as the icon for this item in POS. + sort_name: + type: optional> + docs: >- + A name to sort the item by. If this name is unspecified, namely, the + `sort_name` field is absent, the regular `name` field is used for + sorting. + + Its value must not be empty. + + + It is currently supported for sellers of the Japanese locale only. + categories: + type: optional>> + docs: The list of categories. + description_html: + type: optional> + docs: >- + The item's description as expressed in valid HTML elements. The length + of this field value, including those of HTML tags, + + is of Unicode points. With application query filters, the text values + of the HTML elements and attributes are searchable. Invalid or + + unsupported HTML elements or attributes are ignored. + + + Supported HTML elements include: + + - `a`: Link. Supports linking to website URLs, email address, and + telephone numbers. + + - `b`, `strong`: Bold text + + - `br`: Line break + + - `code`: Computer code + + - `div`: Section + + - `h1-h6`: Headings + + - `i`, `em`: Italics + + - `li`: List element + + - `ol`: Numbered list + + - `p`: Paragraph + + - `ul`: Bullet list + + - `u`: Underline + + + + Supported HTML attributes include: + + - `align`: Alignment of the text content + + - `href`: Link destination + + - `rel`: Relationship between link's target and source + + - `target`: Place to open the linked document + validation: + maxLength: 65535 + description_plaintext: + type: optional + docs: >- + A server-generated plaintext version of the `description_html` field, + without formatting tags. + validation: + maxLength: 65535 + access: read-only + channels: + type: optional>> + docs: >- + A list of IDs representing channels, such as a Square Online site, + where the item can be made visible or available. + + This field is read only and cannot be edited. + is_archived: + type: optional> + docs: Indicates whether this item is archived (`true`) or not (`false`). + ecom_seo_data: + type: optional + docs: The SEO data for a seller's Square Online store. + food_and_beverage_details: + type: optional + docs: The food and beverage-specific details for the `FOOD_AND_BEV` item. + reporting_category: + type: optional + docs: The item's reporting category. + is_alcoholic: + type: optional> + docs: Indicates whether this item is alcoholic (`true`) or not (`false`). + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetails: + docs: The food and beverage-specific details of a `FOOD_AND_BEV` item. + properties: + calorie_count: + type: optional> + docs: >- + The calorie count (in the unit of kcal) for the `FOOD_AND_BEV` type of + items. + dietary_preferences: + type: >- + optional>> + docs: The dietary preferences for the `FOOD_AND_BEV` item. + ingredients: + type: optional>> + docs: The ingredients for the `FOOD_AND_BEV` type item. + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetailsDietaryPreference: + docs: >- + Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its + ingredients. + properties: + type: + type: optional + docs: >- + The dietary preference type. Supported values include `STANDARD` and + `CUSTOM` as specified in + `FoodAndBeverageDetails.DietaryPreferenceType`. + + See [DietaryPreferenceType](#type-dietarypreferencetype) for possible + values + standard_name: + type: >- + optional + docs: >- + The name of the dietary preference from a standard pre-defined list. + This should be null if it's a custom dietary preference. + + See [StandardDietaryPreference](#type-standarddietarypreference) for + possible values + custom_name: + type: optional> + docs: >- + The name of a user-defined custom dietary preference. This should be + null if it's a standard dietary preference. + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference: + enum: + - DAIRY_FREE + - GLUTEN_FREE + - HALAL + - KOSHER + - NUT_FREE + - VEGAN + - VEGETARIAN + docs: >- + Standard dietary preferences for food and beverage items that are + recommended on item creation. + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetailsDietaryPreferenceType: + enum: + - STANDARD + - CUSTOM + docs: >- + The type of dietary preference for the `FOOD_AND_BEV` type of items and + integredients. + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetailsIngredient: + docs: Describes the ingredient used in a `FOOD_AND_BEV` item. + properties: + type: + type: optional + docs: >- + The dietary preference type of the ingredient. Supported values + include `STANDARD` and `CUSTOM` as specified in + `FoodAndBeverageDetails.DietaryPreferenceType`. + + See [DietaryPreferenceType](#type-dietarypreferencetype) for possible + values + standard_name: + type: >- + optional + docs: >- + The name of the ingredient from a standard pre-defined list. This + should be null if it's a custom dietary preference. + + See [StandardIngredient](#type-standardingredient) for possible values + custom_name: + type: optional> + docs: >- + The name of a custom user-defined ingredient. This should be null if + it's a standard dietary preference. + source: + openapi: openapi/openapi.json + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient: + enum: + - CELERY + - CRUSTACEANS + - EGGS + - FISH + - GLUTEN + - LUPIN + - MILK + - MOLLUSCS + - MUSTARD + - PEANUTS + - SESAME + - SOY + - SULPHITES + - TREE_NUTS + docs: >- + Standard ingredients for food and beverage items that are recommended on + item creation. + source: + openapi: openapi/openapi.json + CatalogItemModifierListInfo: + docs: >- + Controls how a modifier list is applied to a specific item. This object + allows for item-specific customization of modifier list behavior + + and provides the ability to override global modifier list settings. + properties: + modifier_list_id: + type: string + docs: >- + The ID of the `CatalogModifierList` controlled by this + `CatalogModifierListInfo`. + validation: + minLength: 1 + modifier_overrides: + type: optional>> + docs: >- + A set of `CatalogModifierOverride` objects that override default + modifier settings for this item. + min_selected_modifiers: + type: optional> + docs: >- + The minimum number of modifiers that must be selected from this + modifier list. + + Values: + + + - 0: No selection is required. + + - -1: Default value, the attribute was not set by the client. When + `max_selected_modifiers` is + + also -1, use the minimum and maximum selection values set on the + `CatalogItemModifierList`. + + - >0: The required minimum modifier selections. This can be larger + than the total `CatalogModifiers` when `allow_quantities` is enabled. + + - < -1: Invalid. Treated as no selection required. + max_selected_modifiers: + type: optional> + docs: >- + The maximum number of modifiers that can be selected. + + Values: + + + - 0: No maximum limit. + + - -1: Default value, the attribute was not set by the client. When + `min_selected_modifiers` is + + also -1, use the minimum and maximum selection values set on the + `CatalogItemModifierList`. + + - >0: The maximum total modifier selections. This can be larger + than the total `CatalogModifiers` when `allow_quantities` is enabled. + + - < -1: Invalid. Treated as no maximum limit. + enabled: + type: optional> + docs: >- + If `true`, enable this `CatalogModifierList`. The default value is + `true`. + ordinal: + type: optional> + docs: >- + The position of this `CatalogItemModifierListInfo` object within the + `modifier_list_info` list applied + + to a `CatalogItem` instance. + allow_quantities: optional + is_conversational: optional + hidden_from_customer_override: optional + source: + openapi: openapi/openapi.json + CatalogItemOption: + docs: A group of variations for a `CatalogItem`. + properties: + name: + type: optional> + docs: >- + The item option's display name for the seller. Must be unique across + + all item options. This is a searchable attribute for use in applicable + query filters. + display_name: + type: optional> + docs: >- + The item option's display name for the customer. This is a searchable + attribute for use in applicable query filters. + description: + type: optional> + docs: >- + The item option's human-readable description. Displayed in the Square + + Point of Sale app for the seller and in the Online Store or on + receipts for + + the buyer. This is a searchable attribute for use in applicable query + filters. + show_colors: + type: optional> + docs: If true, display colors for entries in `values` when present. + values: + type: optional>> + docs: |- + A list of CatalogObjects containing the + `CatalogItemOptionValue`s for this item. + source: + openapi: openapi/openapi.json + CatalogItemOptionForItem: + docs: |2- + An option that can be assigned to an item. + For example, a t-shirt item may offer a color option or a size option. + properties: + item_option_id: + type: optional> + docs: >- + The unique id of the item option, used to form the dimensions of the + item option matrix in a specified order. + source: + openapi: openapi/openapi.json + CatalogItemOptionValue: + docs: |- + An enumerated value that can link a + `CatalogItemVariation` to an item option as one of + its item option values. + properties: + item_option_id: + type: optional> + docs: Unique ID of the associated item option. + name: + type: optional> + docs: >- + Name of this item option value. This is a searchable attribute for use + in applicable query filters. + description: + type: optional> + docs: >- + A human-readable description for the option value. This is a + searchable attribute for use in applicable query filters. + color: + type: optional> + docs: >- + The HTML-supported hex color for the item option (e.g., "#ff8d4e85"). + + Only displayed if `show_colors` is enabled on the parent `ItemOption`. + When + + left unset, `color` defaults to white ("#ffffff") when `show_colors` + is + + enabled on the parent `ItemOption`. + ordinal: + type: optional> + docs: Determines where this option value appears in a list of option values. + source: + openapi: openapi/openapi.json + CatalogItemOptionValueForItemVariation: + docs: >- + A `CatalogItemOptionValue` links an item variation to an item option as + + an item option value. For example, a t-shirt item may offer a color option + and + + a size option. An item option value would represent each variation of + t-shirt: + + For example, "Color:Red, Size:Small" or "Color:Blue, Size:Medium". + properties: + item_option_id: + type: optional> + docs: The unique id of an item option. + item_option_value_id: + type: optional> + docs: The unique id of the selected value for the item option. + source: + openapi: openapi/openapi.json + CatalogItemProductType: + enum: + - REGULAR + - GIFT_CARD + - APPOINTMENTS_SERVICE + - FOOD_AND_BEV + - EVENT + - DIGITAL + - DONATION + - LEGACY_SQUARE_ONLINE_SERVICE + - LEGACY_SQUARE_ONLINE_MEMBERSHIP + docs: >- + The type of a CatalogItem. Connect V2 only allows the creation of + `REGULAR` or `APPOINTMENTS_SERVICE` items. + source: + openapi: openapi/openapi.json + CatalogItemVariation: + docs: >- + An item variation, representing a product for sale, in the Catalog object + model. Each [item](entity:CatalogItem) must have at least one + + item variation and can have at most 250 item variations. + + + An item variation can be sellable, stockable, or both if it has a unit of + measure for its count for the sold number of the variation, the stocked + + number of the variation, or both. For example, when a variation + representing wine is stocked and sold by the bottle, the variation is both + + stockable and sellable. But when a variation of the wine is sold by the + glass, the sold units cannot be used as a measure of the stocked units. + This by-the-glass + + variation is sellable, but not stockable. To accurately keep track of the + wine's inventory count at any time, the sellable count must be + + converted to stockable count. Typically, the seller defines this unit + conversion. For example, 1 bottle equals 5 glasses. The Square API exposes + + the `stockable_conversion` property on the variation to specify the + conversion. Thus, when two glasses of the wine are sold, the sellable + count + + decreases by 2, and the stockable count automatically decreases by 0.4 + bottle according to the conversion. + properties: + item_id: + type: optional> + docs: The ID of the `CatalogItem` associated with this item variation. + name: + type: optional> + docs: >- + The item variation's name. This is a searchable attribute for use in + applicable query filters. + + + Its value has a maximum length of 255 Unicode code points. However, + when the parent [item](entity:CatalogItem) + + uses [item options](entity:CatalogItemOption), this attribute is + auto-generated, read-only, and can be + + longer than 255 Unicode code points. + sku: + type: optional> + docs: >- + The item variation's SKU, if any. This is a searchable attribute for + use in applicable query filters. + upc: + type: optional> + docs: >- + The universal product code (UPC) of the item variation, if any. This + is a searchable attribute for use in applicable query filters. + + + The value of this attribute should be a number of 12-14 digits long. + This restriction is enforced on the Square Seller Dashboard, + + Square Point of Sale or Retail Point of Sale apps, where this + attribute shows in the GTIN field. If a non-compliant UPC value is + assigned + + to this attribute using the API, the value is not editable on the + Seller Dashboard, Square Point of Sale or Retail Point of Sale apps + + unless it is updated to fit the expected format. + ordinal: + type: optional + docs: >- + The order in which this item variation should be displayed. This value + is read-only. On writes, the ordinal + + for each item variation within a parent `CatalogItem` is set according + to the item variations's + + position. On reads, the value is not guaranteed to be sequential or + unique. + access: read-only + pricing_type: + type: optional + docs: >- + Indicates whether the item variation's price is fixed or determined at + the time + + of sale. + + See [CatalogPricingType](#type-catalogpricingtype) for possible values + price_money: + type: optional + docs: The item variation's price, if fixed pricing is used. + location_overrides: + type: optional>> + docs: Per-location price and inventory overrides. + track_inventory: + type: optional> + docs: If `true`, inventory tracking is active for the variation. + inventory_alert_type: + type: optional + docs: >- + Indicates whether the item variation displays an alert when its + inventory quantity is less than or equal + + to its `inventory_alert_threshold`. + + See [InventoryAlertType](#type-inventoryalerttype) for possible values + inventory_alert_threshold: + type: optional> + docs: >- + If the inventory quantity for the variation is less than or equal to + this value and `inventory_alert_type` + + is `LOW_QUANTITY`, the variation displays an alert in the merchant + dashboard. + + + This value is always an integer. + user_data: + type: optional> + docs: >- + Arbitrary user metadata to associate with the item variation. This + attribute value length is of Unicode code points. + validation: + maxLength: 255 + service_duration: + type: optional> + docs: >- + If the `CatalogItem` that owns this item variation is of type + + `APPOINTMENTS_SERVICE`, then this is the duration of the service in + milliseconds. For + + example, a 30 minute appointment would have the value `1800000`, which + is equal to + + 30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per + second). + available_for_booking: + type: optional> + docs: >- + If the `CatalogItem` that owns this item variation is of type + + `APPOINTMENTS_SERVICE`, a bool representing whether this service is + available for booking. + item_option_values: + type: optional>> + docs: |- + List of item option values associated with this item variation. Listed + in the same order as the item options of the parent item. + measurement_unit_id: + type: optional> + docs: >- + ID of the ‘CatalogMeasurementUnit’ that is used to measure the + quantity + + sold of this item variation. If left unset, the item will be sold in + + whole quantities. + sellable: + type: optional> + docs: >- + Whether this variation can be sold. The inventory count of a sellable + variation indicates + + the number of units available for sale. When a variation is both + stockable and sellable, + + its sellable inventory count can be smaller than or equal to its + stockable count. + stockable: + type: optional> + docs: >- + Whether stock is counted directly on this variation (TRUE) or only on + its components (FALSE). + + When a variation is both stockable and sellable, the inventory count + of a stockable variation keeps track of the number of units of this + variation in stock + + and is not an indicator of the number of units of the variation that + can be sold. + image_ids: + type: optional>> + docs: >- + The IDs of images associated with this `CatalogItemVariation` + instance. + + These images will be shown to customers in Square Online Store. + team_member_ids: + type: optional>> + docs: >- + Tokens of employees that can perform the service represented by this + variation. Only valid for + + variations of type `APPOINTMENTS_SERVICE`. + stockable_conversion: + type: optional + docs: >- + The unit conversion rule, as prescribed by the + [CatalogStockConversion](entity:CatalogStockConversion) type, + + that describes how this non-stockable (i.e., sellable/receivable) item + variation is converted + + to/from the stockable item variation sharing the same parent item. + With the stock conversion, + + you can accurately track inventory when an item variation is sold in + one unit, but stocked in + + another unit. + source: + openapi: openapi/openapi.json + CatalogMeasurementUnit: + docs: |- + Represents the unit used to measure a `CatalogItemVariation` and + specifies the precision for decimal quantities. + properties: + measurement_unit: + type: optional + docs: >- + Indicates the unit used to measure the quantity of a catalog item + variation. + precision: + type: optional> + docs: >- + An integer between 0 and 5 that represents the maximum number of + + positions allowed after the decimal in quantities measured with this + unit. + + For example: + + + - if the precision is 0, the quantity can be 1, 2, 3, etc. + + - if the precision is 1, the quantity can be 0.1, 0.2, etc. + + - if the precision is 2, the quantity can be 0.01, 0.12, etc. + + + Default: 3 + source: + openapi: openapi/openapi.json + CatalogModifier: + docs: >- + A modifier that can be applied to items at the time of sale. For example, + a cheese modifier for a burger, or a flavor modifier for a serving of ice + cream. + properties: + name: + type: optional> + docs: >- + The modifier name. This is a searchable attribute for use in + applicable query filters, and its value length is of Unicode code + points. + validation: + maxLength: 255 + price_money: + type: optional + docs: The modifier price. + on_by_default: + type: optional> + docs: >- + When `true`, this modifier is selected by default when displaying the + modifier list. + + This setting can be overridden at the item level using + `CatalogModifierListInfo.modifier_overrides`. + ordinal: + type: optional> + docs: >- + Determines where this `CatalogModifier` appears in the + `CatalogModifierList`. + modifier_list_id: + type: optional> + docs: The ID of the `CatalogModifierList` associated with this modifier. + location_overrides: + type: optional>> + docs: Location-specific price overrides. + image_id: + type: optional> + docs: >- + The ID of the image associated with this `CatalogModifier` instance. + + Currently this image is not displayed by Square, but is free to be + displayed in 3rd party applications. + hidden_online: + type: optional> + docs: >- + When `true`, this modifier is hidden from online ordering channels. + This setting can be overridden at the item level using + `CatalogModifierListInfo.modifier_overrides`. + source: + openapi: openapi/openapi.json + CatalogModifierList: + docs: >- + A container for a list of modifiers, or a text-based modifier. + + For text-based modifiers, this represents text configuration for an item. + (For example, custom text to print on a t-shirt). + + For non text-based modifiers, this represents a list of modifiers that can + be applied to items at the time of sale. + + (For example, a list of condiments for a hot dog, or a list of ice cream + flavors). + + Each element of the modifier list is a `CatalogObject` instance of the + `MODIFIER` type. + properties: + name: + type: optional> + docs: >- + The name of the `CatalogModifierList` instance. This is a searchable + attribute for use in applicable query filters, and its value length is + of + + Unicode code points. + validation: + maxLength: 255 + ordinal: + type: optional> + docs: >- + The position of this `CatalogModifierList` within a list of + `CatalogModifierList` instances. + selection_type: + type: optional + docs: >- + __Deprecated__: Indicates whether a single (`SINGLE`) modifier or + multiple (`MULTIPLE`) modifiers can be selected. Use + + `min_selected_modifiers` and `max_selected_modifiers` instead. + + See + [CatalogModifierListSelectionType](#type-catalogmodifierlistselectiontype) + for possible values + modifiers: + type: optional>> + docs: >- + A non-empty list of `CatalogModifier` objects to be included in the + `CatalogModifierList`, + + for non text-based modifiers when the `modifier_type` attribute is + `LIST`. Each element of this list + + is a `CatalogObject` instance of the `MODIFIER` type, containing the + following attributes: + + ``` + + { + + "id": "{{catalog_modifier_id}}", + + "type": "MODIFIER", + + "modifier_data": {{a CatalogModifier instance>}} + + } + + ``` + image_ids: + type: optional>> + docs: >- + The IDs of images associated with this `CatalogModifierList` instance. + + Currently these images are not displayed on Square products, but may + be displayed in 3rd-party applications. + allow_quantities: + type: optional> + docs: >- + When `true`, allows multiple quantities of the same modifier to be + selected. + is_conversational: + type: optional> + docs: True if modifiers belonging to this list can be used conversationally. + modifier_type: + type: optional + docs: >- + The type of the modifier. + + + When this `modifier_type` value is `TEXT`, the `CatalogModifierList` + represents a text-based modifier. + + When this `modifier_type` value is `LIST`, the `CatalogModifierList` + contains a list of `CatalogModifier` objects. + + See + [CatalogModifierListModifierType](#type-catalogmodifierlistmodifiertype) + for possible values + max_length: + type: optional> + docs: >- + The maximum length, in Unicode points, of the text string of the + text-based modifier as represented by + + this `CatalogModifierList` object with the `modifier_type` set to + `TEXT`. + text_required: + type: optional> + docs: >- + Whether the text string must be a non-empty string (`true`) or not + (`false`) for a text-based modifier + + as represented by this `CatalogModifierList` object with the + `modifier_type` set to `TEXT`. + internal_name: + type: optional> + docs: >- + A note for internal use by the business. + + + For example, for a text-based modifier applied to a T-shirt item, if + the buyer-supplied text of "Hello, Kitty!" + + is to be printed on the T-shirt, this `internal_name` attribute can be + "Use italic face" as + + an instruction for the business to follow. + + + For non text-based modifiers, this `internal_name` attribute can be + + used to include SKUs, internal codes, or supplemental descriptions for + internal use. + validation: + maxLength: 512 + min_selected_modifiers: + type: optional> + docs: >- + The minimum number of modifiers that must be selected from this list. + The value can be overridden with `CatalogItemModifierListInfo`. + + + Values: + + + - 0: No selection is required. + + - -1: Default value, the attribute was not set by the client. Treated + as no selection required. + + - >0: The required minimum modifier selections. This can be larger + than the total `CatalogModifiers` when `allow_quantities` is enabled. + + - < -1: Invalid. Treated as no selection required. + max_selected_modifiers: + type: optional> + docs: >- + The maximum number of modifiers that must be selected from this list. + The value can be overridden with `CatalogItemModifierListInfo`. + + + Values: + + + - 0: No maximum limit. + + - -1: Default value, the attribute was not set by the client. Treated + as no maximum limit. + + - >0: The maximum total modifier selections. This can be larger + than the total `CatalogModifiers` when `allow_quantities` is enabled. + + - < -1: Invalid. Treated as no maximum limit. + hidden_from_customer: + type: optional> + docs: >- + If `true`, modifiers from this list are hidden from customer receipts. + The default value is `false`. + + This setting can be overridden with + `CatalogItemModifierListInfo.hidden_from_customer_override`. + source: + openapi: openapi/openapi.json + CatalogModifierListModifierType: + enum: + - LIST + - TEXT + docs: Defines the type of `CatalogModifierList`. + source: + openapi: openapi/openapi.json + CatalogModifierListSelectionType: + enum: + - SINGLE + - MULTIPLE + docs: Indicates whether a CatalogModifierList supports multiple selections. + source: + openapi: openapi/openapi.json + CatalogModifierOverride: + docs: >- + Options to control how to override the default behavior of the specified + modifier. + properties: + modifier_id: + type: string + docs: >- + The ID of the `CatalogModifier` whose default behavior is being + overridden. + validation: + minLength: 1 + on_by_default: + type: optional> + docs: '__Deprecated__: Use `on_by_default_override` instead.' + hidden_online_override: optional + on_by_default_override: optional + source: + openapi: openapi/openapi.json + CatalogObject: + discriminant: type + base-properties: {} + docs: >- + The wrapper object for the catalog entries of a given object type. + + + Depending on the `type` attribute value, a `CatalogObject` instance + assumes a type-specific data to yield the corresponding type of catalog + object. + + + For example, if `type=ITEM`, the `CatalogObject` instance must have the + ITEM-specific data set on the `item_data` attribute. The resulting + `CatalogObject` instance is also a `CatalogItem` instance. + + + In general, if `type=`, the `CatalogObject` instance must + have the ``-specific data set on the `_data` + attribute. The resulting `CatalogObject` instance is also a + `Catalog` instance. + + + For a more detailed discussion of the Catalog data model, please see the + + [Design a + Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) + guide. + union: + ITEM: CatalogObjectItem + IMAGE: CatalogObjectImage + CATEGORY: CatalogObjectCategory + ITEM_VARIATION: CatalogObjectItemVariation + TAX: CatalogObjectTax + DISCOUNT: CatalogObjectDiscount + MODIFIER_LIST: CatalogObjectModifierList + MODIFIER: CatalogObjectModifier + PRICING_RULE: CatalogObjectPricingRule + PRODUCT_SET: CatalogObjectProductSet + TIME_PERIOD: CatalogObjectTimePeriod + MEASUREMENT_UNIT: CatalogObjectMeasurementUnit + SUBSCRIPTION_PLAN_VARIATION: CatalogObjectSubscriptionPlanVariation + ITEM_OPTION: CatalogObjectItemOption + ITEM_OPTION_VAL: CatalogObjectItemOptionValue + CUSTOM_ATTRIBUTE_DEFINITION: CatalogObjectCustomAttributeDefinition + QUICK_AMOUNTS_SETTINGS: CatalogObjectQuickAmountsSettings + SUBSCRIPTION_PLAN: CatalogObjectSubscriptionPlan + AVAILABILITY_PERIOD: CatalogObjectAvailabilityPeriod + source: + openapi: openapi/openapi.json + CatalogObjectBatch: + docs: A batch of catalog objects. + properties: + objects: + docs: A list of CatalogObjects belonging to this batch. + type: list + source: + openapi: openapi/openapi.json + CatalogObjectCategory: + docs: >- + A category that can be assigned to an item or a parent category that can + be assigned + + to another category. For example, a clothing category can be assigned to a + t-shirt item or + + be made as the parent category to the pants category. + properties: + id: + type: optional + docs: The ID of the object's category. + ordinal: + type: optional> + docs: The order of the object within the context of the category. + category_data: + type: optional + docs: >- + Structured data for a `CatalogCategory`, set for CatalogObjects of + type `CATEGORY`. + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` + + would indicate the UTC time (denoted by `Z`) of August 15, 2016 at + 23:59:33 and 123 milliseconds. + version: + type: optional + docs: >- + 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. + is_deleted: + type: optional + docs: >- + If `true`, the object has been deleted from the database. Must be + `false` for new objects + + being inserted. When deleted, the `updated_at` field will equal the + deletion time. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + The Connect v1 IDs for this object at each location where it is + present, where they + + differ from the object's Connect V2 ID. The field will only be present + for objects that + + have been created or modified by legacy APIs. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectBase: + properties: + id: + type: string + docs: >- + An identifier to reference this object in the catalog. When a new + `CatalogObject` + + is inserted, the client should set the id to a temporary identifier + starting with + + a "`#`" character. Other objects being inserted or updated within the + same request + + may use this identifier to refer to the new object. + + + When the server receives the new object, it will supply a unique + identifier that + + replaces the temporary identifier for all future references. + validation: + minLength: 1 + updated_at: + type: optional + docs: >- + Last modification + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"` + + would indicate the UTC time (denoted by `Z`) of August 15, 2016 at + 23:59:33 and 123 milliseconds. + access: read-only + version: + type: optional + docs: >- + 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. + is_deleted: + type: optional + docs: >- + If `true`, the object has been deleted from the database. Must be + `false` for new objects + + being inserted. When deleted, the `updated_at` field will equal the + deletion time. + custom_attribute_values: + type: optional> + docs: >- + A map (key-value pairs) of application-defined custom attribute + values. The value of a key-value pair + + is a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) + object. The key is the `key` attribute + + value defined in the associated + [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) + + object defined by the application making the request. + + + If the `CatalogCustomAttributeDefinition` object is + + defined by another application, the + `CatalogCustomAttributeDefinition`'s key attribute value is prefixed + by + + the defining application ID. For example, if the + `CatalogCustomAttributeDefinition` has a `key` attribute of + + `"cocoa_brand"` and the defining application ID is `"abcd1234"`, the + key in the map is `"abcd1234:cocoa_brand"` + + if the application making the request is different from the + application defining the custom attribute definition. + + Otherwise, the key used in the map is simply `"cocoa_brand"`. + + + Application-defined custom attributes are set at a global + (location-independent) level. + + Custom attribute values are intended to store additional information + about a catalog object + + or associations with an entity in another system. Do not use custom + attributes + + to store any sensitive information (personally identifiable + information, card details, etc.). + catalog_v1_ids: + type: optional> + docs: >- + The Connect v1 IDs for this object at each location where it is + present, where they + + differ from the object's Connect V2 ID. The field will only be present + for objects that + + have been created or modified by legacy APIs. + present_at_all_locations: + type: optional + docs: >- + If `true`, this object is present at all locations (including future + locations), except where specified in + + the `absent_at_location_ids` field. If `false`, this object is not + present at any locations (including future locations), + + except where specified in the `present_at_location_ids` field. If not + specified, defaults to `true`. + present_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is present, even if + `present_at_all_locations` is `false`. + + This can include locations that are deactivated. + absent_at_location_ids: + type: optional> + docs: >- + A list of locations where the object is not present, even if + `present_at_all_locations` is `true`. + + This can include locations that are deactivated. + image_id: + type: optional + docs: Identifies the `CatalogImage` attached to this `CatalogObject`. + source: + openapi: openapi/openapi.json + CatalogObjectReference: + docs: >- + A reference to a Catalog object at a specific version. In general this is + + used as an entry point into a graph of catalog objects, where the objects + exist + + at a specific version. + properties: + object_id: + type: optional> + docs: The ID of the referenced object. + catalog_version: + type: optional> + docs: The version of the object. + source: + openapi: openapi/openapi.json + CatalogObjectType: + enum: + - ITEM + - IMAGE + - CATEGORY + - ITEM_VARIATION + - TAX + - DISCOUNT + - MODIFIER_LIST + - MODIFIER + - PRICING_RULE + - PRODUCT_SET + - TIME_PERIOD + - MEASUREMENT_UNIT + - SUBSCRIPTION_PLAN_VARIATION + - ITEM_OPTION + - ITEM_OPTION_VAL + - CUSTOM_ATTRIBUTE_DEFINITION + - QUICK_AMOUNTS_SETTINGS + - SUBSCRIPTION_PLAN + - AVAILABILITY_PERIOD + docs: >- + Possible types of CatalogObjects returned from the catalog, each + + containing type-specific properties in the `*_data` field corresponding to + the specified object type. + source: + openapi: openapi/openapi.json + CatalogPricingRule: + docs: >- + Defines how discounts are automatically applied to a set of items that + match the pricing rule + + during the active time period. + properties: + name: + type: optional> + docs: |- + User-defined name for the pricing rule. For example, "Buy one get one + free" or "10% off". + time_period_ids: + type: optional>> + docs: >- + A list of unique IDs for the catalog time periods when + + this pricing rule is in effect. If left unset, the pricing rule is + always + + in effect. + discount_id: + type: optional> + docs: |- + Unique ID for the `CatalogDiscount` to take off + the price of all matched items. + match_products_id: + type: optional> + docs: >- + Unique ID for the `CatalogProductSet` that will be matched by this + rule. A match rule + + matches within the entire cart, and can match multiple times. This + field will always be set. + apply_products_id: + type: optional> + docs: >- + __Deprecated__: Please use the `exclude_products_id` field to apply + + an exclude set instead. Exclude sets allow better control over + quantity + + ranges and offer more flexibility for which matched items receive a + discount. + + + `CatalogProductSet` to apply the pricing to. + + An apply rule matches within the subset of the cart that fits the + match rules (the match set). + + An apply rule can only match once in the match set. + + If not supplied, the pricing will be applied to all products in the + match set. + + Other products retain their base price, or a price generated by other + rules. + exclude_products_id: + type: optional> + docs: >- + `CatalogProductSet` to exclude from the pricing rule. + + An exclude rule matches within the subset of the cart that fits the + match rules (the match set). + + An exclude rule can only match once in the match set. + + If not supplied, the pricing will be applied to all products in the + match set. + + Other products retain their base price, or a price generated by other + rules. + valid_from_date: + type: optional> + docs: >- + Represents the date the Pricing Rule is valid from. Represented in RFC + 3339 full-date format (YYYY-MM-DD). + valid_from_local_time: + type: optional> + docs: >- + Represents the local time the pricing rule should be valid from. + Represented in RFC 3339 partial-time format + + (HH:MM:SS). Partial seconds will be truncated. + valid_until_date: + type: optional> + docs: >- + Represents the date the Pricing Rule is valid until. Represented in + RFC 3339 full-date format (YYYY-MM-DD). + valid_until_local_time: + type: optional> + docs: >- + Represents the local time the pricing rule should be valid until. + Represented in RFC 3339 partial-time format + + (HH:MM:SS). Partial seconds will be truncated. + exclude_strategy: + type: optional + docs: >- + If an `exclude_products_id` was given, controls which subset of + matched + + products is excluded from any discounts. + + + Default value: `LEAST_EXPENSIVE` + + See [ExcludeStrategy](#type-excludestrategy) for possible values + minimum_order_subtotal_money: + type: optional + docs: |- + The minimum order subtotal (before discounts or taxes are applied) + that must be met before this rule may be applied. + customer_group_ids_any: + type: optional>> + docs: >- + A list of IDs of customer groups, the members of which are eligible + for discounts specified in this pricing rule. + + Notice that a group ID is generated by the Customers API. + + If this field is not set, the specified discount applies to matched + products sold to anyone whether the buyer + + has a customer profile created or not. If this + `customer_group_ids_any` field is set, the specified discount + + applies only to matched products sold to customers belonging to the + specified customer groups. + source: + openapi: openapi/openapi.json + CatalogPricingType: + enum: + - FIXED_PRICING + - VARIABLE_PRICING + docs: >- + Indicates whether the price of a CatalogItemVariation should be entered + manually at the time of sale. + source: + openapi: openapi/openapi.json + CatalogProductSet: + docs: >- + Represents a collection of catalog objects for the purpose of applying a + + `PricingRule`. Including a catalog object will include all of its + subtypes. + + For example, including a category in a product set will include all of its + + items and associated item variations in the product set. Including an item + in + + a product set will also include its item variations. + properties: + name: + type: optional> + docs: |- + User-defined name for the product set. For example, "Clearance Items" + or "Winter Sale Items". + product_ids_any: + type: optional>> + docs: >2- + Unique IDs for any `CatalogObject` included in this product set. Any + number of these catalog objects can be in an order for a pricing rule + to apply. + + + This can be used with `product_ids_all` in a parent + `CatalogProductSet` to + + match groups of products for a bulk discount, such as a discount for + an + + entree and side combo. + + + Only one of `product_ids_all`, `product_ids_any`, or `all_products` + can be set. + + + Max: 500 catalog object IDs. + product_ids_all: + type: optional>> + docs: >- + Unique IDs for any `CatalogObject` included in this product set. + + All objects in this set must be included in an order for a pricing + rule to apply. + + + Only one of `product_ids_all`, `product_ids_any`, or `all_products` + can be set. + + + Max: 500 catalog object IDs. + quantity_exact: + type: optional> + docs: >- + If set, there must be exactly this many items from `products_any` or + `products_all` + + in the cart for the discount to apply. + + + Cannot be combined with either `quantity_min` or `quantity_max`. + quantity_min: + type: optional> + docs: >- + If set, there must be at least this many items from `products_any` or + `products_all` + + in a cart for the discount to apply. See `quantity_exact`. Defaults to + 0 if + + `quantity_exact`, `quantity_min` and `quantity_max` are all + unspecified. + quantity_max: + type: optional> + docs: >- + If set, the pricing rule will apply to a maximum of this many items + from + + `products_any` or `products_all`. + all_products: + type: optional> + docs: >- + If set to `true`, the product set will include every item in the + catalog. + + Only one of `product_ids_all`, `product_ids_any`, or `all_products` + can be set. + source: + openapi: openapi/openapi.json + CatalogQuery: + docs: >- + A query composed of one or more different types of filters to narrow the + scope of targeted objects when calling the `SearchCatalogObjects` + endpoint. + + + Although a query can have multiple filters, only certain query types can + be combined per call to + [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). + + Any combination of the following types may be used together: + + - [exact_query](entity:CatalogQueryExact) + + - [prefix_query](entity:CatalogQueryPrefix) + + - [range_query](entity:CatalogQueryRange) + + - [sorted_attribute_query](entity:CatalogQuerySortedAttribute) + + - [text_query](entity:CatalogQueryText) + + + All other query types cannot be combined with any others. + + + When a query filter is based on an attribute, the attribute must be + searchable. + + Searchable attributes are listed as follows, along their parent types that + can be searched for with applicable query filters. + + + Searchable attribute and objects queryable by searchable attributes: + + - `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, + `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, `CatalogModifierList`, + `CatalogItemOption`, `CatalogItemOptionValue` + + - `description`: `CatalogItem`, `CatalogItemOptionValue` + + - `abbreviation`: `CatalogItem` + + - `upc`: `CatalogItemVariation` + + - `sku`: `CatalogItemVariation` + + - `caption`: `CatalogImage` + + - `display_name`: `CatalogItemOption` + + + For example, to search for [CatalogItem](entity:CatalogItem) objects by + searchable attributes, you can use + + the `"name"`, `"description"`, or `"abbreviation"` attribute in an + applicable query filter. + properties: + sorted_attribute_query: + type: optional + docs: >- + A query expression to sort returned query result by the given + attribute. + exact_query: + type: optional + docs: >- + An exact query expression to return objects with attribute name and + value + + matching the specified attribute name and value exactly. Value + matching is case insensitive. + set_query: + type: optional + docs: >- + A set query expression to return objects with attribute name and value + + matching the specified attribute name and any of the specified + attribute values exactly. + + Value matching is case insensitive. + prefix_query: + type: optional + docs: >- + A prefix query expression to return objects with attribute values + + that have a prefix matching the specified string value. Value matching + is case insensitive. + range_query: + type: optional + docs: |- + A range query expression to return objects with numeric values + that lie in the specified range. + text_query: + type: optional + docs: >- + A text query expression to return objects whose searchable attributes + contain all of the given + + keywords, irrespective of their order. For example, if a `CatalogItem` + contains custom attribute values of + + `{"name": "t-shirt"}` and `{"description": "Small, Purple"}`, the + query filter of `{"keywords": ["shirt", "sma", "purp"]}` + + returns this item. + items_for_tax_query: + type: optional + docs: >- + A query expression to return items that have any of the specified + taxes (as identified by the corresponding `CatalogTax` object IDs) + enabled. + items_for_modifier_list_query: + type: optional + docs: >- + A query expression to return items that have any of the given modifier + list (as identified by the corresponding `CatalogModifierList`s IDs) + enabled. + items_for_item_options_query: + type: optional + docs: >- + A query expression to return items that contains the specified item + options (as identified the corresponding `CatalogItemOption` IDs). + item_variations_for_item_option_values_query: + type: optional + docs: >- + A query expression to return item variations (of the + [CatalogItemVariation](entity:CatalogItemVariation) type) that + + contain all of the specified `CatalogItemOption` IDs. + source: + openapi: openapi/openapi.json + CatalogQueryExact: + docs: >- + The query filter to return the search result by exact match of the + specified attribute name and value. + properties: + attribute_name: + type: string + docs: >- + The name of the attribute to be searched. Matching of the attribute + name is exact. + validation: + minLength: 1 + attribute_value: + type: string + docs: >- + The desired value of the search attribute. Matching of the attribute + value is case insensitive and can be partial. + + For example, if a specified value of "sma", objects with the named + attribute value of "Small", "small" are both matched. + source: + openapi: openapi/openapi.json + CatalogQueryItemVariationsForItemOptionValues: + docs: >- + The query filter to return the item variations containing the specified + item option value IDs. + properties: + item_option_value_ids: + type: optional>> + docs: >- + A set of `CatalogItemOptionValue` IDs to be used to find associated + + `CatalogItemVariation`s. All ItemVariations that contain all of the + given + + Item Option Values (in any order) will be returned. + source: + openapi: openapi/openapi.json + CatalogQueryItemsForItemOptions: + docs: >- + The query filter to return the items containing the specified item option + IDs. + properties: + item_option_ids: + type: optional>> + docs: >- + A set of `CatalogItemOption` IDs to be used to find associated + + `CatalogItem`s. All Items that contain all of the given Item Options + (in any order) + + will be returned. + source: + openapi: openapi/openapi.json + CatalogQueryItemsForModifierList: + docs: >- + The query filter to return the items containing the specified modifier + list IDs. + properties: + modifier_list_ids: + docs: >- + A set of `CatalogModifierList` IDs to be used to find associated + `CatalogItem`s. + type: list + source: + openapi: openapi/openapi.json + CatalogQueryItemsForTax: + docs: The query filter to return the items containing the specified tax IDs. + properties: + tax_ids: + docs: >- + A set of `CatalogTax` IDs to be used to find associated + `CatalogItem`s. + type: list + source: + openapi: openapi/openapi.json + CatalogQueryPrefix: + docs: >- + The query filter to return the search result whose named attribute values + are prefixed by the specified attribute value. + properties: + attribute_name: + type: string + docs: The name of the attribute to be searched. + validation: + minLength: 1 + attribute_prefix: + type: string + docs: The desired prefix of the search attribute value. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + CatalogQueryRange: + docs: >- + The query filter to return the search result whose named attribute values + fall between the specified range. + properties: + attribute_name: + type: string + docs: The name of the attribute to be searched. + validation: + minLength: 1 + attribute_min_value: + type: optional> + docs: The desired minimum value for the search attribute (inclusive). + attribute_max_value: + type: optional> + docs: The desired maximum value for the search attribute (inclusive). + source: + openapi: openapi/openapi.json + CatalogQuerySet: + docs: >- + The query filter to return the search result(s) by exact match of the + specified `attribute_name` and any of + + the `attribute_values`. + properties: + attribute_name: + type: string + docs: >- + The name of the attribute to be searched. Matching of the attribute + name is exact. + validation: + minLength: 1 + attribute_values: + docs: >- + The desired values of the search attribute. Matching of the attribute + values is exact and case insensitive. + + A maximum of 250 values may be searched in a request. + type: list + source: + openapi: openapi/openapi.json + CatalogQuerySortedAttribute: + docs: The query expression to specify the key to sort search results. + properties: + attribute_name: + type: string + docs: The attribute whose value is used as the sort key. + validation: + minLength: 1 + initial_attribute_value: + type: optional> + docs: >- + The first attribute value to be returned by the query. Ascending sorts + will return only + + objects with this value or greater, while descending sorts will return + only objects with this value + + or less. If unset, start at the beginning (for ascending sorts) or end + (for descending sorts). + sort_order: + type: optional + docs: |- + The desired sort order, `"ASC"` (ascending) or `"DESC"` (descending). + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + CatalogQueryText: + docs: >- + The query filter to return the search result whose searchable attribute + values contain all of the specified keywords or tokens, independent of the + token order or case. + properties: + keywords: + docs: >- + A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 + alphanumeric characters are ignored. + type: list + source: + openapi: openapi/openapi.json + CatalogQuickAmount: + docs: Represents a Quick Amount in the Catalog. + properties: + type: + type: CatalogQuickAmountType + docs: >- + Represents the type of the Quick Amount. + + See [CatalogQuickAmountType](#type-catalogquickamounttype) for + possible values + amount: + type: Money + docs: Represents the actual amount of the Quick Amount with Money type. + score: + type: optional> + docs: >- + Describes the ranking of the Quick Amount provided by machine learning + model, in the range [0, 100]. + + MANUAL type amount will always have score = 100. + ordinal: + type: optional> + docs: The order in which this Quick Amount should be displayed. + source: + openapi: openapi/openapi.json + CatalogQuickAmountType: + enum: + - QUICK_AMOUNT_TYPE_MANUAL + - QUICK_AMOUNT_TYPE_AUTO + docs: Determines the type of a specific Quick Amount. + source: + openapi: openapi/openapi.json + CatalogQuickAmountsSettings: + docs: >- + A parent Catalog Object model represents a set of Quick Amounts and the + settings control the amounts. + properties: + option: + type: CatalogQuickAmountsSettingsOption + docs: >- + Represents the option seller currently uses on Quick Amounts. + + See + [CatalogQuickAmountsSettingsOption](#type-catalogquickamountssettingsoption) + for possible values + eligible_for_auto_amounts: + type: optional> + docs: >- + Represents location's eligibility for auto amounts + + The boolean should be consistent with whether there are AUTO amounts + in the `amounts`. + amounts: + type: optional>> + docs: Represents a set of Quick Amounts at this location. + source: + openapi: openapi/openapi.json + CatalogQuickAmountsSettingsOption: + enum: + - DISABLED + - MANUAL + - AUTO + docs: Determines a seller's option on Quick Amounts feature. + source: + openapi: openapi/openapi.json + CatalogStockConversion: + docs: >- + Represents the rule of conversion between a stockable + [CatalogItemVariation](entity:CatalogItemVariation) + + and a non-stockable sell-by or receive-by `CatalogItemVariation` that + + share the same underlying stock. + properties: + stockable_item_variation_id: + type: string + docs: >- + References to the stockable + [CatalogItemVariation](entity:CatalogItemVariation) + + for this stock conversion. Selling, receiving or recounting the + non-stockable `CatalogItemVariation` + + defined with a stock conversion results in adjustments of this + stockable `CatalogItemVariation`. + + This immutable field must reference a stockable `CatalogItemVariation` + + that shares the parent [CatalogItem](entity:CatalogItem) of the + converted `CatalogItemVariation.` + validation: + minLength: 1 + stockable_quantity: + type: string + docs: >- + The quantity of the stockable item variation (as identified by + `stockable_item_variation_id`) + + equivalent to the non-stockable item variation quantity (as specified + in `nonstockable_quantity`) + + as defined by this stock conversion. It accepts a decimal number in a + string format that can take + + up to 10 digits before the decimal point and up to 5 digits after the + decimal point. + validation: + minLength: 1 + maxLength: 16 + nonstockable_quantity: + type: string + docs: >- + The converted equivalent quantity of the non-stockable + [CatalogItemVariation](entity:CatalogItemVariation) + + in its measurement unit. The `stockable_quantity` value and this + `nonstockable_quantity` value together + + define the conversion ratio between stockable item variation and the + non-stockable item variation. + + It accepts a decimal number in a string format that can take up to 10 + digits before the decimal point + + and up to 5 digits after the decimal point. + validation: + minLength: 1 + maxLength: 16 + source: + openapi: openapi/openapi.json + CatalogSubscriptionPlan: + docs: >- + Describes a subscription plan. A subscription plan represents what you + want to sell in a subscription model, and includes references to each of + the associated subscription plan variations. + + For more information, see [Subscription Plans and + Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). + properties: + name: + type: string + docs: The name of the plan. + phases: + type: optional>> + docs: >- + A list of SubscriptionPhase containing the + [SubscriptionPhase](entity:SubscriptionPhase) for this plan. + + This field it required. Not including this field will throw a + REQUIRED_FIELD_MISSING error + subscription_plan_variations: + type: optional>> + docs: The list of subscription plan variations available for this product + eligible_item_ids: + type: optional>> + docs: >- + The list of IDs of `CatalogItems` that are eligible for subscription + by this SubscriptionPlan's variations. + eligible_category_ids: + type: optional>> + docs: >- + The list of IDs of `CatalogCategory` that are eligible for + subscription by this SubscriptionPlan's variations. + all_items: + type: optional> + docs: >- + If true, all items in the merchant's catalog are subscribable by this + SubscriptionPlan. + source: + openapi: openapi/openapi.json + CatalogSubscriptionPlanVariation: + docs: >- + Describes a subscription plan variation. A subscription plan variation + represents how the subscription for a product or service is sold. + + For more information, see [Subscription Plans and + Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). + properties: + name: + type: string + docs: The name of the plan variation. + phases: + docs: >- + A list containing each [SubscriptionPhase](entity:SubscriptionPhase) + for this plan variation. + type: list + subscription_plan_id: + type: optional> + docs: The id of the subscription plan, if there is one. + monthly_billing_anchor_date: + type: optional> + docs: The day of the month the billing period starts. + can_prorate: + type: optional> + docs: Whether bills for this plan variation can be split for proration. + successor_plan_variation_id: + type: optional> + docs: >- + The ID of a "successor" plan variation to this one. If the field is + set, and this object is disabled at all + + locations, it indicates that this variation is deprecated and the + object identified by the successor ID be used in + + its stead. + source: + openapi: openapi/openapi.json + CatalogTax: + docs: A tax applicable to an item. + properties: + name: + type: optional> + docs: >- + The tax's name. This is a searchable attribute for use in applicable + query filters, and its value length is of Unicode code points. + validation: + maxLength: 255 + calculation_phase: + type: optional + docs: >- + Whether the tax is calculated based on a payment's subtotal or total. + + See [TaxCalculationPhase](#type-taxcalculationphase) for possible + values + inclusion_type: + type: optional + docs: |- + Whether the tax is `ADDITIVE` or `INCLUSIVE`. + See [TaxInclusionType](#type-taxinclusiontype) for possible values + percentage: + type: optional> + docs: >- + The percentage of the tax in decimal form, using a `'.'` as the + decimal separator and without a `'%'` sign. + + A value of `7.5` corresponds to 7.5%. For a location-specific tax + rate, contact the tax authority of the location or a tax consultant. + applies_to_custom_amounts: + type: optional> + docs: >- + If `true`, the fee applies to custom amounts entered into the Square + Point of Sale + + app that are not associated with a particular `CatalogItem`. + enabled: + type: optional> + docs: >- + A Boolean flag to indicate whether the tax is displayed as enabled + (`true`) in the Square Point of Sale app or not (`false`). + applies_to_product_set_id: + type: optional> + docs: >- + The ID of a `CatalogProductSet` object. If set, the tax is applicable + to all products in the product set. + source: + openapi: openapi/openapi.json + CatalogTimePeriod: + docs: Represents a time period - either a single period or a repeating period. + properties: + event: + type: optional> + docs: >- + An iCalendar (RFC 5545) + [event](https://tools.ietf.org/html/rfc5545#section-3.6.1), which + + specifies the name, timing, duration and recurrence of this time + period. + + + Example: + + + ``` + + DTSTART:20190707T180000 + + DURATION:P2H + + RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR + + ``` + + + Only `SUMMARY`, `DTSTART`, `DURATION` and `RRULE` fields are + supported. + + `DTSTART` must be in local (unzoned) time format. Note that while + `BEGIN:VEVENT` + + and `END:VEVENT` is not required in the request. The response will + always + + include them. + source: + openapi: openapi/openapi.json + CatalogV1Id: + docs: >- + A Square API V1 identifier of an item, including the object ID and its + associated location ID. + properties: + catalog_v1_id: + type: optional> + docs: >- + The ID for an object used in the Square API V1, if the object ID + differs from the Square API V2 object ID. + location_id: + type: optional> + docs: The ID of the `Location` this Connect V1 ID is associated with. + source: + openapi: openapi/openapi.json + CatalogVersionUpdatedEvent: + docs: Published when the catalog is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + CatalogVersionUpdatedEventCatalogVersion: + properties: + updated_at: + type: optional + docs: Last modification timestamp in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + CatalogVersionUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type. + object: + type: optional + docs: >- + An object containing fields and values relevant to the event. Is + absent if affected object was deleted. + source: + openapi: openapi/openapi.json + CatalogVersionUpdatedEventObject: + properties: + catalog_version: + type: optional + docs: The version of the object. + source: + openapi: openapi/openapi.json + CategoryPathToRootNode: + docs: A node in the path from a retrieved category to its root node. + properties: + category_id: + type: optional> + docs: The category's ID. + category_name: + type: optional> + docs: The category's name. + source: + openapi: openapi/openapi.json + ChangeBillingAnchorDateResponse: + docs: >- + Defines output parameters in a request to the + + [ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The specified subscription for updating billing anchor date. + actions: + type: optional> + docs: A list of a single billing anchor date change for the subscription. + source: + openapi: openapi/openapi.json + ChangeTiming: + enum: + - IMMEDIATE + - END_OF_BILLING_CYCLE + docs: >- + Supported timings when a pending change, as an action, takes place to a + subscription. + source: + openapi: openapi/openapi.json + Channel: + properties: + id: + type: optional + docs: The channel's unique ID. + access: read-only + merchant_id: + type: optional + docs: The unique ID of the merchant this channel belongs to. + access: read-only + name: + type: optional> + docs: The name of the channel. + version: + type: optional + docs: >- + The version number which is incremented each time an update is made to + the channel. + access: read-only + reference: + type: optional + docs: Represents an entity the channel is associated with. + status: + type: optional + docs: |- + Status of the channel. + See [Status](#type-status) for possible values + created_at: + type: optional + docs: >- + The timestamp for when the channel was created, in RFC 3339 format + (for example, "2016-09-04T23:59:33.123Z"). + + For more information, see [Working with + Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). + access: read-only + updated_at: + type: optional + docs: >- + The timestamp for when the channel was last updated, in RFC 3339 + format (for example, "2016-09-04T23:59:33.123Z"). + + For more information, see [Working with + Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). + access: read-only + source: + openapi: openapi/openapi.json + ChannelStatus: + enum: + - ACTIVE + - INACTIVE + source: + openapi: openapi/openapi.json + ChargeRequestAdditionalRecipient: + docs: >- + Represents an additional recipient (other than the merchant) entitled to a + portion of the tender. + + Support is currently limited to USD, CAD and GBP currencies + properties: + location_id: + type: string + docs: >- + The location ID for a recipient (other than the merchant) receiving a + portion of the tender. + validation: + minLength: 1 + maxLength: 50 + description: + type: string + docs: The description of the additional recipient. + validation: + minLength: 1 + maxLength: 100 + amount_money: + type: Money + docs: The amount of money distributed to the recipient. + source: + openapi: openapi/openapi.json + Checkout: + docs: |- + Square Checkout lets merchants accept online payments for supported + payment types using a checkout workflow hosted on squareup.com. + properties: + id: + type: optional + docs: ID generated by Square Checkout when a new checkout is requested. + checkout_page_url: + type: optional> + docs: |- + The URL that the buyer's browser should be redirected to after the + checkout is completed. + ask_for_shipping_address: + type: optional> + docs: >- + If `true`, Square Checkout will collect shipping information on your + + behalf and store that information with the transaction information in + your + + Square Dashboard. + + + Default: `false`. + merchant_support_email: + type: optional> + docs: >- + The email address to display on the Square Checkout confirmation page + + and confirmation email that the buyer can use to contact the merchant. + + + If this value is not set, the confirmation page and email will display + the + + primary email address associated with the merchant's Square account. + + + Default: none; only exists if explicitly set. + pre_populate_buyer_email: + type: optional> + docs: |- + If provided, the buyer's email is pre-populated on the checkout page + as an editable text field. + + Default: none; only exists if explicitly set. + pre_populate_shipping_address: + type: optional
+ docs: |- + If provided, the buyer's shipping info is pre-populated on the + checkout page as editable text fields. + + Default: none; only exists if explicitly set. + redirect_url: + type: optional> + docs: >- + The URL to redirect to after checkout is completed with `checkoutId`, + + Square's `orderId`, `transactionId`, and `referenceId` appended as URL + + parameters. For example, if the provided redirect_url is + + `http://www.example.com/order-complete`, a successful transaction + redirects + + the customer to: + + +
http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx
+ + + If you do not provide a redirect URL, Square Checkout will display an + order + + confirmation page on your behalf; however Square strongly recommends + that + + you provide a redirect URL so you can verify the transaction results + and + + finalize the order through your existing/normal confirmation workflow. + order: + type: optional + docs: Order to be checked out. + created_at: + type: optional + docs: The time when the checkout was created, in RFC 3339 format. + access: read-only + additional_recipients: + type: optional>> + docs: >- + Additional recipients (other than the merchant) receiving a portion of + this checkout. + + For example, fees assessed on the purchase by a third party + integration. + source: + openapi: openapi/openapi.json + CheckoutLocationSettings: + properties: + location_id: + type: optional> + docs: The ID of the location that these settings apply to. + customer_notes_enabled: + type: optional> + docs: Indicates whether customers are allowed to leave notes at checkout. + policies: + type: optional>> + docs: |- + Policy information is displayed at the bottom of the checkout pages. + You can set a maximum of two policies. + branding: + type: optional + docs: The branding settings for this location. + tipping: + type: optional + docs: The tip settings for this location. + coupons: + type: optional + docs: The coupon settings for this location. + updated_at: + type: optional + docs: |- + The timestamp when the settings were last updated, in RFC 3339 format. + Examples for January 25th, 2020 6:25:34pm Pacific Standard Time: + UTC: 2020-01-26T02:25:34Z + Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 + access: read-only + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsBranding: + properties: + header_type: + type: optional + docs: |- + Show the location logo on the checkout page. + See [HeaderType](#type-headertype) for possible values + button_color: + type: optional> + docs: >- + The HTML-supported hex color for the button on the checkout page (for + example, "#FFFFFF"). + validation: + minLength: 7 + maxLength: 7 + button_shape: + type: optional + docs: |- + The shape of the button on the checkout page. + See [ButtonShape](#type-buttonshape) for possible values + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsBrandingButtonShape: + enum: + - SQUARED + - ROUNDED + - PILL + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsBrandingHeaderType: + enum: + - BUSINESS_NAME + - FRAMED_LOGO + - FULL_WIDTH_LOGO + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsCoupons: + properties: + enabled: + type: optional> + docs: Indicates whether coupons are enabled for this location. + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsPolicy: + properties: + uid: + type: optional> + docs: >- + A unique ID to identify the policy when making changes. You must set + the UID for policy updates, but it’s optional when setting new + policies. + title: + type: optional> + docs: >- + The title of the policy. This is required when setting the + description, though you can update it in a different request. + validation: + maxLength: 50 + description: + type: optional> + docs: The description of the policy. + validation: + maxLength: 4096 + source: + openapi: openapi/openapi.json + CheckoutLocationSettingsTipping: + properties: + percentages: + type: optional>> + docs: >- + Set three custom percentage amounts that buyers can select at + checkout. If Smart Tip is enabled, this only applies to transactions + totaling $10 or more. + smart_tipping_enabled: + type: optional> + docs: >- + Enables Smart Tip Amounts. If Smart Tip Amounts is enabled, tipping + works as follows: + + If a transaction is less than $10, the available tipping options + include No Tip, $1, $2, or $3. + + If a transaction is $10 or more, the available tipping options include + No Tip, 15%, 20%, or 25%. + + You can set custom percentage amounts with the `percentages` field. + default_percent: + type: optional> + docs: >- + Set the pre-selected percentage amounts that appear at checkout. If + Smart Tip is enabled, this only applies to transactions totaling $10 + or more. + smart_tips: + type: optional>> + docs: Show the Smart Tip Amounts for this location. + default_smart_tip: + type: optional + docs: >- + Set the pre-selected whole amount that appears at checkout when Smart + Tip is enabled and the transaction amount is less than $10. + source: + openapi: openapi/openapi.json + CheckoutMerchantSettings: + properties: + payment_methods: + type: optional + docs: The set of payment methods accepted for the merchant's account. + updated_at: + type: optional + docs: |- + The timestamp when the settings were last updated, in RFC 3339 format. + Examples for January 25th, 2020 6:25:34pm Pacific Standard Time: + UTC: 2020-01-26T02:25:34Z + Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 + access: read-only + source: + openapi: openapi/openapi.json + CheckoutMerchantSettingsPaymentMethods: + properties: + apple_pay: optional + google_pay: optional + cash_app: optional + afterpay_clearpay: optional + source: + openapi: openapi/openapi.json + CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay: + docs: The settings allowed for AfterpayClearpay. + properties: + order_eligibility_range: + type: >- + optional + docs: >- + Afterpay is shown as an option for order totals falling within the + configured range. + item_eligibility_range: + type: >- + optional + docs: >- + Afterpay is shown as an option for item totals falling within the + configured range. + enabled: + type: optional + docs: Indicates whether the payment method is enabled for the account. + access: read-only + source: + openapi: openapi/openapi.json + CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange: + docs: A range of purchase price that qualifies. + properties: + min: Money + max: Money + source: + openapi: openapi/openapi.json + CheckoutMerchantSettingsPaymentMethodsPaymentMethod: + docs: The settings allowed for a payment method. + properties: + enabled: + type: optional> + docs: Indicates whether the payment method is enabled for the account. + source: + openapi: openapi/openapi.json + CheckoutOptions: + properties: + allow_tipping: + type: optional> + docs: Indicates whether the payment allows tipping. + custom_fields: + type: optional>> + docs: The custom fields requesting information from the buyer. + subscription_plan_id: + type: optional> + docs: >- + The ID of the subscription plan for the buyer to pay and subscribe. + + For more information, see [Subscription Plan + Checkout](https://developer.squareup.com/docs/checkout-api/subscription-plan-checkout). + validation: + maxLength: 255 + redirect_url: + type: optional> + docs: >- + The confirmation page URL to redirect the buyer to after Square + processes the payment. + validation: + maxLength: 2048 + merchant_support_email: + type: optional> + docs: The email address that buyers can use to contact the seller. + validation: + maxLength: 256 + ask_for_shipping_address: + type: optional> + docs: Indicates whether to include the address fields in the payment form. + accepted_payment_methods: + type: optional + docs: The methods allowed for buyers during checkout. + app_fee_money: + type: optional + docs: >- + The amount of money that the developer is taking as a fee for + facilitating the payment on behalf of the seller. + + + The amount cannot be more than 90% of the total amount of the payment. + + + The amount must be specified in the smallest denomination of the + applicable currency (for example, US dollar amounts are specified in + cents). For more information, see [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-monetary-amounts). + + + The fee currency code must match the currency associated with the + seller that is accepting the payment. The application must be from a + developer account in the same country and using the same currency code + as the seller. For more information about the application fee + scenario, see [Take Payments and Collect + Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + + + To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth + permission is required. For more information, see + [Permissions](https://developer.squareup.com/docs/payments-api/collect-fees/additional-considerations#permissions). + shipping_fee: + type: optional + docs: >- + The fee associated with shipping to be applied to the `Order` as a + service charge. + enable_coupon: + type: optional> + docs: >- + Indicates whether to include the `Add coupon` section for the buyer to + provide a Square marketing coupon in the payment form. + enable_loyalty: + type: optional> + docs: >- + Indicates whether to include the `REWARDS` section for the buyer to + opt in to loyalty, redeem rewards in the payment form, or both. + source: + openapi: openapi/openapi.json + CheckoutOptionsPaymentType: + enum: + - CARD_PRESENT + - MANUAL_CARD_ENTRY + - FELICA_ID + - FELICA_QUICPAY + - FELICA_TRANSPORTATION_GROUP + - FELICA_ALL + - PAYPAY + - QR_CODE + source: + openapi: openapi/openapi.json + ClearpayDetails: + docs: Additional details about Clearpay payments. + properties: + email_address: + type: optional> + docs: Email address on the buyer's Clearpay account. + validation: + maxLength: 255 + source: + openapi: openapi/openapi.json + CloneOrderResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the [CloneOrder](api-endpoint:Orders-CloneOrder) endpoint. + properties: + order: + type: optional + docs: The cloned order. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CollectedData: + properties: + input_text: + type: optional + docs: The buyer's input text. + access: read-only + source: + openapi: openapi/openapi.json + CompletePaymentResponse: + docs: >- + Defines the response returned + by[CompletePayment](api-endpoint:Payments-CompletePayment). + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + payment: + type: optional + docs: The successfully completed payment. + source: + openapi: openapi/openapi.json + Component: + docs: The wrapper object for the component entries of a given component type. + properties: + type: + type: ComponentComponentType + docs: >- + The type of this component. Each component type has expected + properties expressed + + in a structured format within its corresponding `*_details` field. + + See [ComponentType](#type-componenttype) for possible values + application_details: + type: optional + docs: >- + Structured data for an `Application`, set for Components of type + `APPLICATION`. + card_reader_details: + type: optional + docs: >- + Structured data for a `CardReader`, set for Components of type + `CARD_READER`. + battery_details: + type: optional + docs: Structured data for a `Battery`, set for Components of type `BATTERY`. + wifi_details: + type: optional + docs: >- + Structured data for a `WiFi` interface, set for Components of type + `WIFI`. + ethernet_details: + type: optional + docs: >- + Structured data for an `Ethernet` interface, set for Components of + type `ETHERNET`. + source: + openapi: openapi/openapi.json + ComponentComponentType: + enum: + - APPLICATION + - CARD_READER + - BATTERY + - WIFI + - ETHERNET + - PRINTER + docs: An enum for ComponentType. + source: + openapi: openapi/openapi.json + ConfirmationDecision: + properties: + has_agreed: + type: optional + docs: The buyer's decision to the displayed terms. + access: read-only + source: + openapi: openapi/openapi.json + ConfirmationOptions: + properties: + title: + type: string + docs: >- + The title text to display in the confirmation screen flow on the + Terminal. + validation: + minLength: 1 + maxLength: 250 + body: + type: string + docs: >- + The agreement details to display in the confirmation flow on the + Terminal. + validation: + minLength: 1 + maxLength: 10000 + agree_button_text: + type: string + docs: >- + The button text to display indicating the customer agrees to the + displayed terms. + validation: + minLength: 1 + maxLength: 250 + disagree_button_text: + type: optional> + docs: >- + The button text to display indicating the customer does not agree to + the displayed terms. + validation: + minLength: 1 + maxLength: 250 + decision: + type: optional + docs: >- + The result of the buyer’s actions when presented with the confirmation + screen. + source: + openapi: openapi/openapi.json + Coordinates: + docs: Latitude and longitude coordinates. + properties: + latitude: + type: optional> + docs: The latitude of the coordinate expressed in degrees. + longitude: + type: optional> + docs: The longitude of the coordinate expressed in degrees. + source: + openapi: openapi/openapi.json + Country: + enum: + - ZZ + - AD + - AE + - AF + - AG + - AI + - AL + - AM + - AO + - AQ + - AR + - AS + - AT + - AU + - AW + - AX + - AZ + - BA + - BB + - BD + - BE + - BF + - BG + - BH + - BI + - BJ + - BL + - BM + - BN + - BO + - BQ + - BR + - BS + - BT + - BV + - BW + - BY + - BZ + - CA + - CC + - CD + - CF + - CG + - CH + - CI + - CK + - CL + - CM + - CN + - CO + - CR + - CU + - CV + - CW + - CX + - CY + - CZ + - DE + - DJ + - DK + - DM + - DO + - DZ + - EC + - EE + - EG + - EH + - ER + - ES + - ET + - FI + - FJ + - FK + - FM + - FO + - FR + - GA + - GB + - GD + - GE + - GF + - GG + - GH + - GI + - GL + - GM + - GN + - GP + - GQ + - GR + - GS + - GT + - GU + - GW + - GY + - HK + - HM + - HN + - HR + - HT + - HU + - ID + - IE + - IL + - IM + - IN + - IO + - IQ + - IR + - IS + - IT + - JE + - JM + - JO + - JP + - KE + - KG + - KH + - KI + - KM + - KN + - KP + - KR + - KW + - KY + - KZ + - LA + - LB + - LC + - LI + - LK + - LR + - LS + - LT + - LU + - LV + - LY + - MA + - MC + - MD + - ME + - MF + - MG + - MH + - MK + - ML + - MM + - MN + - MO + - MP + - MQ + - MR + - MS + - MT + - MU + - MV + - MW + - MX + - MY + - MZ + - NA + - NC + - NE + - NF + - NG + - NI + - NL + - 'NO' + - NP + - NR + - NU + - NZ + - OM + - PA + - PE + - PF + - PG + - PH + - PK + - PL + - PM + - PN + - PR + - PS + - PT + - PW + - PY + - QA + - RE + - RO + - RS + - RU + - RW + - SA + - SB + - SC + - SD + - SE + - SG + - SH + - SI + - SJ + - SK + - SL + - SM + - SN + - SO + - SR + - SS + - ST + - SV + - SX + - SY + - SZ + - TC + - TD + - TF + - TG + - TH + - TJ + - TK + - TL + - TM + - TN + - TO + - TR + - TT + - TV + - TW + - TZ + - UA + - UG + - UM + - US + - UY + - UZ + - VA + - VC + - VE + - VG + - VI + - VN + - VU + - WF + - WS + - YE + - YT + - ZA + - ZM + - ZW + docs: >- + Indicates the country associated with another entity, such as a business. + + Values are in [ISO 3166-1-alpha-2 + format](http://www.iso.org/iso/home/standards/country_codes.htm). + source: + openapi: openapi/openapi.json + CreateBookingCustomAttributeDefinitionResponse: + docs: >- + Represents a + [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The newly created custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateBookingResponse: + properties: + booking: + type: optional + docs: The booking that was created. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateBreakTypeResponse: + docs: >- + The response to the request to create a `BreakType`. The response contains + + the created `BreakType` object and might contain a set of `Error` objects + if + + the request resulted in errors. + properties: + break_type: + type: optional + docs: The `BreakType` that was created by the request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateCardResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [CreateCard](api-endpoint:Cards-CreateCard) endpoint. + + + Note: if there are errors processing the request, the card field will not + be + + present. + properties: + errors: + type: optional> + docs: Errors resulting from the request. + card: + type: optional + docs: The card created by the request. + source: + openapi: openapi/openapi.json + CreateCatalogImageRequest: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this CreateCatalogImage request. + + Keys can be any valid string but must be unique for every + CreateCatalogImage request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 128 + object_id: + type: optional + docs: >- + Unique ID of the `CatalogObject` to attach this `CatalogImage` object + to. Leave this + + field empty to create unattached images, for example if you are + building an integration + + where an image can be attached to catalog items at a later time. + image: + type: CatalogObject + docs: >- + The new `CatalogObject` of the `IMAGE` type, namely, a `CatalogImage` + object, to encapsulate the specified image file. + is_primary: + type: optional + docs: >- + If this is set to `true`, the image created will be the primary, or + first image of the object referenced by `object_id`. + + If the `CatalogObject` already has a primary `CatalogImage`, setting + this field to `true` will replace the primary image. + + If this is set to `false` and you use the Square API version + 2021-12-15 or later, the image id will be appended to the list of + `image_ids` on the object. + + + With Square API version 2021-12-15 or later, the default value is + `false`. Otherwise, the effective default value is `true`. + source: + openapi: openapi/openapi.json + CreateCatalogImageResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + image: + type: optional + docs: |- + The newly created `CatalogImage` including a Square-generated + URL for the encapsulated image file. + source: + openapi: openapi/openapi.json + CreateCheckoutResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `CreateCheckout` endpoint. + properties: + checkout: + type: optional + docs: >- + The newly created `checkout` object associated with the provided + idempotency key. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateCustomerCardResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `CreateCustomerCard` endpoint. + + Either `errors` or `card` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + card: + type: optional + docs: The created card on file. + source: + openapi: openapi/openapi.json + CreateCustomerCustomAttributeDefinitionResponse: + docs: >- + Represents a + [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The new custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateCustomerGroupResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [CreateCustomerGroup](api-endpoint:CustomerGroups-CreateCustomerGroup) + endpoint. + + + Either `errors` or `group` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + group: + type: optional + docs: The successfully created customer group. + source: + openapi: openapi/openapi.json + CreateCustomerResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [CreateCustomer](api-endpoint:Customers-CreateCustomer) + or + + [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) + endpoint. + + + Either `errors` or `customer` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + customer: + type: optional + docs: The created customer. + source: + openapi: openapi/openapi.json + CreateDeviceCodeResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + device_code: + type: optional + docs: The created DeviceCode object containing the device code string. + source: + openapi: openapi/openapi.json + CreateDisputeEvidenceFileRequest: + docs: Defines the parameters for a `CreateDisputeEvidenceFile` request. + properties: + idempotency_key: + type: string + docs: >- + A unique key identifying the request. For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + maxLength: 45 + evidence_type: + type: optional + docs: >- + The type of evidence you are uploading. + + See [DisputeEvidenceType](#type-disputeevidencetype) for possible + values + content_type: + type: optional + docs: >- + The MIME type of the uploaded file. + + The type can be image/heic, image/heif, image/jpeg, application/pdf, + image/png, or image/tiff. + validation: + minLength: 1 + maxLength: 40 + source: + openapi: openapi/openapi.json + CreateDisputeEvidenceFileResponse: + docs: Defines the fields in a `CreateDisputeEvidenceFile` response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + evidence: + type: optional + docs: The metadata of the newly uploaded dispute evidence. + source: + openapi: openapi/openapi.json + CreateDisputeEvidenceTextResponse: + docs: Defines the fields in a `CreateDisputeEvidenceText` response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + evidence: + type: optional + docs: The newly uploaded dispute evidence metadata. + source: + openapi: openapi/openapi.json + CreateGiftCardActivityResponse: + docs: >- + A response that contains a `GiftCardActivity` that was created. + + The response might contain a set of `Error` objects if the request + resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card_activity: + type: optional + docs: The gift card activity that was created. + source: + openapi: openapi/openapi.json + CreateGiftCardResponse: + docs: >- + A response that contains a `GiftCard`. The response might contain a set of + `Error` objects if the request + + resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: The new gift card. + source: + openapi: openapi/openapi.json + CreateInvoiceAttachmentRequestData: + docs: >- + Represents a + [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) + request. + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies the `CreateInvoiceAttachment` request. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 128 + description: + type: optional + docs: The description of the attachment to display on the invoice. + validation: + maxLength: 128 + source: + openapi: openapi/openapi.json + CreateInvoiceAttachmentResponse: + docs: >- + Represents a + [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) + response. + properties: + attachment: + type: optional + docs: Metadata about the attachment that was added to the invoice. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + CreateInvoiceResponse: + docs: The response returned by the `CreateInvoice` request. + properties: + invoice: + type: optional + docs: The newly created invoice. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + CreateJobResponse: + docs: >- + Represents a [CreateJob](api-endpoint:Team-CreateJob) response. Either + `job` or `errors` + + is present in the response. + properties: + job: + type: optional + docs: The new job. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateLocationCustomAttributeDefinitionResponse: + docs: >- + Represents a + [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The new custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateLocationResponse: + docs: >- + The response object returned by the + [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint. + properties: + errors: + type: optional> + docs: >- + Information about + [errors](https://developer.squareup.com/docs/build-basics/handling-errors) + encountered during the request. + location: + type: optional + docs: The newly created `Location` object. + source: + openapi: openapi/openapi.json + CreateLoyaltyAccountResponse: + docs: A response that includes loyalty account created. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_account: + type: optional + docs: The newly created loyalty account. + source: + openapi: openapi/openapi.json + CreateLoyaltyPromotionResponse: + docs: >- + Represents a + [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) + response. + + Either `loyalty_promotion` or `errors` is present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_promotion: + type: optional + docs: The new loyalty promotion. + source: + openapi: openapi/openapi.json + CreateLoyaltyRewardResponse: + docs: A response that includes the loyalty reward created. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + reward: + type: optional + docs: The loyalty reward created. + source: + openapi: openapi/openapi.json + CreateMerchantCustomAttributeDefinitionResponse: + docs: >- + Represents a + [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The new custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateMobileAuthorizationCodeResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `CreateMobileAuthorizationCode` endpoint. + properties: + authorization_code: + type: optional + docs: >- + The generated authorization code that connects a mobile application + instance + + to a Square account. + validation: + maxLength: 191 + expires_at: + type: optional + docs: >- + The timestamp when `authorization_code` expires, in + + [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, + "2016-09-04T23:59:33.123Z"). + validation: + minLength: 20 + maxLength: 48 + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateOrderCustomAttributeDefinitionResponse: + docs: Represents a response from creating an order custom attribute definition. + properties: + custom_attribute_definition: + type: optional + docs: The new custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateOrderRequest: + properties: + order: + type: optional + docs: >- + The order to create. If this field is set, the only other top-level + field that can be + + set is the `idempotency_key`. + idempotency_key: + type: optional + docs: >- + A value you specify that uniquely identifies this + + order among orders you have created. + + + If you are unsure whether a particular order was created successfully, + + you can try it again with the same idempotency key without + + worrying about creating duplicate orders. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + CreateOrderResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `CreateOrder` endpoint. + + Either `errors` or `order` is present in a given response, but never both. + properties: + order: + type: optional + docs: The newly created order. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreatePaymentLinkResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + payment_link: + type: optional + docs: The created payment link. + related_resources: + type: optional + docs: The list of related objects. + source: + openapi: openapi/openapi.json + CreatePaymentResponse: + docs: >- + Defines the response returned by + [CreatePayment](api-endpoint:Payments-CreatePayment). + + + If there are errors processing the request, the `payment` field might not + be + + present, or it might be present with a status of `FAILED`. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + payment: + type: optional + docs: The newly created payment. + source: + openapi: openapi/openapi.json + CreateScheduledShiftResponse: + docs: >- + Represents a + [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) response. + + Either `scheduled_shift` or `errors` is present in the response. + properties: + scheduled_shift: + type: optional + docs: >- + The new scheduled shift. To make the shift public, call + + [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) or + + [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateShiftResponse: + docs: |- + The response to a request to create a `Shift`. The response contains + the created `Shift` object and might contain a set of `Error` objects if + the request resulted in errors. + properties: + shift: + type: optional + docs: The `Shift` that was created on the request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [CreateSubscription](api-endpoint:Subscriptions-CreateSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: >- + The newly created subscription. + + + For more information, see + + [Subscription + object](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#subscription-object). + source: + openapi: openapi/openapi.json + CreateTeamMemberRequest: + docs: Represents a create request for a `TeamMember` object. + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies this `CreateTeamMember` request. + + Keys can be any valid string, but must be unique for every request. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + + + The minimum length is 1 and the maximum length is 45. + team_member: + type: optional + docs: >- + **Required** The data used to create the `TeamMember` object. If you + include `wage_setting`, you must provide + + `job_id` for each job assignment. To get job IDs, call + [ListJobs](api-endpoint:Team-ListJobs). + source: + openapi: openapi/openapi.json + CreateTeamMemberResponse: + docs: >- + Represents a response from a create request containing the created + `TeamMember` object or error messages. + properties: + team_member: + type: optional + docs: The successfully created `TeamMember` object. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateTerminalActionResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + action: + type: optional + docs: The created `TerminalAction` + source: + openapi: openapi/openapi.json + CreateTerminalCheckoutResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + checkout: + type: optional + docs: The created `TerminalCheckout`. + source: + openapi: openapi/openapi.json + CreateTerminalRefundResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refund: + type: optional + docs: The created `TerminalRefund`. + source: + openapi: openapi/openapi.json + CreateTimecardResponse: + docs: >- + The response to a request to create a `Timecard`. The response contains + + the created `Timecard` object and might contain a set of `Error` objects + if + + the request resulted in errors. + properties: + timecard: + type: optional + docs: The `Timecard` that was created on the request. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + CreateTransferOrderData: + docs: >- + Data for creating a new transfer order to move + [CatalogItemVariation](entity:CatalogItemVariation)s + + between [Location](entity:Location)s. Used with the + [CreateTransferOrder](api-endpoint:TransferOrders-CreateTransferOrder) + + endpoint. + properties: + source_location_id: + type: string + docs: >- + The source [Location](entity:Location) that will send the items. Must + be an active location + + in your Square account with sufficient inventory of the requested + items. + validation: + minLength: 1 + maxLength: 64 + destination_location_id: + type: string + docs: >- + The destination [Location](entity:Location) that will receive the + items. Must be an active location + + in your Square account + validation: + minLength: 1 + maxLength: 64 + expected_at: + type: optional> + docs: >- + Expected transfer date in RFC 3339 format (e.g. + "2023-10-01T12:00:00Z"). + notes: + type: optional> + docs: Optional notes about the transfer + validation: + maxLength: 4096 + tracking_number: + type: optional> + docs: Optional shipment tracking number + validation: + maxLength: 64 + created_by_team_member_id: + type: optional> + docs: >- + ID of the [TeamMember](entity:TeamMember) creating this transfer + order. Used for tracking + + and auditing purposes. + validation: + maxLength: 64 + line_items: + type: optional>> + docs: >- + List of [CatalogItemVariation](entity:CatalogItemVariation)s to + transfer, including quantities + source: + openapi: openapi/openapi.json + CreateTransferOrderLineData: + docs: >- + Data for creating a new transfer order line item. Each line item specifies + a + + [CatalogItemVariation](entity:CatalogItemVariation) and quantity to + transfer. + properties: + item_variation_id: + type: string + docs: >- + ID of the [CatalogItemVariation](entity:CatalogItemVariation) to + transfer. Must reference a valid + + item variation in the [Catalog](api:Catalog). The item variation must + be: + + - Active and available for sale + + - Enabled for inventory tracking + + - Available at the source location + validation: + minLength: 1 + maxLength: 64 + quantity_ordered: + type: string + docs: Total quantity ordered + validation: + pattern: ^(0|[1-9]\d*)(\.\d{1,4})?$ + minLength: 1 + maxLength: 16 + source: + openapi: openapi/openapi.json + CreateTransferOrderResponse: + docs: Response for creating a transfer order. + properties: + transfer_order: + type: optional + docs: The created transfer order + errors: + type: optional> + docs: Any errors that occurred during the request + source: + openapi: openapi/openapi.json + CreateVendorResponse: + docs: >- + Represents an output from a call to + [CreateVendor](api-endpoint:Vendors-CreateVendor). + properties: + errors: + type: optional> + docs: Errors encountered when the request fails. + vendor: + type: optional + docs: The successfully created [Vendor](entity:Vendor) object. + source: + openapi: openapi/openapi.json + CreateWebhookSubscriptionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) + endpoint. + + + Note: if there are errors processing the request, the + [Subscription](entity:WebhookSubscription) will not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + subscription: + type: optional + docs: The new [Subscription](entity:WebhookSubscription). + source: + openapi: openapi/openapi.json + Currency: + enum: + - UNKNOWN_CURRENCY + - AED + - AFN + - ALL + - AMD + - ANG + - AOA + - ARS + - AUD + - AWG + - AZN + - BAM + - BBD + - BDT + - BGN + - BHD + - BIF + - BMD + - BND + - BOB + - BOV + - BRL + - BSD + - BTN + - BWP + - BYR + - BZD + - CAD + - CDF + - CHE + - CHF + - CHW + - CLF + - CLP + - CNY + - COP + - COU + - CRC + - CUC + - CUP + - CVE + - CZK + - DJF + - DKK + - DOP + - DZD + - EGP + - ERN + - ETB + - EUR + - FJD + - FKP + - GBP + - GEL + - GHS + - GIP + - GMD + - GNF + - GTQ + - GYD + - HKD + - HNL + - HRK + - HTG + - HUF + - IDR + - ILS + - INR + - IQD + - IRR + - ISK + - JMD + - JOD + - JPY + - KES + - KGS + - KHR + - KMF + - KPW + - KRW + - KWD + - KYD + - KZT + - LAK + - LBP + - LKR + - LRD + - LSL + - LTL + - LVL + - LYD + - MAD + - MDL + - MGA + - MKD + - MMK + - MNT + - MOP + - MRO + - MUR + - MVR + - MWK + - MXN + - MXV + - MYR + - MZN + - NAD + - NGN + - NIO + - NOK + - NPR + - NZD + - OMR + - PAB + - PEN + - PGK + - PHP + - PKR + - PLN + - PYG + - QAR + - RON + - RSD + - RUB + - RWF + - SAR + - SBD + - SCR + - SDG + - SEK + - SGD + - SHP + - SLL + - SLE + - SOS + - SRD + - SSP + - STD + - SVC + - SYP + - SZL + - THB + - TJS + - TMT + - TND + - TOP + - TRY + - TTD + - TWD + - TZS + - UAH + - UGX + - USD + - USN + - USS + - UYI + - UYU + - UZS + - VEF + - VND + - VUV + - WST + - XAF + - XAG + - XAU + - XBA + - XBB + - XBC + - XBD + - XCD + - XDR + - XOF + - XPD + - XPF + - XPT + - XTS + - XXX + - YER + - ZAR + - ZMK + - ZMW + - BTC + - XUS + docs: >- + Indicates the associated currency for an amount of money. Values + correspond + + to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). + source: + openapi: openapi/openapi.json + CustomAttribute: + docs: |- + A custom attribute value. Each custom attribute value has a corresponding + `CustomAttributeDefinition` object. + properties: + key: + type: optional> + docs: >- + The identifier + + of the custom attribute definition and its corresponding custom + attributes. This value + + can be a simple key, which is the key that is provided when the custom + attribute definition + + is created, or a qualified key, if the requesting + + application is not the definition owner. The qualified key consists of + the application ID + + of the custom attribute definition owner + + followed by the simple key that was provided when the definition was + created. It has the + + format application_id:simple key. + + + The value for a simple key can contain up to 60 alphanumeric + characters, periods (.), + + underscores (_), and hyphens (-). + validation: + pattern: ^([a-zA-Z0-9\._-]+:)?[a-zA-Z0-9\._-]{1,60}$ + minLength: 1 + value: + type: optional> + docs: >- + The value assigned to the custom attribute. It is validated against + the custom + + attribute definition's schema on write operations. For more + information about custom + + attribute values, + + see [Custom Attributes + Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). + version: + type: optional + docs: >- + Read only. The current version of the custom attribute. This field is + incremented when the custom attribute is changed. + + When updating an existing custom attribute value, you can provide this + field + + and specify the current version of the custom attribute to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency). + + This field can also be used to enforce strong consistency for reads. + For more information about strong consistency for reads, + + see [Custom Attributes + Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). + visibility: + type: optional + docs: >- + A copy of the `visibility` field value for the associated custom + attribute definition. + + See + [CustomAttributeDefinitionVisibility](#type-customattributedefinitionvisibility) + for possible values + definition: + type: optional + docs: >- + A copy of the associated custom attribute definition object. This + field is only set when + + the optional field is specified on the request. + updated_at: + type: optional + docs: >- + The timestamp that indicates when the custom attribute was created or + was most recently + + updated, in RFC 3339 format. + access: read-only + created_at: + type: optional + docs: >- + The timestamp that indicates when the custom attribute was created, in + RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + CustomAttributeDefinition: + docs: >- + Represents a definition for custom attribute values. A custom attribute + definition + + specifies the key, visibility, schema, and other properties for a custom + attribute. + properties: + key: + type: optional> + docs: >- + The identifier + + of the custom attribute definition and its corresponding custom + attributes. This value + + can be a simple key, which is the key that is provided when the custom + attribute definition + + is created, or a qualified key, if the requesting + + application is not the definition owner. The qualified key consists of + the application ID + + of the custom attribute definition owner + + followed by the simple key that was provided when the definition was + created. It has the + + format application_id:simple key. + + + The value for a simple key can contain up to 60 alphanumeric + characters, periods (.), + + underscores (_), and hyphens (-). + + + This field can not be changed + + after the custom attribute definition is created. This field is + required when creating + + a definition and must be unique per application, seller, and resource + type. + validation: + pattern: ^([a-zA-Z0-9\._-]+:)?[a-zA-Z0-9\._-]{1,60}$ + minLength: 1 + schema: + type: optional>> + docs: >- + The JSON schema for the custom attribute definition, which determines + the data type of the corresponding custom attributes. For more + information, + + see [Custom Attributes + Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). + This field is required when creating a definition. + name: + type: optional> + docs: >- + The name of the custom attribute definition for API and seller-facing + UI purposes. The name must + + be unique within the seller and application pair. This field is + required if the + + `visibility` field is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + validation: + maxLength: 255 + description: + type: optional> + docs: >- + Seller-oriented description of the custom attribute definition, + including any constraints + + that the seller should observe. May be displayed as a tooltip in + Square UIs. This field is + + required if the `visibility` field is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + validation: + maxLength: 255 + visibility: + type: optional + docs: >- + Specifies how the custom attribute definition and its values should be + shared with + + the seller and other applications. If no value is specified, the value + defaults to `VISIBILITY_HIDDEN`. + + See [Visibility](#type-visibility) for possible values + version: + type: optional + docs: >- + Read only. The current version of the custom attribute definition. + + The value is incremented each time the custom attribute definition is + updated. + + When updating a custom attribute definition, you can provide this + field + + and specify the current version of the custom attribute definition to + enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency). + + + On writes, this field must be set to the latest version. Stale writes + are rejected. + + + This field can also be used to enforce strong consistency for reads. + For more information about strong consistency for reads, + + see [Custom Attributes + Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). + updated_at: + type: optional + docs: >- + The timestamp that indicates when the custom attribute definition was + created or most recently updated, + + in RFC 3339 format. + access: read-only + created_at: + type: optional + docs: >- + The timestamp that indicates when the custom attribute definition was + created, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + CustomAttributeDefinitionEventData: + docs: |- + Represents an object in the CustomAttributeDefinition event notification + payload that contains the affected custom attribute definition. + properties: + type: + type: optional> + docs: >- + The type of the event data object. The value is + `"custom_attribute_definition"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the custom attribute definition. + source: + openapi: openapi/openapi.json + CustomAttributeDefinitionEventDataObject: + properties: + custom_attribute_definition: + type: optional + docs: The custom attribute definition. + source: + openapi: openapi/openapi.json + CustomAttributeDefinitionVisibility: + enum: + - VISIBILITY_HIDDEN + - VISIBILITY_READ_ONLY + - VISIBILITY_READ_WRITE_VALUES + docs: >- + The level of permission that a seller or other applications requires to + + view this custom attribute definition. + + The `Visibility` field controls who can read and write the custom + attribute values + + and custom attribute definition. + source: + openapi: openapi/openapi.json + CustomAttributeEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"custom_attribute"`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the event data object. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the custom attribute. + source: + openapi: openapi/openapi.json + CustomAttributeEventDataObject: + properties: + custom_attribute: + type: optional + docs: The custom attribute. + source: + openapi: openapi/openapi.json + CustomAttributeFilter: + docs: |- + Supported custom attribute query expressions for calling the + [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + endpoint to search for items or item variations. + properties: + custom_attribute_definition_id: + type: optional> + docs: >- + A query expression to filter items or item variations by matching + their custom attributes' + + `custom_attribute_definition_id` property value against the the + specified id. + + Exactly one of `custom_attribute_definition_id` or `key` must be + specified. + key: + type: optional> + docs: >- + A query expression to filter items or item variations by matching + their custom attributes' + + `key` property value against the specified key. + + Exactly one of `custom_attribute_definition_id` or `key` must be + specified. + string_filter: + type: optional> + docs: >- + A query expression to filter items or item variations by matching + their custom attributes' + + `string_value` property value against the specified text. + + Exactly one of `string_filter`, `number_filter`, + `selection_uids_filter`, or `bool_filter` must be specified. + number_filter: + type: optional + docs: >- + A query expression to filter items or item variations with their + custom attributes + + containing a number value within the specified range. + + Exactly one of `string_filter`, `number_filter`, + `selection_uids_filter`, or `bool_filter` must be specified. + selection_uids_filter: + type: optional>> + docs: >- + A query expression to filter items or item variations by matching + their custom attributes' + + `selection_uid_values` values against the specified selection uids. + + Exactly one of `string_filter`, `number_filter`, + `selection_uids_filter`, or `bool_filter` must be specified. + bool_filter: + type: optional> + docs: >- + A query expression to filter items or item variations by matching + their custom attributes' + + `boolean_value` property values against the specified Boolean + expression. + + Exactly one of `string_filter`, `number_filter`, + `selection_uids_filter`, or `bool_filter` must be specified. + source: + openapi: openapi/openapi.json + CustomField: + docs: >- + Describes a custom form field to add to the checkout page to collect more + information from buyers during checkout. + + For more information, + + see [Specify checkout + options](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#specify-checkout-options-1). + properties: + title: + type: string + docs: The title of the custom field. + validation: + minLength: 1 + maxLength: 50 + source: + openapi: openapi/openapi.json + Customer: + docs: >- + Represents a Square customer profile in the Customer Directory of a Square + seller. + properties: + id: + type: optional + docs: >- + A unique Square-assigned ID for the customer profile. + + + If you need this ID for an API request, use the ID returned when you + created the customer profile or call the + [SearchCustomers](api-endpoint:Customers-SearchCustomers) + + or [ListCustomers](api-endpoint:Customers-ListCustomers) endpoint. + created_at: + type: optional + docs: >- + The timestamp when the customer profile was created, in RFC 3339 + format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp when the customer profile was last updated, in RFC 3339 + format. + access: read-only + given_name: + type: optional> + docs: >- + The given name (that is, the first name) associated with the customer + profile. + family_name: + type: optional> + docs: >- + The family name (that is, the last name) associated with the customer + profile. + nickname: + type: optional> + docs: A nickname for the customer profile. + company_name: + type: optional> + docs: A business name associated with the customer profile. + email_address: + type: optional> + docs: The email address associated with the customer profile. + address: + type: optional
+ docs: The physical address associated with the customer profile. + phone_number: + type: optional> + docs: The phone number associated with the customer profile. + birthday: + type: optional> + docs: >- + The birthday associated with the customer profile, in `YYYY-MM-DD` + format. For example, `1998-09-21` + + represents September 21, 1998, and `0000-09-21` represents September + 21 (without a birth year). + reference_id: + type: optional> + docs: |- + An optional second ID used to associate the customer profile with an + entity in another system. + note: + type: optional> + docs: A custom note associated with the customer profile. + preferences: + type: optional + docs: Represents general customer preferences. + creation_source: + type: optional + docs: >- + The method used to create the customer profile. + + See [CustomerCreationSource](#type-customercreationsource) for + possible values + group_ids: + type: optional>> + docs: >- + The IDs of [customer groups](entity:CustomerGroup) the customer + belongs to. + segment_ids: + type: optional>> + docs: >- + The IDs of [customer segments](entity:CustomerSegment) the customer + belongs to. + version: + type: optional + docs: >- + The Square-assigned version number of the customer profile. The + version number is incremented each time an update is committed to the + customer profile, except for changes to customer segment membership. + tax_ids: + type: optional + docs: >- + The tax ID associated with the customer profile. This field is present + only for customers of sellers in EU countries or the United Kingdom. + + For more information, see [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + source: + openapi: openapi/openapi.json + CustomerAddressFilter: + docs: >- + The customer address filter. This filter is used in a + [CustomerCustomAttributeFilterValue](entity:CustomerCustomAttributeFilterValue) + filter when + + searching by an `Address`-type custom attribute. + properties: + postal_code: + type: optional + docs: The postal code to search for. Only an `exact` match is supported. + country: + type: optional + docs: |- + The country code to search for. + See [Country](#type-country) for possible values + source: + openapi: openapi/openapi.json + CustomerCreatedEvent: + docs: >- + Published when a [customer](entity:Customer) is created. Subscribe to this + event to track customer profiles affected by a merge operation. + + For more information, see [Use Customer + Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). + + + The `customer` object in the event notification does not include the + `segment_ids` field. + properties: + merchant_id: + type: optional> + docs: The ID of the seller associated with the event. + type: + type: optional> + docs: The type of event. For this object, the value is `customer.created`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CustomerCreatedEventData: + docs: The data associated with the event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `customer`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the new customer. + validation: + maxLength: 192 + object: + type: optional + docs: An object that contains the new customer. + source: + openapi: openapi/openapi.json + CustomerCreatedEventEventContext: + docs: Information about the change that triggered the event. + properties: + merge: + type: optional + docs: Information about the merge operation associated with the event. + source: + openapi: openapi/openapi.json + CustomerCreatedEventEventContextMerge: + docs: >- + Information about a merge operation, which creates a new customer using + aggregated properties from two or more existing customers. + properties: + from_customer_ids: + type: optional>> + docs: The IDs of the existing customers that were merged and then deleted. + to_customer_id: + type: optional> + docs: The ID of the new customer created by the merge. + source: + openapi: openapi/openapi.json + CustomerCreatedEventObject: + docs: An object that contains the customer associated with the event. + properties: + customer: + type: optional + docs: The new customer. + event_context: + type: optional + docs: >- + Information about the change that triggered the event. This field is + returned only if the customer is created by a merge operation. + source: + openapi: openapi/openapi.json + CustomerCreationSource: + enum: + - OTHER + - APPOINTMENTS + - COUPON + - DELETION_RECOVERY + - DIRECTORY + - EGIFTING + - EMAIL_COLLECTION + - FEEDBACK + - IMPORT + - INVOICES + - LOYALTY + - MARKETING + - MERGE + - ONLINE_STORE + - INSTANT_PROFILE + - TERMINAL + - THIRD_PARTY + - THIRD_PARTY_IMPORT + - UNMERGE_RECOVERY + docs: Indicates the method used to create the customer profile. + source: + openapi: openapi/openapi.json + CustomerCreationSourceFilter: + docs: >- + The creation source filter. + + + If one or more creation sources are set, customer profiles are included + in, + + or excluded from, the result if they match at least one of the filter + criteria. + properties: + values: + type: optional>> + docs: >- + The list of creation sources used as filtering criteria. + + See [CustomerCreationSource](#type-customercreationsource) for + possible values + rule: + type: optional + docs: >- + Indicates whether a customer profile matching the filter criteria + + should be included in the result or excluded from the result. + + + Default: `INCLUDE`. + + See [CustomerInclusionExclusion](#type-customerinclusionexclusion) for + possible values + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionCreatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + is created by the subscribing application. + + + This event is replaced by + + [customer.custom_attribute_definition.owned.created](webhook:customer.custom_attribute_definition.owned.created). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionCreatedPublicEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to all applications is created. A notification is sent + when any application creates a custom + + attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + + + This event is replaced by + + [customer.custom_attribute_definition.visible.created](webhook:customer.custom_attribute_definition.visible.created), + + which applies to custom attribute definitions that are visible to the + subscribing application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.public.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionDeletedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is deleted. A custom attribute + definition can only be deleted by + + the application that created it. + + + This event is replaced by + + [customer.custom_attribute_definition.owned.deleted](webhook:customer.custom_attribute_definition.owned.deleted). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionDeletedPublicEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to all applications is deleted. A notification is sent + when any application deletes a custom + + attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + + + This event is replaced by + + [customer.custom_attribute_definition.visible.deleted](webhook:customer.custom_attribute_definition.visible.deleted), + + which applies to custom attribute definitions that are visible to the + subscribing application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.public.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionOwnedCreatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + is created by the subscribing application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.owned.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionOwnedDeletedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is deleted. A custom attribute + definition can only be deleted by + + the application that created it. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionOwnedUpdatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is updated. A custom attribute + definition can only be updated by + + the application that created it. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionUpdatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is updated. A custom attribute + definition can only be updated by + + the application that created it. + + + This event is replaced by + + [customer.custom_attribute_definition.owned.updated](webhook:customer.custom_attribute_definition.owned.updated). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionUpdatedPublicEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to all applications is updated. A notification is sent + when any application updates a custom + + attribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + + + This event is replaced by + + [customer.custom_attribute_definition.visible.updated](webhook:customer.custom_attribute_definition.visible.updated), + + which applies to custom attribute definitions that are visible to the + subscribing application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.public.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionVisibleCreatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is created. A notification + is sent when your application + + creates a custom attribute definition or another application creates a + custom attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.visible.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionVisibleDeletedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is deleted. A custom + attribute definition can only be deleted + + by the application that created it. A notification is sent when your + application deletes a custom attribute + + definition or when another application deletes a custom attribute + definition whose `visibility` is + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDefinitionVisibleUpdatedEvent: + docs: >- + Published when a customer [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is updated. A custom + attribute definition can only be updated + + by the application that created it. A notification is sent when your + application updates a custom + + attribute definition or when another application updates a custom + attribute definition whose `visibility` is + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute_definition.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDeletedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) owned + by the + + subscribing application is deleted. Custom attributes are owned by the + application that created the + + corresponding [custom attribute + definition](entity:CustomAttributeDefinition). Custom attributes whose + + `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any + application. + + + This event is replaced by + + [customer.custom_attribute.owned.deleted](webhook:customer.custom_attribute.owned.deleted). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeDeletedPublicEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) that + is visible + + to all applications is deleted. A notification is sent when any + application deletes a custom attribute + + whose `visibility` is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + + + This event is replaced by + + [customer.custom_attribute.visible.deleted](webhook:customer.custom_attribute.visible.deleted), + + which applies to custom attributes that are visible to the subscribing + application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.public.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeFilter: + docs: >- + The custom attribute filter. Use this filter in a set of [custom attribute + filters](entity:CustomerCustomAttributeFilters) to search + + based on the value or last updated date of a customer-related [custom + attribute](entity:CustomAttribute). + properties: + key: + type: string + docs: >- + The `key` of the [custom attribute](entity:CustomAttribute) to filter + by. The key is the identifier of the custom attribute + + (and the corresponding custom attribute definition) and can be + retrieved using the [Customer Custom Attributes + API](api:CustomerCustomAttributes). + filter: + type: optional + docs: >- + A filter that corresponds to the data type of the target custom + attribute. For example, provide the `phone` filter to + + search based on the value of a `PhoneNumber`-type custom attribute. + The data type is specified by the schema field of the custom attribute + definition, + + which can be retrieved using the [Customer Custom Attributes + API](api:CustomerCustomAttributes). + + + You must provide this `filter` field, the `updated_at` field, or both. + updated_at: + type: optional + docs: >- + The date range for when the custom attribute was last updated. The + date range can include `start_at`, `end_at`, or + + both. Range boundaries are inclusive. Dates are specified as RFC 3339 + timestamps. + + + You must provide this `updated_at` field, the `filter` field, or both. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeFilterValue: + docs: >- + A type-specific filter used in a [custom attribute + filter](entity:CustomerCustomAttributeFilter) to search based on the + value + + of a customer-related [custom attribute](entity:CustomAttribute). + properties: + email: + type: optional + docs: >- + A filter for a query based on the value of an `Email`-type custom + attribute. This filter is case-insensitive and can + + include `exact` or `fuzzy`, but not both. + + + For an `exact` match, provide the complete email address. + + + For a `fuzzy` match, provide a query expression containing one or more + query tokens to match against the email address. Square removes + + any punctuation (including periods (.), underscores (_), and the @ + symbol) and tokenizes the email addresses on spaces. A match is found + + if a tokenized email address contains all the tokens in the search + query, irrespective of the token order. For example, `Steven gmail` + + matches steven.jones@gmail.com and mygmail@stevensbakery.com. + phone: + type: optional + docs: >- + A filter for a query based on the value of a `PhoneNumber`-type custom + attribute. This filter is case-insensitive and + + can include `exact` or `fuzzy`, but not both. + + + For an `exact` match, provide the complete phone number. This is + always an E.164-compliant phone number that starts + + with the + sign followed by the country code and subscriber number. + For example, the format for a US phone number is +12061112222. + + + For a `fuzzy` match, provide a query expression containing one or more + query tokens to match against the phone number. + + Square removes any punctuation and tokenizes the expression on spaces. + A match is found if a tokenized phone number contains + + all the tokens in the search query, irrespective of the token order. + For example, `415 123 45` is tokenized to `415`, `123`, and `45`, + + which matches +14151234567 and +12345674158, but does not match + +1234156780. Similarly, the expression `415` matches + + +14151234567, +12345674158, and +1234156780. + text: + type: optional + docs: >- + A filter for a query based on the value of a `String`-type custom + attribute. This filter is case-insensitive and + + can include `exact` or `fuzzy`, but not both. + + + For an `exact` match, provide the complete string. + + + For a `fuzzy` match, provide a query expression containing one or more + query tokens in any order that contain complete words + + to match against the string. Square tokenizes the expression using a + grammar-based tokenizer. For example, the expressions `quick brown`, + + `brown quick`, and `quick fox` match "The quick brown fox jumps over + the lazy dog". However, `quick foxes` and `qui` do not match. + selection: + type: optional + docs: >- + A filter for a query based on the display name for a `Selection`-type + custom attribute value. This filter is case-sensitive + + and can contain `any`, `all`, or both. The `none` condition is not + supported. + + + Provide the display name of each item that you want to search for. To + find the display names for the selection, use the + + [Customer Custom Attributes API](api:CustomerCustomAttributes) to + retrieve the corresponding custom attribute definition + + and then check the `schema.items.names` field. For more information, + see + + [Search based on + selection](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#custom-attribute-value-filter-selection). + + + Note that when a `Selection`-type custom attribute is assigned to a + customer profile, the custom attribute value is a list of one + + or more UUIDs (sourced from the `schema.items.enum` field) that map to + the item names. These UUIDs are unique per seller. + date: + type: optional + docs: >- + A filter for a query based on the value of a `Date`-type custom + attribute. + + + Provide a date range for this filter using `start_at`, `end_at`, or + both. Range boundaries are inclusive. Dates can be specified + + in `YYYY-MM-DD` format or as RFC 3339 timestamps. + number: + type: optional + docs: >- + A filter for a query based on the value of a `Number`-type custom + attribute, which can be an integer or a decimal with up to + + 5 digits of precision. + + + Provide a numerical range for this filter using `start_at`, `end_at`, + or both. Range boundaries are inclusive. Numbers are specified + + as decimals or integers. The absolute value of range boundaries must + not exceed `(2^63-1)/10^5`, or 92233720368547. + boolean: + type: optional> + docs: >- + A filter for a query based on the value of a `Boolean`-type custom + attribute. + address: + type: optional + docs: >- + A filter for a query based on the value of an `Address`-type custom + attribute. The filter can include `postal_code`, `country`, or both. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeFilters: + docs: >- + The custom attribute filters in a set of [customer + filters](entity:CustomerFilter) used in a search query. Use this filter + + to search based on [custom attributes](entity:CustomAttribute) that are + assigned to customer profiles. For more information, see + + [Search by custom + attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute). + properties: + filters: + type: optional>> + docs: >- + The custom attribute filters. Each filter must specify `key` and + include the `filter` field with a type-specific filter, + + the `updated_at` field, or both. The provided keys must be unique + within the list of custom attribute filters. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeOwnedDeletedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) owned + by the + + subscribing application is deleted. Custom attributes are owned by the + application that created the + + corresponding [custom attribute + definition](entity:CustomAttributeDefinition). Custom attributes whose + + `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any + application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeOwnedUpdatedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) owned + by the + + subscribing application is created or updated. Custom attributes are owned + by the application that created + + the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). Custom attributes whose + + `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated + by any application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeUpdatedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) owned + by the + + subscribing application is created or updated. Custom attributes are owned + by the application that created + + the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). Custom attributes whose + + `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated + by any application. + + + This event is replaced by + + [customer.custom_attribute.owned.updated](webhook:customer.custom_attribute.owned.updated). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeUpdatedPublicEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) that + is visible + + to all applications is created or updated. A notification is sent when any + application creates or updates + + a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + + + This event is replaced by + + [customer.custom_attribute.visible.updated](webhook:customer.custom_attribute.visible.updated), + + which applies to custom attributes that are visible to the subscribing + application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.public.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeVisibleDeletedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) that + is visible to the + + subscribing application is deleted. A notification is sent when: + + - Your application deletes a custom attribute owned by your application, + regardless of the `visibility` setting. + + - Any application deletes a custom attribute whose `visibility` is + `VISIBILITY_READ_ONLY` + + or `VISIBILITY_READ_WRITE_VALUES`. + + + Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by + any application, but those set to + + `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the + owner. Custom attributes are owned + + by the application that created the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerCustomAttributeVisibleUpdatedEvent: + docs: >- + Published when a customer [custom attribute](entity:CustomAttribute) that + is visible to the + + subscribing application is created or updated. A notification is sent + when: + + - Your application creates or updates a custom attribute owned by your + application, regardless of the `visibility` setting. + + - Any application creates or updates a custom attribute whose `visibility` + is `VISIBILITY_READ_ONLY` + + or `VISIBILITY_READ_WRITE_VALUES`. + + + Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or + updated by any application, but those set to + + `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or + updated by the owner. Custom attributes are owned + + by the application that created the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"customer.custom_attribute.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + CustomerDeletedEvent: + docs: >- + Published when a [customer](entity:Customer) is deleted. For more + information, see [Use Customer + Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). + + + The `customer` object in the event notification does not include the + following fields: `group_ids` and `segment_ids`. + properties: + merchant_id: + type: optional> + docs: The ID of the seller associated with the event. + type: + type: optional> + docs: The type of event. For this object, the value is `customer.deleted`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CustomerDeletedEventData: + docs: The data associated with the event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `customer`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the deleted customer. + validation: + maxLength: 192 + object: + type: optional + docs: An object that contains the deleted customer. + source: + openapi: openapi/openapi.json + CustomerDeletedEventEventContext: + docs: Information about the change that triggered the event. + properties: + merge: + type: optional + docs: Information about the merge operation associated with the event. + source: + openapi: openapi/openapi.json + CustomerDeletedEventEventContextMerge: + docs: >- + Information about a merge operation, which creates a new customer using + aggregated properties from two or more existing customers. + properties: + from_customer_ids: + type: optional>> + docs: The IDs of the existing customers that were merged and then deleted. + to_customer_id: + type: optional> + docs: The ID of the new customer created by the merge. + source: + openapi: openapi/openapi.json + CustomerDeletedEventObject: + docs: An object that contains the customer associated with the event. + properties: + customer: + type: optional + docs: The deleted customer. + event_context: + type: optional + docs: >- + Information about the change that triggered the event. This field is + returned only if the customer is deleted by a merge operation. + source: + openapi: openapi/openapi.json + CustomerDetails: + docs: Details about the customer making the payment. + properties: + customer_initiated: + type: optional> + docs: Indicates whether the customer initiated the payment. + seller_keyed_in: + type: optional> + docs: >- + Indicates that the seller keyed in payment details on behalf of the + customer. + + This is used to flag a payment as Mail Order / Telephone Order (MOTO). + source: + openapi: openapi/openapi.json + CustomerFilter: + docs: >- + Represents the filtering criteria in a [search + query](entity:CustomerQuery) that defines how to filter + + customer profiles returned in + [SearchCustomers](api-endpoint:Customers-SearchCustomers) results. + properties: + creation_source: + type: optional + docs: A filter to select customers based on their creation source. + created_at: + type: optional + docs: A filter to select customers based on when they were created. + updated_at: + type: optional + docs: A filter to select customers based on when they were last updated. + email_address: + type: optional + docs: >- + A filter to [select customers by their email + address](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-email-address) + + visible to the seller. + + This filter is case-insensitive. + + + For [exact + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-email-address), + this + + filter causes the search to return customer profiles + + whose `email_address` field value are identical to the email address + provided + + in the query. + + + For [fuzzy + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-email-address), + + this filter causes the search to return customer profiles + + whose `email_address` field value has a token-wise partial match + against the filtering + + expression in the query. For example, with `Steven gmail` provided in + a search + + query, the search returns customers whose email address is + `steven.johnson@gmail.com` + + or `mygmail@stevensbakery.com`. Square removes any punctuation + (including periods (.), + + underscores (_), and the @ symbol) and tokenizes the email addresses + on spaces. A match is + + found if a tokenized email address contains all the tokens in the + search query, + + irrespective of the token order. + phone_number: + type: optional + docs: >- + A filter to [select customers by their phone + numbers](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-phone-number) + + visible to the seller. + + + For [exact + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-phone-number), + + this filter returns customers whose phone number matches the specified + query expression. The number in the query must be of an + + E.164-compliant form. In particular, it must include the leading `+` + sign followed by a country code and then a subscriber number. + + For example, the standard E.164 form of a US phone number is + `+12062223333` and an E.164-compliant variation is `+1 (206) + 222-3333`. + + To match the query expression, stored customer phone numbers are + converted to the standard E.164 form. + + + For [fuzzy + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-phone-number), + + this filter returns customers whose phone number matches the token or + tokens provided in the query expression. For example, with `415` + + provided in a search query, the search returns customers with the + phone numbers `+1-415-212-1200`, `+1-212-415-1234`, and `+1 (551) + 234-1567`. + + Similarly, a search query of `415 123` returns customers with the + phone numbers `+1-212-415-1234` and `+1 (551) 234-1567` but not + + `+1-212-415-1200`. A match is found if a tokenized phone number + contains all the tokens in the search query, irrespective of the token + order. + reference_id: + type: optional + docs: >- + A filter to [select customers by their reference + IDs](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-reference-id). + + This filter is case-insensitive. + + + [Exact + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-reference-id) + + of a customer's reference ID against a query's reference ID is + evaluated as an + + exact match between two strings, character by character in the given + order. + + + [Fuzzy + matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-reference-id) + + of stored reference IDs against queried reference IDs works + + exactly the same as fuzzy matching on email addresses. + Non-alphanumeric characters + + are replaced by spaces to tokenize stored and queried reference IDs. A + match is found + + if a tokenized stored reference ID contains all tokens specified in + any order in the query. For example, + + a query of `NYC M` matches customer profiles with the `reference_id` + value of `NYC_M_35_JOHNSON` + + and `NYC_27_MURRAY`. + group_ids: + type: optional + docs: >- + A filter to select customers based on the + [groups](entity:CustomerGroup) they belong to. + + Group membership is controlled by sellers and developers. + + + The `group_ids` filter has the following syntax: + + ``` + + "group_ids": { + + "any": ["{group_a_id}", "{group_b_id}", ...], + + "all": ["{group_1_id}", "{group_2_id}", ...], + + "none": ["{group_i_id}", "{group_ii_id}", ...] + + } + + ``` + + + You can use any combination of the `any`, `all`, and `none` fields in + the filter. + + With `any`, the search returns customers in groups `a` or `b` or any + other group specified in the list. + + With `all`, the search returns customers in groups `1` and `2` and all + other groups specified in the list. + + With `none`, the search returns customers not in groups `i` or `ii` or + any other group specified in the list. + + + If any of the search conditions are not met, including when an invalid + or non-existent group ID is provided, + + the result is an empty object (`{}`). + custom_attribute: + type: optional + docs: >- + A filter to select customers based on one or more custom attributes. + + This filter can contain up to 10 custom attribute filters. Each custom + attribute filter specifies filtering criteria for a target custom + + attribute. If multiple custom attribute filters are provided, they are + combined as an `AND` operation. + + + To be valid for a search, the custom attributes must be visible to the + requesting application. For more information, including example + queries, + + see [Search by custom + attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute). + + + Square returns matching customer profiles, which do not contain custom + attributes. To retrieve customer-related custom attributes, + + use the [Customer Custom Attributes + API](api:CustomerCustomAttributes). For example, you can call + + [RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) + using a customer ID from the result set. + segment_ids: + type: optional + docs: >2- + A filter to select customers based on the [segments](entity:CustomerSegment) they belong to. + Segment membership is dynamic and adjusts automatically based on + whether customers meet the segment criteria. + + + You can provide up to three segment IDs in the filter, using any + combination of the `all`, `any`, and `none` fields. + + For the following example, the results include customers who belong to + both segment A and segment B but do not belong to segment C. + + + ``` + + "segment_ids": { + + "all": ["{segment_A_id}", "{segment_B_id}"], + + "none": ["{segment_C_id}"] + + } + + ``` + + + If an invalid or non-existent segment ID is provided in the filter, + Square stops processing the request + + and returns a `400 BAD_REQUEST` error that includes the segment ID. + source: + openapi: openapi/openapi.json + CustomerGroup: + docs: >- + Represents a group of customer profiles. + + + Customer groups can be created, be modified, and have their membership + defined using + + the Customers API or within the Customer Directory in the Square Seller + Dashboard or Point of Sale. + properties: + id: + type: optional + docs: A unique Square-generated ID for the customer group. + validation: + maxLength: 255 + access: read-only + name: + type: string + docs: The name of the customer group. + created_at: + type: optional + docs: The timestamp when the customer group was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp when the customer group was last updated, in RFC 3339 + format. + access: read-only + source: + openapi: openapi/openapi.json + CustomerInclusionExclusion: + enum: + - INCLUDE + - EXCLUDE + docs: |- + Indicates whether customers should be included in, or excluded from, + the result set when they match the filtering criteria. + source: + openapi: openapi/openapi.json + CustomerPreferences: + docs: Represents communication preferences for the customer profile. + properties: + email_unsubscribed: + type: optional> + docs: >- + Indicates whether the customer has unsubscribed from marketing + campaign emails. A value of `true` means that the customer chose to + opt out of email marketing from the current Square seller or from all + Square sellers. This value is read-only from the Customers API. + source: + openapi: openapi/openapi.json + CustomerQuery: + docs: >- + Represents filtering and sorting criteria for a + [SearchCustomers](api-endpoint:Customers-SearchCustomers) request. + properties: + filter: + type: optional + docs: >- + The filtering criteria for the search query. A query can contain + multiple filters in any combination. + + Multiple filters are combined as `AND` statements. + + + __Note:__ Combining multiple filters as `OR` statements is not + supported. Instead, send multiple single-filter + + searches and join the result sets. + sort: + type: optional + docs: |- + Sorting criteria for query results. The default behavior is to sort + customers alphabetically by `given_name` and `family_name`. + source: + openapi: openapi/openapi.json + CustomerSegment: + docs: >- + Represents a group of customer profiles that match one or more predefined + filter criteria. + + + Segments (also known as Smart Groups) are defined and created within the + Customer Directory in the + + Square Seller Dashboard or Point of Sale. + properties: + id: + type: optional + docs: A unique Square-generated ID for the segment. + validation: + maxLength: 255 + access: read-only + name: + type: optional + docs: The name of the segment. + access: read-only + created_at: + type: optional + docs: The timestamp when the segment was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the segment was last updated, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + CustomerSort: + docs: >- + Represents the sorting criteria in a [search query](entity:CustomerQuery) + that defines how to sort + + customer profiles returned in + [SearchCustomers](api-endpoint:Customers-SearchCustomers) results. + properties: + field: + type: optional + docs: >- + Indicates the fields to use as the sort key, which is either the + default set of fields or `created_at`. + + + The default value is `DEFAULT`. + + See [CustomerSortField](#type-customersortfield) for possible values + order: + type: optional + docs: >- + Indicates the order in which results should be sorted based on the + + sort field value. Strings use standard alphabetic comparison + + to determine order. Strings representing numbers are sorted as + strings. + + + The default value is `ASC`. + + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + CustomerSortField: + enum: + - DEFAULT + - CREATED_AT + docs: >- + Specifies customer attributes as the sort key to customer profiles + returned from a search. + source: + openapi: openapi/openapi.json + CustomerTaxIds: + docs: >- + Represents the tax ID associated with a [customer + profile](entity:Customer). The corresponding `tax_ids` field is available + only for customers of sellers in EU countries or the United Kingdom. + + For more information, see [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + properties: + eu_vat: + type: optional> + docs: >- + The EU VAT identification number for the customer. For example, + `IE3426675K`. The ID can contain alphanumeric characters only. + validation: + maxLength: 20 + source: + openapi: openapi/openapi.json + CustomerTextFilter: + docs: >- + A filter to select customers based on exact or fuzzy matching of + + customer attributes against a specified query. Depending on the customer + attributes, + + the filter can be case-sensitive. This filter can be exact or fuzzy, but + it cannot be both. + properties: + exact: + type: optional> + docs: >- + Use the exact filter to select customers whose attributes match + exactly the specified query. + fuzzy: + type: optional> + docs: >- + Use the fuzzy filter to select customers whose attributes match the + specified query + + in a fuzzy manner. When the fuzzy option is used, search queries are + tokenized, and then + + each query token must be matched somewhere in the searched attribute. + For single token queries, + + this is effectively the same behavior as a partial match operation. + source: + openapi: openapi/openapi.json + CustomerUpdatedEvent: + docs: >- + Published when a [customer](entity:Customer) is updated. For more + information, see [Use Customer + Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). + + + Updates to the 'segment_ids' customer field does not invoke a + `customer.updated` event. In addition, the `customer` object in the event + notification does not include this field. + properties: + merchant_id: + type: optional> + docs: The ID of the seller associated with the event. + type: + type: optional> + docs: The type of event. For this object, the value is `customer.updated`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + CustomerUpdatedEventData: + docs: The data associated with the event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `customer`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the updated customer. + validation: + maxLength: 192 + object: + type: optional + docs: An object that contains the updated customer. + source: + openapi: openapi/openapi.json + CustomerUpdatedEventObject: + docs: An object that contains the customer associated with the event. + properties: + customer: + type: optional + docs: The updated customer. + source: + openapi: openapi/openapi.json + DataCollectionOptions: + properties: + title: + type: string + docs: The title text to display in the data collection flow on the Terminal. + validation: + minLength: 1 + maxLength: 250 + body: + type: string + docs: >- + The body text to display under the title in the data collection screen + flow on the + + Terminal. + validation: + minLength: 1 + maxLength: 10000 + input_type: + type: DataCollectionOptionsInputType + docs: |- + Represents the type of the input text. + See [InputType](#type-inputtype) for possible values + collected_data: + type: optional + docs: The buyer’s input text from the data collection screen. + source: + openapi: openapi/openapi.json + DataCollectionOptionsInputType: + enum: + - EMAIL + - PHONE_NUMBER + docs: Describes the input type of the data. + source: + openapi: openapi/openapi.json + DateRange: + docs: |- + A range defined by two dates. Used for filtering a query for Connect v2 + objects that have date properties. + properties: + start_date: + type: optional> + docs: >- + A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO + 8601 + + extended format for calendar dates. + + The beginning of a date range (inclusive). + end_date: + type: optional> + docs: >- + A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO + 8601 + + extended format for calendar dates. + + The end of a date range (inclusive). + source: + openapi: openapi/openapi.json + DayOfWeek: + enum: + - SUN + - MON + - TUE + - WED + - THU + - FRI + - SAT + docs: Indicates the specific day of the week. + source: + openapi: openapi/openapi.json + DeleteBookingCustomAttributeDefinitionResponse: + docs: >- + Represents a + [DeleteBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttributeDefinition) + response + + containing error messages when errors occurred during the request. The + successful response does not contain any payload. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteBookingCustomAttributeResponse: + docs: >- + Represents a + [DeleteBookingCustomAttribute](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttribute) + response. + + Either an empty object `{}` (for a successful deletion) or `errors` is + present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteBreakTypeResponse: + docs: >- + The response to a request to delete a `BreakType`. The response might + contain a set + + of `Error` objects if the request resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteCatalogObjectResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + deleted_object_ids: + type: optional> + docs: >- + The IDs of all catalog objects deleted by this request. + + Multiple IDs may be returned when associated objects are also deleted, + for example + + a catalog item variation will be deleted (and its ID included in this + field) + + when its parent catalog item is deleted. + deleted_at: + type: optional + docs: >- + The database + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + of this deletion in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. + source: + openapi: openapi/openapi.json + DeleteCustomerCardResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `DeleteCustomerCard` endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteCustomerCustomAttributeDefinitionResponse: + docs: >- + Represents a response from a delete request containing error messages if + there are any. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteCustomerCustomAttributeResponse: + docs: >- + Represents a + [DeleteCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-DeleteCustomerCustomAttribute) + response. + + Either an empty object `{}` (for a successful deletion) or `errors` is + present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteCustomerGroupResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [DeleteCustomerGroup](api-endpoint:CustomerGroups-DeleteCustomerGroup) + endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteCustomerResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `DeleteCustomer` endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteDisputeEvidenceResponse: + docs: Defines the fields in a `DeleteDisputeEvidence` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + DeleteInvoiceAttachmentResponse: + docs: >- + Represents a + [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) + response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + DeleteInvoiceResponse: + docs: Describes a `DeleteInvoice` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + DeleteLocationCustomAttributeDefinitionResponse: + docs: >- + Represents a response from a delete request containing error messages if + there are any. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteLocationCustomAttributeResponse: + docs: >- + Represents a + [DeleteLocationCustomAttribute](api-endpoint:LocationCustomAttributes-DeleteLocationCustomAttribute) + response. + + Either an empty object `{}` (for a successful deletion) or `errors` is + present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteLoyaltyRewardResponse: + docs: A response returned by the API call. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteMerchantCustomAttributeDefinitionResponse: + docs: >- + Represents a response from a delete request containing error messages if + there are any. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteMerchantCustomAttributeResponse: + docs: >- + Represents a + [DeleteMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-DeleteMerchantCustomAttribute) + response. + + Either an empty object `{}` (for a successful deletion) or `errors` is + present in the response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteOrderCustomAttributeDefinitionResponse: + docs: Represents a response from deleting an order custom attribute definition. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteOrderCustomAttributeResponse: + docs: Represents a response from deleting an order custom attribute. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeletePaymentLinkResponse: + properties: + errors: optional> + id: + type: optional + docs: The ID of the link that is deleted. + cancelled_order_id: + type: optional + docs: >- + The ID of the order that is canceled. When a payment link is deleted, + Square updates the + + the `state` (of the order that the checkout link created) to CANCELED. + source: + openapi: openapi/openapi.json + DeleteShiftResponse: + docs: >- + The response to a request to delete a `Shift`. The response might contain + a set of + + `Error` objects if the request resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteSnippetResponse: + docs: Represents a `DeleteSnippet` response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteSubscriptionActionResponse: + docs: >- + Defines output parameters in a response of the + [DeleteSubscriptionAction](api-endpoint:Subscriptions-DeleteSubscriptionAction) + + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The subscription that has the specified action deleted. + source: + openapi: openapi/openapi.json + DeleteTimecardResponse: + docs: >- + The response to a request to delete a `Timecard`. The response might + contain a set of + + `Error` objects if the request resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + DeleteTransferOrderResponse: + docs: Response for deleting a transfer order + properties: + errors: + type: optional> + docs: Any errors that occurred during the request + source: + openapi: openapi/openapi.json + DeleteWebhookSubscriptionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [DeleteWebhookSubscription](api-endpoint:WebhookSubscriptions-DeleteWebhookSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + source: + openapi: openapi/openapi.json + Destination: + docs: Information about the destination against which the payout was made. + properties: + type: + type: optional + docs: |- + Type of the destination such as a bank account or debit card. + See [DestinationType](#type-destinationtype) for possible values + id: + type: optional + docs: >- + Square issued unique ID (also known as the instrument ID) associated + with this destination. + source: + openapi: openapi/openapi.json + DestinationDetails: + docs: Details about a refund's destination. + properties: + card_details: + type: optional + docs: >- + Details about a card refund. Only populated if the destination_type is + `CARD`. + cash_details: + type: optional + docs: >- + Details about a cash refund. Only populated if the destination_type is + `CASH`. + external_details: + type: optional + docs: >- + Details about an external refund. Only populated if the + destination_type is `EXTERNAL`. + source: + openapi: openapi/openapi.json + DestinationDetailsCardRefundDetails: + properties: + card: + type: optional + docs: The card's non-confidential details. + entry_method: + type: optional> + docs: >- + The method used to enter the card's details for the refund. The method + can be + + `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. + validation: + maxLength: 50 + auth_result_code: + type: optional> + docs: >- + The authorization code provided by the issuer when a refund is + approved. + validation: + maxLength: 10 + source: + openapi: openapi/openapi.json + DestinationDetailsCashRefundDetails: + docs: >- + Stores details about a cash refund. Contains only non-confidential + information. + properties: + seller_supplied_money: + type: Money + docs: The amount and currency of the money supplied by the seller. + change_back_money: + type: optional + docs: |- + The amount of change due back to the seller. + This read-only field is calculated + from the `amount_money` and `seller_supplied_money` fields. + source: + openapi: openapi/openapi.json + DestinationDetailsExternalRefundDetails: + docs: >- + Stores details about an external refund. Contains only non-confidential + information. + properties: + type: + type: string + docs: >- + The type of external refund the seller paid to the buyer. It can be + one of the + + following: + + - CHECK - Refunded using a physical check. + + - BANK_TRANSFER - Refunded using external bank transfer. + + - OTHER\_GIFT\_CARD - Refunded using a non-Square gift card. + + - CRYPTO - Refunded using a crypto currency. + + - SQUARE_CASH - Refunded using Square Cash App. + + - SOCIAL - Refunded using peer-to-peer payment applications. + + - EXTERNAL - A third-party application gathered this refund outside of + Square. + + - EMONEY - Refunded using an E-money provider. + + - CARD - A credit or debit card that Square does not support. + + - STORED_BALANCE - Use for house accounts, store credit, and so forth. + + - FOOD_VOUCHER - Restaurant voucher provided by employers to employees + to pay for meals + + - OTHER - A type not listed here. + validation: + maxLength: 50 + source: + type: string + docs: |- + A description of the external refund source. For example, + "Food Delivery Service". + validation: + maxLength: 255 + source_id: + type: optional> + docs: An ID to associate the refund to its originating source. + validation: + maxLength: 255 + source: + openapi: openapi/openapi.json + DestinationType: + enum: + - BANK_ACCOUNT + - CARD + - SQUARE_BALANCE + - SQUARE_STORED_BALANCE + docs: List of possible destinations against which a payout can be made. + source: + openapi: openapi/openapi.json + Device: + properties: + id: + type: optional + docs: >- + A synthetic identifier for the device. The identifier includes a + standardized prefix and + + is otherwise an opaque id generated from key device fields. + access: read-only + attributes: + type: DeviceAttributes + docs: A collection of DeviceAttributes representing the device. + components: + type: optional>> + docs: A list of components applicable to the device. + status: + type: optional + docs: The current status of the device. + source: + openapi: openapi/openapi.json + DeviceAttributes: + properties: + type: + type: DeviceAttributesDeviceType + docs: |- + The device type. + See [DeviceType](#type-devicetype) for possible values + manufacturer: + type: string + docs: The maker of the device. + model: + type: optional> + docs: The specific model of the device. + name: + type: optional> + docs: A seller-specified name for the device. + manufacturers_id: + type: optional> + docs: >- + The manufacturer-supplied identifier for the device (where available). + In many cases, + + this identifier will be a serial number. + updated_at: + type: optional + docs: >- + The RFC 3339-formatted value of the most recent update to the device + information. + + (Could represent any field update on the device.) + access: read-only + version: + type: optional + docs: The current version of software installed on the device. + merchant_token: + type: optional> + docs: The merchant_token identifying the merchant controlling the device. + source: + openapi: openapi/openapi.json + DeviceAttributesDeviceType: + enum: + - TERMINAL + - HANDHELD + docs: An enum identifier of the device type. + source: + openapi: openapi/openapi.json + DeviceCheckoutOptions: + properties: + device_id: + type: string + docs: >- + The unique ID of the device intended for this `TerminalCheckout`. + + A list of `DeviceCode` objects can be retrieved from the + /v2/devices/codes endpoint. + + Match a `DeviceCode.device_id` value with `device_id` to get the + associated device code. + skip_receipt_screen: + type: optional> + docs: Instructs the device to skip the receipt screen. Defaults to false. + collect_signature: + type: optional> + docs: >- + Indicates that signature collection is desired during checkout. + Defaults to false. + tip_settings: + type: optional + docs: Tip-specific settings. + show_itemized_cart: + type: optional> + docs: >- + Show the itemization screen prior to taking a payment. This field is + only meaningful when the + + checkout includes an order ID. Defaults to true. + source: + openapi: openapi/openapi.json + DeviceCode: + properties: + id: + type: optional + docs: The unique id for this device code. + access: read-only + name: + type: optional> + docs: An optional user-defined name for the device code. + validation: + maxLength: 128 + code: + type: optional + docs: The unique code that can be used to login. + access: read-only + device_id: + type: optional + docs: >- + The unique id of the device that used this code. Populated when the + device is paired up. + access: read-only + product_type: + type: ProductType + docs: The targeting product type of the device code. + location_id: + type: optional> + docs: The location assigned to this code. + validation: + maxLength: 50 + status: + type: optional + docs: |- + The pairing status of the device code. + See [DeviceCodeStatus](#type-devicecodestatus) for possible values + pair_by: + type: optional + docs: >- + When this DeviceCode will expire and no longer login. Timestamp in RFC + 3339 format. + access: read-only + created_at: + type: optional + docs: When this DeviceCode was created. Timestamp in RFC 3339 format. + access: read-only + status_changed_at: + type: optional + docs: >- + When this DeviceCode's status was last changed. Timestamp in RFC 3339 + format. + access: read-only + paired_at: + type: optional + docs: When this DeviceCode was paired. Timestamp in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + DeviceCodePairedEvent: + docs: |- + Published when a Square Terminal has been paired with a + Terminal API client and the device_id of the paired Square Terminal is + available. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"device.code.paired"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DeviceCodePairedEventData: + properties: + type: + type: optional> + docs: Name of the paired object’s type, `"device_code"`. + id: + type: optional + docs: ID of the paired device code. + object: + type: optional + docs: An object containing the paired device code. + source: + openapi: openapi/openapi.json + DeviceCodePairedEventObject: + properties: + device_code: + type: optional + docs: The created terminal checkout + source: + openapi: openapi/openapi.json + DeviceCodeStatus: + enum: + - UNKNOWN + - UNPAIRED + - PAIRED + - EXPIRED + docs: DeviceCode.Status enum. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsApplicationDetails: + properties: + application_type: + type: optional + docs: |- + The type of application. + See [ApplicationType](#type-applicationtype) for possible values + version: + type: optional + docs: The version of the application. + session_location: + type: optional> + docs: The location_id of the session for the application. + device_code_id: + type: optional> + docs: The id of the device code that was used to log in to the device. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsBatteryDetails: + properties: + visible_percent: + type: optional> + docs: The battery charge percentage as displayed on the device. + external_power: + type: optional + docs: |- + The status of external_power. + See [ExternalPower](#type-externalpower) for possible values + source: + openapi: openapi/openapi.json + DeviceComponentDetailsCardReaderDetails: + properties: + version: + type: optional + docs: The version of the card reader. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsEthernetDetails: + properties: + active: + type: optional> + docs: >- + A boolean to represent whether the Ethernet interface is currently + active. + ip_address_v4: + type: optional> + docs: The string representation of the device’s IPv4 address. + mac_address: + type: optional> + docs: The mac address of the device in this network. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsExternalPower: + enum: + - AVAILABLE_CHARGING + - AVAILABLE_NOT_IN_USE + - UNAVAILABLE + - AVAILABLE_INSUFFICIENT + docs: An enum for ExternalPower. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsMeasurement: + docs: A value qualified by unit of measure. + properties: + value: + type: optional> + docs: Value of measure. + source: + openapi: openapi/openapi.json + DeviceComponentDetailsWiFiDetails: + properties: + active: + type: optional> + docs: A boolean to represent whether the WiFI interface is currently active. + ssid: + type: optional> + docs: The name of the connected WIFI network. + ip_address_v4: + type: optional> + docs: The string representation of the device’s IPv4 address. + secure_connection: + type: optional> + docs: >- + The security protocol for a secure connection (e.g. WPA2). None + provided if the connection + + is unsecured. + signal_strength: + type: optional + docs: A representation of signal strength of the WIFI network connection. + mac_address: + type: optional> + docs: The mac address of the device in this network. + source: + openapi: openapi/openapi.json + DeviceCreatedEvent: + docs: Published when a Device is created. + properties: + merchant_id: + type: optional> + docs: The merchant the newly created device belongs to. + type: + type: optional> + docs: The type of event this represents. The value is `"device.created"`. + event_id: + type: optional> + docs: A UUID that uniquely identifies this device creation event. + created_at: + type: optional + docs: >- + The time when the device creation event was first created, in RFC 3339 + format. + access: read-only + data: + type: optional + docs: The metadata associated with the device creation event. + source: + openapi: openapi/openapi.json + DeviceCreatedEventData: + properties: + type: + type: optional> + docs: The type of the event data object. The value is `"device"`. + id: + type: optional + docs: The ID of the device. + object: + type: optional + docs: An object containing the created device. + source: + openapi: openapi/openapi.json + DeviceCreatedEventObject: + properties: + device: + type: optional + docs: The created device. + source: + openapi: openapi/openapi.json + DeviceDetails: + docs: Details about the device that took the payment. + properties: + device_id: + type: optional> + docs: The Square-issued ID of the device. + validation: + maxLength: 255 + device_installation_id: + type: optional> + docs: The Square-issued installation ID for the device. + validation: + maxLength: 255 + device_name: + type: optional> + docs: The name of the device set by the seller. + validation: + maxLength: 255 + source: + openapi: openapi/openapi.json + DeviceMetadata: + properties: + battery_percentage: + type: optional> + docs: The Terminal’s remaining battery percentage, between 1-100. + charging_state: + type: optional> + docs: |- + The current charging state of the Terminal. + Options: `CHARGING`, `NOT_CHARGING` + location_id: + type: optional> + docs: >- + The ID of the Square seller business location associated with the + Terminal. + merchant_id: + type: optional> + docs: >- + The ID of the Square merchant account that is currently signed-in to + the Terminal. + network_connection_type: + type: optional> + docs: |- + The Terminal’s current network connection type. + Options: `WIFI`, `ETHERNET` + payment_region: + type: optional> + docs: The country in which the Terminal is authorized to take payments. + serial_number: + type: optional> + docs: >- + The unique identifier assigned to the Terminal, which can be found on + the lower back + + of the device. + os_version: + type: optional> + docs: The current version of the Terminal’s operating system. + app_version: + type: optional> + docs: The current version of the application running on the Terminal. + wifi_network_name: + type: optional> + docs: The name of the Wi-Fi network to which the Terminal is connected. + wifi_network_strength: + type: optional> + docs: |- + The signal strength of the Wi-FI network connection. + Options: `POOR`, `FAIR`, `GOOD`, `EXCELLENT` + ip_address: + type: optional> + docs: The IP address of the Terminal. + source: + openapi: openapi/openapi.json + DeviceStatus: + properties: + category: + type: optional + docs: |- + Category of the device status. + See [Category](#type-category) for possible values + source: + openapi: openapi/openapi.json + DeviceStatusCategory: + enum: + - AVAILABLE + - NEEDS_ATTENTION + - OFFLINE + source: + openapi: openapi/openapi.json + DigitalWalletDetails: + docs: >- + Additional details about `WALLET` type payments. Contains only + non-confidential information. + properties: + status: + type: optional> + docs: >- + The status of the `WALLET` payment. The status can be `AUTHORIZED`, + `CAPTURED`, `VOIDED`, or + + `FAILED`. + validation: + maxLength: 50 + brand: + type: optional> + docs: >- + The brand used for the `WALLET` payment. The brand can be `CASH_APP`, + `PAYPAY`, `ALIPAY`, + + `RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or + `UNKNOWN`. + validation: + maxLength: 50 + cash_app_details: + type: optional + docs: Brand-specific details for payments with the `brand` of `CASH_APP`. + source: + openapi: openapi/openapi.json + DisableCardResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [DisableCard](api-endpoint:Cards-DisableCard) endpoint. + + + Note: if there are errors processing the request, the card field will not + be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + card: + type: optional + docs: The retrieved card. + source: + openapi: openapi/openapi.json + DisableEventsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [DisableEvents](api-endpoint:Events-DisableEvents) + endpoint. + + + Note: if there are errors processing the request, the events field will + not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + source: + openapi: openapi/openapi.json + DismissTerminalActionResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + action: + type: optional + docs: Current state of the action to be dismissed. + source: + openapi: openapi/openapi.json + DismissTerminalCheckoutResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + checkout: + type: optional + docs: Current state of the checkout to be dismissed. + source: + openapi: openapi/openapi.json + DismissTerminalRefundResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + refund: + type: optional + docs: Current state of the refund to be dismissed. + source: + openapi: openapi/openapi.json + Dispute: + docs: >- + Represents a + [dispute](https://developer.squareup.com/docs/disputes-api/overview) a + cardholder initiated with their bank. + properties: + dispute_id: + type: optional> + docs: The unique ID for this `Dispute`, generated by Square. + validation: + minLength: 1 + maxLength: 40 + id: + type: optional + docs: The unique ID for this `Dispute`, generated by Square. + validation: + minLength: 1 + maxLength: 40 + amount_money: + type: optional + docs: >- + The disputed amount, which can be less than the total transaction + amount. + + For instance, if multiple items were purchased but the cardholder only + initiates a dispute over some of the items. + reason: + type: optional + docs: |- + The reason why the cardholder initiated the dispute. + See [DisputeReason](#type-disputereason) for possible values + state: + type: optional + docs: |- + The current state of this dispute. + See [DisputeState](#type-disputestate) for possible values + due_at: + type: optional> + docs: >- + The deadline by which the seller must respond to the dispute, in [RFC + 3339 + format](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates). + validation: + minLength: 1 + maxLength: 40 + disputed_payment: + type: optional + docs: The payment challenged in this dispute. + evidence_ids: + type: optional>> + docs: The IDs of the evidence associated with the dispute. + card_brand: + type: optional + docs: |- + The card brand used in the disputed payment. + See [CardBrand](#type-cardbrand) for possible values + created_at: + type: optional + docs: The timestamp when the dispute was created, in RFC 3339 format. + validation: + minLength: 1 + maxLength: 40 + access: read-only + updated_at: + type: optional + docs: The timestamp when the dispute was last updated, in RFC 3339 format. + validation: + minLength: 1 + maxLength: 40 + access: read-only + brand_dispute_id: + type: optional> + docs: >- + The ID of the dispute in the card brand system, generated by the card + brand. + validation: + minLength: 1 + maxLength: 40 + reported_date: + type: optional> + docs: The timestamp when the dispute was reported, in RFC 3339 format. + validation: + minLength: 1 + maxLength: 40 + reported_at: + type: optional> + docs: The timestamp when the dispute was reported, in RFC 3339 format. + validation: + minLength: 1 + maxLength: 40 + version: + type: optional + docs: The current version of the `Dispute`. + location_id: + type: optional> + docs: The ID of the location where the dispute originated. + validation: + minLength: 1 + maxLength: 40 + source: + openapi: openapi/openapi.json + DisputeCreatedEvent: + docs: Published when a [Dispute](entity:Dispute) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeCreatedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeEvidence: + properties: + evidence_id: + type: optional> + docs: The Square-generated ID of the evidence. + validation: + minLength: 1 + maxLength: 40 + id: + type: optional + docs: The Square-generated ID of the evidence. + validation: + minLength: 1 + maxLength: 40 + dispute_id: + type: optional> + docs: The ID of the dispute the evidence is associated with. + validation: + minLength: 1 + maxLength: 40 + evidence_file: + type: optional + docs: Image, PDF, TXT + evidence_text: + type: optional> + docs: Raw text + validation: + minLength: 1 + maxLength: 500 + uploaded_at: + type: optional> + docs: The time when the evidence was uploaded, in RFC 3339 format. + validation: + minLength: 1 + maxLength: 40 + evidence_type: + type: optional + docs: >- + The type of the evidence. + + See [DisputeEvidenceType](#type-disputeevidencetype) for possible + values + source: + openapi: openapi/openapi.json + DisputeEvidenceAddedEvent: + docs: >- + Published when evidence is added to a [Dispute](entity:Dispute) + + from the Disputes Dashboard in the Seller Dashboard, the Square Point of + Sale app, + + or by calling either + [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) + or + [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceAddedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceAddedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeEvidenceCreatedEvent: + docs: >- + Published when evidence is added to a [Dispute](entity:Dispute) + + from the Disputes Dashboard in the Seller Dashboard, the Square Point of + Sale app, + + or by calling either + [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) + or + [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceCreatedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeEvidenceDeletedEvent: + docs: >- + Published when evidence is removed from a [Dispute](entity:Dispute) + + from the Disputes Dashboard in the Seller Dashboard, the Square Point of + Sale app, + + or by calling + [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceDeletedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceDeletedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeEvidenceFile: + docs: A file to be uploaded as dispute evidence. + properties: + filename: + type: optional> + docs: >- + The file name including the file extension. For example: + "receipt.tiff". + validation: + minLength: 1 + maxLength: 40 + filetype: + type: optional> + docs: >- + Dispute evidence files must be application/pdf, image/heic, + image/heif, image/jpeg, image/png, or image/tiff formats. + validation: + minLength: 1 + maxLength: 40 + source: + openapi: openapi/openapi.json + DisputeEvidenceRemovedEvent: + docs: >- + Published when evidence is removed from a [Dispute](entity:Dispute) + + from the Disputes Dashboard in the Seller Dashboard, the Square Point of + Sale app, + + or by calling + [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceRemovedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeEvidenceRemovedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeEvidenceType: + enum: + - GENERIC_EVIDENCE + - ONLINE_OR_APP_ACCESS_LOG + - AUTHORIZATION_DOCUMENTATION + - CANCELLATION_OR_REFUND_DOCUMENTATION + - CARDHOLDER_COMMUNICATION + - CARDHOLDER_INFORMATION + - PURCHASE_ACKNOWLEDGEMENT + - DUPLICATE_CHARGE_DOCUMENTATION + - PRODUCT_OR_SERVICE_DESCRIPTION + - RECEIPT + - SERVICE_RECEIVED_DOCUMENTATION + - PROOF_OF_DELIVERY_DOCUMENTATION + - RELATED_TRANSACTION_DOCUMENTATION + - REBUTTAL_EXPLANATION + - TRACKING_NUMBER + docs: The type of the dispute evidence. + source: + openapi: openapi/openapi.json + DisputeReason: + enum: + - AMOUNT_DIFFERS + - CANCELLED + - DUPLICATE + - NO_KNOWLEDGE + - NOT_AS_DESCRIBED + - NOT_RECEIVED + - PAID_BY_OTHER_MEANS + - CUSTOMER_REQUESTS_CREDIT + - EMV_LIABILITY_SHIFT + docs: |- + The list of possible reasons why a cardholder might initiate a + dispute with their bank. + source: + openapi: openapi/openapi.json + DisputeState: + enum: + - INQUIRY_EVIDENCE_REQUIRED + - INQUIRY_PROCESSING + - INQUIRY_CLOSED + - EVIDENCE_REQUIRED + - PROCESSING + - WON + - LOST + - ACCEPTED + docs: The list of possible dispute states. + source: + openapi: openapi/openapi.json + DisputeStateChangedEvent: + docs: >- + Published when the state of a [Dispute](entity:Dispute) changes. + + This includes the dispute resolution (WON, LOST) reported by the bank. The + event + + data includes details of what changed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeStateChangedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeStateChangedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputeStateUpdatedEvent: + docs: >- + Published when the state of a [Dispute](entity:Dispute) changes. + + This includes the dispute resolution (WON, LOST) reported by the bank. The + event + + data includes details of what changed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + DisputeStateUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected dispute's type. + id: + type: optional + docs: ID of the affected dispute. + object: + type: optional + docs: An object containing fields and values relevant to the event. + source: + openapi: openapi/openapi.json + DisputeStateUpdatedEventObject: + properties: + object: + type: optional + docs: The dispute object. + source: + openapi: openapi/openapi.json + DisputedPayment: + docs: The payment the cardholder disputed. + properties: + payment_id: + type: optional> + docs: Square-generated unique ID of the payment being disputed. + validation: + minLength: 1 + maxLength: 192 + source: + openapi: openapi/openapi.json + EcomVisibility: + enum: + - UNINDEXED + - UNAVAILABLE + - HIDDEN + - VISIBLE + docs: Determines item visibility in Ecom (Online Store) and Online Checkout. + source: + openapi: openapi/openapi.json + Employee: + docs: >- + An employee object that is used by the external API. + + + DEPRECATED at version 2020-08-26. Replaced by + [TeamMember](entity:TeamMember). + properties: + id: + type: optional + docs: UUID for this object. + first_name: + type: optional> + docs: The employee's first name. + last_name: + type: optional> + docs: The employee's last name. + email: + type: optional> + docs: The employee's email address + phone_number: + type: optional> + docs: The employee's phone number in E.164 format, i.e. "+12125554250" + location_ids: + type: optional>> + docs: A list of location IDs where this employee has access to. + status: + type: optional + docs: |- + Specifies the status of the employees being fetched. + See [EmployeeStatus](#type-employeestatus) for possible values + is_owner: + type: optional> + docs: |- + Whether this employee is the owner of the merchant. Each merchant + has one owner employee, and that employee has full authority over + the account. + created_at: + type: optional + docs: A read-only timestamp in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: A read-only timestamp in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + EmployeeStatus: + enum: + - ACTIVE + - INACTIVE + docs: >- + The status of the Employee being retrieved. + + + DEPRECATED at version 2020-08-26. Replaced by + [TeamMemberStatus](entity:TeamMemberStatus). + source: + openapi: openapi/openapi.json + EmployeeWage: + docs: >- + The hourly wage rate that an employee earns on a `Shift` for doing the job + specified by the `title` property of this object. Deprecated at version + 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage). + properties: + id: + type: optional + docs: The UUID for this object. + employee_id: + type: optional> + docs: The `Employee` that this wage is assigned to. + title: + type: optional> + docs: The job title that this wage relates to. + hourly_rate: + type: optional + docs: |- + Can be a custom-set hourly wage or the calculated effective hourly + wage based on the annual wage and hours worked per week. + source: + openapi: openapi/openapi.json + EnableEventsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [EnableEvents](api-endpoint:Events-EnableEvents) + endpoint. + + + Note: if there are errors processing the request, the events field will + not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + source: + openapi: openapi/openapi.json + Error: + docs: >- + Represents an error encountered during a request to the Connect API. + + + See [Handling + errors](https://developer.squareup.com/docs/build-basics/handling-errors) + for more information. + properties: + category: + type: ErrorCategory + docs: |- + The high-level category for the error. + See [ErrorCategory](#type-errorcategory) for possible values + code: + type: ErrorCode + docs: |- + The specific code of the error. + See [ErrorCode](#type-errorcode) for possible values + detail: + type: optional + docs: A human-readable description of the error for debugging purposes. + field: + type: optional + docs: |- + The name of the field provided in the original request (if any) that + the error pertains to. + source: + openapi: openapi/openapi.json + ErrorCategory: + enum: + - API_ERROR + - AUTHENTICATION_ERROR + - INVALID_REQUEST_ERROR + - RATE_LIMIT_ERROR + - PAYMENT_METHOD_ERROR + - REFUND_ERROR + - MERCHANT_SUBSCRIPTION_ERROR + - EXTERNAL_VENDOR_ERROR + docs: |- + Indicates which high-level category of error has occurred during a + request to the Connect API. + source: + openapi: openapi/openapi.json + ErrorCode: + enum: + - INTERNAL_SERVER_ERROR + - UNAUTHORIZED + - ACCESS_TOKEN_EXPIRED + - ACCESS_TOKEN_REVOKED + - CLIENT_DISABLED + - FORBIDDEN + - INSUFFICIENT_SCOPES + - APPLICATION_DISABLED + - V1_APPLICATION + - V1_ACCESS_TOKEN + - CARD_PROCESSING_NOT_ENABLED + - MERCHANT_SUBSCRIPTION_NOT_FOUND + - BAD_REQUEST + - MISSING_REQUIRED_PARAMETER + - INCORRECT_TYPE + - INVALID_TIME + - INVALID_TIME_RANGE + - INVALID_VALUE + - INVALID_CURSOR + - UNKNOWN_QUERY_PARAMETER + - CONFLICTING_PARAMETERS + - EXPECTED_JSON_BODY + - INVALID_SORT_ORDER + - VALUE_REGEX_MISMATCH + - VALUE_TOO_SHORT + - VALUE_TOO_LONG + - VALUE_TOO_LOW + - VALUE_TOO_HIGH + - VALUE_EMPTY + - ARRAY_LENGTH_TOO_LONG + - ARRAY_LENGTH_TOO_SHORT + - ARRAY_EMPTY + - EXPECTED_BOOLEAN + - EXPECTED_INTEGER + - EXPECTED_FLOAT + - EXPECTED_STRING + - EXPECTED_OBJECT + - EXPECTED_ARRAY + - EXPECTED_MAP + - EXPECTED_BASE64_ENCODED_BYTE_ARRAY + - INVALID_ARRAY_VALUE + - INVALID_ENUM_VALUE + - INVALID_CONTENT_TYPE + - INVALID_FORM_VALUE + - CUSTOMER_NOT_FOUND + - ONE_INSTRUMENT_EXPECTED + - NO_FIELDS_SET + - TOO_MANY_MAP_ENTRIES + - MAP_KEY_LENGTH_TOO_SHORT + - MAP_KEY_LENGTH_TOO_LONG + - CUSTOMER_MISSING_NAME + - CUSTOMER_MISSING_EMAIL + - INVALID_PAUSE_LENGTH + - INVALID_DATE + - UNSUPPORTED_COUNTRY + - UNSUPPORTED_CURRENCY + - APPLE_TTP_PIN_TOKEN + - CARD_EXPIRED + - INVALID_EXPIRATION + - INVALID_EXPIRATION_YEAR + - INVALID_EXPIRATION_DATE + - UNSUPPORTED_CARD_BRAND + - UNSUPPORTED_ENTRY_METHOD + - INVALID_ENCRYPTED_CARD + - INVALID_CARD + - PAYMENT_AMOUNT_MISMATCH + - GENERIC_DECLINE + - CVV_FAILURE + - ADDRESS_VERIFICATION_FAILURE + - INVALID_ACCOUNT + - CURRENCY_MISMATCH + - INSUFFICIENT_FUNDS + - INSUFFICIENT_PERMISSIONS + - CARDHOLDER_INSUFFICIENT_PERMISSIONS + - INVALID_LOCATION + - TRANSACTION_LIMIT + - VOICE_FAILURE + - PAN_FAILURE + - EXPIRATION_FAILURE + - CARD_NOT_SUPPORTED + - READER_DECLINED + - INVALID_PIN + - MISSING_PIN + - MISSING_ACCOUNT_TYPE + - INVALID_POSTAL_CODE + - INVALID_FEES + - MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED + - PAYMENT_LIMIT_EXCEEDED + - GIFT_CARD_AVAILABLE_AMOUNT + - ACCOUNT_UNUSABLE + - BUYER_REFUSED_PAYMENT + - DELAYED_TRANSACTION_EXPIRED + - DELAYED_TRANSACTION_CANCELED + - DELAYED_TRANSACTION_CAPTURED + - DELAYED_TRANSACTION_FAILED + - CARD_TOKEN_EXPIRED + - CARD_TOKEN_USED + - AMOUNT_TOO_HIGH + - UNSUPPORTED_INSTRUMENT_TYPE + - REFUND_AMOUNT_INVALID + - REFUND_ALREADY_PENDING + - PAYMENT_NOT_REFUNDABLE + - PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE + - REFUND_ERROR_PAYMENT_NEEDS_COMPLETION + - REFUND_DECLINED + - INSUFFICIENT_PERMISSIONS_FOR_REFUND + - INVALID_CARD_DATA + - SOURCE_USED + - SOURCE_EXPIRED + - UNSUPPORTED_LOYALTY_REWARD_TIER + - LOCATION_MISMATCH + - ORDER_UNPAID_NOT_RETURNABLE + - IDEMPOTENCY_KEY_REUSED + - UNEXPECTED_VALUE + - SANDBOX_NOT_SUPPORTED + - INVALID_EMAIL_ADDRESS + - INVALID_PHONE_NUMBER + - CHECKOUT_EXPIRED + - BAD_CERTIFICATE + - INVALID_SQUARE_VERSION_FORMAT + - API_VERSION_INCOMPATIBLE + - CARD_PRESENCE_REQUIRED + - UNSUPPORTED_SOURCE_TYPE + - CARD_MISMATCH + - PLAID_ERROR + - PLAID_ERROR_ITEM_LOGIN_REQUIRED + - PLAID_ERROR_RATE_LIMIT + - CARD_DECLINED + - VERIFY_CVV_FAILURE + - VERIFY_AVS_FAILURE + - CARD_DECLINED_CALL_ISSUER + - CARD_DECLINED_VERIFICATION_REQUIRED + - BAD_EXPIRATION + - CHIP_INSERTION_REQUIRED + - ALLOWABLE_PIN_TRIES_EXCEEDED + - RESERVATION_DECLINED + - UNKNOWN_BODY_PARAMETER + - NOT_FOUND + - APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND + - METHOD_NOT_ALLOWED + - NOT_ACCEPTABLE + - REQUEST_TIMEOUT + - CONFLICT + - GONE + - REQUEST_ENTITY_TOO_LARGE + - UNSUPPORTED_MEDIA_TYPE + - UNPROCESSABLE_ENTITY + - RATE_LIMITED + - NOT_IMPLEMENTED + - BAD_GATEWAY + - SERVICE_UNAVAILABLE + - TEMPORARY_ERROR + - GATEWAY_TIMEOUT + docs: |- + Indicates the specific error that occurred during a request to a + Square API. + source: + openapi: openapi/openapi.json + Event: + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + EventData: + properties: + type: + type: optional> + docs: The name of the affected object’s type. + id: + type: optional + docs: The ID of the affected object. + deleted: + type: optional> + docs: >- + This is true if the affected object has been deleted; otherwise, it's + absent. + object: + type: optional>> + docs: >- + An object containing fields and values relevant to the event. It is + absent if the affected object has been deleted. + source: + openapi: openapi/openapi.json + EventMetadata: + docs: Contains metadata about a particular [Event](entity:Event). + properties: + event_id: + type: optional> + docs: A unique ID for the event. + api_version: + type: optional> + docs: >- + The API version of the event. This corresponds to the default API + version of the developer application at the time when the event was + created. + source: + openapi: openapi/openapi.json + EventTypeMetadata: + docs: Contains the metadata of a webhook event type. + properties: + event_type: + type: optional + docs: The event type. + access: read-only + api_version_introduced: + type: optional + docs: The API version at which the event type was introduced. + access: read-only + release_status: + type: optional + docs: The release status of the event type. + access: read-only + source: + openapi: openapi/openapi.json + ExcludeStrategy: + enum: + - LEAST_EXPENSIVE + - MOST_EXPENSIVE + docs: |- + Indicates which products matched by a CatalogPricingRule + will be excluded if the pricing rule uses an exclude set. + source: + openapi: openapi/openapi.json + ExternalPaymentDetails: + docs: >- + Stores details about an external payment. Contains only non-confidential + information. + + For more information, see + + [Take External + Payments](https://developer.squareup.com/docs/payments-api/take-payments/external-payments). + properties: + type: + type: string + docs: >- + The type of external payment the seller received. It can be one of the + following: + + - CHECK - Paid using a physical check. + + - BANK_TRANSFER - Paid using external bank transfer. + + - OTHER\_GIFT\_CARD - Paid using a non-Square gift card. + + - CRYPTO - Paid using a crypto currency. + + - SQUARE_CASH - Paid using Square Cash App. + + - SOCIAL - Paid using peer-to-peer payment applications. + + - EXTERNAL - A third-party application gathered this payment outside + of Square. + + - EMONEY - Paid using an E-money provider. + + - CARD - A credit or debit card that Square does not support. + + - STORED_BALANCE - Use for house accounts, store credit, and so forth. + + - FOOD_VOUCHER - Restaurant voucher provided by employers to employees + to pay for meals + + - OTHER - A type not listed here. + validation: + maxLength: 50 + source: + type: string + docs: |- + A description of the external payment source. For example, + "Food Delivery Service". + validation: + maxLength: 255 + source_id: + type: optional> + docs: An ID to associate the payment to its originating source. + validation: + maxLength: 255 + source_fee_money: + type: optional + docs: |- + The fees paid to the source. The `amount_money` minus this field is + the net amount seller receives. + source: + openapi: openapi/openapi.json + FilterValue: + docs: >- + A filter to select resources based on an exact field value. For any given + + value, the value can only be in one property. Depending on the field, + either + + all properties can be set or only a subset will be available. + + + Refer to the documentation of the field. + properties: + all: + type: optional>> + docs: A list of terms that must be present on the field of the resource. + any: + type: optional>> + docs: |- + A list of terms where at least one of them must be present on the + field of the resource. + none: + type: optional>> + docs: A list of terms that must not be present on the field the resource + source: + openapi: openapi/openapi.json + FloatNumberRange: + docs: Specifies a decimal number range. + properties: + start_at: + type: optional> + docs: A decimal value indicating where the range starts. + end_at: + type: optional> + docs: A decimal value indicating where the range ends. + source: + openapi: openapi/openapi.json + Fulfillment: + docs: >- + Contains details about how to fulfill this order. + + Orders can only be created with at most one fulfillment using the API. + + However, orders returned by the Orders API might contain multiple + fulfillments because sellers can create multiple fulfillments using Square + products such as Square Online. + properties: + uid: + type: optional> + docs: A unique ID that identifies the fulfillment only within this order. + validation: + maxLength: 60 + type: + type: optional + docs: |- + The type of the fulfillment. + See [FulfillmentType](#type-fulfillmenttype) for possible values + state: + type: optional + docs: |- + The state of the fulfillment. + See [FulfillmentState](#type-fulfillmentstate) for possible values + line_item_application: + type: optional + docs: >- + Describes what order line items this fulfillment applies to. + + It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment + entries. + + See + [FulfillmentFulfillmentLineItemApplication](#type-fulfillmentfulfillmentlineitemapplication) + for possible values + entries: + type: optional> + docs: >- + A list of entries pertaining to the fulfillment of an order. Each + entry must reference + + a valid `uid` for an order line item in the `line_item_uid` field, as + well as a `quantity` to + + fulfill. + + + Multiple entries can reference the same line item `uid`, as long as + the total quantity among + + all fulfillment entries referencing a single line item does not exceed + the quantity of the + + order's line item itself. + + + An order cannot be marked as `COMPLETED` before all fulfillments are + `COMPLETED`, + + `CANCELED`, or `FAILED`. Fulfillments can be created and completed + independently + + before order completion. + access: read-only + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this fulfillment. Metadata fields + are intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + pickup_details: + type: optional + docs: >- + Contains details for a pickup fulfillment. These details are required + when the fulfillment + + type is `PICKUP`. + shipment_details: + type: optional + docs: >- + Contains details for a shipment fulfillment. These details are + required when the fulfillment type + + is `SHIPMENT`. + + + A shipment fulfillment's relationship to fulfillment `state`: + + `PROPOSED`: A shipment is requested. + + `RESERVED`: Fulfillment in progress. Shipment processing. + + `PREPARED`: Shipment packaged. Shipping label created. + + `COMPLETED`: Package has been shipped. + + `CANCELED`: Shipment has been canceled. + + `FAILED`: Shipment has failed. + delivery_details: + type: optional + docs: Describes delivery details of an order fulfillment. + source: + openapi: openapi/openapi.json + FulfillmentDeliveryDetails: + docs: Describes delivery details of an order fulfillment. + properties: + recipient: + type: optional + docs: The contact information for the person to receive the fulfillment. + schedule_type: + type: >- + optional + docs: >- + Indicates the fulfillment delivery schedule type. If `SCHEDULED`, then + + `deliver_at` is required. If `ASAP`, then `prep_time_duration` is + required. The default is `SCHEDULED`. + + See + [OrderFulfillmentDeliveryDetailsScheduleType](#type-orderfulfillmentdeliverydetailsscheduletype) + for possible values + placed_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was placed. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + + + Must be in RFC 3339 timestamp format, e.g., + "2016-09-04T23:59:33.123Z". + access: read-only + deliver_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + that represents the start of the delivery period. + + When the fulfillment `schedule_type` is `ASAP`, the field is + automatically + + set to the current time plus the `prep_time_duration`. + + Otherwise, the application can set this field while the fulfillment + `state` is + + `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the + + terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). + + + The timestamp must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + prep_time_duration: + type: optional> + docs: |- + The duration of time it takes to prepare and deliver this fulfillment. + The duration must be in RFC 3339 format (for example, "P1W3D"). + delivery_window_duration: + type: optional> + docs: >- + The time period after `deliver_at` in which to deliver the order. + + Applications can set this field when the fulfillment `state` is + + `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal + state + + such as `COMPLETED`, `CANCELED`, and `FAILED`). + + + The duration must be in RFC 3339 format (for example, "P1W3D"). + note: + type: optional> + docs: >- + Provides additional instructions about the delivery fulfillment. + + It is displayed in the Square Point of Sale application and set by the + API. + validation: + maxLength: 550 + completed_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicates when the seller completed the fulfillment. + + This field is automatically set when fulfillment `state` changes to + `COMPLETED`. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + in_progress_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicates when the seller started processing the fulfillment. + + This field is automatically set when the fulfillment `state` changes + to `RESERVED`. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + access: read-only + rejected_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was rejected. This field is + + automatically set when the fulfillment `state` changes to `FAILED`. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + access: read-only + ready_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the seller marked the fulfillment as ready for + + courier pickup. This field is automatically set when the fulfillment + `state` changes + + to PREPARED. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + access: read-only + delivered_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was delivered to the recipient. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + access: read-only + canceled_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was canceled. This field is + automatically + + set when the fulfillment `state` changes to `CANCELED`. + + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + access: read-only + cancel_reason: + type: optional> + docs: 'The delivery cancellation reason. Max length: 100 characters.' + validation: + maxLength: 100 + courier_pickup_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when an order can be picked up by the courier for delivery. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + courier_pickup_window_duration: + type: optional> + docs: >- + The time period after `courier_pickup_at` in which the courier should + pick up the order. + + The duration must be in RFC 3339 format (for example, "P1W3D"). + is_no_contact_delivery: + type: optional> + docs: Whether the delivery is preferred to be no contact. + dropoff_notes: + type: optional> + docs: >- + A note to provide additional instructions about how to deliver the + order. + validation: + maxLength: 550 + courier_provider_name: + type: optional> + docs: The name of the courier provider. + validation: + maxLength: 255 + courier_support_phone_number: + type: optional> + docs: The support phone number of the courier. + validation: + maxLength: 17 + square_delivery_id: + type: optional> + docs: The identifier for the delivery created by Square. + validation: + maxLength: 50 + external_delivery_id: + type: optional> + docs: >- + The identifier for the delivery created by the third-party courier + service. + validation: + maxLength: 50 + managed_delivery: + type: optional> + docs: >- + The flag to indicate the delivery is managed by a third party (ie + DoorDash), which means + + we may not receive all recipient information for PII purposes. + source: + openapi: openapi/openapi.json + FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType: + enum: + - SCHEDULED + - ASAP + docs: The schedule type of the delivery fulfillment. + source: + openapi: openapi/openapi.json + FulfillmentFulfillmentEntry: + docs: >- + Links an order line item to a fulfillment. Each entry must reference + + a valid `uid` for an order line item in the `line_item_uid` field, as well + as a `quantity` to + + fulfill. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the fulfillment entry only within this + order. + validation: + maxLength: 60 + line_item_uid: + type: string + docs: The `uid` from the order line item. + validation: + minLength: 1 + quantity: + type: string + docs: >- + The quantity of the line item being fulfilled, formatted as a decimal + number. + + For example, `"3"`. + + + Fulfillments for line items with a `quantity_unit` can have + non-integer quantities. + + For example, `"1.70000"`. + validation: + minLength: 1 + maxLength: 12 + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this fulfillment entry. Metadata + fields are intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + source: + openapi: openapi/openapi.json + FulfillmentFulfillmentLineItemApplication: + enum: + - ALL + - ENTRY_LIST + docs: >- + The `line_item_application` describes what order line items this + fulfillment applies + + to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment + entries. + source: + openapi: openapi/openapi.json + FulfillmentPickupDetails: + docs: Contains details necessary to fulfill a pickup order. + properties: + recipient: + type: optional + docs: >- + Information about the person to pick up this fulfillment from a + physical + + location. + expires_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when this fulfillment expires if it is not marked in + progress. The timestamp must be + + in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). The + expiration time can only be set + + up to 7 days in the future. If `expires_at` is not set, any new + payments attached to the order + + are automatically completed. + auto_complete_duration: + type: optional> + docs: >- + The duration of time after which an in progress pickup fulfillment is + automatically moved + + to the `COMPLETED` state. The duration must be in RFC 3339 format (for + example, "P1W3D"). + + + If not set, this pickup fulfillment remains in progress until it is + canceled or completed. + schedule_type: + type: optional + docs: >- + The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`. + + See + [FulfillmentPickupDetailsScheduleType](#type-fulfillmentpickupdetailsscheduletype) + for possible values + pickup_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + that represents the start of the pickup window. Must be in RFC 3339 + timestamp format, e.g., + + "2016-09-04T23:59:33.123Z". + + + For fulfillments with the schedule type `ASAP`, this is automatically + set + + to the current time plus the expected duration to prepare the + fulfillment. + pickup_window_duration: + type: optional> + docs: >- + The window of time in which the order should be picked up after the + `pickup_at` timestamp. + + Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an + + informational guideline for merchants. + prep_time_duration: + type: optional> + docs: |- + The duration of time it takes to prepare this fulfillment. + The duration must be in RFC 3339 format (for example, "P1W3D"). + note: + type: optional> + docs: >- + A note to provide additional instructions about the pickup + + fulfillment displayed in the Square Point of Sale application and set + by the API. + validation: + maxLength: 500 + placed_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was placed. The timestamp must be in + RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + accepted_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was marked in progress. The timestamp + must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + rejected_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was rejected. The timestamp must be in + RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + ready_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment is marked as ready for pickup. The + timestamp must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + expired_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment expired. The timestamp must be in RFC + 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + picked_up_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was picked up by the recipient. The + timestamp must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + canceled_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the fulfillment was canceled. The timestamp must be in + RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + cancel_reason: + type: optional> + docs: >- + A description of why the pickup was canceled. The maximum length: 100 + characters. + validation: + maxLength: 100 + is_curbside_pickup: + type: optional> + docs: >- + If set to `true`, indicates that this pickup order is for curbside + pickup, not in-store pickup. + curbside_pickup_details: + type: optional + docs: >- + Specific details for curbside pickup. These details can only be + populated if `is_curbside_pickup` is set to `true`. + source: + openapi: openapi/openapi.json + FulfillmentPickupDetailsCurbsidePickupDetails: + docs: Specific details for curbside pickup. + properties: + curbside_details: + type: optional> + docs: >- + Specific details for curbside pickup, such as parking number and + vehicle model. + validation: + maxLength: 250 + buyer_arrived_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the buyer arrived and is waiting for pickup. The + timestamp must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + source: + openapi: openapi/openapi.json + FulfillmentPickupDetailsScheduleType: + enum: + - SCHEDULED + - ASAP + docs: The schedule type of the pickup fulfillment. + source: + openapi: openapi/openapi.json + FulfillmentRecipient: + docs: Information about the fulfillment recipient. + properties: + customer_id: + type: optional> + docs: >- + The ID of the customer associated with the fulfillment. + + + If `customer_id` is provided, the fulfillment recipient's + `display_name`, + + `email_address`, and `phone_number` are automatically populated from + the + + targeted customer profile. If these fields are set in the request, the + request + + values override the information from the customer profile. If the + + targeted customer profile does not contain the necessary information + and + + these fields are left unset, the request results in an error. + validation: + maxLength: 191 + display_name: + type: optional> + docs: >- + The display name of the fulfillment recipient. This field is required. + + + If provided, the display name overrides the corresponding customer + profile value + + indicated by `customer_id`. + validation: + maxLength: 255 + email_address: + type: optional> + docs: >- + The email address of the fulfillment recipient. + + + If provided, the email address overrides the corresponding customer + profile value + + indicated by `customer_id`. + validation: + maxLength: 255 + phone_number: + type: optional> + docs: >- + The phone number of the fulfillment recipient. This field is required. + + + If provided, the phone number overrides the corresponding customer + profile value + + indicated by `customer_id`. + validation: + maxLength: 17 + address: + type: optional
+ docs: >- + The address of the fulfillment recipient. This field is required. + + + If provided, the address overrides the corresponding customer profile + value + + indicated by `customer_id`. + source: + openapi: openapi/openapi.json + FulfillmentShipmentDetails: + docs: Contains the details necessary to fulfill a shipment order. + properties: + recipient: + type: optional + docs: Information about the person to receive this shipment fulfillment. + carrier: + type: optional> + docs: >- + The shipping carrier being used to ship this fulfillment (such as UPS, + FedEx, or USPS). + validation: + maxLength: 50 + shipping_note: + type: optional> + docs: A note with additional information for the shipping carrier. + validation: + maxLength: 500 + shipping_type: + type: optional> + docs: >- + A description of the type of shipping product purchased from the + carrier + + (such as First Class, Priority, or Express). + validation: + maxLength: 50 + tracking_number: + type: optional> + docs: >- + The reference number provided by the carrier to track the shipment's + progress. + validation: + maxLength: 100 + tracking_url: + type: optional> + docs: A link to the tracking webpage on the carrier's website. + validation: + maxLength: 2000 + placed_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the shipment was requested. The timestamp must be in + RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + in_progress_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when this fulfillment was moved to the `RESERVED` state, + which indicates that preparation + + of this shipment has begun. The timestamp must be in RFC 3339 format + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + packaged_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when this fulfillment was moved to the `PREPARED` state, + which indicates that the + + fulfillment is packaged. The timestamp must be in RFC 3339 format (for + example, "2016-09-04T23:59:33.123Z"). + access: read-only + expected_shipped_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the shipment is expected to be delivered to the + shipping carrier. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + shipped_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when this fulfillment was moved to the `COMPLETED` state, + which indicates that + + the fulfillment has been given to the shipping carrier. The timestamp + must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + canceled_at: + type: optional> + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating the shipment was canceled. + + The timestamp must be in RFC 3339 format (for example, + "2016-09-04T23:59:33.123Z"). + cancel_reason: + type: optional> + docs: A description of why the shipment was canceled. + validation: + maxLength: 100 + failed_at: + type: optional + docs: >- + The + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + + indicating when the shipment failed to be completed. The timestamp + must be in RFC 3339 format + + (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + failure_reason: + type: optional> + docs: A description of why the shipment failed to be completed. + validation: + maxLength: 100 + source: + openapi: openapi/openapi.json + FulfillmentState: + enum: + - PROPOSED + - RESERVED + - PREPARED + - COMPLETED + - CANCELED + - FAILED + docs: The current state of this fulfillment. + source: + openapi: openapi/openapi.json + FulfillmentType: + enum: + - PICKUP + - SHIPMENT + - DELIVERY + docs: The type of fulfillment. + source: + openapi: openapi/openapi.json + GetBankAccountByV1IdResponse: + docs: Response object returned by GetBankAccountByV1Id. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + bank_account: + type: optional + docs: The requested `BankAccount` object. + source: + openapi: openapi/openapi.json + GetBankAccountResponse: + docs: Response object returned by `GetBankAccount`. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + bank_account: + type: optional + docs: The requested `BankAccount` object. + source: + openapi: openapi/openapi.json + GetBreakTypeResponse: + docs: >- + The response to a request to get a `BreakType`. The response contains + + the requested `BreakType` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + break_type: + type: optional + docs: The response object. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetDeviceCodeResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + device_code: + type: optional + docs: The queried DeviceCode. + source: + openapi: openapi/openapi.json + GetDeviceResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + device: + type: optional + docs: The requested `Device`. + source: + openapi: openapi/openapi.json + GetEmployeeWageResponse: + docs: >- + A response to a request to get an `EmployeeWage`. The response contains + + the requested `EmployeeWage` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + employee_wage: + type: optional + docs: The requested `EmployeeWage` object. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetInvoiceResponse: + docs: Describes a `GetInvoice` response. + properties: + invoice: + type: optional + docs: The invoice requested. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + GetPaymentRefundResponse: + docs: >- + Defines the response returned by + [GetRefund](api-endpoint:Refunds-GetPaymentRefund). + + + Note: If there are errors processing the request, the refund field might + not be + + present or it might be present in a FAILED state. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refund: + type: optional + docs: The requested `PaymentRefund`. + source: + openapi: openapi/openapi.json + GetPaymentResponse: + docs: >- + Defines the response returned by + [GetPayment](api-endpoint:Payments-GetPayment). + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + payment: + type: optional + docs: The requested `Payment`. + source: + openapi: openapi/openapi.json + GetPayoutResponse: + properties: + payout: + type: optional + docs: The requested payout. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + GetShiftResponse: + docs: |- + A response to a request to get a `Shift`. The response contains + the requested `Shift` object and might contain a set of `Error` objects if + the request resulted in errors. + properties: + shift: + type: optional + docs: The requested `Shift`. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetTeamMemberWageResponse: + docs: >- + A response to a request to get a `TeamMemberWage`. The response contains + + the requested `TeamMemberWage` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + team_member_wage: + type: optional + docs: The requested `TeamMemberWage` object. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetTerminalActionResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + action: + type: optional + docs: The requested `TerminalAction` + source: + openapi: openapi/openapi.json + GetTerminalCheckoutResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + checkout: + type: optional + docs: The requested `TerminalCheckout`. + source: + openapi: openapi/openapi.json + GetTerminalRefundResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refund: + type: optional + docs: The requested `Refund`. + source: + openapi: openapi/openapi.json + GiftCard: + docs: Represents a Square gift card. + properties: + id: + type: optional + docs: The Square-assigned ID of the gift card. + access: read-only + type: + type: GiftCardType + docs: |- + The gift card type. + See [Type](#type-type) for possible values + gan_source: + type: optional + docs: >- + The source that generated the gift card account number (GAN). The + default value is `SQUARE`. + + See [GANSource](#type-gansource) for possible values + state: + type: optional + docs: |- + The current gift card state. + See [Status](#type-status) for possible values + balance_money: + type: optional + docs: >- + The current gift card balance. This balance is always greater than or + equal to zero. + gan: + type: optional> + docs: >- + The gift card account number (GAN). Buyers can use the GAN to make + purchases or check + + the gift card balance. + created_at: + type: optional + docs: >- + The timestamp when the gift card was created, in RFC 3339 format. + + In the case of a digital gift card, it is the time when you create a + card + + (using the Square Point of Sale application, Seller Dashboard, or Gift + Cards API). + + In the case of a plastic gift card, it is the time when Square + associates the card with the + + seller at the time of activation. + access: read-only + customer_ids: + type: optional> + docs: >- + The IDs of the [customer profiles](entity:Customer) to whom this gift + card is linked. + access: read-only + source: + openapi: openapi/openapi.json + GiftCardActivity: + docs: >- + Represents an action performed on a [gift card](entity:GiftCard) that + affects its state or balance. + + A gift card activity contains information about a specific activity type. + For example, a `REDEEM` activity + + includes a `redeem_activity_details` field that contains information about + the redemption. + properties: + id: + type: optional + docs: The Square-assigned ID of the gift card activity. + access: read-only + type: + type: GiftCardActivityType + docs: |- + The type of gift card activity. + See [Type](#type-type) for possible values + location_id: + type: string + docs: >- + The ID of the [business location](entity:Location) where the activity + occurred. + created_at: + type: optional + docs: >- + The timestamp when the gift card activity was created, in RFC 3339 + format. + access: read-only + gift_card_id: + type: optional> + docs: >- + The gift card ID. When creating a gift card activity, `gift_card_id` + is not required if + + `gift_card_gan` is specified. + gift_card_gan: + type: optional> + docs: >- + The gift card account number (GAN). When creating a gift card + activity, `gift_card_gan` + + is not required if `gift_card_id` is specified. + gift_card_balance_money: + type: optional + docs: The final balance on the gift card after the action is completed. + load_activity_details: + type: optional + docs: >- + Additional details about a `LOAD` activity, which is used to reload + money onto a gift card. + activate_activity_details: + type: optional + docs: >- + Additional details about an `ACTIVATE` activity, which is used to + activate a gift card with + + an initial balance. + redeem_activity_details: + type: optional + docs: >- + Additional details about a `REDEEM` activity, which is used to redeem + a gift card for a purchase. + + + For applications that process payments using the Square Payments API, + Square creates a `REDEEM` activity that + + updates the gift card balance after the corresponding + [CreatePayment](api-endpoint:Payments-CreatePayment) + + request is completed. Applications that use a custom payment + processing system must call + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + to create the `REDEEM` activity. + clear_balance_activity_details: + type: optional + docs: >- + Additional details about a `CLEAR_BALANCE` activity, which is used to + set the balance of a gift card to zero. + deactivate_activity_details: + type: optional + docs: >- + Additional details about a `DEACTIVATE` activity, which is used to + deactivate a gift card. + adjust_increment_activity_details: + type: optional + docs: >- + Additional details about an `ADJUST_INCREMENT` activity, which is used + to add money to a gift card + + outside of a typical `ACTIVATE`, `LOAD`, or `REFUND` activity flow. + adjust_decrement_activity_details: + type: optional + docs: >- + Additional details about an `ADJUST_DECREMENT` activity, which is used + to deduct money from a gift + + card outside of a typical `REDEEM` activity flow. + refund_activity_details: + type: optional + docs: >- + Additional details about a `REFUND` activity, which is used to add + money to a gift card when + + refunding a payment. + + + For applications that refund payments to a gift card using the Square + Refunds API, Square automatically + + creates a `REFUND` activity that updates the gift card balance after a + [RefundPayment](api-endpoint:Refunds-RefundPayment) + + request is completed. Applications that use a custom processing system + must call + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + to create the `REFUND` activity. + unlinked_activity_refund_activity_details: + type: optional + docs: >- + Additional details about an `UNLINKED_ACTIVITY_REFUND` activity. This + activity is used to add money + + to a gift card when refunding a payment that was processed using a + custom payment processing system + + and not linked to the gift card. + import_activity_details: + type: optional + docs: >- + Additional details about an `IMPORT` activity, which Square uses to + import a third-party + + gift card with a balance. + block_activity_details: + type: optional + docs: >- + Additional details about a `BLOCK` activity, which Square uses to + temporarily block a gift card. + unblock_activity_details: + type: optional + docs: >- + Additional details about an `UNBLOCK` activity, which Square uses to + unblock a gift card. + import_reversal_activity_details: + type: optional + docs: >- + Additional details about an `IMPORT_REVERSAL` activity, which Square + uses to reverse the + + import of a third-party gift card. + transfer_balance_to_activity_details: + type: optional + docs: >- + Additional details about a `TRANSFER_BALANCE_TO` activity, which + Square uses to add money to + + a gift card as the result of a transfer from another gift card. + transfer_balance_from_activity_details: + type: optional + docs: >- + Additional details about a `TRANSFER_BALANCE_FROM` activity, which + Square uses to deduct money from + + a gift as the result of a transfer to another gift card. + source: + openapi: openapi/openapi.json + GiftCardActivityActivate: + docs: >- + Represents details about an `ACTIVATE` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: optional + docs: >- + The amount added to the gift card. This value is a positive integer. + + + Applications that use a custom order processing system must specify + this amount in the + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + order_id: + type: optional> + docs: >- + The ID of the [order](entity:Order) that contains the `GIFT_CARD` line + item. + + + Applications that use the Square Orders API to process orders must + specify the order ID + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + line_item_uid: + type: optional> + docs: >- + The UID of the `GIFT_CARD` line item in the order that represents the + gift card purchase. + + + Applications that use the Square Orders API to process orders must + specify the line item UID + + in the + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + reference_id: + type: optional> + docs: >- + A client-specified ID that associates the gift card activity with an + entity in another system. + + + Applications that use a custom order processing system can use this + field to track information + + related to an order or payment. + buyer_payment_instrument_ids: + type: optional>> + docs: >- + The payment instrument IDs used to process the gift card purchase, + such as a credit card ID + + or bank account ID. + + + Applications that use a custom order processing system must specify + payment instrument IDs in + + the + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + + Square uses this information to perform compliance checks. + + + For applications that use the Square Orders API to process payments, + Square has the necessary + + instrument IDs to perform compliance checks. + + + Each buyer payment instrument ID can contain a maximum of 255 + characters. + source: + openapi: openapi/openapi.json + GiftCardActivityAdjustDecrement: + docs: >- + Represents details about an `ADJUST_DECREMENT` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: Money + docs: >- + The amount deducted from the gift card balance. This value is a + positive integer. + reason: + type: GiftCardActivityAdjustDecrementReason + docs: |- + The reason the gift card balance was adjusted. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityAdjustDecrementReason: + enum: + - SUSPICIOUS_ACTIVITY + - BALANCE_ACCIDENTALLY_INCREASED + - SUPPORT_ISSUE + - PURCHASE_WAS_REFUNDED + docs: >- + Indicates the reason for deducting money from a [gift + card](entity:GiftCard). + source: + openapi: openapi/openapi.json + GiftCardActivityAdjustIncrement: + docs: >- + Represents details about an `ADJUST_INCREMENT` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: Money + docs: >- + The amount added to the gift card balance. This value is a positive + integer. + reason: + type: GiftCardActivityAdjustIncrementReason + docs: |- + The reason the gift card balance was adjusted. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityAdjustIncrementReason: + enum: + - COMPLIMENTARY + - SUPPORT_ISSUE + - TRANSACTION_VOIDED + docs: Indicates the reason for adding money to a [gift card](entity:GiftCard). + source: + openapi: openapi/openapi.json + GiftCardActivityBlock: + docs: >- + Represents details about a `BLOCK` [gift card activity + type](entity:GiftCardActivityType). + properties: + reason: + type: GiftCardActivityBlockReason + docs: |- + The reason the gift card was blocked. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityBlockReason: + type: literal<"CHARGEBACK_BLOCK"> + docs: Indicates the reason for blocking a [gift card](entity:GiftCard). + GiftCardActivityClearBalance: + docs: >- + Represents details about a `CLEAR_BALANCE` [gift card activity + type](entity:GiftCardActivityType). + properties: + reason: + type: GiftCardActivityClearBalanceReason + docs: |- + The reason the gift card balance was cleared. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityClearBalanceReason: + enum: + - SUSPICIOUS_ACTIVITY + - REUSE_GIFTCARD + - UNKNOWN_REASON + docs: >- + Indicates the reason for clearing the balance of a [gift + card](entity:GiftCard). + source: + openapi: openapi/openapi.json + GiftCardActivityCreatedEvent: + docs: Published when a [gift card activity](entity:GiftCardActivity) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `gift_card.activity.created`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardActivityCreatedEventData: + docs: Represents the data associated with a `gift_card.activity.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card_activity`. + id: + type: optional + docs: The ID of the new gift card activity. + object: + type: optional + docs: An object that contains the new gift card activity. + source: + openapi: openapi/openapi.json + GiftCardActivityCreatedEventObject: + docs: |- + An object that contains the gift card activity associated with a + `gift_card.activity.created` event. + properties: + gift_card_activity: + type: optional + docs: The new gift card activity. + source: + openapi: openapi/openapi.json + GiftCardActivityDeactivate: + docs: >- + Represents details about a `DEACTIVATE` [gift card activity + type](entity:GiftCardActivityType). + properties: + reason: + type: GiftCardActivityDeactivateReason + docs: |- + The reason the gift card was deactivated. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityDeactivateReason: + enum: + - SUSPICIOUS_ACTIVITY + - UNKNOWN_REASON + - CHARGEBACK_DEACTIVATE + docs: Indicates the reason for deactivating a [gift card](entity:GiftCard). + source: + openapi: openapi/openapi.json + GiftCardActivityImport: + docs: >- + Represents details about an `IMPORT` [gift card activity + type](entity:GiftCardActivityType). + + This activity type is used when Square imports a third-party gift card, in + which case the + + `gan_source` of the gift card is set to `OTHER`. + properties: + amount_money: + type: Money + docs: The balance amount on the imported gift card. + source: + openapi: openapi/openapi.json + GiftCardActivityImportReversal: + docs: >- + Represents details about an `IMPORT_REVERSAL` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: Money + docs: |- + The amount of money cleared from the third-party gift card when + the import was reversed. + source: + openapi: openapi/openapi.json + GiftCardActivityLoad: + docs: >- + Represents details about a `LOAD` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: optional + docs: >- + The amount added to the gift card. This value is a positive integer. + + + Applications that use a custom order processing system must specify + this amount in the + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + order_id: + type: optional> + docs: >- + The ID of the [order](entity:Order) that contains the `GIFT_CARD` line + item. + + + Applications that use the Square Orders API to process orders must + specify the order ID in the + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + line_item_uid: + type: optional> + docs: >- + The UID of the `GIFT_CARD` line item in the order that represents the + additional funds for the gift card. + + + Applications that use the Square Orders API to process orders must + specify the line item UID + + in the + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + reference_id: + type: optional> + docs: >- + A client-specified ID that associates the gift card activity with an + entity in another system. + + + Applications that use a custom order processing system can use this + field to track information related to + + an order or payment. + buyer_payment_instrument_ids: + type: optional>> + docs: >- + The payment instrument IDs used to process the order for the + additional funds, such as a credit card ID + + or bank account ID. + + + Applications that use a custom order processing system must specify + payment instrument IDs in + + the + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + + Square uses this information to perform compliance checks. + + + For applications that use the Square Orders API to process payments, + Square has the necessary + + instrument IDs to perform compliance checks. + + + Each buyer payment instrument ID can contain a maximum of 255 + characters. + source: + openapi: openapi/openapi.json + GiftCardActivityRedeem: + docs: >- + Represents details about a `REDEEM` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: Money + docs: >- + The amount deducted from the gift card for the redemption. This value + is a positive integer. + + + Applications that use a custom payment processing system must specify + this amount in the + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + request. + payment_id: + type: optional + docs: >- + The ID of the payment that represents the gift card redemption. Square + populates this field + + if the payment was processed by Square. + access: read-only + reference_id: + type: optional> + docs: >- + A client-specified ID that associates the gift card activity with an + entity in another system. + + + Applications that use a custom payment processing system can use this + field to track information + + related to an order or payment. + status: + type: optional + docs: >- + The status of the gift card redemption. Gift cards redeemed from + Square Point of Sale or the + + Square Seller Dashboard use a two-state process: `PENDING` + + to `COMPLETED` or `PENDING` to `CANCELED`. Gift cards redeemed using + the Gift Card Activities API + + always have a `COMPLETED` status. + + See [Status](#type-status) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityRedeemStatus: + enum: + - PENDING + - COMPLETED + - CANCELED + docs: >- + Indicates the status of a [gift card](entity:GiftCard) redemption. This + status is relevant only for + + redemptions made from Square products (such as Square Point of Sale) + because Square products use a + + two-state process. Gift cards redeemed using the Gift Card Activities API + always have a `COMPLETED` status. + source: + openapi: openapi/openapi.json + GiftCardActivityRefund: + docs: >- + Represents details about a `REFUND` [gift card activity + type](entity:GiftCardActivityType). + properties: + redeem_activity_id: + type: optional> + docs: >- + The ID of the refunded `REDEEM` gift card activity. Square populates + this field if the + + `payment_id` in the corresponding + [RefundPayment](api-endpoint:Refunds-RefundPayment) request + + represents a gift card redemption. + + + For applications that use a custom payment processing system, this + field is required when creating + + a `REFUND` activity. The provided `REDEEM` activity ID must be linked + to the same gift card. + amount_money: + type: optional + docs: >- + The amount added to the gift card for the refund. This value is a + positive integer. + + + This field is required when creating a `REFUND` activity. The amount + can represent a full or partial refund. + reference_id: + type: optional> + docs: >- + A client-specified ID that associates the gift card activity with an + entity in another system. + payment_id: + type: optional + docs: >- + The ID of the refunded payment. Square populates this field if the + refund is for a + + payment processed by Square. This field matches the `payment_id` in + the corresponding + + [RefundPayment](api-endpoint:Refunds-RefundPayment) request. + access: read-only + source: + openapi: openapi/openapi.json + GiftCardActivityTransferBalanceFrom: + docs: >- + Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity + type](entity:GiftCardActivityType). + properties: + transfer_to_gift_card_id: + type: string + docs: The ID of the gift card to which the specified amount was transferred. + amount_money: + type: Money + docs: >- + The amount deducted from the gift card for the transfer. This value is + a positive integer. + source: + openapi: openapi/openapi.json + GiftCardActivityTransferBalanceTo: + docs: >- + Represents details about a `TRANSFER_BALANCE_TO` [gift card activity + type](entity:GiftCardActivityType). + properties: + transfer_from_gift_card_id: + type: string + docs: >- + The ID of the gift card from which the specified amount was + transferred. + amount_money: + type: Money + docs: >- + The amount added to the gift card balance for the transfer. This value + is a positive integer. + source: + openapi: openapi/openapi.json + GiftCardActivityType: + enum: + - ACTIVATE + - LOAD + - REDEEM + - CLEAR_BALANCE + - DEACTIVATE + - ADJUST_INCREMENT + - ADJUST_DECREMENT + - REFUND + - UNLINKED_ACTIVITY_REFUND + - IMPORT + - BLOCK + - UNBLOCK + - IMPORT_REVERSAL + - TRANSFER_BALANCE_FROM + - TRANSFER_BALANCE_TO + docs: Indicates the type of [gift card activity](entity:GiftCardActivity). + source: + openapi: openapi/openapi.json + GiftCardActivityUnblock: + docs: >- + Represents details about an `UNBLOCK` [gift card activity + type](entity:GiftCardActivityType). + properties: + reason: + type: GiftCardActivityUnblockReason + docs: |- + The reason the gift card was unblocked. + See [Reason](#type-reason) for possible values + source: + openapi: openapi/openapi.json + GiftCardActivityUnblockReason: + type: literal<"CHARGEBACK_UNBLOCK"> + docs: Indicates the reason for unblocking a [gift card](entity:GiftCard). + GiftCardActivityUnlinkedActivityRefund: + docs: >- + Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity + type](entity:GiftCardActivityType). + properties: + amount_money: + type: Money + docs: >- + The amount added to the gift card for the refund. This value is a + positive integer. + reference_id: + type: optional> + docs: >- + A client-specified ID that associates the gift card activity with an + entity in another system. + payment_id: + type: optional + docs: >- + The ID of the refunded payment. This field is not used starting in + Square version 2022-06-16. + access: read-only + source: + openapi: openapi/openapi.json + GiftCardActivityUpdatedEvent: + docs: >- + Published when a [gift card activity](entity:GiftCardActivity) is + updated. + + Subscribe to this event to be notified about the following changes: + + - An update to the `REDEEM` activity for a gift card redemption made from + a Square product (such as Square Point of Sale). + + These redemptions are initially assigned a `PENDING` state, but then + change to a `COMPLETED` or `CANCELED` state. + + - An update to the `IMPORT` activity for an imported gift card when the + balance is later adjusted by Square. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `gift_card.activity.updated`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardActivityUpdatedEventData: + docs: The data associated with a `gift_card.activity.updated` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card_activity`. + id: + type: optional + docs: The ID of the updated gift card activity. + object: + type: optional + docs: An object that contains the updated gift card activity. + source: + openapi: openapi/openapi.json + GiftCardActivityUpdatedEventObject: + docs: |- + An object that contains the gift card activity associated with a + `gift_card.activity.updated` event. + properties: + gift_card_activity: + type: optional + docs: The updated gift card activity. + source: + openapi: openapi/openapi.json + GiftCardCreatedEvent: + docs: Published when a [gift card](entity:GiftCard) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: The type of event. For this event, the value is `gift_card.created`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardCreatedEventData: + docs: The data associated with a `gift_card.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card`. + id: + type: optional + docs: The ID of the new gift card. + object: + type: optional + docs: An object that contains the new gift card. + source: + openapi: openapi/openapi.json + GiftCardCreatedEventObject: + docs: >- + An object that contains the gift card associated with a + `gift_card.created` event. + properties: + gift_card: + type: optional + docs: The new gift card. + source: + openapi: openapi/openapi.json + GiftCardCustomerLinkedEvent: + docs: >- + Published when a [customer](entity:Customer) is linked to a [gift + card](entity:GiftCard). + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `gift_card.customer_linked`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardCustomerLinkedEventData: + docs: The data associated with a `gift_card.customer_linked` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card`. + id: + type: optional + docs: The ID of the updated gift card. + object: + type: optional + docs: >- + An object that contains the updated gift card and the ID of the linked + customer. + source: + openapi: openapi/openapi.json + GiftCardCustomerLinkedEventObject: + docs: |- + An object that contains the gift card and customer ID associated with a + `gift_card.customer_linked` event. + properties: + gift_card: + type: optional + docs: The gift card with the updated `customer_ids` field. + linked_customer_id: + type: optional> + docs: The ID of the linked [customer](entity:Customer). + source: + openapi: openapi/openapi.json + GiftCardCustomerUnlinkedEvent: + docs: >- + Published when a [customer](entity:Customer) is unlinked from a [gift + card](entity:GiftCard). + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `gift_card.customer_unlinked`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardCustomerUnlinkedEventData: + docs: The data associated with a `gift_card.customer_unlinked` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card`. + id: + type: optional + docs: The ID of the updated gift card. + object: + type: optional + docs: >- + An object that contains the updated gift card and the ID of the + unlinked customer. + source: + openapi: openapi/openapi.json + GiftCardCustomerUnlinkedEventObject: + docs: >- + An object that contains the gift card and the customer ID associated with + a + + `gift_card.customer_linked` event. + properties: + gift_card: + type: optional + docs: |- + The gift card with the updated `customer_ids` field. + The field is removed if the gift card is not linked to any customers. + unlinked_customer_id: + type: optional> + docs: The ID of the unlinked [customer](entity:Customer). + source: + openapi: openapi/openapi.json + GiftCardGanSource: + enum: + - SQUARE + - OTHER + docs: |- + Indicates the source that generated the gift card + account number (GAN). + source: + openapi: openapi/openapi.json + GiftCardStatus: + enum: + - ACTIVE + - DEACTIVATED + - BLOCKED + - PENDING + docs: Indicates the gift card state. + source: + openapi: openapi/openapi.json + GiftCardType: + enum: + - PHYSICAL + - DIGITAL + docs: Indicates the gift card type. + source: + openapi: openapi/openapi.json + GiftCardUpdatedEvent: + docs: |- + Published when a [gift card](entity:GiftCard) is updated. This includes + changes to the state, balance, and customer association. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. For this event, the value is + `gift_card.updated`. + event_id: + type: optional> + docs: >- + The unique ID of the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + GiftCardUpdatedEventData: + docs: The data associated with a `gift_card.updated` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `gift_card`. + id: + type: optional + docs: The ID of the updated gift card. + object: + type: optional + docs: An object that contains the updated gift card. + source: + openapi: openapi/openapi.json + GiftCardUpdatedEventObject: + docs: >- + An object that contains the gift card associated with a + `gift_card.updated` event. + properties: + gift_card: + type: optional + docs: >- + The gift card with the updated `balance_money`, `state`, or + `customer_ids` field. + + Some events can affect both `balance_money` and `state`. + source: + openapi: openapi/openapi.json + InventoryAdjustment: + docs: |- + Represents a change in state or quantity of product inventory at a + particular time and location. + properties: + id: + type: optional + docs: |- + A unique ID generated by Square for the + `InventoryAdjustment`. + validation: + maxLength: 100 + reference_id: + type: optional> + docs: |- + An optional ID provided by the application to tie the + `InventoryAdjustment` to an external + system. + validation: + maxLength: 255 + from_state: + type: optional + docs: |- + The [inventory state](entity:InventoryState) of the related quantity + of items before the adjustment. + See [InventoryState](#type-inventorystate) for possible values + to_state: + type: optional + docs: |- + The [inventory state](entity:InventoryState) of the related quantity + of items after the adjustment. + See [InventoryState](#type-inventorystate) for possible values + location_id: + type: optional> + docs: >- + The Square-generated ID of the [Location](entity:Location) where the + related + + quantity of items is being tracked. + validation: + maxLength: 100 + catalog_object_id: + type: optional> + docs: |- + The Square-generated ID of the + [CatalogObject](entity:CatalogObject) being tracked. + validation: + maxLength: 100 + catalog_object_type: + type: optional> + docs: >- + The [type](entity:CatalogObjectType) of the + [CatalogObject](entity:CatalogObject) being tracked. + + + The Inventory API supports setting and reading the + `"catalog_object_type": "ITEM_VARIATION"` field value. + + In addition, it can also read the `"catalog_object_type": "ITEM"` + field value that is set by the Square Restaurants app. + validation: + maxLength: 14 + quantity: + type: optional> + docs: |- + The number of items affected by the adjustment as a decimal string. + Can support up to 5 digits after the decimal point. + validation: + maxLength: 26 + total_price_money: + type: optional + docs: |- + The total price paid for goods associated with the + adjustment. Present if and only if `to_state` is `SOLD`. Always + non-negative. + occurred_at: + type: optional> + docs: >- + A client-generated RFC 3339-formatted timestamp that indicates when + + the inventory adjustment took place. For inventory adjustment updates, + the `occurred_at` + + timestamp cannot be older than 24 hours or in the future relative to + the + + time of the request. + validation: + maxLength: 34 + created_at: + type: optional + docs: >- + An RFC 3339-formatted timestamp that indicates when the inventory + adjustment is received. + validation: + maxLength: 34 + access: read-only + source: + type: optional + docs: |- + Information about the application that caused the + inventory adjustment. + employee_id: + type: optional> + docs: >- + The Square-generated ID of the [Employee](entity:Employee) responsible + for the + + inventory adjustment. + validation: + maxLength: 100 + team_member_id: + type: optional> + docs: >- + The Square-generated ID of the [Team Member](entity:TeamMember) + responsible for the + + inventory adjustment. + validation: + maxLength: 100 + transaction_id: + type: optional + docs: |- + The Square-generated ID of the [Transaction](entity:Transaction) that + caused the adjustment. Only relevant for payment-related state + transitions. + validation: + maxLength: 255 + access: read-only + refund_id: + type: optional + docs: |- + The Square-generated ID of the [Refund](entity:Refund) that + caused the adjustment. Only relevant for refund-related state + transitions. + validation: + maxLength: 255 + access: read-only + purchase_order_id: + type: optional + docs: >- + The Square-generated ID of the purchase order that caused the + + adjustment. Only relevant for state transitions from the Square for + Retail + + app. + validation: + maxLength: 100 + access: read-only + goods_receipt_id: + type: optional + docs: >- + The Square-generated ID of the goods receipt that caused the + + adjustment. Only relevant for state transitions from the Square for + Retail + + app. + validation: + maxLength: 100 + access: read-only + adjustment_group: + type: optional + docs: >- + An adjustment group bundling the related adjustments of item + variations through stock conversions in a single inventory event. + source: + openapi: openapi/openapi.json + InventoryAdjustmentGroup: + properties: + id: + type: optional + docs: |- + A unique ID generated by Square for the + `InventoryAdjustmentGroup`. + validation: + maxLength: 100 + access: read-only + root_adjustment_id: + type: optional + docs: The inventory adjustment of the composed variation. + validation: + maxLength: 100 + access: read-only + from_state: + type: optional + docs: >- + Representative `from_state` for adjustments within the group. For + example, for a group adjustment from `IN_STOCK` to `SOLD`, + + there can be two component adjustments in the group: one from + `IN_STOCK`to `COMPOSED` and the other one from `COMPOSED` to `SOLD`. + + Here, the representative `from_state` for the + `InventoryAdjustmentGroup` is `IN_STOCK`. + + See [InventoryState](#type-inventorystate) for possible values + to_state: + type: optional + docs: >- + Representative `to_state` for adjustments within group. For example, + for a group adjustment from `IN_STOCK` to `SOLD`, + + the two component adjustments in the group can be from `IN_STOCK` to + `COMPOSED` and from `COMPOSED` to `SOLD`. + + Here, the representative `to_state` of the `InventoryAdjustmentGroup` + is `SOLD`. + + See [InventoryState](#type-inventorystate) for possible values + source: + openapi: openapi/openapi.json + InventoryAlertType: + enum: + - NONE + - LOW_QUANTITY + docs: >- + Indicates whether Square should alert the merchant when the inventory + quantity of a CatalogItemVariation is low. + source: + openapi: openapi/openapi.json + InventoryChange: + docs: |- + Represents a single physical count, inventory, adjustment, or transfer + that is part of the history of inventory changes for a particular + [CatalogObject](entity:CatalogObject) instance. + properties: + type: + type: optional + docs: >- + Indicates how the inventory change is applied. See + + [InventoryChangeType](entity:InventoryChangeType) for all possible + values. + + See [InventoryChangeType](#type-inventorychangetype) for possible + values + physical_count: + type: optional + docs: |- + Contains details about the physical count when `type` is + `PHYSICAL_COUNT`, and is unset for all other change types. + adjustment: + type: optional + docs: |- + Contains details about the inventory adjustment when `type` is + `ADJUSTMENT`, and is unset for all other change types. + transfer: + type: optional + docs: >- + Contains details about the inventory transfer when `type` is + + `TRANSFER`, and is unset for all other change types. + + + _Note:_ An [InventoryTransfer](entity:InventoryTransfer) object can + only be set in the input to the + + [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) + endpoint when the seller has an active Retail Plus subscription. + measurement_unit: + type: optional + docs: >- + The [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object + representing the catalog measurement unit associated with the + inventory change. + measurement_unit_id: + type: optional + docs: >- + The ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) + object representing the catalog measurement unit associated with the + inventory change. + access: read-only + source: + openapi: openapi/openapi.json + InventoryChangeType: + enum: + - PHYSICAL_COUNT + - ADJUSTMENT + - TRANSFER + docs: >- + Indicates how the inventory change was applied to a tracked product + quantity. + source: + openapi: openapi/openapi.json + InventoryCount: + docs: >- + Represents Square-estimated quantity of items in a particular state at a + + particular seller location based on the known history of physical counts + and + + inventory adjustments. + properties: + catalog_object_id: + type: optional> + docs: |- + The Square-generated ID of the + [CatalogObject](entity:CatalogObject) being tracked. + validation: + maxLength: 100 + catalog_object_type: + type: optional> + docs: >- + The [type](entity:CatalogObjectType) of the + [CatalogObject](entity:CatalogObject) being tracked. + + + The Inventory API supports setting and reading the + `"catalog_object_type": "ITEM_VARIATION"` field value. + + In addition, it can also read the `"catalog_object_type": "ITEM"` + field value that is set by the Square Restaurants app. + validation: + maxLength: 14 + state: + type: optional + docs: |- + The current [inventory state](entity:InventoryState) for the related + quantity of items. + See [InventoryState](#type-inventorystate) for possible values + location_id: + type: optional> + docs: >- + The Square-generated ID of the [Location](entity:Location) where the + related + + quantity of items is being tracked. + validation: + maxLength: 100 + quantity: + type: optional> + docs: >- + The number of items affected by the estimated count as a decimal + string. + + Can support up to 5 digits after the decimal point. + validation: + maxLength: 26 + calculated_at: + type: optional + docs: >- + An RFC 3339-formatted timestamp that indicates when the most recent + physical count or adjustment affecting + + the estimated count is received. + validation: + maxLength: 34 + access: read-only + is_estimated: + type: optional + docs: >- + Whether the inventory count is for composed variation (TRUE) or not + (FALSE). If true, the inventory count will not be present in the + response of + + any of these endpoints: + [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory), + + [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges), + + [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts), + and + + [RetrieveInventoryChanges](api-endpoint:Inventory-RetrieveInventoryChanges). + access: read-only + source: + openapi: openapi/openapi.json + InventoryCountUpdatedEvent: + docs: |- + Published when the quantity is updated for a + [CatalogItemVariation](entity:CatalogItemVariation). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InventoryCountUpdatedEventData: + properties: + type: + type: optional> + docs: >- + Name of the affected object’s type. For this event, the value is + `inventory_counts`. + id: + type: optional + docs: ID of the affected object. + object: + type: optional + docs: >- + An object containing fields and values relevant to the event. Is + absent if affected object was deleted. + source: + openapi: openapi/openapi.json + InventoryCountUpdatedEventObject: + properties: + inventory_counts: + type: optional>> + docs: The inventory counts. + source: + openapi: openapi/openapi.json + InventoryPhysicalCount: + docs: >- + 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. + properties: + id: + type: optional + docs: |- + A unique Square-generated ID for the + [InventoryPhysicalCount](entity:InventoryPhysicalCount). + validation: + maxLength: 100 + reference_id: + type: optional> + docs: |- + An optional ID provided by the application to tie the + [InventoryPhysicalCount](entity:InventoryPhysicalCount) to an external + system. + validation: + maxLength: 255 + catalog_object_id: + type: optional> + docs: |- + The Square-generated ID of the + [CatalogObject](entity:CatalogObject) being tracked. + validation: + maxLength: 100 + catalog_object_type: + type: optional> + docs: >- + The [type](entity:CatalogObjectType) of the + [CatalogObject](entity:CatalogObject) being tracked. + + + The Inventory API supports setting and reading the + `"catalog_object_type": "ITEM_VARIATION"` field value. + + In addition, it can also read the `"catalog_object_type": "ITEM"` + field value that is set by the Square Restaurants app. + validation: + maxLength: 14 + state: + type: optional + docs: |- + The current [inventory state](entity:InventoryState) for the related + quantity of items. + See [InventoryState](#type-inventorystate) for possible values + location_id: + type: optional> + docs: >- + The Square-generated ID of the [Location](entity:Location) where the + related + + quantity of items is being tracked. + validation: + maxLength: 100 + quantity: + type: optional> + docs: >- + The number of items affected by the physical count as a decimal + string. + + The number can support up to 5 digits after the decimal point. + validation: + maxLength: 26 + source: + type: optional + docs: |- + Information about the application with which the + physical count is submitted. + employee_id: + type: optional> + docs: >- + The Square-generated ID of the [Employee](entity:Employee) responsible + for the + + physical count. + validation: + maxLength: 100 + team_member_id: + type: optional> + docs: >- + The Square-generated ID of the [Team Member](entity:TeamMember) + responsible for the + + physical count. + validation: + maxLength: 100 + occurred_at: + type: optional> + docs: >- + A client-generated RFC 3339-formatted timestamp that indicates when + + the physical count was examined. For physical count updates, the + `occurred_at` + + timestamp cannot be older than 24 hours or in the future relative to + the + + time of the request. + validation: + maxLength: 34 + created_at: + type: optional + docs: >- + An RFC 3339-formatted timestamp that indicates when the physical count + is received. + validation: + maxLength: 34 + access: read-only + source: + openapi: openapi/openapi.json + InventoryState: + enum: + - CUSTOM + - IN_STOCK + - SOLD + - RETURNED_BY_CUSTOMER + - RESERVED_FOR_SALE + - SOLD_ONLINE + - ORDERED_FROM_VENDOR + - RECEIVED_FROM_VENDOR + - IN_TRANSIT_TO + - NONE + - WASTE + - UNLINKED_RETURN + - COMPOSED + - DECOMPOSED + - SUPPORTED_BY_NEWER_VERSION + - IN_TRANSIT + docs: Indicates the state of a tracked item quantity in the lifecycle of goods. + source: + openapi: openapi/openapi.json + InventoryTransfer: + docs: |- + Represents the transfer of a quantity of product inventory at a + particular time from one location to another. + properties: + id: + type: optional + docs: |- + A unique ID generated by Square for the + `InventoryTransfer`. + validation: + maxLength: 100 + reference_id: + type: optional> + docs: |- + An optional ID provided by the application to tie the + `InventoryTransfer` to an external system. + validation: + maxLength: 255 + state: + type: optional + docs: |- + The [inventory state](entity:InventoryState) for the quantity of + items being transferred. + See [InventoryState](#type-inventorystate) for possible values + from_location_id: + type: optional> + docs: >- + The Square-generated ID of the [Location](entity:Location) where the + related + + quantity of items was tracked before the transfer. + validation: + maxLength: 100 + to_location_id: + type: optional> + docs: >- + The Square-generated ID of the [Location](entity:Location) where the + related + + quantity of items was tracked after the transfer. + validation: + maxLength: 100 + catalog_object_id: + type: optional> + docs: |- + The Square-generated ID of the + [CatalogObject](entity:CatalogObject) being tracked. + validation: + maxLength: 100 + catalog_object_type: + type: optional> + docs: >- + The [type](entity:CatalogObjectType) of the + [CatalogObject](entity:CatalogObject) being tracked. + + + The Inventory API supports setting and reading the + `"catalog_object_type": "ITEM_VARIATION"` field value. + + In addition, it can also read the `"catalog_object_type": "ITEM"` + field value that is set by the Square Restaurants app. + validation: + maxLength: 14 + quantity: + type: optional> + docs: |- + The number of items affected by the transfer as a decimal string. + Can support up to 5 digits after the decimal point. + validation: + maxLength: 26 + occurred_at: + type: optional> + docs: >- + A client-generated RFC 3339-formatted timestamp that indicates when + + the transfer took place. For write actions, the `occurred_at` + timestamp + + cannot be older than 24 hours or in the future relative to the time of + the + + request. + validation: + maxLength: 34 + created_at: + type: optional + docs: |- + An RFC 3339-formatted timestamp that indicates when Square + received the transfer request. + validation: + maxLength: 34 + access: read-only + source: + type: optional + docs: |- + Information about the application that initiated the + inventory transfer. + employee_id: + type: optional> + docs: >- + The Square-generated ID of the [Employee](entity:Employee) responsible + for the + + inventory transfer. + validation: + maxLength: 100 + team_member_id: + type: optional> + docs: >- + The Square-generated ID of the [Team Member](entity:TeamMember) + responsible for the + + inventory transfer. + validation: + maxLength: 100 + source: + openapi: openapi/openapi.json + Invoice: + docs: >- + Stores information about an invoice. You use the Invoices API to create + and manage + + invoices. For more information, see [Invoices API + Overview](https://developer.squareup.com/docs/invoices-api/overview). + properties: + id: + type: optional + docs: The Square-assigned ID of the invoice. + access: read-only + version: + type: optional + docs: >- + The Square-assigned version number, which is incremented each time an + update is committed to the invoice. + location_id: + type: optional> + docs: >- + The ID of the location that this invoice is associated with. + + + If specified in a `CreateInvoice` request, the value must match the + `location_id` of the associated order. + validation: + minLength: 1 + maxLength: 255 + order_id: + type: optional> + docs: >- + The ID of the [order](entity:Order) for which the invoice is created. + + This field is required when creating an invoice, and the order must be + in the `OPEN` state. + + + To view the line items and other information for the associated order, + call the + + [RetrieveOrder](api-endpoint:Orders-RetrieveOrder) endpoint using the + order ID. + validation: + minLength: 1 + maxLength: 255 + primary_recipient: + type: optional + docs: >- + The customer who receives the invoice. This customer data is displayed + on the invoice and used by Square to deliver the invoice. + + + This field is required to publish an invoice, and it must specify the + `customer_id`. + payment_requests: + type: optional>> + docs: >- + The payment schedule for the invoice, represented by one or more + payment requests that + + define payment settings, such as amount due and due date. An invoice + supports the following payment request combinations: + + - One balance + + - One deposit with one balance + + - 2–12 installments + + - One deposit with 2–12 installments + + + This field is required when creating an invoice. It must contain at + least one payment request. + + All payment requests for the invoice must equal the total order + amount. For more information, see + + [Configuring payment + requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). + + + Adding `INSTALLMENT` payment requests to an invoice requires an + + [Invoices Plus + subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). + delivery_method: + type: optional + docs: >- + The delivery method that Square uses to send the invoice, reminders, + and receipts to + + the customer. After the invoice is published, Square processes the + invoice based on the delivery + + method and payment request settings, either immediately or on the + `scheduled_at` date, if specified. + + For example, Square might send the invoice or receipt for an automatic + payment. For invoices with + + automatic payments, this field must be set to `EMAIL`. + + + One of the following is required when creating an invoice: + + - (Recommended) This `delivery_method` field. To configure an + automatic payment, the + + `automatic_payment_source` field of the payment request is also + required. + + - The deprecated `request_method` field of the payment request. Note + that `invoice` + + objects returned in responses do not include `request_method`. + + See [InvoiceDeliveryMethod](#type-invoicedeliverymethod) for possible + values + invoice_number: + type: optional> + docs: >- + A user-friendly invoice number that is displayed on the invoice. The + value is unique within a location. + + If not provided when creating an invoice, Square assigns a value. + + It increments from 1 and is padded with zeros making it 7 characters + long + + (for example, 0000001 and 0000002). + validation: + minLength: 1 + maxLength: 191 + title: + type: optional> + docs: The title of the invoice, which is displayed on the invoice. + validation: + minLength: 1 + maxLength: 255 + description: + type: optional> + docs: The description of the invoice, which is displayed on the invoice. + validation: + minLength: 1 + maxLength: 65536 + scheduled_at: + type: optional> + docs: >- + The timestamp when the invoice is scheduled for processing, in RFC + 3339 format. + + After the invoice is published, Square processes the invoice on the + specified date, + + according to the delivery method and payment request settings. + + + If the field is not set, Square processes the invoice immediately + after it is published. + public_url: + type: optional + docs: >- + A temporary link to the Square-hosted payment page where the customer + can pay the + + invoice. If the link expires, customers can provide the email address + or phone number + + associated with the invoice and request a new link directly from the + expired payment page. + + + This field is added after the invoice is published and reaches the + scheduled date + + (if one is defined). + access: read-only + next_payment_amount_money: + type: optional + docs: >- + The current amount due for the invoice. In addition to the + + amount due on the next payment request, this includes any overdue + payment amounts. + status: + type: optional + docs: |- + The status of the invoice. + See [InvoiceStatus](#type-invoicestatus) for possible values + timezone: + type: optional + docs: >- + The time zone used to interpret calendar dates on the invoice, such as + `due_date`. + + When an invoice is created, this field is set to the `timezone` + specified for the seller + + location. The value cannot be changed. + + + For example, a payment `due_date` of 2021-03-09 with a `timezone` of + America/Los\_Angeles + + becomes overdue at midnight on March 9 in America/Los\_Angeles (which + equals a UTC timestamp + + of 2021-03-10T08:00:00Z). + access: read-only + created_at: + type: optional + docs: The timestamp when the invoice was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the invoice was last updated, in RFC 3339 format. + access: read-only + accepted_payment_methods: + type: optional + docs: >- + The payment methods that customers can use to pay the invoice on the + Square-hosted + + invoice page. This setting is independent of any automatic payment + requests for the invoice. + + + This field is required when creating an invoice and must set at least + one payment method to `true`. + custom_fields: + type: optional>> + docs: >- + Additional seller-defined fields that are displayed on the invoice. + For more information, see + + [Custom + fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields). + + + Adding custom fields to an invoice requires an + + [Invoices Plus + subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). + + + Max: 2 custom fields + subscription_id: + type: optional + docs: >- + The ID of the [subscription](entity:Subscription) associated with the + invoice. + + This field is present only on subscription billing invoices. + access: read-only + sale_or_service_date: + type: optional> + docs: >- + The date of the sale or the date that the service is rendered, in + `YYYY-MM-DD` format. + + This field can be used to specify a past or future date which is + displayed on the invoice. + payment_conditions: + type: optional> + docs: >- + **France only.** The payment terms and conditions that are displayed + on the invoice. For more information, + + see [Payment + conditions](https://developer.squareup.com/docs/invoices-api/overview#payment-conditions). + + + For countries other than France, Square returns an + `INVALID_REQUEST_ERROR` with a `BAD_REQUEST` code and + + "Payment conditions are not supported for this location's country" + detail if this field is included in `CreateInvoice` or `UpdateInvoice` + requests. + validation: + minLength: 1 + maxLength: 2000 + store_payment_method_enabled: + type: optional> + docs: >- + Indicates whether to allow a customer to save a credit or debit card + as a card on file or a bank transfer as a + + bank account on file. If `true`, Square displays a __Save my card on + file__ or __Save my bank on file__ checkbox on the + + invoice payment page. Stored payment information can be used for + future automatic payments. The default value is `false`. + attachments: + type: optional> + docs: >- + Metadata about the attachments on the invoice. Invoice attachments are + managed using the + + [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) + and + [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) + endpoints. + access: read-only + creator_team_member_id: + type: optional + docs: >- + The ID of the [team member](entity:TeamMember) who created the + invoice. + + This field is present only on invoices created in the Square Dashboard + or Square Invoices app by a logged-in team member. + access: read-only + source: + openapi: openapi/openapi.json + InvoiceAcceptedPaymentMethods: + docs: >- + The payment methods that customers can use to pay an + [invoice](entity:Invoice) on the Square-hosted invoice payment page. + properties: + card: + type: optional> + docs: >- + Indicates whether credit card or debit card payments are accepted. The + default value is `false`. + square_gift_card: + type: optional> + docs: >- + Indicates whether Square gift card payments are accepted. The default + value is `false`. + bank_account: + type: optional> + docs: >- + Indicates whether ACH bank transfer payments are accepted. The default + value is `false`. + buy_now_pay_later: + type: optional> + docs: >- + Indicates whether Afterpay (also known as Clearpay) payments are + accepted. The default value is `false`. + + + This option is allowed only for invoices that have a single payment + request of the `BALANCE` type. This payment method is + + supported if the seller account accepts Afterpay payments and the + seller location is in a country where Afterpay + + invoice payments are supported. As a best practice, consider enabling + an additional payment method when allowing + + `buy_now_pay_later` payments. For more information, including detailed + requirements and processing limits, see + + [Buy Now Pay Later payments with + Afterpay](https://developer.squareup.com/docs/invoices-api/overview#buy-now-pay-later). + cash_app_pay: + type: optional> + docs: >- + Indicates whether Cash App payments are accepted. The default value is + `false`. + + + This payment method is supported only for seller + [locations](entity:Location) in the United States. + source: + openapi: openapi/openapi.json + InvoiceAttachment: + docs: Represents a file attached to an [invoice](entity:Invoice). + properties: + id: + type: optional + docs: The Square-assigned ID of the attachment. + access: read-only + filename: + type: optional + docs: The file name of the attachment, which is displayed on the invoice. + access: read-only + description: + type: optional + docs: |- + The description of the attachment, which is displayed on the invoice. + This field maps to the seller-defined **Message** field. + access: read-only + filesize: + type: optional + docs: The file size of the attachment in bytes. + access: read-only + hash: + type: optional + docs: The MD5 hash that was generated from the file contents. + access: read-only + mime_type: + type: optional + docs: >- + The mime type of the attachment. + + The following mime types are supported: + + image/gif, image/jpeg, image/png, image/tiff, image/bmp, + application/pdf. + access: read-only + uploaded_at: + type: optional + docs: The timestamp when the attachment was uploaded, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + InvoiceAutomaticPaymentSource: + enum: + - NONE + - CARD_ON_FILE + - BANK_ON_FILE + docs: >- + Indicates the automatic payment method for an [invoice payment + request](entity:InvoicePaymentRequest). + source: + openapi: openapi/openapi.json + InvoiceCanceledEvent: + docs: Published when an [Invoice](entity:Invoice) is canceled. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.canceled"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceCanceledEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the canceled invoice. + source: + openapi: openapi/openapi.json + InvoiceCanceledEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoiceCreatedEvent: + docs: Published when an [Invoice](entity:Invoice) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the created invoice. + source: + openapi: openapi/openapi.json + InvoiceCreatedEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoiceCustomField: + docs: >- + An additional seller-defined and customer-facing field to include on the + invoice. For more information, + + see [Custom + fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields). + + + Adding custom fields to an invoice requires an + + [Invoices Plus + subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). + properties: + label: + type: optional> + docs: >- + The label or title of the custom field. This field is required for a + custom field. + validation: + maxLength: 30 + value: + type: optional> + docs: The text of the custom field. If omitted, only the label is rendered. + validation: + maxLength: 2000 + placement: + type: optional + docs: >- + The location of the custom field on the invoice. This field is + required for a custom field. + + See [InvoiceCustomFieldPlacement](#type-invoicecustomfieldplacement) + for possible values + source: + openapi: openapi/openapi.json + InvoiceCustomFieldPlacement: + enum: + - ABOVE_LINE_ITEMS + - BELOW_LINE_ITEMS + docs: >- + Indicates where to render a custom field on the Square-hosted invoice page + and in emailed or PDF + + copies of the invoice. + source: + openapi: openapi/openapi.json + InvoiceDeletedEvent: + docs: Published when a draft [Invoice](entity:Invoice) is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceDeletedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + deleted: + type: optional> + docs: Indicates that the invoice was deleted. + source: + openapi: openapi/openapi.json + InvoiceDeliveryMethod: + enum: + - EMAIL + - SHARE_MANUALLY + - SMS + docs: >- + Indicates how Square delivers the [invoice](entity:Invoice) to the + customer. + source: + openapi: openapi/openapi.json + InvoiceFilter: + docs: Describes query filters to apply. + properties: + location_ids: + docs: |- + Limits the search to the specified locations. A location is required. + In the current implementation, only one location can be specified. + type: list + customer_ids: + type: optional>> + docs: >- + Limits the search to the specified customers, within the specified + locations. + + Specifying a customer is optional. In the current implementation, + + a maximum of one customer can be specified. + source: + openapi: openapi/openapi.json + InvoicePaymentMadeEvent: + docs: >- + Published when a payment that is associated with an + [invoice](entity:Invoice) is completed. + + For more information about invoice payments, see [Pay an + invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#pay-invoice). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.payment_made"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoicePaymentMadeEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the invoice that was paid. + source: + openapi: openapi/openapi.json + InvoicePaymentMadeEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoicePaymentReminder: + docs: >- + Describes a payment request reminder (automatic notification) that Square + sends + + to the customer. You configure a reminder relative to the payment request + + `due_date`. + properties: + uid: + type: optional + docs: |- + A Square-assigned ID that uniquely identifies the reminder within the + `InvoicePaymentRequest`. + access: read-only + relative_scheduled_days: + type: optional> + docs: >- + The number of days before (a negative number) or after (a positive + number) + + the payment request `due_date` when the reminder is sent. For example, + -3 indicates that + + the reminder should be sent 3 days before the payment request + `due_date`. + validation: + min: -32767 + max: 32767 + message: + type: optional> + docs: The reminder message. + validation: + minLength: 1 + maxLength: 1000 + status: + type: optional + docs: >- + The status of the reminder. + + See [InvoicePaymentReminderStatus](#type-invoicepaymentreminderstatus) + for possible values + sent_at: + type: optional + docs: If sent, the timestamp when the reminder was sent, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + InvoicePaymentReminderStatus: + enum: + - PENDING + - NOT_APPLICABLE + - SENT + docs: The status of a payment request reminder. + source: + openapi: openapi/openapi.json + InvoicePaymentRequest: + docs: >- + Represents a payment request for an [invoice](entity:Invoice). Invoices + can specify a maximum + + of 13 payment requests, with up to 12 `INSTALLMENT` request types. For + more information, + + see [Configuring payment + requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). + + + Adding `INSTALLMENT` payment requests to an invoice requires an + + [Invoices Plus + subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). + properties: + uid: + type: optional> + docs: >- + The Square-generated ID of the payment request in an + [invoice](entity:Invoice). + validation: + minLength: 1 + maxLength: 255 + request_method: + type: optional + docs: >- + Indicates how Square processes the payment request. DEPRECATED at + version 2021-01-21. Replaced by the + + `Invoice.delivery_method` and + `InvoicePaymentRequest.automatic_payment_source` fields. + + + One of the following is required when creating an invoice: + + - (Recommended) The `delivery_method` field of the invoice. To + configure an automatic payment, the + + `automatic_payment_source` field of the payment request is also + required. + + - This `request_method` field. Note that `invoice` objects returned in + responses do not include `request_method`. + + See [InvoiceRequestMethod](#type-invoicerequestmethod) for possible + values + request_type: + type: optional + docs: >- + Identifies the payment request type. This type defines how the payment + request amount is determined. + + This field is required to create a payment request. + + See [InvoiceRequestType](#type-invoicerequesttype) for possible values + due_date: + type: optional> + docs: >- + The due date (in the invoice's time zone) for the payment request, in + `YYYY-MM-DD` format. This field + + is required to create a payment request. If an + `automatic_payment_source` is defined for the request, Square + + charges the payment source on this date. + + + After this date, the invoice becomes overdue. For example, a payment + `due_date` of 2021-03-09 with a `timezone` + + of America/Los\_Angeles becomes overdue at midnight on March 9 in + America/Los\_Angeles (which equals a UTC + + timestamp of 2021-03-10T08:00:00Z). + fixed_amount_requested_money: + type: optional + docs: >- + If the payment request specifies `DEPOSIT` or `INSTALLMENT` as the + `request_type`, + + this indicates the request amount. + + You cannot specify this when `request_type` is `BALANCE` or when the + + payment request includes the `percentage_requested` field. + percentage_requested: + type: optional> + docs: >- + Specifies the amount for the payment request in percentage: + + + - When the payment `request_type` is `DEPOSIT`, it is the percentage + of the order's total amount. + + - When the payment `request_type` is `INSTALLMENT`, it is the + percentage of the order's total less + + the deposit, if requested. The sum of the `percentage_requested` in + all installment + + payment requests must be equal to 100. + + + You cannot specify this when the payment `request_type` is `BALANCE` + or when the + + payment request specifies the `fixed_amount_requested_money` field. + tipping_enabled: + type: optional> + docs: >- + If set to true, the Square-hosted invoice page (the `public_url` field + of the invoice) + + provides a place for the customer to pay a tip. + + + This field is allowed only on the final payment request + + and the payment `request_type` must be `BALANCE` or `INSTALLMENT`. + automatic_payment_source: + type: optional + docs: >- + The payment method for an automatic payment. + + + The default value is `NONE`. + + See + [InvoiceAutomaticPaymentSource](#type-invoiceautomaticpaymentsource) + for possible values + card_id: + type: optional> + docs: >- + The ID of the credit or debit card on file to charge for the payment + request. To get the cards on file for a customer, + + call [ListCards](api-endpoint:Cards-ListCards) and include the + `customer_id` of the invoice recipient. + validation: + minLength: 1 + maxLength: 255 + reminders: + type: optional>> + docs: A list of one or more reminders to send for the payment request. + computed_amount_money: + type: optional + docs: >- + The amount of the payment request, computed using the order amount and + information from the various payment + + request fields (`request_type`, `fixed_amount_requested_money`, and + `percentage_requested`). + total_completed_amount_money: + type: optional + docs: >- + The amount of money already paid for the specific payment request. + + This amount might include a rounding adjustment if the most recent + invoice payment + + was in cash in a currency that rounds cash payments (such as, `CAD` or + `AUD`). + rounding_adjustment_included_money: + type: optional + docs: >- + If the most recent payment was a cash payment + + in a currency that rounds cash payments (such as, `CAD` or `AUD`) and + the payment + + is rounded from `computed_amount_money` in the payment request, then + this + + field specifies the rounding adjustment applied. This amount + + might be negative. + source: + openapi: openapi/openapi.json + InvoicePublishedEvent: + docs: >- + Published when an [Invoice](entity:Invoice) transitions from a draft to a + non-draft status. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.published"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoicePublishedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the published invoice. + source: + openapi: openapi/openapi.json + InvoicePublishedEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoiceQuery: + docs: Describes query criteria for searching invoices. + properties: + filter: + type: InvoiceFilter + docs: >- + Query filters to apply in searching invoices. + + For more information, see [Search for + invoices](https://developer.squareup.com/docs/invoices-api/retrieve-list-search-invoices#search-invoices). + sort: + type: optional + docs: Describes the sort order for the search result. + source: + openapi: openapi/openapi.json + InvoiceRecipient: + docs: >- + Represents a snapshot of customer data. This object stores customer data + that is displayed on the invoice + + and that Square uses to deliver the invoice. + + + When you provide a customer ID for a draft invoice, Square retrieves the + associated customer profile and populates + + the remaining `InvoiceRecipient` fields. You cannot update these fields + after the invoice is published. + + Square updates the customer ID in response to a merge operation, but does + not update other fields. + properties: + customer_id: + type: optional> + docs: |- + The ID of the customer. This is the customer profile ID that + you provide when creating a draft invoice. + validation: + minLength: 1 + maxLength: 255 + given_name: + type: optional + docs: The recipient's given (that is, first) name. + access: read-only + family_name: + type: optional + docs: The recipient's family (that is, last) name. + access: read-only + email_address: + type: optional + docs: The recipient's email address. + access: read-only + address: + type: optional
+ docs: The recipient's physical address. + phone_number: + type: optional + docs: The recipient's phone number. + access: read-only + company_name: + type: optional + docs: The name of the recipient's company. + access: read-only + tax_ids: + type: optional + docs: >- + The recipient's tax IDs. The country of the seller account determines + whether this field + + is available for the customer. For more information, see [Invoice + recipient tax + IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids). + source: + openapi: openapi/openapi.json + InvoiceRecipientTaxIds: + docs: >- + Represents the tax IDs for an invoice recipient. The country of the seller + account determines + + whether the corresponding `tax_ids` field is available for the customer. + For more information, + + see [Invoice recipient tax + IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids). + properties: + eu_vat: + type: optional + docs: >- + The EU VAT identification number for the invoice recipient. For + example, `IE3426675K`. + access: read-only + source: + openapi: openapi/openapi.json + InvoiceRefundedEvent: + docs: >- + Published when a refund is applied toward a payment of an + [invoice](entity:Invoice). + + For more information about invoice refunds, see [Refund an + invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#refund-invoice). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.refunded"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceRefundedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the refunded invoice. + source: + openapi: openapi/openapi.json + InvoiceRefundedEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoiceRequestMethod: + enum: + - EMAIL + - CHARGE_CARD_ON_FILE + - SHARE_MANUALLY + - CHARGE_BANK_ON_FILE + - SMS + - SMS_CHARGE_CARD_ON_FILE + - SMS_CHARGE_BANK_ON_FILE + docs: >- + Specifies the action for Square to take for processing the invoice. For + example, + + email the invoice, charge a customer's card on file, or do nothing. + DEPRECATED at + + version 2021-01-21. The corresponding `request_method` field is replaced + by the + + `Invoice.delivery_method` and + `InvoicePaymentRequest.automatic_payment_source` fields. + source: + openapi: openapi/openapi.json + InvoiceRequestType: + enum: + - BALANCE + - DEPOSIT + - INSTALLMENT + docs: >- + Indicates the type of the payment request. For more information, see + + [Configuring payment + requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). + source: + openapi: openapi/openapi.json + InvoiceScheduledChargeFailedEvent: + docs: >- + Published when an automatic scheduled payment for an + [Invoice](entity:Invoice) has failed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: >- + The type of event this represents, + `"invoice.scheduled_charge_failed"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceScheduledChargeFailedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: >- + An object containing the invoice that experienced the failed scheduled + charge. + source: + openapi: openapi/openapi.json + InvoiceScheduledChargeFailedEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + InvoiceSort: + docs: Identifies the sort field and sort order. + properties: + field: + type: InvoiceSortField + docs: |- + The field to use for sorting. + See [InvoiceSortField](#type-invoicesortfield) for possible values + order: + type: optional + docs: |- + The order to use for sorting the results. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + InvoiceSortField: + type: literal<"INVOICE_SORT_DATE"> + docs: The field to use for sorting. + InvoiceStatus: + enum: + - DRAFT + - UNPAID + - SCHEDULED + - PARTIALLY_PAID + - PAID + - PARTIALLY_REFUNDED + - REFUNDED + - CANCELED + - FAILED + - PAYMENT_PENDING + docs: Indicates the status of an [invoice](entity:Invoice). + source: + openapi: openapi/openapi.json + InvoiceUpdatedEvent: + docs: Published when an [Invoice](entity:Invoice) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"invoice.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + InvoiceUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"invoice"`. + id: + type: optional + docs: ID of the affected invoice. + object: + type: optional + docs: An object containing the updated invoice. + source: + openapi: openapi/openapi.json + InvoiceUpdatedEventObject: + properties: + invoice: + type: optional + docs: The related invoice. + source: + openapi: openapi/openapi.json + ItemVariationLocationOverrides: + docs: >- + Price and inventory alerting overrides for a `CatalogItemVariation` at a + specific `Location`. + properties: + location_id: + type: optional> + docs: >- + The ID of the `Location`. This can include locations that are + deactivated. + price_money: + type: optional + docs: >- + The price of the `CatalogItemVariation` at the given `Location`, or + blank for variable pricing. + pricing_type: + type: optional + docs: >- + The pricing type (fixed or variable) for the `CatalogItemVariation` at + the given `Location`. + + See [CatalogPricingType](#type-catalogpricingtype) for possible values + track_inventory: + type: optional> + docs: >- + If `true`, inventory tracking is active for the `CatalogItemVariation` + at this `Location`. + inventory_alert_type: + type: optional + docs: >- + Indicates whether the `CatalogItemVariation` displays an alert when + its inventory + + quantity is less than or equal to its `inventory_alert_threshold`. + + See [InventoryAlertType](#type-inventoryalerttype) for possible values + inventory_alert_threshold: + type: optional> + docs: >- + If the inventory quantity for the variation is less than or equal to + this value and `inventory_alert_type` + + is `LOW_QUANTITY`, the variation displays an alert in the merchant + dashboard. + + + This value is always an integer. + sold_out: + type: optional + docs: >- + Indicates whether the overridden item variation is sold out at the + specified location. + + + When inventory tracking is enabled on the item variation either + globally or at the specified location, + + the item variation is automatically marked as sold out when its + inventory count reaches zero. The seller + + can manually set the item variation as sold out even when the + inventory count is greater than zero. + + Attempts by an application to set this attribute are ignored. + Regardless how the sold-out status is set, + + applications should treat its inventory count as zero when this + attribute value is `true`. + access: read-only + sold_out_valid_until: + type: optional + docs: >- + The seller-assigned timestamp, of the RFC 3339 format, to indicate + when this sold-out variation + + becomes available again at the specified location. Attempts by an + application to set this attribute are ignored. + + When the current time is later than this attribute value, the affected + item variation is no longer sold out. + access: read-only + source: + openapi: openapi/openapi.json + Job: + docs: >- + Represents a job that can be assigned to [team + members](entity:TeamMember). This object defines the + + job's title and tip eligibility. Compensation is defined in a [job + assignment](entity:JobAssignment) + + in a team member's wage setting. + properties: + id: + type: optional + docs: >- + **Read only** The unique Square-assigned ID of the job. If you need a + job ID for an API request, + + call [ListJobs](api-endpoint:Team-ListJobs) or use the ID returned + when you created the job. + + You can also get job IDs from a team member's wage setting. + title: + type: optional> + docs: The title of the job. + validation: + maxLength: 150 + is_tip_eligible: + type: optional> + docs: Indicates whether team members can earn tips for the job. + created_at: + type: optional + docs: The timestamp when the job was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the job was last updated, in RFC 3339 format. + access: read-only + version: + type: optional + docs: >- + **Read only** The current version of the job. Include this field in + `UpdateJob` requests to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) + + control and avoid overwrites from concurrent requests. Requests fail + if the provided version doesn't + + match the server version at the time of the request. + source: + openapi: openapi/openapi.json + JobAssignment: + docs: >- + Represents a job assigned to a [team member](entity:TeamMember), including + the compensation the team + + member earns for the job. Job assignments are listed in the team member's + [wage setting](entity:WageSetting). + properties: + job_title: + type: optional> + docs: The title of the job. + pay_type: + type: JobAssignmentPayType + docs: >- + The current pay type for the job assignment used to + + calculate the pay amount in a pay period. + + See [JobAssignmentPayType](#type-jobassignmentpaytype) for possible + values + hourly_rate: + type: optional + docs: >- + The hourly pay rate of the job. For `SALARY` pay types, Square + calculates the hourly rate based on + + `annual_rate` and `weekly_hours`. + annual_rate: + type: optional + docs: >- + The total pay amount for a 12-month period on the job. Set if the job + `PayType` is `SALARY`. + weekly_hours: + type: optional> + docs: >- + The planned hours per week for the job. Set if the job `PayType` is + `SALARY`. + job_id: + type: optional> + docs: The ID of the [job](entity:Job). + source: + openapi: openapi/openapi.json + JobAssignmentPayType: + enum: + - NONE + - HOURLY + - SALARY + docs: Enumerates the possible pay types that a job can be assigned. + source: + openapi: openapi/openapi.json + JobCreatedEvent: + docs: Published when a Job is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"job.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + JobCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"job"`. + id: + type: optional + docs: ID of the created job. + object: + type: optional + docs: An object containing the created job. + source: + openapi: openapi/openapi.json + JobCreatedEventObject: + properties: + job: + type: optional + docs: The created job. + source: + openapi: openapi/openapi.json + JobUpdatedEvent: + docs: Published when a Job is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"job.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + JobUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"job"`. + id: + type: optional + docs: ID of the updated job. + object: + type: optional + docs: An object containing the updated job. + source: + openapi: openapi/openapi.json + JobUpdatedEventObject: + properties: + job: + type: optional + docs: The updated job. + source: + openapi: openapi/openapi.json + LaborScheduledShiftCreatedEvent: + docs: Published when a [ScheduledShift](entity:ScheduledShift) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + location_id: + type: optional> + docs: The ID of the location associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.scheduled_shift.created`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborScheduledShiftCreatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `scheduled_shift`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the affected `ScheduledShift`. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the affected `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborScheduledShiftCreatedEventObject: + properties: + ScheduledShift: + type: optional + docs: The new `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborScheduledShiftDeletedEvent: + docs: Published when a [ScheduledShift](entity:ScheduledShift) is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + location_id: + type: optional> + docs: The ID of the location associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.scheduled_shift.deleted`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborScheduledShiftDeletedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `scheduled_shift`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the affected `ScheduledShift`. + validation: + maxLength: 255 + deleted: + type: optional> + docs: Is true if the affected object was deleted. Otherwise absent. + source: + openapi: openapi/openapi.json + LaborScheduledShiftPublishedEvent: + docs: Published when a [ScheduledShift](entity:ScheduledShift) is published. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + location_id: + type: optional> + docs: The ID of the location associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.scheduled_shift.published`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborScheduledShiftPublishedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `scheduled_shift`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the affected `ScheduledShift`. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the affected `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborScheduledShiftPublishedEventObject: + properties: + ScheduledShift: + type: optional + docs: The published `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborScheduledShiftUpdatedEvent: + docs: Published when a [ScheduledShift](entity:ScheduledShift) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + location_id: + type: optional> + docs: The ID of the location associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.scheduled_shift.updated`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborScheduledShiftUpdatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `scheduled_shift`. + validation: + maxLength: 50 + id: + type: optional + docs: The ID of the affected `ScheduledShift`. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the affected `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborScheduledShiftUpdatedEventObject: + properties: + ScheduledShift: + type: optional + docs: The updated `ScheduledShift`. + source: + openapi: openapi/openapi.json + LaborShiftCreatedEvent: + docs: >- + Published when a worker starts a [Shift](entity:Shift). + + + Deprecated at Square API version 2025-05-21. Replaced by + `labor.timecard.created`. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + type: + type: optional> + docs: The type of event. For this event, the value is `labor.shift.created`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborShiftCreatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `shift`. + id: + type: optional + docs: The ID of the affected `Shift`. + object: + type: optional + docs: An object containing the affected `Shift`. + source: + openapi: openapi/openapi.json + LaborShiftCreatedEventObject: + properties: + shift: + type: optional + docs: The new `Shift`. + source: + openapi: openapi/openapi.json + LaborShiftDeletedEvent: + docs: >- + Published when a [Shift](entity:Shift) is deleted. + + + Deprecated at Square API version 2025-05-21. Replaced by + `labor.timecard.deleted`. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + type: + type: optional> + docs: The type of event. For this event, the value is `labor.shift.deleted`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborShiftDeletedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `shift`. + id: + type: optional + docs: The ID of the affected `Shift`. + deleted: + type: optional> + docs: Is true if the affected object was deleted. Otherwise absent. + source: + openapi: openapi/openapi.json + LaborShiftUpdatedEvent: + docs: >- + Published when a [Shift](entity:Shift) is updated. + + + Deprecated at Square API version 2025-05-21. Replaced by + `labor.timecard.updated`. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + type: + type: optional> + docs: The type of event. For this event, the value is `labor.shift.updated`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborShiftUpdatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `shift`. + id: + type: optional + docs: ID of the affected `Shift`. + object: + type: optional + docs: An object containing the affected `Shift`. + source: + openapi: openapi/openapi.json + LaborShiftUpdatedEventObject: + properties: + shift: + type: optional + docs: The updated `Shift`. + source: + openapi: openapi/openapi.json + LaborTimecardCreatedEvent: + docs: Published when a worker starts a [Timecard](entity:Timecard). + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.timecard.created`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborTimecardCreatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `timecard`. + id: + type: optional + docs: The ID of the affected `Timecard`. + object: + type: optional + docs: An object containing the affected `Timecard`. + source: + openapi: openapi/openapi.json + LaborTimecardCreatedEventObject: + properties: + timecard: + type: optional + docs: The new `Timecard`. + source: + openapi: openapi/openapi.json + LaborTimecardDeletedEvent: + docs: Published when a [Timecard](entity:Timecard) is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.timecard.deleted`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborTimecardDeletedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `timecard`. + id: + type: optional + docs: The ID of the affected `Timecard`. + deleted: + type: optional> + docs: Is true if the affected object was deleted. Otherwise absent. + source: + openapi: openapi/openapi.json + LaborTimecardUpdatedEvent: + docs: Published when a [Timecard](entity:Timecard) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the merchant associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `labor.timecard.updated`. + event_id: + type: optional> + docs: The unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LaborTimecardUpdatedEventData: + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `timecard`. + id: + type: optional + docs: The ID of the affected `Timecard`. + object: + type: optional + docs: An object containing the affected `Timecard`. + source: + openapi: openapi/openapi.json + LaborTimecardUpdatedEventObject: + properties: + timecard: + type: optional + docs: The updated `Timecard`. + source: + openapi: openapi/openapi.json + LinkCustomerToGiftCardResponse: + docs: >- + A response that contains the linked `GiftCard` object. If the request + resulted in errors, + + the response contains a set of `Error` objects. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: >- + The gift card with the ID of the linked customer listed in the + `customer_ids` field. + source: + openapi: openapi/openapi.json + ListBankAccountsResponse: + docs: Response object returned by ListBankAccounts. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + bank_accounts: + type: optional> + docs: List of BankAccounts associated with this account. + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can + + use in a subsequent request to fetch next set of bank accounts. + + If empty, this is the final response. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + source: + openapi: openapi/openapi.json + ListBookingCustomAttributeDefinitionsResponse: + docs: >- + Represents a + [ListBookingCustomAttributeDefinitions](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributeDefinitions) + response. + + Either `custom_attribute_definitions`, an empty object, or `errors` is + present in the response. + + If additional results are available, the `cursor` field is also present + along with `custom_attribute_definitions`. + properties: + custom_attribute_definitions: + type: optional> + docs: >- + The retrieved custom attribute definitions. If no custom attribute + definitions are found, + + Square returns an empty object (`{}`). + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of + + results for your original request. This field is present only if the + request succeeded and + + additional results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListBookingCustomAttributesResponse: + docs: >- + Represents a + [ListBookingCustomAttributes](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributes) + response. + + Either `custom_attributes`, an empty object, or `errors` is present in the + response. If additional + + results are available, the `cursor` field is also present along with + `custom_attributes`. + properties: + custom_attributes: + type: optional> + docs: >- + The retrieved custom attributes. If `with_definitions` was set to + `true` in the request, + + the custom attribute definition is returned in the `definition` field + of each custom attribute. + + + If no custom attributes are found, Square returns an empty object + (`{}`). + cursor: + type: optional + docs: >- + The cursor to use in your next call to this endpoint to retrieve the + next page of results + + for your original request. This field is present only if the request + succeeded and additional + + results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListBookingsResponse: + properties: + bookings: + type: optional> + docs: The list of targeted bookings. + cursor: + type: optional + docs: >- + The pagination cursor to be used in the subsequent request to get the + next page of the results. Stop retrieving the next page of the results + when the cursor is not set. + validation: + maxLength: 65536 + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListBreakTypesResponse: + docs: >- + The response to a request for a set of `BreakType` objects. The response + contains + + the requested `BreakType` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + break_types: + type: optional> + docs: ' A page of `BreakType` results.' + cursor: + type: optional + docs: |- + The value supplied in the subsequent request to fetch the next page + of `BreakType` results. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListCardsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [ListCards](api-endpoint:Cards-ListCards) endpoint. + + + Note: if there are errors processing the request, the card field will not + be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + cards: + type: optional> + docs: The requested list of `Card`s. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + source: + openapi: openapi/openapi.json + ListCashDrawerShiftEventsResponse: + properties: + cursor: + type: optional + docs: |- + Opaque cursor for fetching the next page. Cursor is not present in + the last page of results. + errors: + type: optional> + docs: Any errors that occurred during the request. + cash_drawer_shift_events: + type: optional> + docs: |- + All of the events (payments, refunds, etc.) for a cash drawer during + the shift. + source: + openapi: openapi/openapi.json + ListCashDrawerShiftsResponse: + properties: + cursor: + type: optional + docs: |- + Opaque cursor for fetching the next page of results. Cursor is not + present in the last page of results. + errors: + type: optional> + docs: Any errors that occurred during the request. + cash_drawer_shifts: + type: optional> + docs: |- + A collection of CashDrawerShiftSummary objects for shifts that match + the query. + source: + openapi: openapi/openapi.json + ListCatalogResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + this is the final response. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + objects: + type: optional> + docs: The CatalogObjects returned. + source: + openapi: openapi/openapi.json + ListChannelsRequestConstants: literal<"MAX_PAGE_SIZE"> + ListChannelsResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + channels: + type: optional> + docs: List of requested Channel. + cursor: + type: optional + docs: The token required to retrieve the next page of results. + source: + openapi: openapi/openapi.json + ListCustomerCustomAttributeDefinitionsResponse: + docs: >- + Represents a + [ListCustomerCustomAttributeDefinitions](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributeDefinitions) + response. + + Either `custom_attribute_definitions`, an empty object, or `errors` is + present in the response. + + If additional results are available, the `cursor` field is also present + along with `custom_attribute_definitions`. + properties: + custom_attribute_definitions: + type: optional> + docs: >- + The retrieved custom attribute definitions. If no custom attribute + definitions are found, + + Square returns an empty object (`{}`). + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of + + results for your original request. This field is present only if the + request succeeded and + + additional results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListCustomerCustomAttributesResponse: + docs: >- + Represents a + [ListCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributes) + response. + + Either `custom_attributes`, an empty object, or `errors` is present in the + response. If additional + + results are available, the `cursor` field is also present along with + `custom_attributes`. + properties: + custom_attributes: + type: optional> + docs: >- + The retrieved custom attributes. If `with_definitions` was set to + `true` in the request, + + the custom attribute definition is returned in the `definition` field + of each custom attribute. + + + If no custom attributes are found, Square returns an empty object + (`{}`). + cursor: + type: optional + docs: >- + The cursor to use in your next call to this endpoint to retrieve the + next page of results + + for your original request. This field is present only if the request + succeeded and additional + + results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListCustomerGroupsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [ListCustomerGroups](api-endpoint:CustomerGroups-ListCustomerGroups) + endpoint. + + + Either `errors` or `groups` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + groups: + type: optional> + docs: A list of customer groups belonging to the current seller. + cursor: + type: optional + docs: >- + A pagination cursor to retrieve the next set of results for your + + original query to the endpoint. This value is present only if the + request + + succeeded and additional results are available. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListCustomerSegmentsResponse: + docs: >- + Defines the fields that are included in the response body for requests to + the `ListCustomerSegments` endpoint. + + + Either `errors` or `segments` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + segments: + type: optional> + docs: >- + The list of customer segments belonging to the associated Square + account. + cursor: + type: optional + docs: >- + A pagination cursor to be used in subsequent calls to + `ListCustomerSegments` + + to retrieve the next set of query results. The cursor is only present + if the request succeeded and + + additional results are available. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListCustomersResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the `ListCustomers` endpoint. + + + Either `errors` or `customers` is present in a given response (never + both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + customers: + type: optional> + docs: >- + The customer profiles associated with the Square account or an empty + object (`{}`) if none are found. + + Only customer profiles with public information (`given_name`, + `family_name`, `company_name`, `email_address`, or + + `phone_number`) are included in the response. + cursor: + type: optional + docs: >- + A pagination cursor to retrieve the next set of results for the + + original query. A cursor is only present if the request succeeded and + additional results + + are available. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + count: + type: optional + docs: >- + The total count of customers associated with the Square account. Only + customer profiles with public information + + (`given_name`, `family_name`, `company_name`, `email_address`, or + `phone_number`) are counted. This field is present + + only if `count` is set to `true` in the request. + source: + openapi: openapi/openapi.json + ListDeviceCodesResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + device_codes: + type: optional> + docs: The queried DeviceCode. + cursor: + type: optional + docs: >- + A pagination cursor to retrieve the next set of results for your + + original query to the endpoint. This value is present only if the + request + + succeeded and additional results are available. + + + See [Paginating + results](https://developer.squareup.com/docs/working-with-apis/pagination) + for more information. + source: + openapi: openapi/openapi.json + ListDevicesResponse: + properties: + errors: + type: optional> + docs: Information about errors that occurred during the request. + devices: + type: optional> + docs: The requested list of `Device` objects. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + source: + openapi: openapi/openapi.json + ListDisputeEvidenceResponse: + docs: Defines the fields in a `ListDisputeEvidence` response. + properties: + evidence: + type: optional> + docs: The list of evidence previously uploaded to the specified dispute. + errors: + type: optional> + docs: Information about errors encountered during the request. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. + + If unset, this is the final response. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListDisputesResponse: + docs: Defines fields in a `ListDisputes` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + disputes: + type: optional> + docs: The list of disputes. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. + + If unset, this is the final response. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListEmployeeWagesResponse: + docs: >- + The response to a request for a set of `EmployeeWage` objects. The + response contains + + a set of `EmployeeWage` objects. + properties: + employee_wages: + type: optional> + docs: A page of `EmployeeWage` results. + cursor: + type: optional + docs: |- + The value supplied in the subsequent request to fetch the next page + of `EmployeeWage` results. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListEmployeesResponse: + properties: + employees: optional> + cursor: + type: optional + docs: The token to be used to retrieve the next page of results. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListEventTypesResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [ListEventTypes](api-endpoint:Events-ListEventTypes) + endpoint. + + + Note: if there are errors processing the request, the event types field + will not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + event_types: + type: optional> + docs: The list of event types. + metadata: + type: optional> + docs: >- + Contains the metadata of an event type. For more information, see + [EventTypeMetadata](entity:EventTypeMetadata). + source: + openapi: openapi/openapi.json + ListGiftCardActivitiesResponse: + docs: >- + A response that contains a list of `GiftCardActivity` objects. If the + request resulted in errors, + + the response contains a set of `Error` objects. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card_activities: + type: optional> + docs: >- + The requested gift card activities or an empty object if none are + found. + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can use in + a + + subsequent request to retrieve the next set of activities. If a cursor + is not present, this is + + the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + source: + openapi: openapi/openapi.json + ListGiftCardsResponse: + docs: >- + A response that contains a list of `GiftCard` objects. If the request + resulted in errors, + + the response contains a set of `Error` objects. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_cards: + type: optional> + docs: The requested gift cards or an empty object if none are found. + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can use in + a + + subsequent request to retrieve the next set of gift cards. If a cursor + is not present, this is + + the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + source: + openapi: openapi/openapi.json + ListInvoicesResponse: + docs: Describes a `ListInvoice` response. + properties: + invoices: + type: optional> + docs: The invoices retrieved. + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can use in + a + + subsequent request to retrieve the next set of invoices. If empty, + this is the final + + response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + ListJobsResponse: + docs: >- + Represents a [ListJobs](api-endpoint:Team-ListJobs) response. Either + `jobs` or `errors` + + is present in the response. If additional results are available, the + `cursor` field is also present. + properties: + jobs: + type: optional> + docs: The retrieved jobs. A single paged response contains up to 100 jobs. + cursor: + type: optional + docs: >- + An opaque cursor used to retrieve the next page of results. This field + is present only + + if the request succeeded and additional results are available. For + more information, see + + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListLocationBookingProfilesResponse: + properties: + location_booking_profiles: + type: optional> + docs: The list of a seller's location booking profiles. + cursor: + type: optional + docs: >- + The pagination cursor to be used in the subsequent request to get the + next page of the results. Stop retrieving the next page of the results + when the cursor is not set. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListLocationCustomAttributeDefinitionsResponse: + docs: >- + Represents a + [ListLocationCustomAttributeDefinitions](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributeDefinitions) + response. + + Either `custom_attribute_definitions`, an empty object, or `errors` is + present in the response. + + If additional results are available, the `cursor` field is also present + along with `custom_attribute_definitions`. + properties: + custom_attribute_definitions: + type: optional> + docs: >- + The retrieved custom attribute definitions. If no custom attribute + definitions are found, + + Square returns an empty object (`{}`). + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of + + results for your original request. This field is present only if the + request succeeded and + + additional results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListLocationCustomAttributesResponse: + docs: >- + Represents a + [ListLocationCustomAttributes](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributes) + response. + + Either `custom_attributes`, an empty object, or `errors` is present in the + response. If additional + + results are available, the `cursor` field is also present along with + `custom_attributes`. + properties: + custom_attributes: + type: optional> + docs: >- + The retrieved custom attributes. If `with_definitions` was set to + `true` in the request, + + the custom attribute definition is returned in the `definition` field + of each custom attribute. + + If no custom attributes are found, Square returns an empty object + (`{}`). + cursor: + type: optional + docs: >- + The cursor to use in your next call to this endpoint to retrieve the + next page of results + + for your original request. This field is present only if the request + succeeded and additional + + results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListLocationsResponse: + docs: >- + Defines the fields that are included in the response body of a request + + to the [ListLocations](api-endpoint:Locations-ListLocations) endpoint. + + + Either `errors` or `locations` is present in a given response (never + both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + locations: + type: optional> + docs: The business locations. + source: + openapi: openapi/openapi.json + ListLoyaltyProgramsResponse: + docs: A response that contains all loyalty programs. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + programs: + type: optional> + docs: A list of `LoyaltyProgram` for the merchant. + source: + openapi: openapi/openapi.json + ListLoyaltyPromotionsResponse: + docs: >- + Represents a + [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) + response. + + One of `loyalty_promotions`, an empty object, or `errors` is present in + the response. + + If additional results are available, the `cursor` field is also present + along with `loyalty_promotions`. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_promotions: + type: optional> + docs: The retrieved loyalty promotions. + cursor: + type: optional + docs: >- + The cursor to use in your next call to this endpoint to retrieve the + next page of results + + for your original request. This field is present only if the request + succeeded and additional + + results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListMerchantCustomAttributeDefinitionsResponse: + docs: >- + Represents a + [ListMerchantCustomAttributeDefinitions](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributeDefinitions) + response. + + Either `custom_attribute_definitions`, an empty object, or `errors` is + present in the response. + + If additional results are available, the `cursor` field is also present + along with `custom_attribute_definitions`. + properties: + custom_attribute_definitions: + type: optional> + docs: >- + The retrieved custom attribute definitions. If no custom attribute + definitions are found, + + Square returns an empty object (`{}`). + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of + + results for your original request. This field is present only if the + request succeeded and + + additional results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListMerchantCustomAttributesResponse: + docs: >- + Represents a + [ListMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributes) + response. + + Either `custom_attributes`, an empty object, or `errors` is present in the + response. If additional + + results are available, the `cursor` field is also present along with + `custom_attributes`. + properties: + custom_attributes: + type: optional> + docs: >- + The retrieved custom attributes. If `with_definitions` was set to + `true` in the request, + + the custom attribute definition is returned in the `definition` field + of each custom attribute. + + If no custom attributes are found, Square returns an empty object + (`{}`). + cursor: + type: optional + docs: >- + The cursor to use in your next call to this endpoint to retrieve the + next page of results + + for your original request. This field is present only if the request + succeeded and additional + + results are available. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListMerchantsResponse: + docs: >- + The response object returned by the + [ListMerchant](api-endpoint:Merchants-ListMerchants) endpoint. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + merchant: + type: optional> + docs: The requested `Merchant` entities. + cursor: + type: optional + docs: >- + If the response is truncated, the cursor to use in next request to + fetch next set of objects. + source: + openapi: openapi/openapi.json + ListOrderCustomAttributeDefinitionsResponse: + docs: Represents a response from listing order custom attribute definitions. + properties: + custom_attribute_definitions: + docs: >- + The retrieved custom attribute definitions. If no custom attribute + definitions are found, Square returns an empty object (`{}`). + type: list + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of results for your original request. + + This field is present only if the request succeeded and additional + results are available. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + validation: + minLength: 1 + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListOrderCustomAttributesResponse: + docs: Represents a response from listing order custom attributes. + properties: + custom_attributes: + type: optional> + docs: >- + The retrieved custom attributes. If no custom attribute are found, + Square returns an empty object (`{}`). + cursor: + type: optional + docs: >- + The cursor to provide in your next call to this endpoint to retrieve + the next page of results for your original request. + + This field is present only if the request succeeded and additional + results are available. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + validation: + minLength: 1 + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListPaymentLinksResponse: + properties: + errors: + type: optional> + docs: Errors that occurred during the request. + payment_links: + type: optional> + docs: The list of payment links. + cursor: + type: optional + docs: >2- + When a response is truncated, it includes a cursor that you can use in a subsequent request + to retrieve the next set of gift cards. If a cursor is not present, + this is the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListPaymentRefundsRequestSortField: + enum: + - CREATED_AT + - UPDATED_AT + source: + openapi: openapi/openapi.json + ListPaymentRefundsResponse: + docs: >- + Defines the response returned by + [ListPaymentRefunds](api-endpoint:Refunds-ListPaymentRefunds). + + + Either `errors` or `refunds` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refunds: + type: optional> + docs: The list of requested refunds. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListPaymentsRequestSortField: + enum: + - CREATED_AT + - OFFLINE_CREATED_AT + - UPDATED_AT + source: + openapi: openapi/openapi.json + ListPaymentsResponse: + docs: >- + Defines the response returned by + [ListPayments](api-endpoint:Payments-ListPayments). + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + payments: + type: optional> + docs: The requested list of payments. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListPayoutEntriesResponse: + docs: The response to retrieve payout records entries. + properties: + payout_entries: + type: optional> + docs: >- + The requested list of payout entries, ordered with the given or + default sort order. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + this is the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + ListPayoutsResponse: + docs: The response to retrieve payout records entries. + properties: + payouts: + type: optional> + docs: The requested list of payouts. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + this is the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + ListSitesResponse: + docs: >- + Represents a `ListSites` response. The response can include either `sites` + or `errors`. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + sites: + type: optional> + docs: The sites that belong to the seller. + source: + openapi: openapi/openapi.json + ListSubscriptionEventsResponse: + docs: >- + Defines output parameters in a response from the + + [ListSubscriptionEvents](api-endpoint:Subscriptions-ListSubscriptionEvents). + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription_events: + type: optional> + docs: The retrieved subscription events. + cursor: + type: optional + docs: >- + When the total number of resulting subscription events exceeds the + limit of a paged response, + + the response includes a cursor for you to use in a subsequent request + to fetch the next set of events. + + If the cursor is unset, the response contains the last page of the + results. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListTeamMemberBookingProfilesResponse: + properties: + team_member_booking_profiles: + type: optional> + docs: >- + The list of team member booking profiles. The results are returned in + the ascending order of the time + + when the team member booking profiles were last updated. Multiple + booking profiles updated at the same time + + are further sorted in the ascending order of their IDs. + cursor: + type: optional + docs: >- + The pagination cursor to be used in the subsequent request to get the + next page of the results. Stop retrieving the next page of the results + when the cursor is not set. + validation: + maxLength: 65536 + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListTeamMemberWagesResponse: + docs: >- + The response to a request for a set of `TeamMemberWage` objects. The + response contains + + a set of `TeamMemberWage` objects. + properties: + team_member_wages: + type: optional> + docs: A page of `TeamMemberWage` results. + cursor: + type: optional + docs: |- + The value supplied in the subsequent request to fetch the next page + of `TeamMemberWage` results. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ListTransactionsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [ListTransactions](api-endpoint:Transactions-ListTransactions) endpoint. + + + One of `errors` or `transactions` is present in a given response (never + both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + transactions: + type: optional> + docs: An array of transactions that match your query. + cursor: + type: optional + docs: >- + A pagination cursor for retrieving the next set of results, + + if any remain. Provide this value as the `cursor` parameter in a + subsequent + + request to this endpoint. + + + See [Paginating + results](https://developer.squareup.com/docs/working-with-apis/pagination) + for more information. + source: + openapi: openapi/openapi.json + ListWebhookEventTypesResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [ListWebhookEventTypes](api-endpoint:WebhookSubscriptions-ListWebhookEventTypes) + endpoint. + + + Note: if there are errors processing the request, the event types field + will not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + event_types: + type: optional> + docs: The list of event types. + metadata: + type: optional> + docs: >- + Contains the metadata of a webhook event type. For more information, + see [EventTypeMetadata](entity:EventTypeMetadata). + source: + openapi: openapi/openapi.json + ListWebhookSubscriptionsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [ListWebhookSubscriptions](api-endpoint:WebhookSubscriptions-ListWebhookSubscriptions) + endpoint. + + + Note: if there are errors processing the request, the subscriptions field + will not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + subscriptions: + type: optional> + docs: The requested list of [Subscription](entity:WebhookSubscription)s. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + ListWorkweekConfigsResponse: + docs: >- + The response to a request for a set of `WorkweekConfig` objects. The + response contains + + the requested `WorkweekConfig` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + workweek_configs: + type: optional> + docs: A page of `WorkweekConfig` results. + cursor: + type: optional + docs: |- + The value supplied in the subsequent request to fetch the next page of + `WorkweekConfig` results. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + Location: + docs: >- + Represents one of a business' + [locations](https://developer.squareup.com/docs/locations-api). + properties: + id: + type: optional + docs: >- + A short generated string of letters and numbers that uniquely + identifies this location instance. + validation: + maxLength: 32 + access: read-only + name: + type: optional> + docs: |- + The name of the location. + This information appears in the Seller Dashboard as the nickname. + A location name must be unique within a seller account. + validation: + maxLength: 255 + address: + type: optional
+ docs: The physical address of the location. + timezone: + type: optional> + docs: |- + The [IANA time zone](https://www.iana.org/time-zones) identifier for + the time zone of the location. For example, `America/Los_Angeles`. + validation: + maxLength: 30 + capabilities: + type: optional> + docs: >- + The Square features that are enabled for the location. + + See [LocationCapability](entity:LocationCapability) for possible + values. + + See [LocationCapability](#type-locationcapability) for possible values + access: read-only + status: + type: optional + docs: |- + The status of the location. + See [LocationStatus](#type-locationstatus) for possible values + created_at: + type: optional + docs: >- + The time when the location was created, in RFC 3339 format. + + For more information, see [Working with + Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). + validation: + minLength: 20 + maxLength: 25 + access: read-only + merchant_id: + type: optional + docs: The ID of the merchant that owns the location. + validation: + maxLength: 32 + access: read-only + country: + type: optional + docs: >- + The country of the location, in the two-letter format of ISO 3166. For + example, `US` or `JP`. + + + See [Country](entity:Country) for possible values. + + See [Country](#type-country) for possible values + language_code: + type: optional> + docs: >- + The language associated with the location, in + + [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). + + For more information, see [Language + Preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences). + validation: + minLength: 2 + maxLength: 5 + currency: + type: optional + docs: >- + The currency used for all transactions at this location, + + in ISO 4217 format. For example, the currency code for US dollars is + `USD`. + + See [Currency](entity:Currency) for possible values. + + See [Currency](#type-currency) for possible values + phone_number: + type: optional> + docs: The phone number of the location. For example, `+1 855-700-6000`. + validation: + maxLength: 17 + business_name: + type: optional> + docs: >- + The name of the location's overall business. This name is present on + receipts and other customer-facing branding, and can be changed no + more than three times in a twelve-month period. + validation: + maxLength: 255 + type: + type: optional + docs: |- + The type of the location. + See [LocationType](#type-locationtype) for possible values + website_url: + type: optional> + docs: The website URL of the location. For example, `https://squareup.com`. + validation: + maxLength: 255 + business_hours: + type: optional + docs: The hours of operation for the location. + business_email: + type: optional> + docs: >- + The email address of the location. This can be unique to the location + and is not always the email address for the business owner or + administrator. + validation: + maxLength: 255 + description: + type: optional> + docs: The description of the location. For example, `Main Street location`. + validation: + maxLength: 1024 + twitter_username: + type: optional> + docs: >- + The Twitter username of the location without the '@' symbol. For + example, `Square`. + validation: + minLength: 1 + maxLength: 15 + instagram_username: + type: optional> + docs: >- + The Instagram username of the location without the '@' symbol. For + example, `square`. + validation: + minLength: 1 + maxLength: 30 + facebook_url: + type: optional> + docs: >- + The Facebook profile URL of the location. The URL should begin with + 'facebook.com/'. For example, `https://www.facebook.com/square`. + validation: + maxLength: 255 + coordinates: + type: optional + docs: The physical coordinates (latitude and longitude) of the location. + logo_url: + type: optional + docs: >- + The URL of the logo image for the location. When configured in the + Seller + + Dashboard (Receipts section), the logo appears on transactions (such + as receipts and invoices) that Square generates on behalf of the + seller. + + This image should have a roughly square (1:1) aspect ratio and should + be at least 200x200 pixels. + validation: + maxLength: 255 + access: read-only + pos_background_url: + type: optional + docs: The URL of the Point of Sale background image for the location. + validation: + maxLength: 255 + access: read-only + mcc: + type: optional> + docs: >- + A four-digit number that describes the kind of goods or services sold + at the location. + + The [merchant category code + (MCC)](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) + of the location as standardized by ISO 18245. + + For example, `5045`, for a location that sells computer goods and + software. + validation: + minLength: 4 + maxLength: 4 + full_format_logo_url: + type: optional + docs: >- + The URL of a full-format logo image for the location. When configured + in the Seller + + Dashboard (Receipts section), the logo appears on transactions (such + as receipts and invoices) that Square generates on behalf of the + seller. + + This image can be wider than it is tall and should be at least + 1280x648 pixels. + access: read-only + tax_ids: + type: optional + docs: The tax IDs for this location. + source: + openapi: openapi/openapi.json + LocationBookingProfile: + docs: >- + The booking profile of a seller's location, including the location's ID + and whether the location is enabled for online booking. + properties: + location_id: + type: optional> + docs: The ID of the [location](entity:Location). + booking_site_url: + type: optional> + docs: Url for the online booking site for this location. + online_booking_enabled: + type: optional> + docs: Indicates whether the location is enabled for online booking. + source: + openapi: openapi/openapi.json + LocationCapability: + enum: + - CREDIT_CARD_PROCESSING + - AUTOMATIC_TRANSFERS + - UNLINKED_REFUNDS + docs: The capabilities a location might have. + source: + openapi: openapi/openapi.json + LocationCreatedEvent: + docs: Published when a [Location](entity:Location) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the [Location](entity:Location) associated with the event. + type: + type: optional> + docs: The type of event this represents, `"location.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + LocationCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"location"`. + id: + type: optional + docs: ID of the updated [Location](entity:Location). + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionOwnedCreatedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + is created by the subscribing application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.owned.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionOwnedDeletedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is deleted. A custom attribute + definition can only be deleted by + + the application that created it. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionOwnedUpdatedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + created by the subscribing application is updated. A custom attribute + definition can only be updated + + by the application that created it. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionVisibleCreatedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is created. A notification + is sent when your application + + creates a custom attribute definition or another application creates a + custom attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.visible.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionVisibleDeletedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is deleted. A custom + attribute definition can only + + be deleted by the application that created it. A notification is sent when + your application deletes + + a custom attribute definition or when another application deletes a custom + attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeDefinitionVisibleUpdatedEvent: + docs: >- + Published when a location [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is updated. A custom + attribute definition can only be updated + + by the application that created it. A notification is sent when your + application updates a custom attribute + + definition or when another application updates a custom attribute + definition whose `visibility` is + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute_definition.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeOwnedDeletedEvent: + docs: >- + Published when a location [custom attribute](entity:CustomAttribute) + + owned by the subscribing application is deleted. Custom attributes are + owned by the + + application that created the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). + + Custom attributes whose `visibility` is `VISIBILITY_READ_WRITE_VALUES` can + be deleted by any application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeOwnedUpdatedEvent: + docs: >- + Published when a location [custom attribute](entity:CustomAttribute) owned + by the + + subscribing application is created or updated. Custom attributes are owned + by the application that created + + the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). Custom attributes whose + + `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated + by any application. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeVisibleDeletedEvent: + docs: >- + Published when a location [custom attribute](entity:CustomAttribute) that + is visible to the + + subscribing application is deleted. A notification is sent when: + + - Your application deletes a custom attribute owned by your application, + regardless of the `visibility` setting. + + - Any application deletes a custom attribute whose `visibility` is + `VISIBILITY_READ_ONLY` + + or `VISIBILITY_READ_WRITE_VALUES`. + + + Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by + any application, but those set to + + `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the + owner. Custom attributes are owned + + by the application that created the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationCustomAttributeVisibleUpdatedEvent: + docs: >- + Published when a location [custom attribute](entity:CustomAttribute) that + is visible + + to the subscribing application is created or updated. A notification is + sent when: + + - Your application creates or updates a custom attribute owned by your + application, regardless of the `visibility` setting. + + - Any application creates or updates a custom attribute whose `visibility` + is `VISIBILITY_READ_ONLY` + + or `VISIBILITY_READ_WRITE_VALUES`. + + + Custom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or + updated by any application, but those set to + + `VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or + updated by the owner. Custom attributes are owned + + by the application that created the corresponding [custom attribute + definition](entity:CustomAttributeDefinition). + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"location.custom_attribute.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + LocationSettingsUpdatedEvent: + docs: Published when online checkout location settings are updated + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: >- + The type of event this represents, + `"online_checkout.location_settings.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + LocationSettingsUpdatedEventData: + properties: + type: + type: optional> + docs: >- + Name of the updated object’s type, + `"online_checkout.location_settings"`. + id: + type: optional + docs: ID of the updated location settings. + object: + type: optional + docs: An object containing the updated location settings. + source: + openapi: openapi/openapi.json + LocationSettingsUpdatedEventObject: + properties: + location_settings: + type: optional + docs: The updated location settings. + source: + openapi: openapi/openapi.json + LocationStatus: + enum: + - ACTIVE + - INACTIVE + docs: A location's status. + source: + openapi: openapi/openapi.json + LocationType: + enum: + - PHYSICAL + - MOBILE + docs: A location's type. + source: + openapi: openapi/openapi.json + LocationUpdatedEvent: + docs: Published when a [Location](entity:Location) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the [Location](entity:Location) associated with the event. + type: + type: optional> + docs: The type of event this represents, `"location.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + LocationUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"location"`. + id: + type: optional + docs: ID of the updated [Location](entity:Location). + source: + openapi: openapi/openapi.json + LoyaltyAccount: + docs: >- + Describes a loyalty account in a [loyalty program](entity:LoyaltyProgram). + For more information, see + + [Create and Retrieve Loyalty + Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). + properties: + id: + type: optional + docs: The Square-assigned ID of the loyalty account. + validation: + maxLength: 36 + access: read-only + program_id: + type: string + docs: >- + The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram) + to which the account belongs. + validation: + minLength: 1 + maxLength: 36 + balance: + type: optional + docs: >- + The available point balance in the loyalty account. If points are + scheduled to expire, they are listed in the `expiring_point_deadlines` + field. + + + Your application should be able to handle loyalty accounts that have a + negative point balance (`balance` is less than 0). This might occur if + a seller makes a manual adjustment or as a result of a refund or + exchange. + access: read-only + lifetime_points: + type: optional + docs: The total points accrued during the lifetime of the account. + access: read-only + customer_id: + type: optional> + docs: >- + The Square-assigned ID of the [customer](entity:Customer) that is + associated with the account. + enrolled_at: + type: optional> + docs: >- + The timestamp when the buyer joined the loyalty program, in RFC 3339 + format. This field is used to display the **Enrolled On** or **Member + Since** date in first-party Square products. + + + If this field is not set in a `CreateLoyaltyAccount` request, Square + populates it after the buyer's first action on their account + + (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). + In first-party flows, Square populates the field when the buyer agrees + to the terms of service on Square Point of Sale. + + + If this field is set in a `CreateLoyaltyAccount` request, it is meant + to be used when there is a loyalty migration from another system and + into Square. + + In that case, the timestamp can reflect when the buyer originally + enrolled in the previous system. It may represent a current or past + date, but cannot be set in the future. + + Note: Setting this field in this scenario does not, by itself, impact + the first-party enrollment flow on Square Point of Sale. + created_at: + type: optional + docs: >- + The timestamp when the loyalty account was created, in RFC 3339 + format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp when the loyalty account was last updated, in RFC 3339 + format. + access: read-only + mapping: + type: optional + docs: >- + The mapping that associates the loyalty account with a buyer. + Currently, + + a loyalty account can only be mapped to a buyer by phone number. + + + To create a loyalty account, you must specify the `mapping` field, + with the buyer's phone number + + in the `phone_number` field. + expiring_point_deadlines: + type: optional>> + docs: >- + The schedule for when points expire in the loyalty account balance. + This field is present only if the account has points that are + scheduled to expire. + + + The total number of points in this field equals the number of points + in the `balance` field. + source: + openapi: openapi/openapi.json + LoyaltyAccountCreatedEvent: + docs: Published when a [loyalty account](entity:LoyaltyAccount) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.account.created`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyAccountCreatedEventData: + docs: The data associated with a `loyalty.account.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_account`. + id: + type: optional + docs: The ID of the affected loyalty account. + object: + type: optional + docs: An object that contains the new loyalty account. + source: + openapi: openapi/openapi.json + LoyaltyAccountCreatedEventObject: + properties: + loyalty_account: + type: optional + docs: The loyalty account that was created. + source: + openapi: openapi/openapi.json + LoyaltyAccountDeletedEvent: + docs: Published when a [loyalty account](entity:LoyaltyAccount) is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.account.deleted`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyAccountDeletedEventData: + docs: The data associated with a `loyalty.account.deleted` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_account`. + id: + type: optional + docs: The ID of the affected loyalty account. + object: + type: optional + docs: An object that contains the loyalty account that was deleted. + source: + openapi: openapi/openapi.json + LoyaltyAccountDeletedEventObject: + properties: + loyalty_account: + type: optional + docs: The loyalty account that was deleted. + source: + openapi: openapi/openapi.json + LoyaltyAccountExpiringPointDeadline: + docs: >- + Represents a set of points for a loyalty account that are scheduled to + expire on a specific date. + properties: + points: + type: integer + docs: >- + The number of points scheduled to expire at the `expires_at` + timestamp. + expires_at: + type: string + docs: >- + The timestamp of when the points are scheduled to expire, in RFC 3339 + format. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyAccountMapping: + docs: >- + Represents the mapping that associates a loyalty account with a buyer. + + + Currently, a loyalty account can only be mapped to a buyer by phone + number. For more information, see + + [Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). + properties: + id: + type: optional + docs: The Square-assigned ID of the mapping. + validation: + maxLength: 36 + access: read-only + created_at: + type: optional + docs: The timestamp when the mapping was created, in RFC 3339 format. + access: read-only + phone_number: + type: optional> + docs: >- + The phone number of the buyer, in E.164 format. For example, + "+14155551111". + source: + openapi: openapi/openapi.json + LoyaltyAccountMappingType: + type: literal<"PHONE"> + docs: The type of mapping. + LoyaltyAccountUpdatedEvent: + docs: Published when a [loyalty account](entity:LoyaltyAccount) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.account.updated`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyAccountUpdatedEventData: + docs: The data associated with a `loyalty.account.updated` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_account`. + id: + type: optional + docs: The ID of the affected loyalty account. + object: + type: optional + docs: An object that contains the loyalty account that was updated. + source: + openapi: openapi/openapi.json + LoyaltyAccountUpdatedEventObject: + properties: + loyalty_account: + type: optional + docs: The loyalty account that was updated. + source: + openapi: openapi/openapi.json + LoyaltyEvent: + docs: >- + Provides information about a loyalty event. + + For more information, see [Search for Balance-Changing Loyalty + Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events). + properties: + id: + type: optional + docs: The Square-assigned ID of the loyalty event. + validation: + minLength: 1 + access: read-only + type: + type: LoyaltyEventType + docs: |- + The type of the loyalty event. + See [LoyaltyEventType](#type-loyaltyeventtype) for possible values + created_at: + type: optional + docs: The timestamp when the event was created, in RFC 3339 format. + validation: + minLength: 1 + access: read-only + accumulate_points: + type: optional + docs: Provides metadata when the event `type` is `ACCUMULATE_POINTS`. + create_reward: + type: optional + docs: Provides metadata when the event `type` is `CREATE_REWARD`. + redeem_reward: + type: optional + docs: Provides metadata when the event `type` is `REDEEM_REWARD`. + delete_reward: + type: optional + docs: Provides metadata when the event `type` is `DELETE_REWARD`. + adjust_points: + type: optional + docs: Provides metadata when the event `type` is `ADJUST_POINTS`. + loyalty_account_id: + type: optional + docs: >- + The ID of the [loyalty account](entity:LoyaltyAccount) associated with + the event. + validation: + minLength: 1 + maxLength: 36 + access: read-only + location_id: + type: optional + docs: The ID of the [location](entity:Location) where the event occurred. + access: read-only + source: + type: LoyaltyEventSource + docs: |- + Defines whether the event was generated by the Square Point of Sale. + See [LoyaltyEventSource](#type-loyaltyeventsource) for possible values + expire_points: + type: optional + docs: Provides metadata when the event `type` is `EXPIRE_POINTS`. + other_event: + type: optional + docs: Provides metadata when the event `type` is `OTHER`. + accumulate_promotion_points: + type: optional + docs: >- + Provides metadata when the event `type` is + `ACCUMULATE_PROMOTION_POINTS`. + source: + openapi: openapi/openapi.json + LoyaltyEventAccumulatePoints: + docs: Provides metadata when the event `type` is `ACCUMULATE_POINTS`. + properties: + loyalty_program_id: + type: optional + docs: The ID of the [loyalty program](entity:LoyaltyProgram). + validation: + maxLength: 36 + access: read-only + points: + type: optional> + docs: The number of points accumulated by the event. + validation: + min: 1 + order_id: + type: optional> + docs: >- + The ID of the [order](entity:Order) for which the buyer accumulated + the points. + + This field is returned only if the Orders API is used to process + orders. + source: + openapi: openapi/openapi.json + LoyaltyEventAccumulatePromotionPoints: + docs: Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. + properties: + loyalty_program_id: + type: optional + docs: >- + The Square-assigned ID of the [loyalty + program](entity:LoyaltyProgram). + validation: + maxLength: 36 + access: read-only + loyalty_promotion_id: + type: optional + docs: >- + The Square-assigned ID of the [loyalty + promotion](entity:LoyaltyPromotion). + validation: + minLength: 1 + maxLength: 255 + access: read-only + points: + type: optional + docs: The number of points earned by the event. + access: read-only + order_id: + type: optional + docs: >- + The ID of the [order](entity:Order) for which the buyer earned the + promotion points. + + Only applications that use the Orders API to process orders can + trigger this event. + validation: + minLength: 1 + access: read-only + source: + openapi: openapi/openapi.json + LoyaltyEventAdjustPoints: + docs: Provides metadata when the event `type` is `ADJUST_POINTS`. + properties: + loyalty_program_id: + type: optional + docs: >- + The Square-assigned ID of the [loyalty + program](entity:LoyaltyProgram). + validation: + maxLength: 36 + access: read-only + points: + type: integer + docs: The number of points added or removed. + reason: + type: optional> + docs: The reason for the adjustment of points. + validation: + maxLength: 3500 + source: + openapi: openapi/openapi.json + LoyaltyEventCreateReward: + docs: Provides metadata when the event `type` is `CREATE_REWARD`. + properties: + loyalty_program_id: + type: optional + docs: The ID of the [loyalty program](entity:LoyaltyProgram). + validation: + minLength: 1 + maxLength: 36 + access: read-only + reward_id: + type: optional + docs: >- + The Square-assigned ID of the created [loyalty + reward](entity:LoyaltyReward). + + This field is returned only if the event source is `LOYALTY_API`. + validation: + maxLength: 36 + access: read-only + points: + type: optional + docs: The loyalty points used to create the reward. + access: read-only + source: + openapi: openapi/openapi.json + LoyaltyEventCreatedEvent: + docs: Published when a [loyalty event](entity:LoyaltyEvent) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.event.created`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyEventCreatedEventData: + docs: The data associated with a `loyalty.event.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_event`. + id: + type: optional + docs: ID of the affected loyalty event. + object: + type: optional + docs: An object that contains the new loyalty event. + source: + openapi: openapi/openapi.json + LoyaltyEventCreatedEventObject: + properties: + loyalty_event: + type: optional + docs: The loyalty event that was created. + source: + openapi: openapi/openapi.json + LoyaltyEventDateTimeFilter: + docs: Filter events by date time range. + properties: + created_at: + type: TimeRange + docs: The `created_at` date time range used to filter the result. + source: + openapi: openapi/openapi.json + LoyaltyEventDeleteReward: + docs: Provides metadata when the event `type` is `DELETE_REWARD`. + properties: + loyalty_program_id: + type: optional + docs: The ID of the [loyalty program](entity:LoyaltyProgram). + validation: + minLength: 1 + maxLength: 36 + access: read-only + reward_id: + type: optional + docs: |- + The ID of the deleted [loyalty reward](entity:LoyaltyReward). + This field is returned only if the event source is `LOYALTY_API`. + validation: + maxLength: 36 + access: read-only + points: + type: optional + docs: The number of points returned to the loyalty account. + access: read-only + source: + openapi: openapi/openapi.json + LoyaltyEventExpirePoints: + docs: Provides metadata when the event `type` is `EXPIRE_POINTS`. + properties: + loyalty_program_id: + type: optional + docs: >- + The Square-assigned ID of the [loyalty + program](entity:LoyaltyProgram). + validation: + minLength: 1 + maxLength: 36 + access: read-only + points: + type: integer + docs: The number of points expired. + source: + openapi: openapi/openapi.json + LoyaltyEventFilter: + docs: |- + The filtering criteria. If the request specifies multiple filters, + the endpoint uses a logical AND to evaluate them. + properties: + loyalty_account_filter: + type: optional + docs: Filter events by loyalty account. + type_filter: + type: optional + docs: Filter events by event type. + date_time_filter: + type: optional + docs: |- + Filter events by date time range. + For each range, the start time is inclusive and the end time + is exclusive. + location_filter: + type: optional + docs: Filter events by location. + order_filter: + type: optional + docs: Filter events by the order associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyEventLocationFilter: + docs: Filter events by location. + properties: + location_ids: + docs: |- + The [location](entity:Location) IDs for loyalty events to query. + If multiple values are specified, the endpoint uses + a logical OR to combine them. + type: list + source: + openapi: openapi/openapi.json + LoyaltyEventLoyaltyAccountFilter: + docs: Filter events by loyalty account. + properties: + loyalty_account_id: + type: string + docs: >- + The ID of the [loyalty account](entity:LoyaltyAccount) associated with + loyalty events. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyEventOrderFilter: + docs: Filter events by the order associated with the event. + properties: + order_id: + type: string + docs: The ID of the [order](entity:Order) associated with the event. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyEventOther: + docs: Provides metadata when the event `type` is `OTHER`. + properties: + loyalty_program_id: + type: optional + docs: >- + The Square-assigned ID of the [loyalty + program](entity:LoyaltyProgram). + validation: + minLength: 1 + maxLength: 36 + access: read-only + points: + type: integer + docs: The number of points added or removed. + source: + openapi: openapi/openapi.json + LoyaltyEventQuery: + docs: Represents a query used to search for loyalty events. + properties: + filter: + type: optional + docs: The query filter criteria. + source: + openapi: openapi/openapi.json + LoyaltyEventRedeemReward: + docs: Provides metadata when the event `type` is `REDEEM_REWARD`. + properties: + loyalty_program_id: + type: optional + docs: The ID of the [loyalty program](entity:LoyaltyProgram). + validation: + minLength: 1 + maxLength: 36 + access: read-only + reward_id: + type: optional + docs: |- + The ID of the redeemed [loyalty reward](entity:LoyaltyReward). + This field is returned only if the event source is `LOYALTY_API`. + validation: + maxLength: 36 + access: read-only + order_id: + type: optional + docs: >- + The ID of the [order](entity:Order) that redeemed the reward. + + This field is returned only if the Orders API is used to process + orders. + access: read-only + source: + openapi: openapi/openapi.json + LoyaltyEventSource: + enum: + - SQUARE + - LOYALTY_API + docs: Defines whether the event was generated by the Square Point of Sale. + source: + openapi: openapi/openapi.json + LoyaltyEventType: + enum: + - ACCUMULATE_POINTS + - CREATE_REWARD + - REDEEM_REWARD + - DELETE_REWARD + - ADJUST_POINTS + - EXPIRE_POINTS + - OTHER + - ACCUMULATE_PROMOTION_POINTS + docs: The type of the loyalty event. + source: + openapi: openapi/openapi.json + LoyaltyEventTypeFilter: + docs: Filter events by event type. + properties: + types: + docs: |- + The loyalty event types used to filter the result. + If multiple values are specified, the endpoint uses a + logical OR to combine them. + See [LoyaltyEventType](#type-loyaltyeventtype) for possible values + type: list + source: + openapi: openapi/openapi.json + LoyaltyProgram: + docs: >- + Represents a Square loyalty program. Loyalty programs define how buyers + can earn points and redeem points for rewards. + + Square sellers can have only one loyalty program, which is created and + managed from the Seller Dashboard. + + For more information, see [Loyalty Program + Overview](https://developer.squareup.com/docs/loyalty/overview). + properties: + id: + type: optional + docs: |- + The Square-assigned ID of the loyalty program. Updates to + the loyalty program do not modify the identifier. + validation: + maxLength: 36 + access: read-only + status: + type: optional + docs: >- + Whether the program is currently active. + + See [LoyaltyProgramStatus](#type-loyaltyprogramstatus) for possible + values + reward_tiers: + type: optional>> + docs: The list of rewards for buyers, sorted by ascending points. + expiration_policy: + type: optional + docs: If present, details for how points expire. + terminology: + type: optional + docs: A cosmetic name for the “points” currency. + location_ids: + type: optional>> + docs: The [locations](entity:Location) at which the program is active. + created_at: + type: optional + docs: The timestamp when the program was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the reward was last updated, in RFC 3339 format. + access: read-only + accrual_rules: + type: optional>> + docs: >- + Defines how buyers can earn loyalty points from the base loyalty + program. + + To check for associated [loyalty promotions](entity:LoyaltyPromotion) + that enable + + buyers to earn extra points, call + [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions). + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRule: + docs: >- + Represents an accrual rule, which defines how buyers can earn points from + the base [loyalty program](entity:LoyaltyProgram). + properties: + accrual_type: + type: LoyaltyProgramAccrualRuleType + docs: >- + The type of the accrual rule that defines how buyers can earn points. + + See + [LoyaltyProgramAccrualRuleType](#type-loyaltyprogramaccrualruletype) + for possible values + points: + type: optional> + docs: |- + The number of points that + buyers earn based on the `accrual_type`. + validation: + min: 1 + visit_data: + type: optional + docs: Additional data for rules with the `VISIT` accrual type. + spend_data: + type: optional + docs: Additional data for rules with the `SPEND` accrual type. + item_variation_data: + type: optional + docs: Additional data for rules with the `ITEM_VARIATION` accrual type. + category_data: + type: optional + docs: Additional data for rules with the `CATEGORY` accrual type. + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleCategoryData: + docs: Represents additional data for rules with the `CATEGORY` accrual type. + properties: + category_id: + type: string + docs: >- + The ID of the `CATEGORY` [catalog object](entity:CatalogObject) that + buyers can purchase to earn + + points. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleItemVariationData: + docs: >- + Represents additional data for rules with the `ITEM_VARIATION` accrual + type. + properties: + item_variation_id: + type: string + docs: >- + The ID of the `ITEM_VARIATION` [catalog object](entity:CatalogObject) + that buyers can purchase to earn + + points. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleSpendData: + docs: Represents additional data for rules with the `SPEND` accrual type. + properties: + amount_money: + type: Money + docs: >- + The amount that buyers must spend to earn points. + + For example, given an "Earn 1 point for every $10 spent" accrual rule, + a buyer who spends $105 earns 10 points. + excluded_category_ids: + type: optional>> + docs: >- + The IDs of any `CATEGORY` catalog objects that are excluded from + points accrual. + + + You can use the + [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) + + endpoint to retrieve information about the excluded categories. + excluded_item_variation_ids: + type: optional>> + docs: >- + The IDs of any `ITEM_VARIATION` catalog objects that are excluded from + points accrual. + + + You can use the + [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) + + endpoint to retrieve information about the excluded item variations. + tax_mode: + type: LoyaltyProgramAccrualRuleTaxMode + docs: >- + Indicates how taxes should be treated when calculating the purchase + amount used for points accrual. + + See + [LoyaltyProgramAccrualRuleTaxMode](#type-loyaltyprogramaccrualruletaxmode) + for possible values + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleTaxMode: + enum: + - BEFORE_TAX + - AFTER_TAX + docs: >- + Indicates how taxes should be treated when calculating the purchase amount + used for loyalty points accrual. + + This setting applies only to `SPEND` accrual rules or `VISIT` accrual + rules that have a minimum spend requirement. + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleType: + enum: + - VISIT + - SPEND + - ITEM_VARIATION + - CATEGORY + docs: The type of the accrual rule that defines how buyers can earn points. + source: + openapi: openapi/openapi.json + LoyaltyProgramAccrualRuleVisitData: + docs: Represents additional data for rules with the `VISIT` accrual type. + properties: + minimum_amount_money: + type: optional + docs: The minimum purchase required during the visit to quality for points. + tax_mode: + type: LoyaltyProgramAccrualRuleTaxMode + docs: >- + Indicates how taxes should be treated when calculating the purchase + amount to determine whether the visit qualifies for points. + + This setting applies only if `minimum_amount_money` is specified. + + See + [LoyaltyProgramAccrualRuleTaxMode](#type-loyaltyprogramaccrualruletaxmode) + for possible values + source: + openapi: openapi/openapi.json + LoyaltyProgramCreatedEvent: + docs: Published when a [loyalty program](entity:LoyaltyProgram) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.program.created`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyProgramCreatedEventData: + docs: The data associated with a `loyalty.program.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_program`. + id: + type: optional + docs: The ID of the created loyalty program. + object: + type: optional + docs: An object that contains the loyalty program that was created. + source: + openapi: openapi/openapi.json + LoyaltyProgramCreatedEventObject: + docs: >- + An object that contains the loyalty program associated with a + `loyalty.program.created` event. + properties: + loyalty_program: + type: optional + docs: The loyalty program that was created. + source: + openapi: openapi/openapi.json + LoyaltyProgramExpirationPolicy: + docs: Describes when the loyalty program expires. + properties: + expiration_duration: + type: string + docs: >- + The number of months before points expire, in `P[n]M` RFC 3339 + duration format. For example, a value of `P12M` represents a duration + of 12 months. + + Points are valid through the last day of the month in which they are + scheduled to expire. For example, with a `P12M` duration, points + earned on July 6, 2020 expire on August 1, 2021. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyProgramRewardTier: + docs: >- + Represents a reward tier in a loyalty program. A reward tier defines how + buyers can redeem points for a reward, such as the number of points + required and the value and scope of the discount. A loyalty program can + offer multiple reward tiers. + properties: + id: + type: optional + docs: The Square-assigned ID of the reward tier. + validation: + maxLength: 36 + access: read-only + points: + type: integer + docs: The points exchanged for the reward tier. + validation: + min: 1 + name: + type: optional + docs: The name of the reward tier. + access: read-only + created_at: + type: optional + docs: The timestamp when the reward tier was created, in RFC 3339 format. + access: read-only + pricing_rule_reference: + type: CatalogObjectReference + docs: >- + A reference to the specific version of a `PRICING_RULE` catalog object + that contains information about the reward tier discount. + + + Use `object_id` and `catalog_version` with the + [RetrieveCatalogObject](api-endpoint:Catalog-RetrieveCatalogObject) + endpoint + + to get discount details. Make sure to set `include_related_objects` to + true in the request to retrieve all catalog objects + + that define the discount. For more information, see [Getting discount + details for a reward + tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). + source: + openapi: openapi/openapi.json + LoyaltyProgramStatus: + enum: + - INACTIVE + - ACTIVE + docs: Indicates whether the program is currently active. + source: + openapi: openapi/openapi.json + LoyaltyProgramTerminology: + docs: Represents the naming used for loyalty points. + properties: + one: + type: string + docs: A singular unit for a point (for example, 1 point is called 1 star). + validation: + minLength: 1 + other: + type: string + docs: A plural unit for point (for example, 10 points is called 10 stars). + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + LoyaltyProgramUpdatedEvent: + docs: Published when a [loyalty program](entity:LoyaltyProgram) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.program.updated`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyProgramUpdatedEventData: + docs: The data associated with a `loyalty.program.updated` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_program`. + id: + type: optional + docs: The ID of the affected loyalty program. + object: + type: optional + docs: An object that contains the loyalty program that was updated. + source: + openapi: openapi/openapi.json + LoyaltyProgramUpdatedEventObject: + docs: >- + An object that contains the loyalty program associated with a + `loyalty.program.updated` event. + properties: + loyalty_program: + type: optional + docs: The loyalty program that was updated. + source: + openapi: openapi/openapi.json + LoyaltyPromotion: + docs: >- + Represents a promotion for a [loyalty program](entity:LoyaltyProgram). + Loyalty promotions enable buyers + + to earn extra points on top of those earned from the base program. + + + A loyalty program can have a maximum of 10 loyalty promotions with an + `ACTIVE` or `SCHEDULED` status. + properties: + id: + type: optional + docs: The Square-assigned ID of the promotion. + validation: + minLength: 1 + maxLength: 255 + access: read-only + name: + type: string + docs: The name of the promotion. + validation: + minLength: 1 + maxLength: 70 + incentive: + type: LoyaltyPromotionIncentive + docs: >- + The points incentive for the promotion. This field defines whether + promotion points + + are earned by multiplying base program points or by adding a specified + number of points. + available_time: + type: LoyaltyPromotionAvailableTimeData + docs: >- + The scheduling information that defines when purchases can qualify to + earn points from an `ACTIVE` promotion. + trigger_limit: + type: optional + docs: >- + The number of times a buyer can earn promotion points during a + specified interval. + + If not specified, buyers can trigger the promotion an unlimited number + of times. + status: + type: optional + docs: >- + The current status of the promotion. + + See [LoyaltyPromotionStatus](#type-loyaltypromotionstatus) for + possible values + created_at: + type: optional + docs: The timestamp of when the promotion was created, in RFC 3339 format. + access: read-only + canceled_at: + type: optional + docs: The timestamp of when the promotion was canceled, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the promotion was last updated, in RFC 3339 format. + access: read-only + loyalty_program_id: + type: optional + docs: >- + The ID of the [loyalty program](entity:LoyaltyProgram) associated with + the promotion. + access: read-only + minimum_spend_amount_money: + type: optional + docs: >- + The minimum purchase amount required to earn promotion points. If + specified, this amount is positive. + qualifying_item_variation_ids: + type: optional>> + docs: >- + The IDs of any qualifying `ITEM_VARIATION` [catalog + objects](entity:CatalogObject). If specified, + + the purchase must include at least one of these items to qualify for + the promotion. + + + This option is valid only if the base loyalty program uses a `VISIT` + or `SPEND` accrual rule. + + With `SPEND` accrual rules, make sure that qualifying promotional + items are not excluded. + + + You can specify `qualifying_item_variation_ids` or + `qualifying_category_ids` for a given promotion, but not both. + qualifying_category_ids: + type: optional>> + docs: >- + The IDs of any qualifying `CATEGORY` [catalog + objects](entity:CatalogObject). If specified, + + the purchase must include at least one item from one of these + categories to qualify for the promotion. + + + This option is valid only if the base loyalty program uses a `VISIT` + or `SPEND` accrual rule. + + With `SPEND` accrual rules, make sure that qualifying promotional + items are not excluded. + + + You can specify `qualifying_category_ids` or + `qualifying_item_variation_ids` for a promotion, but not both. + source: + openapi: openapi/openapi.json + LoyaltyPromotionAvailableTimeData: + docs: >- + Represents scheduling information that determines when purchases can + qualify to earn points + + from a [loyalty promotion](entity:LoyaltyPromotion). + properties: + start_date: + type: optional + docs: >- + The date that the promotion starts, in `YYYY-MM-DD` format. Square + populates this field + + based on the provided `time_periods`. + access: read-only + end_date: + type: optional + docs: >- + The date that the promotion ends, in `YYYY-MM-DD` format. Square + populates this field + + based on the provided `time_periods`. If an end date is not specified, + an `ACTIVE` promotion + + remains available until it is canceled. + access: read-only + time_periods: + docs: >- + A list of [iCalendar (RFC 5545) + events](https://tools.ietf.org/html/rfc5545#section-3.6.1) + + (`VEVENT`). Each event represents an available time period per day or + days of the week. + + A day can have a maximum of one available time period. + + + Only `DTSTART`, `DURATION`, and `RRULE` are supported. `DTSTART` and + `DURATION` are required and + + timestamps must be in local (unzoned) time format. Include `RRULE` to + specify recurring promotions, + + an end date (using the `UNTIL` keyword), or both. For more + information, see + + [Available + time](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#available-time). + + + Note that `BEGIN:VEVENT` and `END:VEVENT` are optional in a + `CreateLoyaltyPromotion` request + + but are always included in the response. + type: list + source: + openapi: openapi/openapi.json + LoyaltyPromotionCreatedEvent: + docs: Published when a [loyalty promotion](entity:LoyaltyPromotion) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.promotion.created`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyPromotionCreatedEventData: + docs: The data associated with a `loyalty.promotion.created` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_promotion`. + id: + type: optional + docs: The ID of the affected loyalty promotion. + object: + type: optional + docs: An object that contains the loyalty promotion that was created. + source: + openapi: openapi/openapi.json + LoyaltyPromotionCreatedEventObject: + docs: >- + An object that contains the loyalty promotion associated with a + `loyalty.promotion.created` event. + properties: + loyalty_promotion: + type: optional + docs: The loyalty promotion that was created. + source: + openapi: openapi/openapi.json + LoyaltyPromotionIncentive: + docs: >- + Represents how points for a [loyalty promotion](entity:LoyaltyPromotion) + are calculated, + + either by multiplying the points earned from the base program or by adding + a specified number + + of points to the points earned from the base program. + properties: + type: + type: LoyaltyPromotionIncentiveType + docs: >- + The type of points incentive. + + See + [LoyaltyPromotionIncentiveType](#type-loyaltypromotionincentivetype) + for possible values + points_multiplier_data: + type: optional + docs: Additional data for a `POINTS_MULTIPLIER` incentive type. + points_addition_data: + type: optional + docs: Additional data for a `POINTS_ADDITION` incentive type. + source: + openapi: openapi/openapi.json + LoyaltyPromotionIncentivePointsAdditionData: + docs: >- + Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion + incentive](entity:LoyaltyPromotionIncentive). + properties: + points_addition: + type: integer + docs: >- + The number of additional points to earn each time the promotion is + triggered. For example, + + suppose a purchase qualifies for 5 points from the base loyalty + program. If the purchase also + + qualifies for a `POINTS_ADDITION` promotion incentive with a + `points_addition` of 3, the buyer + + earns a total of 8 points (5 program points + 3 promotion points = 8 + points). + validation: + min: 1 + source: + openapi: openapi/openapi.json + LoyaltyPromotionIncentivePointsMultiplierData: + docs: >- + Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty + promotion incentive](entity:LoyaltyPromotionIncentive). + properties: + points_multiplier: + type: optional> + docs: >- + The multiplier used to calculate the number of points earned each time + the promotion + + is triggered. For example, suppose a purchase qualifies for 5 points + from the base loyalty program. + + If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion + incentive with a `points_multiplier` + + of 3, the buyer earns a total of 15 points (5 program points x 3 + promotion multiplier = 15 points). + + + DEPRECATED at version 2023-08-16. Replaced by the `multiplier` field. + + + One of the following is required when specifying a points multiplier: + + - (Recommended) The `multiplier` field. + + - This deprecated `points_multiplier` field. If provided in the + request, Square also returns `multiplier` + + with the equivalent value. + validation: + min: 2 + max: 10 + multiplier: + type: optional> + docs: >- + The multiplier used to calculate the number of points earned each time + the promotion is triggered, + + specified as a string representation of a decimal. Square supports + multipliers up to 10x, with three + + point precision for decimal multipliers. For example, suppose a + purchase qualifies for 4 points from the + + base loyalty program. If the purchase also qualifies for a + `POINTS_MULTIPLIER` promotion incentive with a + + `multiplier` of "1.5", the buyer earns a total of 6 points (4 program + points x 1.5 promotion multiplier = 6 points). + + Fractional points are dropped. + + + One of the following is required when specifying a points multiplier: + + - (Recommended) This `multiplier` field. + + - The deprecated `points_multiplier` field. If provided in the + request, Square also returns `multiplier` + + with the equivalent value. + validation: + maxLength: 5 + source: + openapi: openapi/openapi.json + LoyaltyPromotionIncentiveType: + enum: + - POINTS_MULTIPLIER + - POINTS_ADDITION + docs: >- + Indicates the type of points incentive for a [loyalty + promotion](entity:LoyaltyPromotion), + + which is used to determine how buyers can earn points from the promotion. + source: + openapi: openapi/openapi.json + LoyaltyPromotionStatus: + enum: + - ACTIVE + - ENDED + - CANCELED + - SCHEDULED + docs: Indicates the status of a [loyalty promotion](entity:LoyaltyPromotion). + source: + openapi: openapi/openapi.json + LoyaltyPromotionTriggerLimit: + docs: >- + Represents the number of times a buyer can earn points during a [loyalty + promotion](entity:LoyaltyPromotion). + + If this field is not set, buyers can trigger the promotion an unlimited + number of times to earn points during + + the time that the promotion is available. + + + A purchase that is disqualified from earning points because of this limit + might qualify for another active promotion. + properties: + times: + type: integer + docs: >- + The maximum number of times a buyer can trigger the promotion during + the specified `interval`. + validation: + min: 1 + max: 30 + interval: + type: optional + docs: >- + The time period the limit applies to. + + See + [LoyaltyPromotionTriggerLimitInterval](#type-loyaltypromotiontriggerlimitinterval) + for possible values + source: + openapi: openapi/openapi.json + LoyaltyPromotionTriggerLimitInterval: + enum: + - ALL_TIME + - DAY + docs: >- + Indicates the time period that the [trigger + limit](entity:LoyaltyPromotionTriggerLimit) applies to, + + which is used to determine the number of times a buyer can earn points for + a [loyalty promotion](entity:LoyaltyPromotion). + source: + openapi: openapi/openapi.json + LoyaltyPromotionUpdatedEvent: + docs: >- + Published when a [loyalty promotion](entity:LoyaltyPromotion) is updated. + This event is + + invoked only when a loyalty promotion is canceled. + properties: + merchant_id: + type: optional> + docs: The ID of the Square seller associated with the event. + type: + type: optional> + docs: >- + The type of event. For this event, the value is + `loyalty.promotion.updated`. + event_id: + type: optional> + docs: >- + The unique ID for the event, which is used for + + [idempotency + support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices). + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + LoyaltyPromotionUpdatedEventData: + docs: The data associated with a `loyalty.promotion.updated` event. + properties: + type: + type: optional> + docs: >- + The type of object affected by the event. For this event, the value is + `loyalty_promotion`. + id: + type: optional + docs: The ID of the affected loyalty promotion. + object: + type: optional + docs: An object that contains the loyalty promotion that was updated. + source: + openapi: openapi/openapi.json + LoyaltyPromotionUpdatedEventObject: + docs: >- + An object that contains the loyalty promotion associated with a + `loyalty.promotion.updated` event. + properties: + loyalty_promotion: + type: optional + docs: The loyalty promotion that was updated. + source: + openapi: openapi/openapi.json + LoyaltyReward: + docs: >- + Represents a contract to redeem loyalty points for a [reward + tier](entity:LoyaltyProgramRewardTier) discount. Loyalty rewards can be in + an ISSUED, REDEEMED, or DELETED state. + + For more information, see [Manage loyalty + rewards](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards). + properties: + id: + type: optional + docs: The Square-assigned ID of the loyalty reward. + validation: + maxLength: 36 + access: read-only + status: + type: optional + docs: >- + The status of a loyalty reward. + + See [LoyaltyRewardStatus](#type-loyaltyrewardstatus) for possible + values + loyalty_account_id: + type: string + docs: >- + The Square-assigned ID of the [loyalty account](entity:LoyaltyAccount) + to which the reward belongs. + validation: + minLength: 1 + maxLength: 36 + reward_tier_id: + type: string + docs: >- + The Square-assigned ID of the [reward + tier](entity:LoyaltyProgramRewardTier) used to create the reward. + validation: + minLength: 1 + maxLength: 36 + points: + type: optional + docs: The number of loyalty points used for the reward. + validation: + min: 1 + access: read-only + order_id: + type: optional> + docs: >- + The Square-assigned ID of the [order](entity:Order) to which the + reward is attached. + created_at: + type: optional + docs: The timestamp when the reward was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp when the reward was last updated, in RFC 3339 format. + access: read-only + redeemed_at: + type: optional + docs: The timestamp when the reward was redeemed, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + LoyaltyRewardStatus: + enum: + - ISSUED + - REDEEMED + - DELETED + docs: The status of the loyalty reward. + source: + openapi: openapi/openapi.json + MeasurementUnit: + docs: >- + 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`. + properties: + custom_unit: + type: optional + docs: >- + A custom unit of measurement defined by the seller using the Point of + Sale + + app or ad-hoc as an order line item. + area_unit: + type: optional + docs: >- + Represents a standard area unit. + + See [MeasurementUnitArea](#type-measurementunitarea) for possible + values + length_unit: + type: optional + docs: >- + Represents a standard length unit. + + See [MeasurementUnitLength](#type-measurementunitlength) for possible + values + volume_unit: + type: optional + docs: >- + Represents a standard volume unit. + + See [MeasurementUnitVolume](#type-measurementunitvolume) for possible + values + weight_unit: + type: optional + docs: >- + Represents a standard unit of weight or mass. + + See [MeasurementUnitWeight](#type-measurementunitweight) for possible + values + generic_unit: + type: optional + docs: >- + Reserved for API integrations that lack the ability to specify a real + measurement unit + + See [MeasurementUnitGeneric](#type-measurementunitgeneric) for + possible values + time_unit: + type: optional + docs: >- + Represents a standard unit of time. + + See [MeasurementUnitTime](#type-measurementunittime) for possible + values + type: + type: optional + docs: >- + Represents the type of the measurement unit. + + See [MeasurementUnitUnitType](#type-measurementunitunittype) for + possible values + source: + openapi: openapi/openapi.json + MeasurementUnitArea: + enum: + - IMPERIAL_ACRE + - IMPERIAL_SQUARE_INCH + - IMPERIAL_SQUARE_FOOT + - IMPERIAL_SQUARE_YARD + - IMPERIAL_SQUARE_MILE + - METRIC_SQUARE_CENTIMETER + - METRIC_SQUARE_METER + - METRIC_SQUARE_KILOMETER + docs: Unit of area used to measure a quantity. + source: + openapi: openapi/openapi.json + MeasurementUnitCustom: + docs: The information needed to define a custom unit, provided by the seller. + properties: + name: + type: string + docs: The name of the custom unit, for example "bushel". + abbreviation: + type: string + docs: >- + The abbreviation of the custom unit, such as "bsh" (bushel). This + appears + + in the cart for the Point of Sale app, and in reports. + source: + openapi: openapi/openapi.json + MeasurementUnitGeneric: literal<"UNIT"> + MeasurementUnitLength: + enum: + - IMPERIAL_INCH + - IMPERIAL_FOOT + - IMPERIAL_YARD + - IMPERIAL_MILE + - METRIC_MILLIMETER + - METRIC_CENTIMETER + - METRIC_METER + - METRIC_KILOMETER + docs: The unit of length used to measure a quantity. + source: + openapi: openapi/openapi.json + MeasurementUnitTime: + enum: + - GENERIC_MILLISECOND + - GENERIC_SECOND + - GENERIC_MINUTE + - GENERIC_HOUR + - GENERIC_DAY + docs: Unit of time used to measure a quantity (a duration). + source: + openapi: openapi/openapi.json + MeasurementUnitUnitType: + enum: + - TYPE_CUSTOM + - TYPE_AREA + - TYPE_LENGTH + - TYPE_VOLUME + - TYPE_WEIGHT + - TYPE_GENERIC + docs: >- + Describes the type of this unit and indicates which field contains the + unit information. This is an ‘open’ enum. + source: + openapi: openapi/openapi.json + MeasurementUnitVolume: + enum: + - GENERIC_FLUID_OUNCE + - GENERIC_SHOT + - GENERIC_CUP + - GENERIC_PINT + - GENERIC_QUART + - GENERIC_GALLON + - IMPERIAL_CUBIC_INCH + - IMPERIAL_CUBIC_FOOT + - IMPERIAL_CUBIC_YARD + - METRIC_MILLILITER + - METRIC_LITER + docs: The unit of volume used to measure a quantity. + source: + openapi: openapi/openapi.json + MeasurementUnitWeight: + enum: + - IMPERIAL_WEIGHT_OUNCE + - IMPERIAL_POUND + - IMPERIAL_STONE + - METRIC_MILLIGRAM + - METRIC_GRAM + - METRIC_KILOGRAM + docs: Unit of weight used to measure a quantity. + source: + openapi: openapi/openapi.json + Merchant: + docs: Represents a business that sells with Square. + properties: + id: + type: optional + docs: The Square-issued ID of the merchant. + business_name: + type: optional> + docs: The name of the merchant's overall business. + country: + type: Country + docs: >- + The country code associated with the merchant, in the two-letter + format of ISO 3166. For example, `US` or `JP`. + + See [Country](#type-country) for possible values + language_code: + type: optional> + docs: >- + The code indicating the [language + preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences) + of the merchant, in [BCP 47 + format](https://tools.ietf.org/html/bcp47#appendix-A). For example, + `en-US` or `fr-CA`. + currency: + type: optional + docs: >- + The currency associated with the merchant, in ISO 4217 format. For + example, the currency code for US dollars is `USD`. + + See [Currency](#type-currency) for possible values + status: + type: optional + docs: |- + The merchant's status. + See [MerchantStatus](#type-merchantstatus) for possible values + main_location_id: + type: optional> + docs: >- + The ID of the [main + `Location`](https://developer.squareup.com/docs/locations-api#about-the-main-location) + for this merchant. + created_at: + type: optional + docs: |- + The time when the merchant was created, in RFC 3339 format. + For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). + access: read-only + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionOwnedCreatedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + is created by the subscribing application. Subscribe to this event to be + notified + + when your application creates a merchant custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.owned.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionOwnedDeletedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + is deleted by the subscribing application. Subscribe to this event to be + notified + + when your application deletes a merchant custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionOwnedUpdatedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + is updated by the subscribing application. Subscribe to this event to be + notified + + when your application updates a merchant custom attribute definition. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionVisibleCreatedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is created. A notification + is sent when your application + + creates a custom attribute definition or another application creates a + custom attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.visible.created"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionVisibleDeletedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is deleted. A notification + is sent when your application + + deletes a custom attribute definition or another application deletes a + custom attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeDefinitionVisibleUpdatedEvent: + docs: >- + Published when a merchant [custom attribute + definition](entity:CustomAttributeDefinition) + + that is visible to the subscribing application is updated. A notification + is sent when your application + + updates a custom attribute definition or another application updates a + custom attribute definition whose + + `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute_definition.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeOwnedDeletedEvent: + docs: >- + Published when a merchant [custom attribute](entity:CustomAttribute) + + associated with a [custom attribute + definition](entity:CustomAttributeDefinition) that is + + owned by the subscribing application is deleted. Subscribe to this event + to be notified + + when your application deletes a merchant custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeOwnedUpdatedEvent: + docs: >- + Published when a merchant [custom attribute](entity:CustomAttribute) + + associated with a [custom attribute + definition](entity:CustomAttributeDefinition) that is + + owned by the subscribing application is updated. Subscribe to this event + to be notified + + when your application updates a merchant custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeVisibleDeletedEvent: + docs: >- + Published when a merchant [custom attribute](entity:CustomAttribute) with + + the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is deleted. + + An application that subscribes to this event is notified when a merchant + custom attribute is deleted + + by any application for which the subscribing application has read access + to the merchant custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantCustomAttributeVisibleUpdatedEvent: + docs: >- + Published when a merchant [custom attribute](entity:CustomAttribute) with + + the `visibility` field set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES` is updated. + + An application that subscribes to this event is notified when a merchant + custom attribute is updated + + by any application for which the subscribing application has read access + to the merchant custom attribute. + properties: + merchant_id: + type: optional> + docs: >- + The ID of the seller associated with the event that triggered the + event notification. + type: + type: optional> + docs: >- + The type of this event. The value is + `"merchant.custom_attribute.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event notification. + created_at: + type: optional + docs: >- + The timestamp that indicates when the event notification was created, + in RFC 3339 format. + access: read-only + data: + type: optional + docs: >- + The data associated with the event that triggered the event + notification. + source: + openapi: openapi/openapi.json + MerchantSettingsUpdatedEvent: + docs: Published when online checkout merchant settings are updated + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: >- + The type of event this represents, + `"online_checkout.merchant_settings.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + MerchantSettingsUpdatedEventData: + properties: + type: + type: optional> + docs: >- + Name of the updated object’s type, + `"online_checkout.merchant_settings"`. + id: + type: optional + docs: ID of the updated merchant settings. + object: + type: optional + docs: An object containing the updated merchant settings. + source: + openapi: openapi/openapi.json + MerchantSettingsUpdatedEventObject: + properties: + merchant_settings: + type: optional + docs: The updated merchant settings. + source: + openapi: openapi/openapi.json + MerchantStatus: + enum: + - ACTIVE + - INACTIVE + source: + openapi: openapi/openapi.json + ModifierLocationOverrides: + docs: >- + Location-specific overrides for specified properties of a + `CatalogModifier` object. + properties: + location_id: + type: optional> + docs: >- + The ID of the `Location` object representing the location. This can + include a deactivated location. + price_money: + type: optional + docs: >- + The overridden price at the specified location. If this is + unspecified, the modifier price is not overridden. + + The modifier becomes free of charge at the specified location, when + this `price_money` field is set to 0. + sold_out: + type: optional + docs: >- + Indicates whether the modifier is sold out at the specified location + or not. As an example, for cheese (modifier) burger (item), when the + modifier is sold out, it is the cheese, but not the burger, that is + sold out. + + The seller can manually set this sold out status. Attempts by an + application to set this attribute are ignored. + access: read-only + source: + openapi: openapi/openapi.json + Money: + docs: >- + Represents an amount of money. `Money` fields can be signed or unsigned. + + Fields that do not explicitly define whether they are signed or unsigned + are + + considered unsigned and can only hold positive amounts. For signed fields, + the + + sign of the value indicates the purpose of the money transfer. See + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) + + for more information. + properties: + amount: + type: optional> + docs: >- + The amount of money, in the smallest denomination of the currency + + indicated by `currency`. For example, when `currency` is `USD`, + `amount` is + + in cents. Monetary amounts can be positive or negative. See the + specific + + field description to determine the meaning of the sign in a particular + case. + currency: + type: optional + docs: >- + The type of currency, in __ISO 4217 format__. For example, the + currency + + code for US dollars is `USD`. + + + See [Currency](entity:Currency) for possible values. + + See [Currency](#type-currency) for possible values + source: + openapi: openapi/openapi.json + OauthAuthorizationRevokedEvent: + docs: >- + Published when a merchant/application revokes all access tokens and + refresh tokens granted to an application. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"oauth.authorization.revoked"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + OauthAuthorizationRevokedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"revocation"`. + id: + type: optional + docs: Not applicable, revocation is not an object + object: + type: optional + docs: An object containing information about revocation event. + source: + openapi: openapi/openapi.json + OauthAuthorizationRevokedEventObject: + properties: + revocation: + type: optional + docs: The revocation event. + source: + openapi: openapi/openapi.json + OauthAuthorizationRevokedEventRevocationObject: + properties: + revoked_at: + type: optional> + docs: Timestamp of when the revocation event occurred, in RFC 3339 format. + revoker_type: + type: optional + docs: >- + Type of client that performed the revocation, either APPLICATION, + MERCHANT, or SQUARE. + + See + [OauthAuthorizationRevokedEventRevokerType](#type-oauthauthorizationrevokedeventrevokertype) + for possible values + source: + openapi: openapi/openapi.json + OauthAuthorizationRevokedEventRevokerType: + enum: + - APPLICATION + - MERCHANT + - SQUARE + docs: Defines the possible types for the revoking client. + source: + openapi: openapi/openapi.json + ObtainTokenResponse: + docs: Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) response. + properties: + access_token: + type: optional + docs: >- + An OAuth access token used to authorize Square API requests on behalf + of the seller. + + Include this token as a bearer token in the `Authorization` header of + your API requests. + + + OAuth access tokens expire in 30 days (except `short_lived` access + tokens). You should call + + `ObtainToken` and provide the returned `refresh_token` to get a new + access token well before + + the current one expires. For more information, see [OAuth API: + Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough). + validation: + minLength: 2 + maxLength: 1024 + token_type: + type: optional + docs: The type of access token. This value is always `bearer`. + validation: + minLength: 2 + maxLength: 10 + expires_at: + type: optional + docs: >- + The timestamp of when the `access_token` expires, in [ISO + 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. + validation: + minLength: 20 + maxLength: 48 + merchant_id: + type: optional + docs: >- + The ID of the authorizing [merchant](entity:Merchant) (seller), which + represents a business. + validation: + minLength: 8 + maxLength: 191 + subscription_id: + type: optional + docs: >- + __LEGACY__ The ID of merchant's subscription. + + The ID is only present if the merchant signed up for a subscription + plan during authorization. + plan_id: + type: optional + docs: >- + __LEGACY__ The ID of the subscription plan the merchant signed + + up for. The ID is only present if the merchant signed up for a + subscription plan during + + authorization. + id_token: + type: optional + docs: >- + The OpenID token that belongs to this person. This token is only + present if the + + `OPENID` scope is included in the authorization request. + + + Deprecated at version 2021-09-15. Square doesn't support OpenID or + other single sign-on (SSO) + + protocols on top of OAuth. + refresh_token: + type: optional + docs: >- + A refresh token that can be used in an `ObtainToken` request to + generate a new access token. + + + With the code flow: + + - For the `authorization_code` grant type, the refresh token is + multi-use and never expires. + + - For the `refresh_token` grant type, the response returns the same + refresh token. + + + With the PKCE flow: + + - For the `authorization_code` grant type, the refresh token is + single-use and expires in 90 days. + + - For the `refresh_token` grant type, the refresh token is a new + single-use refresh token that expires in 90 days. + + + For more information, see [Refresh, Revoke, and Limit the Scope of + OAuth + Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope). + validation: + minLength: 2 + maxLength: 1024 + short_lived: + type: optional + docs: >- + Indicates whether the access_token is short lived. If `true`, the + access token expires + + in 24 hours. If `false`, the access token expires in 30 days. + errors: + type: optional> + docs: Any errors that occurred during the request. + refresh_token_expires_at: + type: optional + docs: >- + The timestamp of when the `refresh_token` expires, in [ISO + 8601](http://www.iso.org/iso/home/standards/iso8601.htm) + + format. + + + This field is only returned for the PKCE flow. + validation: + minLength: 20 + maxLength: 48 + source: + openapi: openapi/openapi.json + OfflinePaymentDetails: + docs: Details specific to offline payments. + properties: + client_created_at: + type: optional + docs: >- + The client-side timestamp of when the offline payment was created, in + RFC 3339 format. + validation: + maxLength: 32 + access: read-only + source: + openapi: openapi/openapi.json + Order: + docs: >- + Contains all information related to a single order to process with Square, + + including line items that specify the products to purchase. `Order` + objects also + + include information about any associated tenders, refunds, and returns. + + + All Connect V2 Transactions have all been converted to Orders including + all associated + + itemization data. + properties: + id: + type: optional + docs: The order's unique ID. + access: read-only + location_id: + type: string + docs: The ID of the seller location that this order is associated with. + validation: + minLength: 1 + reference_id: + type: optional> + docs: |- + A client-specified ID to associate an entity in another system + with this order. + validation: + maxLength: 40 + source: + type: optional + docs: The origination details of the order. + customer_id: + type: optional> + docs: >- + The ID of the [customer](entity:Customer) associated with the order. + + + You should specify a `customer_id` on the order (or the payment) to + ensure that transactions + + are reliably linked to customers. Omitting this field might result in + the creation of new + + [instant + profiles](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). + validation: + maxLength: 191 + line_items: + type: optional>> + docs: The line items included in the order. + taxes: + type: optional>> + docs: >- + The list of all taxes associated with the order. + + + Taxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with + `LINE_ITEM` scope, an + + `OrderLineItemAppliedTax` must be added to each line item that the tax + applies to. For taxes + + with `ORDER` scope, the server generates an `OrderLineItemAppliedTax` + for every line item. + + + On reads, each tax in the list includes the total amount of that tax + applied to the order. + + + __IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, + using the deprecated + + `line_items.taxes` field results in an error. Use + `line_items.applied_taxes` + + instead. + discounts: + type: optional>> + docs: >- + The list of all discounts associated with the order. + + + Discounts can be scoped to either `ORDER` or `LINE_ITEM`. For + discounts scoped to `LINE_ITEM`, + + an `OrderLineItemAppliedDiscount` must be added to each line item that + the discount applies to. + + For discounts with `ORDER` scope, the server generates an + `OrderLineItemAppliedDiscount` + + for every line item. + + + __IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this + field, using the deprecated + + `line_items.discounts` field results in an error. Use + `line_items.applied_discounts` + + instead. + service_charges: + type: optional>> + docs: A list of service charges applied to the order. + fulfillments: + type: optional>> + docs: >- + Details about order fulfillment. + + + Orders can only be created with at most one fulfillment. However, + orders returned + + by the API might contain multiple fulfillments. + returns: + type: optional> + docs: >- + A collection of items from sale orders being returned in this one. + Normally part of an + + itemized return or exchange. There is exactly one `Return` object per + sale `Order` being + + referenced. + access: read-only + return_amounts: + type: optional + docs: The rollup of the returned money amounts. + net_amounts: + type: optional + docs: The net money amounts (sale money - return money). + rounding_adjustment: + type: optional + docs: >- + A positive rounding adjustment to the total of the order. This + adjustment is commonly + + used to apply cash rounding when the minimum unit of account is + smaller than the lowest physical + + denomination of the currency. + tenders: + type: optional> + docs: The tenders that were used to pay for the order. + access: read-only + refunds: + type: optional> + docs: The refunds that are part of this order. + access: read-only + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this order. Metadata fields are + intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + created_at: + type: optional + docs: >- + The timestamp for when the order was created, at server side, in RFC + 3339 format (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + updated_at: + type: optional + docs: >- + The timestamp for when the order was last updated, at server side, in + RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + access: read-only + closed_at: + type: optional + docs: >- + The timestamp for when the order reached a terminal + [state](entity:OrderState), in RFC 3339 format (for example + "2016-09-04T23:59:33.123Z"). + access: read-only + state: + type: optional + docs: |- + The current state of the order. + See [OrderState](#type-orderstate) for possible values + version: + type: optional + docs: >- + The version number, which is incremented each time an update is + committed to the order. + + Orders not created through the API do not include a version number and + + therefore cannot be updated. + + + [Read more about working with + versions](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders). + total_money: + type: optional + docs: The total amount of money to collect for the order. + total_tax_money: + type: optional + docs: The total amount of tax money to collect for the order. + total_discount_money: + type: optional + docs: The total amount of discount money to collect for the order. + total_tip_money: + type: optional + docs: The total amount of tip money to collect for the order. + total_service_charge_money: + type: optional + docs: >- + The total amount of money collected in service charges for the order. + + + Note: `total_service_charge_money` is the sum of `applied_money` + fields for each individual + + service charge. Therefore, `total_service_charge_money` only includes + inclusive tax amounts, + + not additive tax amounts. + ticket_name: + type: optional> + docs: |- + A short-term identifier for the order (such as a customer first name, + table number, or auto-generated order number that resets daily). + validation: + maxLength: 30 + pricing_options: + type: optional + docs: >- + Pricing options for an order. The options affect how the order's price + is calculated. + + They can be used, for example, to apply automatic price adjustments + that are based on + + preconfigured [pricing rules](entity:CatalogPricingRule). + rewards: + type: optional> + docs: A set-like list of Rewards that have been added to the Order. + access: read-only + net_amount_due_money: + type: optional + docs: The net amount of money due on the order. + source: + openapi: openapi/openapi.json + OrderCreated: + properties: + order_id: + type: optional> + docs: The order's unique ID. + version: + type: optional + docs: >- + The version number, which is incremented each time an update is + committed to the order. + + Orders that were not created through the API do not include a version + number and + + therefore cannot be updated. + + + [Read more about working with + versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) + location_id: + type: optional> + docs: The ID of the seller location that this order is associated with. + state: + type: optional + docs: |- + The state of the order. + See [OrderState](#type-orderstate) for possible values + created_at: + type: optional + docs: The timestamp for when the order was created, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + OrderCreatedEvent: + docs: "Published when an [Order](entity:Order) is created. This event is\ntriggered only by the [CreateOrder](api-endpoint:Orders-CreateOrder) endpoint call.\n\nCreating an order in the Point of Sale\_app will **not** publish this event." + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"order.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + OrderCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"order_created"`. + id: + type: optional + docs: ID of the affected order. + object: + type: optional + docs: An object containing information about the created Order. + source: + openapi: openapi/openapi.json + OrderCreatedObject: + properties: + order_created: + type: optional + docs: Information about the created order. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionOwnedCreatedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is owned by the + subscribing app is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.owned.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionOwnedDeletedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is owned by the + subscribing app is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionOwnedUpdatedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is owned by the + subscribing app is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionVisibleCreatedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is visible to the + subscribing app is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.visible.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionVisibleDeletedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is visible to the + subscribing app is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeDefinitionVisibleUpdatedEvent: + docs: >- + Published when an order [custom attribute + definition](entity:CustomAttributeDefinition) that is visible to the + subscribing app is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute_definition.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeOwnedDeletedEvent: + docs: >- + Published when an order [custom attribute](entity:CustomAttribute) + associated with a [custom attribute + definition](entity:CustomAttributeDefinition) that is owned by the + subscribing app is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute.owned.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeOwnedUpdatedEvent: + docs: >- + Published when an order [custom attribute](entity:CustomAttribute) + associated with a [custom attribute + definition](entity:CustomAttributeDefinition) that is owned by the + subscribing app is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute.owned.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeVisibleDeletedEvent: + docs: >- + Published when an order [custom attribute](entity:CustomAttribute) that is + visible to the subscribing app is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute.visible.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderCustomAttributeVisibleUpdatedEvent: + docs: >- + Published when an order [custom attribute](entity:CustomAttribute) that is + visible to the subscribing app is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target seller associated with the event. + type: + type: optional> + docs: >- + The type of this event. The value is + `"order.custom_attribute.visible.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: The data associated with the event. + source: + openapi: openapi/openapi.json + OrderEntry: + docs: >- + A lightweight description of an [order](entity:Order) that is returned + when + + `returned_entries` is `true` on a + [SearchOrdersRequest](api-endpoint:Orders-SearchOrders). + properties: + order_id: + type: optional> + docs: The ID of the order. + version: + type: optional + docs: >- + The version number, which is incremented each time an update is + committed to the order. + + Orders that were not created through the API do not include a version + number and + + therefore cannot be updated. + + + [Read more about working with + versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) + access: read-only + location_id: + type: optional> + docs: The location ID the order belongs to. + source: + openapi: openapi/openapi.json + OrderFulfillmentDeliveryDetailsScheduleType: + enum: + - SCHEDULED + - ASAP + docs: The schedule type of the delivery fulfillment. + source: + openapi: openapi/openapi.json + OrderFulfillmentFulfillmentLineItemApplication: + enum: + - ALL + - ENTRY_LIST + docs: >- + The `line_item_application` describes what order line items this + fulfillment applies + + to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment + entries. + source: + openapi: openapi/openapi.json + OrderFulfillmentPickupDetailsScheduleType: + enum: + - SCHEDULED + - ASAP + docs: The schedule type of the pickup fulfillment. + source: + openapi: openapi/openapi.json + OrderFulfillmentState: + enum: + - PROPOSED + - RESERVED + - PREPARED + - COMPLETED + - CANCELED + - FAILED + docs: The current state of this fulfillment. + source: + openapi: openapi/openapi.json + OrderFulfillmentType: + enum: + - PICKUP + - SHIPMENT + - DELIVERY + docs: The type of fulfillment. + source: + openapi: openapi/openapi.json + OrderFulfillmentUpdated: + properties: + order_id: + type: optional> + docs: The order's unique ID. + version: + type: optional + docs: >- + The version number, which is incremented each time an update is + committed to the order. + + Orders that were not created through the API do not include a version + number and + + therefore cannot be updated. + + + [Read more about working with + versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) + location_id: + type: optional> + docs: The ID of the seller location that this order is associated with. + state: + type: optional + docs: |- + The state of the order. + See [OrderState](#type-orderstate) for possible values + created_at: + type: optional + docs: The timestamp for when the order was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp for when the order was last updated, in RFC 3339 format. + access: read-only + fulfillment_update: + type: optional>> + docs: The fulfillments that were updated with this version change. + source: + openapi: openapi/openapi.json + OrderFulfillmentUpdatedEvent: + docs: |- + Published when an [OrderFulfillment](entity:OrderFulfillment) + is created or updated. This event is triggered only by the + [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint call. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"order.fulfillment.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + OrderFulfillmentUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"order_fulfillment_updated"`. + id: + type: optional + docs: ID of the affected order. + object: + type: optional + docs: An object containing information about the updated Order. + source: + openapi: openapi/openapi.json + OrderFulfillmentUpdatedObject: + properties: + order_fulfillment_updated: + type: optional + docs: Information about the updated order fulfillment. + source: + openapi: openapi/openapi.json + OrderFulfillmentUpdatedUpdate: + docs: Information about fulfillment updates. + properties: + fulfillment_uid: + type: optional> + docs: A unique ID that identifies the fulfillment only within this order. + old_state: + type: optional + docs: >- + The state of the fulfillment before the change. + + The state is not populated if the fulfillment is created with this new + `Order` version. + new_state: + type: optional + docs: >- + The state of the fulfillment after the change. The state might be + equal to `old_state` if a non-state + + field was changed on the fulfillment (such as the tracking number). + source: + openapi: openapi/openapi.json + OrderLineItem: + docs: |- + Represents a line item in an order. Each line item describes a different + product to purchase, with its own quantity and price details. + properties: + uid: + type: optional> + docs: A unique ID that identifies the line item only within this order. + validation: + maxLength: 60 + name: + type: optional> + docs: The name of the line item. + validation: + maxLength: 512 + quantity: + type: string + docs: >- + The count, or measurement, of a line item being purchased: + + + If `quantity` is a whole number, and `quantity_unit` is not specified, + then `quantity` denotes an item count. For example: `3` apples. + + + If `quantity` is a whole or decimal number, and `quantity_unit` is + also specified, then `quantity` denotes a measurement. For example: + `2.25` pounds of broccoli. + + + For more information, see [Specify item quantity and measurement + unit](https://developer.squareup.com/docs/orders-api/create-orders#specify-item-quantity-and-measurement-unit). + + + Line items with a quantity of `0` are automatically removed + + when paying for or otherwise completing the order. + validation: + minLength: 1 + maxLength: 12 + quantity_unit: + type: optional + docs: >- + The measurement unit and decimal precision that this line item's + quantity is measured in. + note: + type: optional> + docs: An optional note associated with the line item. + validation: + maxLength: 2000 + catalog_object_id: + type: optional> + docs: >- + The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to + this line item. + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this line item references. + variation_name: + type: optional> + docs: The name of the variation applied to this line item. + validation: + maxLength: 400 + item_type: + type: optional + docs: >- + The type of line item: an itemized sale, a non-itemized sale (custom + amount), or the + + activation or reloading of a gift card. + + See [OrderLineItemItemType](#type-orderlineitemitemtype) for possible + values + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this line item. Metadata fields + are intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + modifiers: + type: optional>> + docs: >- + The [CatalogModifier](entity:CatalogModifier)s applied to this line + item. + applied_taxes: + type: optional>> + docs: >- + The list of references to taxes applied to this line item. Each + + `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of + a + + top-level `OrderLineItemTax` applied to the line item. On reads, the + + amount applied is populated. + + + An `OrderLineItemAppliedTax` is automatically created on every line + + item for all `ORDER` scoped taxes added to the order. + `OrderLineItemAppliedTax` + + records for `LINE_ITEM` scoped taxes must be added in requests for the + tax + + to apply to any line items. + + + To change the amount of a tax, modify the referenced top-level tax. + applied_discounts: + type: optional>> + docs: >- + The list of references to discounts applied to this line item. Each + + `OrderLineItemAppliedDiscount` has a `discount_uid` that references + the `uid` of a top-level + + `OrderLineItemDiscounts` applied to the line item. On reads, the + amount + + applied is populated. + + + An `OrderLineItemAppliedDiscount` is automatically created on every + line item for all + + `ORDER` scoped discounts that are added to the order. + `OrderLineItemAppliedDiscount` records + + for `LINE_ITEM` scoped discounts must be added in requests for the + discount to apply to any + + line items. + + + To change the amount of a discount, modify the referenced top-level + discount. + applied_service_charges: + type: optional>> + docs: >- + The list of references to service charges applied to this line item. + Each + + `OrderLineItemAppliedServiceCharge` has a `service_charge_id` that + references the `uid` of a + + top-level `OrderServiceCharge` applied to the line item. On reads, the + amount applied is + + populated. + + + To change the amount of a service charge, modify the referenced + top-level service charge. + base_price_money: + type: optional + docs: The base price for a single unit of the line item. + variation_total_price_money: + type: optional + docs: >- + The total price of all item variations sold in this line item. + + The price is calculated as `base_price_money` multiplied by + `quantity`. + + It does not include modifiers. + gross_sales_money: + type: optional + docs: >- + The amount of money made in gross sales for this line item. + + The amount is calculated as the sum of the variation's total price and + each modifier's total price. + + For inclusive tax items in the US, Canada, and Japan, tax is deducted + from `gross_sales_money`. For Europe and + + Australia, inclusive tax remains as part of the gross sale + calculation. + total_tax_money: + type: optional + docs: The total amount of tax money to collect for the line item. + total_discount_money: + type: optional + docs: The total amount of discount money to collect for the line item. + total_money: + type: optional + docs: The total amount of money to collect for this line item. + pricing_blocklists: + type: optional + docs: >- + Describes pricing adjustments that are blocked from automatic + + application to a line item. For more information, see + + [Apply Taxes and + Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts). + total_service_charge_money: + type: optional + docs: >- + The total amount of apportioned service charge money to collect for + the line item. + source: + openapi: openapi/openapi.json + OrderLineItemAppliedDiscount: + docs: >- + Represents an applied portion of a discount to a line item in an order. + + + Order scoped discounts have automatically applied discounts present for + each line item. + + Line-item scoped discounts must have applied discounts added manually for + any applicable line + + items. The corresponding applied money is automatically computed based on + participating + + line items. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the applied discount only within this + order. + validation: + maxLength: 60 + discount_uid: + type: string + docs: >- + The `uid` of the discount that the applied discount represents. It + must + + reference a discount present in the `order.discounts` field. + + + This field is immutable. To change which discounts apply to a line + item, + + you must delete the discount and re-add it as a new + `OrderLineItemAppliedDiscount`. + validation: + minLength: 1 + maxLength: 60 + applied_money: + type: optional + docs: The amount of money applied by the discount to the line item. + source: + openapi: openapi/openapi.json + OrderLineItemAppliedServiceCharge: + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the applied service charge only within + this order. + validation: + maxLength: 60 + service_charge_uid: + type: string + docs: >- + The `uid` of the service charge that the applied service charge + represents. It must + + reference a service charge present in the `order.service_charges` + field. + + + This field is immutable. To change which service charges apply to a + line item, + + delete and add a new `OrderLineItemAppliedServiceCharge`. + validation: + minLength: 1 + maxLength: 60 + applied_money: + type: optional + docs: The amount of money applied by the service charge to the line item. + source: + openapi: openapi/openapi.json + OrderLineItemAppliedTax: + docs: >- + Represents an applied portion of a tax to a line item in an order. + + + Order-scoped taxes automatically include the applied taxes in each line + item. + + Line item taxes must be referenced from any applicable line items. + + The corresponding applied money is automatically computed, based on the + + set of participating line items. + properties: + uid: + type: optional> + docs: A unique ID that identifies the applied tax only within this order. + validation: + maxLength: 60 + tax_uid: + type: string + docs: >- + The `uid` of the tax for which this applied tax represents. It must + reference + + a tax present in the `order.taxes` field. + + + This field is immutable. To change which taxes apply to a line item, + delete and add a new + + `OrderLineItemAppliedTax`. + validation: + minLength: 1 + maxLength: 60 + applied_money: + type: optional + docs: The amount of money applied by the tax to the line item. + source: + openapi: openapi/openapi.json + OrderLineItemDiscount: + docs: >- + Represents a discount that applies to one or more line items in an + + order. + + + Fixed-amount, order-scoped discounts are distributed across all non-zero + line item totals. + + The amount distributed to each line item is relative to the + + amount contributed by the item to the order subtotal. + properties: + uid: + type: optional> + docs: A unique ID that identifies the discount only within this order. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID referencing + [CatalogDiscount](entity:CatalogDiscount). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this discount references. + name: + type: optional> + docs: The discount's name. + validation: + maxLength: 255 + type: + type: optional + docs: >- + The type of the discount. + + + Discounts that do not reference a catalog object ID must have a type + of + + `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. + + See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for + possible values + percentage: + type: optional> + docs: >- + The percentage of the discount, as a string representation of a + decimal number. + + A value of `7.25` corresponds to a percentage of 7.25%. + + + `percentage` is not set for amount-based discounts. + validation: + maxLength: 10 + amount_money: + type: optional + docs: |- + The total declared monetary amount of the discount. + + `amount_money` is not set for percentage-based discounts. + applied_money: + type: optional + docs: >- + The amount of discount actually applied to the line item. + + + The amount represents the amount of money applied as a line-item + scoped discount. + + When an amount-based discount is scoped to the entire order, the value + + of `applied_money` is different than `amount_money` because the total + + amount of the discount is distributed across all line items. + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this discount. Metadata fields + are intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + scope: + type: optional + docs: >- + Indicates the level at which the discount applies. For `ORDER` scoped + discounts, + + Square generates references in `applied_discounts` on all order line + items that do + + not have them. For `LINE_ITEM` scoped discounts, the discount only + applies to line items + + with a discount reference in their `applied_discounts` field. + + + This field is immutable. To change the scope of a discount, you must + delete + + the discount and re-add it as a new discount. + + See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for + possible values + reward_ids: + type: optional> + docs: >- + The reward IDs corresponding to this discount. The application and + + specification of discounts that have `reward_ids` are completely + controlled by the backing + + criteria corresponding to the reward tiers of the rewards that are + added to the order + + through the Loyalty API. To manually unapply discounts that are the + result of added rewards, + + the rewards must be removed from the order through the Loyalty API. + access: read-only + pricing_rule_id: + type: optional + docs: >- + The object ID of a [pricing rule](entity:CatalogPricingRule) to be + applied + + automatically to this discount. The specification and application of + the discounts, to + + which a `pricing_rule_id` is assigned, are completely controlled by + the corresponding + + pricing rule. + access: read-only + source: + openapi: openapi/openapi.json + OrderLineItemDiscountScope: + enum: + - OTHER_DISCOUNT_SCOPE + - LINE_ITEM + - ORDER + docs: Indicates whether this is a line-item or order-level discount. + source: + openapi: openapi/openapi.json + OrderLineItemDiscountType: + enum: + - UNKNOWN_DISCOUNT + - FIXED_PERCENTAGE + - FIXED_AMOUNT + - VARIABLE_PERCENTAGE + - VARIABLE_AMOUNT + docs: >- + Indicates how the discount is applied to the associated line item or + order. + source: + openapi: openapi/openapi.json + OrderLineItemItemType: + enum: + - ITEM + - CUSTOM_AMOUNT + - GIFT_CARD + docs: Represents the line item type. + source: + openapi: openapi/openapi.json + OrderLineItemModifier: + docs: A [CatalogModifier](entity:CatalogModifier). + properties: + uid: + type: optional> + docs: A unique ID that identifies the modifier only within this order. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID referencing + [CatalogModifier](entity:CatalogModifier). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this modifier references. + name: + type: optional> + docs: The name of the item modifier. + validation: + maxLength: 255 + quantity: + type: optional> + docs: >- + The quantity of the line item modifier. The modifier quantity can be 0 + or more. + + For example, suppose a restaurant offers a cheeseburger on the menu. + When a buyer orders + + this item, the restaurant records the purchase by creating an `Order` + object with a line item + + for a burger. The line item includes a line item modifier: the name is + cheese and the quantity + + is 1. The buyer has the option to order extra cheese (or no cheese). + If the buyer chooses + + the extra cheese option, the modifier quantity increases to 2. If the + buyer does not want + + any cheese, the modifier quantity is set to 0. + base_price_money: + type: optional + docs: >- + 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](entity:CatalogModifier) + price. + total_price_money: + type: optional + docs: >- + 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. + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this order. Metadata fields are + intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + source: + openapi: openapi/openapi.json + OrderLineItemPricingBlocklists: + docs: >- + Describes pricing adjustments that are blocked from automatic + + application to a line item. For more information, see + + [Apply Taxes and + Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts). + properties: + blocked_discounts: + type: >- + optional>> + docs: >- + A list of discounts blocked from applying to the line item. + + Discounts can be blocked by the `discount_uid` (for ad hoc discounts) + or + + the `discount_catalog_object_id` (for catalog discounts). + blocked_taxes: + type: optional>> + docs: |- + A list of taxes blocked from applying to the line item. + Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or + the `tax_catalog_object_id` (for catalog taxes). + source: + openapi: openapi/openapi.json + OrderLineItemPricingBlocklistsBlockedDiscount: + docs: >- + A discount to block from applying to a line item. The discount must be + + identified by either `discount_uid` or `discount_catalog_object_id`, but + not both. + properties: + uid: + type: optional> + docs: A unique ID of the `BlockedDiscount` within the order. + validation: + maxLength: 60 + discount_uid: + type: optional> + docs: >- + The `uid` of the discount that should be blocked. Use this field to + block + + ad hoc discounts. For catalog discounts, use the + `discount_catalog_object_id` field. + validation: + maxLength: 60 + discount_catalog_object_id: + type: optional> + docs: >- + The `catalog_object_id` of the discount that should be blocked. + + Use this field to block catalog discounts. For ad hoc discounts, use + the + + `discount_uid` field. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + OrderLineItemPricingBlocklistsBlockedTax: + docs: |- + A tax to block from applying to a line item. The tax must be + identified by either `tax_uid` or `tax_catalog_object_id`, but not both. + properties: + uid: + type: optional> + docs: A unique ID of the `BlockedTax` within the order. + validation: + maxLength: 60 + tax_uid: + type: optional> + docs: >- + The `uid` of the tax that should be blocked. Use this field to block + + ad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` + field. + validation: + maxLength: 60 + tax_catalog_object_id: + type: optional> + docs: |- + The `catalog_object_id` of the tax that should be blocked. + Use this field to block catalog taxes. For ad hoc taxes, use the + `tax_uid` field. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + OrderLineItemTax: + docs: >- + Represents a tax that applies to one or more line item in the order. + + + Fixed-amount, order-scoped taxes are distributed across all non-zero line + item totals. + + The amount distributed to each line item is relative to the amount the + item + + contributes to the order subtotal. + properties: + uid: + type: optional> + docs: A unique ID that identifies the tax only within this order. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: The catalog object ID referencing [CatalogTax](entity:CatalogTax). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this tax references. + name: + type: optional> + docs: The tax's name. + validation: + maxLength: 255 + type: + type: optional + docs: >- + Indicates the calculation method used to apply the tax. + + See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible + values + percentage: + type: optional> + docs: >- + The percentage of the tax, as a string representation of a decimal + + number. For example, a value of `"7.25"` corresponds to a percentage + of + + 7.25%. + validation: + maxLength: 10 + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this tax. Metadata fields are + intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + applied_money: + type: optional + docs: |- + The amount of money applied to the order by the tax. + + - For percentage-based taxes, `applied_money` is the money + calculated using the percentage. + scope: + type: optional + docs: >- + Indicates the level at which the tax applies. For `ORDER` scoped + taxes, + + Square generates references in `applied_taxes` on all order line items + that do + + not have them. For `LINE_ITEM` scoped taxes, the tax only applies to + line items + + with references in their `applied_taxes` field. + + + This field is immutable. To change the scope, you must delete the tax + and + + re-add it as a new tax. + + See [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible + values + auto_applied: + type: optional + docs: >- + Determines whether the tax was automatically applied to the order + based on + + the catalog configuration. For an example, see + + [Automatically Apply Taxes to an + Order](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-taxes). + access: read-only + source: + openapi: openapi/openapi.json + OrderLineItemTaxScope: + enum: + - OTHER_TAX_SCOPE + - LINE_ITEM + - ORDER + docs: Indicates whether this is a line-item or order-level tax. + source: + openapi: openapi/openapi.json + OrderLineItemTaxType: + enum: + - UNKNOWN_TAX + - ADDITIVE + - INCLUSIVE + docs: Indicates how the tax is applied to the associated line item or order. + source: + openapi: openapi/openapi.json + OrderMoneyAmounts: + docs: A collection of various money amounts. + properties: + total_money: + type: optional + docs: The total money. + tax_money: + type: optional + docs: The money associated with taxes. + discount_money: + type: optional + docs: The money associated with discounts. + tip_money: + type: optional + docs: The money associated with tips. + service_charge_money: + type: optional + docs: The money associated with service charges. + source: + openapi: openapi/openapi.json + OrderPricingOptions: + docs: >- + Pricing options for an order. The options affect how the order's price is + calculated. + + They can be used, for example, to apply automatic price adjustments that + are based on preconfigured + + [pricing rules](entity:CatalogPricingRule). + properties: + auto_apply_discounts: + type: optional> + docs: |- + The option to determine whether pricing rule-based + discounts are automatically applied to an order. + auto_apply_taxes: + type: optional> + docs: >- + The option to determine whether rule-based taxes are automatically + + applied to an order when the criteria of the corresponding rules are + met. + source: + openapi: openapi/openapi.json + OrderQuantityUnit: + docs: >- + Contains the measurement unit for a quantity and a precision that + + specifies the number of digits after the decimal point for decimal + quantities. + properties: + measurement_unit: + type: optional + docs: |- + A [MeasurementUnit](entity:MeasurementUnit) that represents the + unit of measure for the quantity. + precision: + type: optional> + docs: >- + For non-integer quantities, represents the number of digits after the + decimal point that are + + recorded for this quantity. + + + For example, a precision of 1 allows quantities such as `"1.0"` and + `"1.1"`, but not `"1.01"`. + + + Min: 0. Max: 5. + catalog_object_id: + type: optional> + docs: |- + The catalog object ID referencing the + [CatalogMeasurementUnit](entity:CatalogMeasurementUnit). + + This field is set when this is a catalog-backed measurement unit. + catalog_version: + type: optional> + docs: >- + The version of the catalog object that this measurement unit + references. + + + This field is set when this is a catalog-backed measurement unit. + source: + openapi: openapi/openapi.json + OrderReturn: + docs: >- + The set of line items, service charges, taxes, discounts, tips, and other + items being returned in an order. + properties: + uid: + type: optional> + docs: A unique ID that identifies the return only within this order. + validation: + maxLength: 60 + source_order_id: + type: optional> + docs: >- + An order that contains the original sale of these return line items. + This is unset + + for unlinked returns. + return_line_items: + type: optional>> + docs: A collection of line items that are being returned. + return_service_charges: + type: optional>> + docs: A collection of service charges that are being returned. + return_taxes: + type: optional> + docs: >- + A collection of references to taxes being returned for an order, + including the total + + applied tax amount to be returned. The taxes must reference a + top-level tax ID from the source + + order. + access: read-only + return_discounts: + type: optional> + docs: >- + A collection of references to discounts being returned for an order, + including the total + + applied discount amount to be returned. The discounts must reference a + top-level discount ID + + from the source order. + access: read-only + return_tips: + type: optional>> + docs: A collection of references to tips being returned for an order. + rounding_adjustment: + type: optional + docs: >- + A positive or negative rounding adjustment to the total value being + returned. Adjustments are commonly + + used to apply cash rounding when the minimum unit of the account is + smaller than the lowest + + physical denomination of the currency. + return_amounts: + type: optional + docs: An aggregate monetary value being returned by this return entry. + source: + openapi: openapi/openapi.json + OrderReturnDiscount: + docs: >- + Represents a discount being returned that applies to one or more return + line items in an + + order. + + + Fixed-amount, order-scoped discounts are distributed across all non-zero + return line item totals. + + The amount distributed to each return line item is relative to that item’s + contribution to the + + order subtotal. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the returned discount only within this + order. + validation: + maxLength: 60 + source_discount_uid: + type: optional> + docs: >- + The discount `uid` from the order that contains the original + application of this discount. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID referencing + [CatalogDiscount](entity:CatalogDiscount). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this discount references. + name: + type: optional> + docs: The discount's name. + validation: + maxLength: 255 + type: + type: optional + docs: >- + The type of the discount. If it is created by the API, it is + `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. + + + Discounts that do not reference a catalog object ID must have a type + of + + `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. + + See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for + possible values + percentage: + type: optional> + docs: >- + The percentage of the tax, as a string representation of a decimal + number. + + A value of `"7.25"` corresponds to a percentage of 7.25%. + + + `percentage` is not set for amount-based discounts. + validation: + maxLength: 10 + amount_money: + type: optional + docs: |- + The total declared monetary amount of the discount. + + `amount_money` is not set for percentage-based discounts. + applied_money: + type: optional + docs: >- + The amount of discount actually applied to this line item. When an + amount-based + + discount is at the order level, this value is different from + `amount_money` because the discount + + is distributed across the line items. + scope: + type: optional + docs: >- + Indicates the level at which the `OrderReturnDiscount` applies. For + `ORDER` scoped + + discounts, the server generates references in `applied_discounts` on + all + + `OrderReturnLineItem`s. For `LINE_ITEM` scoped discounts, the discount + is only applied to + + `OrderReturnLineItem`s with references in their `applied_discounts` + field. + + See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for + possible values + source: + openapi: openapi/openapi.json + OrderReturnLineItem: + docs: The line item being returned in an order. + properties: + uid: + type: optional> + docs: A unique ID for this return line-item entry. + validation: + maxLength: 60 + source_line_item_uid: + type: optional> + docs: The `uid` of the line item in the original sale order. + validation: + maxLength: 60 + name: + type: optional> + docs: The name of the line item. + validation: + maxLength: 512 + quantity: + type: string + docs: |- + 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"`. + validation: + minLength: 1 + maxLength: 12 + quantity_unit: + type: optional + docs: >- + The unit and precision that this return line item's quantity is + measured in. + note: + type: optional> + docs: The note of the return line item. + validation: + maxLength: 2000 + catalog_object_id: + type: optional> + docs: >- + The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to + this return line item. + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this line item references. + variation_name: + type: optional> + docs: The name of the variation applied to this return line item. + validation: + maxLength: 400 + item_type: + type: optional + docs: >- + The type of line item: an itemized return, a non-itemized return + (custom amount), + + or the return of an unactivated gift card sale. + + See [OrderLineItemItemType](#type-orderlineitemitemtype) for possible + values + return_modifiers: + type: optional>> + docs: >- + The [CatalogModifier](entity:CatalogModifier)s applied to this line + item. + applied_taxes: + type: optional>> + docs: >- + The list of references to `OrderReturnTax` entities applied to the + return line item. Each + + `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of + a top-level + + `OrderReturnTax` applied to the return line item. On reads, the + applied amount + + is populated. + applied_discounts: + type: optional>> + docs: >- + The list of references to `OrderReturnDiscount` entities applied to + the return line item. Each + + `OrderLineItemAppliedDiscount` has a `discount_uid` that references + the `uid` of a top-level + + `OrderReturnDiscount` applied to the return line item. On reads, the + applied amount + + is populated. + base_price_money: + type: optional + docs: The base price for a single unit of the line item. + variation_total_price_money: + type: optional + docs: >- + The total price of all item variations returned in this line item. + + The price is calculated as `base_price_money` multiplied by `quantity` + and + + does not include modifiers. + gross_return_money: + type: optional + docs: >- + The gross return amount of money calculated as (item base price + + modifiers price) * quantity. + total_tax_money: + type: optional + docs: The total amount of tax money to return for the line item. + total_discount_money: + type: optional + docs: The total amount of discount money to return for the line item. + total_money: + type: optional + docs: The total amount of money to return for this line item. + applied_service_charges: + type: optional>> + docs: >- + The list of references to `OrderReturnServiceCharge` entities applied + to the return + + line item. Each `OrderLineItemAppliedServiceCharge` has a + `service_charge_uid` that + + references the `uid` of a top-level `OrderReturnServiceCharge` applied + to the return line + + item. On reads, the applied amount is populated. + total_service_charge_money: + type: optional + docs: >- + The total amount of apportioned service charge money to return for the + line item. + source: + openapi: openapi/openapi.json + OrderReturnLineItemModifier: + docs: A line item modifier being returned. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the return modifier only within this + order. + validation: + maxLength: 60 + source_modifier_uid: + type: optional> + docs: |- + The modifier `uid` from the order's line item that contains the + original sale of this line item modifier. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID referencing + [CatalogModifier](entity:CatalogModifier). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: >- + The version of the catalog object that this line item modifier + references. + name: + type: optional> + docs: The name of the item modifier. + validation: + maxLength: 255 + base_price_money: + type: optional + docs: >- + The base price for the modifier. + + + `base_price_money` is required for ad hoc modifiers. + + If both `catalog_object_id` and `base_price_money` are set, + `base_price_money` overrides the predefined + [CatalogModifier](entity:CatalogModifier) price. + total_price_money: + type: optional + docs: >- + 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. + quantity: + type: optional> + docs: >- + The quantity of the line item modifier. The modifier quantity can be 0 + or more. + + For example, suppose a restaurant offers a cheeseburger on the menu. + When a buyer orders + + this item, the restaurant records the purchase by creating an `Order` + object with a line item + + for a burger. The line item includes a line item modifier: the name is + cheese and the quantity + + is 1. The buyer has the option to order extra cheese (or no cheese). + If the buyer chooses + + the extra cheese option, the modifier quantity increases to 2. If the + buyer does not want + + any cheese, the modifier quantity is set to 0. + source: + openapi: openapi/openapi.json + OrderReturnServiceCharge: + docs: Represents the service charge applied to the original order. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the return service charge only within this + order. + validation: + maxLength: 60 + source_service_charge_uid: + type: optional> + docs: |- + The service charge `uid` from the order containing the original + service charge. `source_service_charge_uid` is `null` for + unlinked returns. + validation: + maxLength: 60 + name: + type: optional> + docs: The name of the service charge. + validation: + maxLength: 255 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID of the associated + [OrderServiceCharge](entity:OrderServiceCharge). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this service charge references. + percentage: + type: optional> + docs: |- + The percentage of the service charge, as a string representation of + a decimal number. For example, a value of `"7.25"` corresponds to a + percentage of 7.25%. + + Either `percentage` or `amount_money` should be set, but not both. + validation: + maxLength: 10 + amount_money: + type: optional + docs: |- + The amount of a non-percentage-based service charge. + + Either `percentage` or `amount_money` should be set, but not both. + applied_money: + type: optional + docs: >- + The amount of money applied to the order by the service charge, + including + + any inclusive tax amounts, as calculated by Square. + + + - For fixed-amount service charges, `applied_money` is equal to + `amount_money`. + + - For percentage-based service charges, `applied_money` is the money + calculated using the percentage. + total_money: + type: optional + docs: >- + The total amount of money to collect for the service charge. + + + __NOTE__: If an inclusive tax is applied to the service charge, + `total_money` + + does not equal `applied_money` plus `total_tax_money` because the + inclusive + + tax amount is already included in both `applied_money` and + `total_tax_money`. + total_tax_money: + type: optional + docs: The total amount of tax money to collect for the service charge. + calculation_phase: + type: optional + docs: >- + The calculation phase after which to apply the service charge. + + See + [OrderServiceChargeCalculationPhase](#type-orderservicechargecalculationphase) + for possible values + taxable: + type: optional> + docs: |- + Indicates whether the surcharge can be taxed. Service charges + calculated in the `TOTAL_PHASE` cannot be marked as taxable. + applied_taxes: + type: optional>> + docs: >- + The list of references to `OrderReturnTax` entities applied to the + + `OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a + `tax_uid` + + that references the `uid` of a top-level `OrderReturnTax` that is + being + + applied to the `OrderReturnServiceCharge`. On reads, the applied + amount is + + populated. + treatment_type: + type: optional + docs: >- + The treatment type of the service charge. + + See + [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) + for possible values + scope: + type: optional + docs: >- + Indicates the level at which the apportioned service charge applies. + For `ORDER` + + scoped service charges, Square generates references in + `applied_service_charges` on + + all order line items that do not have them. For `LINE_ITEM` scoped + service charges, + + the service charge only applies to line items with a service charge + reference in their + + `applied_service_charges` field. + + + This field is immutable. To change the scope of an apportioned service + charge, you must delete + + the apportioned service charge and re-add it as a new apportioned + service charge. + + See [OrderServiceChargeScope](#type-orderservicechargescope) for + possible values + source: + openapi: openapi/openapi.json + OrderReturnTax: + docs: >- + Represents a tax being returned that applies to one or more return line + items in an order. + + + Fixed-amount, order-scoped taxes are distributed across all non-zero + return line item totals. + + The amount distributed to each return line item is relative to that item’s + contribution to the + + order subtotal. + properties: + uid: + type: optional> + docs: A unique ID that identifies the returned tax only within this order. + validation: + maxLength: 60 + source_tax_uid: + type: optional> + docs: The tax `uid` from the order that contains the original tax charge. + validation: + maxLength: 60 + catalog_object_id: + type: optional> + docs: The catalog object ID referencing [CatalogTax](entity:CatalogTax). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this tax references. + name: + type: optional> + docs: The tax's name. + validation: + maxLength: 255 + type: + type: optional + docs: >- + Indicates the calculation method used to apply the tax. + + See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible + values + percentage: + type: optional> + docs: >- + The percentage of the tax, as a string representation of a decimal + number. + + For example, a value of `"7.25"` corresponds to a percentage of 7.25%. + validation: + maxLength: 10 + applied_money: + type: optional + docs: The amount of money applied by the tax in an order. + scope: + type: optional + docs: >- + Indicates the level at which the `OrderReturnTax` applies. For `ORDER` + scoped + + taxes, Square generates references in `applied_taxes` on all + + `OrderReturnLineItem`s. For `LINE_ITEM` scoped taxes, the tax is only + applied to + + `OrderReturnLineItem`s with references in their `applied_discounts` + field. + + See [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible + values + source: + openapi: openapi/openapi.json + OrderReturnTip: + docs: A tip being returned. + properties: + uid: + type: optional> + docs: A unique ID that identifies the tip only within this order. + validation: + maxLength: 60 + applied_money: + type: optional + docs: |- + The amount of tip being returned + -- + source_tender_uid: + type: optional> + docs: >- + The tender `uid` from the order that contains the original application + of this tip. + validation: + maxLength: 192 + source_tender_id: + type: optional> + docs: >- + The tender `id` from the order that contains the original application + of this tip. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + OrderReward: + docs: |- + Represents a reward that can be applied to an order if the necessary + reward tier criteria are met. Rewards are created through the Loyalty API. + properties: + id: + type: string + docs: The identifier of the reward. + validation: + minLength: 1 + reward_tier_id: + type: string + docs: The identifier of the reward tier corresponding to this reward. + validation: + minLength: 1 + source: + openapi: openapi/openapi.json + OrderRoundingAdjustment: + docs: >- + A rounding adjustment of the money being returned. Commonly used to apply + cash rounding + + when the minimum unit of the account is smaller than the lowest physical + denomination of the currency. + properties: + uid: + type: optional> + docs: >- + A unique ID that identifies the rounding adjustment only within this + order. + validation: + maxLength: 60 + name: + type: optional> + docs: The name of the rounding adjustment from the original sale order. + amount_money: + type: optional + docs: The actual rounding adjustment amount. + source: + openapi: openapi/openapi.json + OrderServiceCharge: + docs: Represents a service charge applied to an order. + properties: + uid: + type: optional> + docs: A unique ID that identifies the service charge only within this order. + validation: + maxLength: 60 + name: + type: optional> + docs: The name of the service charge. + validation: + maxLength: 512 + catalog_object_id: + type: optional> + docs: >- + The catalog object ID referencing the service charge + [CatalogObject](entity:CatalogObject). + validation: + maxLength: 192 + catalog_version: + type: optional> + docs: The version of the catalog object that this service charge references. + percentage: + type: optional> + docs: >- + The service charge percentage as a string representation of a + + decimal number. For example, `"7.25"` indicates a service charge of + 7.25%. + + + Exactly 1 of `percentage` or `amount_money` should be set. + validation: + maxLength: 10 + amount_money: + type: optional + docs: |- + The amount of a non-percentage-based service charge. + + Exactly one of `percentage` or `amount_money` should be set. + applied_money: + type: optional + docs: >- + The amount of money applied to the order by the service charge, + + including any inclusive tax amounts, as calculated by Square. + + + - For fixed-amount service charges, `applied_money` is equal to + `amount_money`. + + - For percentage-based service charges, `applied_money` is the money + + calculated using the percentage. + total_money: + type: optional + docs: |- + The total amount of money to collect for the service charge. + + __Note__: If an inclusive tax is applied to the service charge, + `total_money` does not equal `applied_money` plus `total_tax_money` + because the inclusive tax amount is already included in both + `applied_money` and `total_tax_money`. + total_tax_money: + type: optional + docs: The total amount of tax money to collect for the service charge. + calculation_phase: + type: optional + docs: >- + The calculation phase at which to apply the service charge. + + See + [OrderServiceChargeCalculationPhase](#type-orderservicechargecalculationphase) + for possible values + taxable: + type: optional> + docs: >- + Indicates whether the service charge can be taxed. If set to `true`, + + order-level taxes automatically apply to the service charge. Note that + + service charges calculated in the `TOTAL_PHASE` cannot be marked as + taxable. + applied_taxes: + type: optional>> + docs: >- + The list of references to the taxes applied to this service charge. + Each + + `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of + a top-level + + `OrderLineItemTax` that is being applied to this service charge. On + reads, the amount applied + + is populated. + + + An `OrderLineItemAppliedTax` is automatically created on every taxable + service charge + + for all `ORDER` scoped taxes that are added to the order. + `OrderLineItemAppliedTax` records + + for `LINE_ITEM` scoped taxes must be added in requests for the tax to + apply to any taxable + + service charge. Taxable service charges have the `taxable` field set + to `true` and calculated + + in the `SUBTOTAL_PHASE`. + + + To change the amount of a tax, modify the referenced top-level tax. + metadata: + type: optional>>>> + docs: >- + Application-defined data attached to this service charge. Metadata + fields are intended + + to store descriptive references or associations with an entity in + another system or store brief + + information about the object. Square does not process this field; it + only stores and returns it + + in relevant API calls. Do not use metadata to store any sensitive + information (such as personally + + identifiable information or card details). + + + Keys written by applications must be 60 characters or less and must be + in the character set + + `[a-zA-Z0-9_-]`. Entries can also include metadata generated by + Square. These keys are prefixed + + with a namespace, separated from the key with a ':' character. + + + Values have a maximum length of 255 characters. + + + An application can have up to 10 entries per metadata field. + + + Entries written by applications are private and can only be read or + modified by the same + + application. + + + For more information, see + [Metadata](https://developer.squareup.com/docs/build-basics/metadata). + type: + type: optional + docs: >- + The type of the service charge. + + See [OrderServiceChargeType](#type-orderservicechargetype) for + possible values + treatment_type: + type: optional + docs: >- + The treatment type of the service charge. + + See + [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) + for possible values + scope: + type: optional + docs: >- + Indicates the level at which the apportioned service charge applies. + For `ORDER` + + scoped service charges, Square generates references in + `applied_service_charges` on + + all order line items that do not have them. For `LINE_ITEM` scoped + service charges, + + the service charge only applies to line items with a service charge + reference in their + + `applied_service_charges` field. + + + This field is immutable. To change the scope of an apportioned service + charge, you must delete + + the apportioned service charge and re-add it as a new apportioned + service charge. + + See [OrderServiceChargeScope](#type-orderservicechargescope) for + possible values + source: + openapi: openapi/openapi.json + OrderServiceChargeCalculationPhase: + enum: + - SUBTOTAL_PHASE + - TOTAL_PHASE + - APPORTIONED_PERCENTAGE_PHASE + - APPORTIONED_AMOUNT_PHASE + docs: >- + Represents a phase in the process of calculating order totals. + + Service charges are applied after the indicated phase. + + + [Read more about how order totals are + calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) + source: + openapi: openapi/openapi.json + OrderServiceChargeScope: + enum: + - OTHER_SERVICE_CHARGE_SCOPE + - LINE_ITEM + - ORDER + docs: |- + Indicates whether this is a line-item or order-level apportioned + service charge. + source: + openapi: openapi/openapi.json + OrderServiceChargeTreatmentType: + enum: + - LINE_ITEM_TREATMENT + - APPORTIONED_TREATMENT + docs: >- + Indicates whether the service charge will be treated as a value-holding + line item or + + apportioned toward a line item. + source: + openapi: openapi/openapi.json + OrderServiceChargeType: + enum: + - AUTO_GRATUITY + - CUSTOM + source: + openapi: openapi/openapi.json + OrderSource: + docs: Represents the origination details of an order. + properties: + name: + type: optional> + docs: >- + The name used to identify the place (physical or digital) that an + order originates. + + If unset, the name defaults to the name of the application that + created the order. + source: + openapi: openapi/openapi.json + OrderState: + enum: + - OPEN + - COMPLETED + - CANCELED + - DRAFT + docs: The state of the order. + source: + openapi: openapi/openapi.json + OrderUpdated: + properties: + order_id: + type: optional> + docs: The order's unique ID. + version: + type: optional + docs: >- + The version number, which is incremented each time an update is + committed to the order. + + Orders that were not created through the API do not include a version + number and + + therefore cannot be updated. + + + [Read more about working with + versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders) + location_id: + type: optional> + docs: The ID of the seller location that this order is associated with. + state: + type: optional + docs: |- + The state of the order. + See [OrderState](#type-orderstate) for possible values + created_at: + type: optional + docs: The timestamp for when the order was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp for when the order was last updated, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + OrderUpdatedEvent: + docs: |- + Published when an [Order](entity:Order) is updated. This + event is triggered by the [UpdateOrder](api-endpoint:Orders-UpdateOrder) + endpoint call, Order Manager, or the Square Dashboard. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"order.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + OrderUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"order_updated"`. + id: + type: optional + docs: ID of the affected order. + object: + type: optional + docs: An object containing information about the updated Order. + source: + openapi: openapi/openapi.json + OrderUpdatedObject: + properties: + order_updated: + type: optional + docs: Information about the updated order. + source: + openapi: openapi/openapi.json + PauseSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [PauseSubscription](api-endpoint:Subscriptions-PauseSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The subscription to be paused by the scheduled `PAUSE` action. + actions: + type: optional> + docs: >- + The list of a `PAUSE` action and a possible `RESUME` action created by + the request. + source: + openapi: openapi/openapi.json + PayOrderResponse: + docs: >- + Defines the fields that are included in the response body of a request to + the + + [PayOrder](api-endpoint:Orders-PayOrder) endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + order: + type: optional + docs: The paid, updated [order](entity:Order). + source: + openapi: openapi/openapi.json + Payment: + docs: Represents a payment processed by the Square API. + properties: + id: + type: optional + docs: A unique ID for the payment. + validation: + maxLength: 192 + access: read-only + created_at: + type: optional + docs: The timestamp of when the payment was created, in RFC 3339 format. + validation: + maxLength: 32 + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the payment was last updated, in RFC 3339 + format. + validation: + maxLength: 32 + access: read-only + amount_money: + type: optional + docs: >- + The amount processed for this payment, not including `tip_money`. + + + The amount is specified in the smallest denomination of the applicable + currency (for example, + + US dollar amounts are specified in cents). For more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + tip_money: + type: optional + docs: >- + The amount designated as a tip for the seller's staff. + + + Tips for external vendors such as a 3rd party delivery courier must be + recorded using Order.service_charges. + + + This amount is specified in the smallest denomination of the + applicable currency (for example, + + US dollar amounts are specified in cents). For more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + total_money: + type: optional + docs: >- + The total amount for the payment, including `amount_money` and + `tip_money`. + + This amount is specified in the smallest denomination of the + applicable currency (for example, + + US dollar amounts are specified in cents). For more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + app_fee_money: + type: optional + docs: >- + The amount the developer is taking as a fee for facilitating the + payment on behalf + + of the seller. This amount is specified in the smallest denomination + of the applicable currency + + (for example, US dollar amounts are specified in cents). For more + information, + + see [Take Payments and Collect + Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + + + The amount cannot be more than 90% of the `total_money` value. + + + To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth + permission is required. + + For more information, see + [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions). + approved_money: + type: optional + docs: >- + The amount of money approved for this payment. This value may change + if Square chooses to + + obtain reauthorization as part of a call to + [UpdatePayment](api-endpoint:Payments-UpdatePayment). + processing_fee: + type: optional> + docs: >- + The processing fees and fee adjustments assessed by Square for this + payment. + access: read-only + refunded_money: + type: optional + docs: >- + The total amount of the payment refunded to date. + + + This amount is specified in the smallest denomination of the + applicable currency (for example, + + US dollar amounts are specified in cents). + status: + type: optional + docs: >- + Indicates whether the payment is APPROVED, PENDING, COMPLETED, + CANCELED, or FAILED. + validation: + maxLength: 50 + access: read-only + delay_duration: + type: optional + docs: >- + The duration of time after the payment's creation when Square + automatically applies the + + `delay_action` to the payment. This automatic `delay_action` applies + only to payments that + + do not reach a terminal state (COMPLETED, CANCELED, or FAILED) before + the `delay_duration` + + time period. + + + This field is specified as a time duration, in RFC 3339 format. + + + Notes: + + This feature is only supported for card payments. + + + Default: + + + - Card-present payments: "PT36H" (36 hours) from the creation time. + + - Card-not-present payments: "P7D" (7 days) from the creation time. + access: read-only + delay_action: + type: optional> + docs: >- + The action to be applied to the payment when the `delay_duration` has + elapsed. + + + Current values include `CANCEL` and `COMPLETE`. + delayed_until: + type: optional + docs: >- + The read-only timestamp of when the `delay_action` is automatically + applied, + + in RFC 3339 format. + + + Note that this field is calculated by summing the payment's + `delay_duration` and `created_at` + + fields. The `created_at` field is generated by Square and might not + exactly match the + + time on your local machine. + access: read-only + source_type: + type: optional + docs: >- + The source type for this payment. + + + Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, + `BUY_NOW_PAY_LATER`, `SQUARE_ACCOUNT`, + + `CASH` and `EXTERNAL`. For information about these payment source + types, + + see [Take + Payments](https://developer.squareup.com/docs/payments-api/take-payments). + validation: + maxLength: 50 + access: read-only + card_details: + type: optional + docs: >- + Details about a card payment. These details are only populated if the + source_type is `CARD`. + cash_details: + type: optional + docs: >- + Details about a cash payment. These details are only populated if the + source_type is `CASH`. + bank_account_details: + type: optional + docs: >- + Details about a bank account payment. These details are only populated + if the source_type is `BANK_ACCOUNT`. + external_details: + type: optional + docs: |- + Details about an external payment. The details are only populated + if the `source_type` is `EXTERNAL`. + wallet_details: + type: optional + docs: |- + Details about an wallet payment. The details are only populated + if the `source_type` is `WALLET`. + buy_now_pay_later_details: + type: optional + docs: >- + Details about a Buy Now Pay Later payment. The details are only + populated + + if the `source_type` is `BUY_NOW_PAY_LATER`. For more information, + see + + [Afterpay + Payments](https://developer.squareup.com/docs/payments-api/take-payments/afterpay-payments). + square_account_details: + type: optional + docs: |- + Details about a Square Account payment. The details are only populated + if the `source_type` is `SQUARE_ACCOUNT`. + location_id: + type: optional + docs: The ID of the location associated with the payment. + validation: + maxLength: 50 + access: read-only + order_id: + type: optional + docs: The ID of the order associated with the payment. + validation: + maxLength: 192 + access: read-only + reference_id: + type: optional + docs: |- + An optional ID that associates the payment with an entity in + another system. + validation: + maxLength: 40 + access: read-only + customer_id: + type: optional + docs: >- + The ID of the customer associated with the payment. If the ID is + + not provided in the `CreatePayment` request that was used to create + the `Payment`, + + Square may use information in the request + + (such as the billing and shipping address, email address, and payment + source) + + to identify a matching customer profile in the Customer Directory. + + If found, the profile ID is used. If a profile is not found, the + + API attempts to create an + + [instant + profile](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). + + If the API cannot create an + + instant profile (either because the seller has disabled it or the + + seller's region prevents creating it), this field remains unset. Note + that + + this process is asynchronous and it may take some time before a + + customer ID is added to the payment. + validation: + maxLength: 191 + access: read-only + employee_id: + type: optional + docs: |- + __Deprecated__: Use `Payment.team_member_id` instead. + + An optional ID of the employee associated with taking the payment. + validation: + maxLength: 192 + access: read-only + team_member_id: + type: optional> + docs: >- + An optional ID of the [TeamMember](entity:TeamMember) associated with + taking the payment. + validation: + maxLength: 192 + refund_ids: + type: optional> + docs: A list of `refund_id`s identifying refunds for the payment. + access: read-only + risk_evaluation: + type: optional + docs: >- + Provides information about the risk associated with the payment, as + determined by Square. + + This field is present for payments to sellers that have opted in to + receive risk + + evaluations. + terminal_checkout_id: + type: optional + docs: >- + An optional ID for a Terminal checkout that is associated with the + payment. + access: read-only + buyer_email_address: + type: optional + docs: The buyer's email address. + validation: + maxLength: 255 + access: read-only + billing_address: + type: optional
+ docs: The buyer's billing address. + shipping_address: + type: optional
+ docs: The buyer's shipping address. + note: + type: optional + docs: An optional note to include when creating a payment. + validation: + maxLength: 500 + access: read-only + statement_description_identifier: + type: optional + docs: >- + Additional payment information that gets added to the customer's card + statement + + as part of the statement description. + + + Note that the `statement_description_identifier` might get truncated + on the statement description + + to fit the required information including the Square identifier (SQ *) + and the name of the + + seller taking the payment. + access: read-only + capabilities: + type: optional> + docs: |- + Actions that can be performed on this payment: + - `EDIT_AMOUNT_UP` - The payment amount can be edited up. + - `EDIT_AMOUNT_DOWN` - The payment amount can be edited down. + - `EDIT_TIP_AMOUNT_UP` - The tip amount can be edited up. + - `EDIT_TIP_AMOUNT_DOWN` - The tip amount can be edited down. + - `EDIT_DELAY_ACTION` - The delay_action can be edited. + access: read-only + receipt_number: + type: optional + docs: |- + The payment's receipt number. + The field is missing if a payment is canceled. + validation: + maxLength: 4 + access: read-only + receipt_url: + type: optional + docs: |- + The URL for the payment's receipt. + The field is only populated for COMPLETED payments. + validation: + maxLength: 255 + access: read-only + device_details: + type: optional + docs: Details about the device that took the payment. + application_details: + type: optional + docs: Details about the application that took the payment. + is_offline_payment: + type: optional + docs: Whether or not this payment was taken offline. + access: read-only + offline_payment_details: + type: optional + docs: Additional information about the payment if it was taken offline. + version_token: + type: optional> + docs: >- + Used for optimistic concurrency. This opaque token identifies a + specific version of the + + `Payment` object. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityAppFeeRefundDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + refund_id: + type: optional> + docs: The ID of the refund associated with this activity. + location_id: + type: optional> + docs: >- + The ID of the location of the merchant associated with the payment + refund activity + source: + openapi: openapi/openapi.json + PaymentBalanceActivityAppFeeRevenueDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + location_id: + type: optional> + docs: >- + The ID of the location of the merchant associated with the payment + activity + source: + openapi: openapi/openapi.json + PaymentBalanceActivityAutomaticSavingsDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + payout_id: + type: optional> + docs: The ID of the payout associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityAutomaticSavingsReversedDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + payout_id: + type: optional> + docs: The ID of the payout associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityChargeDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityDepositFeeDetail: + properties: + payout_id: + type: optional> + docs: The ID of the payout that triggered this deposit fee activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityDepositFeeReversedDetail: + properties: + payout_id: + type: optional> + docs: The ID of the payout that triggered this deposit fee activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityDisputeDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + dispute_id: + type: optional> + docs: The ID of the dispute associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityFeeDetail: + properties: + payment_id: + type: optional> + docs: >- + The ID of the payment associated with this activity + + This will only be populated when a principal LedgerEntryToken is also + populated. + + If the fee is independent (there is no principal LedgerEntryToken) + then this will likely not + + be populated. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityFreeProcessingDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityHoldAdjustmentDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityOpenDisputeDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + dispute_id: + type: optional> + docs: The ID of the dispute associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityOtherAdjustmentDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityOtherDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityRefundDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + refund_id: + type: optional> + docs: The ID of the refund associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityReleaseAdjustmentDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityReserveHoldDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityReserveReleaseDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivitySquareCapitalPaymentDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivitySquareCapitalReversedPaymentDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivitySquarePayrollTransferDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivitySquarePayrollTransferReversedDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityTaxOnFeeDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + tax_rate_description: + type: optional> + docs: >- + The description of the tax rate being applied. For example: "GST", + "HST". + source: + openapi: openapi/openapi.json + PaymentBalanceActivityThirdPartyFeeDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + source: + openapi: openapi/openapi.json + PaymentBalanceActivityThirdPartyFeeRefundDetail: + properties: + payment_id: + type: optional> + docs: The ID of the payment associated with this activity. + refund_id: + type: optional> + docs: The public refund id associated with this activity. + source: + openapi: openapi/openapi.json + PaymentCreatedEvent: + docs: Published when a [Payment](entity:Payment) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"payment.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + PaymentCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"payment"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected payment. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the created payment. + source: + openapi: openapi/openapi.json + PaymentCreatedEventObject: + properties: + payment: + type: optional + docs: The created payment. + source: + openapi: openapi/openapi.json + PaymentLink: + properties: + id: + type: optional + docs: The Square-assigned ID of the payment link. + access: read-only + version: + type: integer + docs: >- + The Square-assigned version number, which is incremented each time an + update is committed to the payment link. + validation: + max: 65535 + description: + type: optional> + docs: |- + The optional description of the `payment_link` object. + It is primarily for use by your application and is not used anywhere. + validation: + maxLength: 4096 + order_id: + type: optional + docs: The ID of the order associated with the payment link. + validation: + maxLength: 192 + access: read-only + checkout_options: + type: optional + docs: >- + The checkout options configured for the payment link. + + For more information, see [Optional Checkout + Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). + pre_populated_data: + type: optional + docs: |- + Describes buyer data to prepopulate + on the checkout page. + url: + type: optional + docs: The shortened URL of the payment link. + validation: + maxLength: 255 + access: read-only + long_url: + type: optional + docs: The long URL of the payment link. + validation: + maxLength: 255 + access: read-only + created_at: + type: optional + docs: The timestamp when the payment link was created, in RFC 3339 format. + updated_at: + type: optional + docs: >- + The timestamp when the payment link was last updated, in RFC 3339 + format. + payment_note: + type: optional> + docs: >- + An optional note. After Square processes the payment, this note is + added to the + + resulting `Payment`. + validation: + maxLength: 500 + source: + openapi: openapi/openapi.json + PaymentLinkRelatedResources: + properties: + orders: + type: optional>> + docs: The order associated with the payment link. + subscription_plans: + type: optional>> + docs: The subscription plan associated with the payment link. + source: + openapi: openapi/openapi.json + PaymentOptions: + properties: + autocomplete: + type: optional> + docs: >- + Indicates whether the `Payment` objects created from this + `TerminalCheckout` are + + automatically `COMPLETED` or left in an `APPROVED` state for later + modification. + + + Default: true + delay_duration: + type: optional> + docs: >- + The duration of time after the payment's creation when Square + automatically resolves the + + payment. This automatic resolution applies only to payments that do + not reach a terminal state + + (`COMPLETED` or `CANCELED`) before the `delay_duration` time period. + + + This parameter should be specified as a time duration, in RFC 3339 + format, with a minimum value + + of 1 minute and a maximum value of 36 hours. This feature is only + supported for card payments, + + and all payments will be considered card-present. + + + This parameter can only be set for a delayed capture payment + (`autocomplete=false`). For more + + information, see [Delayed + Capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). + + + Default: "PT36H" (36 hours) from the creation time + accept_partial_authorization: + type: optional> + docs: >- + If set to `true` and charging a Square Gift Card, a payment might be + returned with + + `amount_money` equal to less than what was requested. For example, a + request for $20 when charging + + a Square Gift Card with a balance of $5 results in an APPROVED payment + of $5. You might choose + + to prompt the buyer for an additional payment to cover the remainder + or cancel the Gift Card + + payment. + + + This parameter can only be set for a delayed capture payment + (`autocomplete=false`). + + + For more information, see [Take Partial + Payments](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/partial-payments-with-gift-cards). + + + Default: false + delay_action: + type: optional + docs: >- + The action to be applied to the `Payment` when the delay_duration has + elapsed. + + The action must be CANCEL or COMPLETE. + + + The action cannot be set to COMPLETE if an `order_id` is present on + the TerminalCheckout. + + + This parameter can only be set for a delayed capture payment + (`autocomplete=false`). For more + + information, see [Delayed + Capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). + + + Default: CANCEL + + See [DelayAction](#type-delayaction) for possible values + source: + openapi: openapi/openapi.json + PaymentOptionsDelayAction: + enum: + - CANCEL + - COMPLETE + docs: >- + Describes the action to be applied to a delayed capture payment when the + delay_duration + + has elapsed. + source: + openapi: openapi/openapi.json + PaymentRefund: + docs: >- + Represents a refund of a payment made using Square. Contains information + about + + the original payment and the amount of money refunded. + properties: + id: + type: string + docs: The unique ID for this refund, generated by Square. + validation: + minLength: 1 + maxLength: 255 + status: + type: optional> + docs: |- + The refund's status: + - `PENDING` - Awaiting approval. + - `COMPLETED` - Successfully completed. + - `REJECTED` - The refund was rejected. + - `FAILED` - An error occurred. + validation: + maxLength: 50 + location_id: + type: optional> + docs: >- + The location ID associated with the payment this refund is attached + to. + validation: + maxLength: 50 + unlinked: + type: optional + docs: >- + Flag indicating whether or not the refund is linked to an existing + payment in Square. + access: read-only + destination_type: + type: optional> + docs: >- + The destination type for this refund. + + + Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, + `BUY_NOW_PAY_LATER`, `CASH`, + + `EXTERNAL`, and `SQUARE_ACCOUNT`. + validation: + maxLength: 50 + destination_details: + type: optional + docs: >- + Contains information about the refund destination. This field is + populated only if + + `destination_id` is defined in the `RefundPayment` request. + amount_money: + type: Money + docs: >- + The amount of money refunded. This amount is specified in the smallest + denomination + + of the applicable currency (for example, US dollar amounts are + specified in cents). + app_fee_money: + type: optional + docs: >- + The amount of money the application developer contributed to help + cover the refunded amount. + + This amount is specified in the smallest denomination of the + applicable currency (for example, + + US dollar amounts are specified in cents). For more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + processing_fee: + type: optional>> + docs: >- + Processing fees and fee adjustments assessed by Square for this + refund. + payment_id: + type: optional> + docs: The ID of the payment associated with this refund. + validation: + maxLength: 192 + order_id: + type: optional> + docs: The ID of the order associated with the refund. + validation: + maxLength: 192 + reason: + type: optional> + docs: The reason for the refund. + validation: + maxLength: 192 + created_at: + type: optional + docs: The timestamp of when the refund was created, in RFC 3339 format. + validation: + maxLength: 32 + access: read-only + updated_at: + type: optional + docs: The timestamp of when the refund was last updated, in RFC 3339 format. + validation: + maxLength: 32 + access: read-only + team_member_id: + type: optional + docs: An optional ID of the team member associated with taking the payment. + validation: + maxLength: 192 + access: read-only + terminal_refund_id: + type: optional + docs: An optional ID for a Terminal refund. + access: read-only + source: + openapi: openapi/openapi.json + PaymentUpdatedEvent: + docs: >- + Published when a [Payment](entity:Payment) is updated. + + Typically the `payment.status`, or `card_details.status` fields are + updated + + as a payment is canceled, authorized, or completed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"payment.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + PaymentUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"payment"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected payment. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the updated payment. + source: + openapi: openapi/openapi.json + PaymentUpdatedEventObject: + properties: + payment: + type: optional + docs: The updated payment. + source: + openapi: openapi/openapi.json + Payout: + docs: >- + An accounting of the amount owed the seller and record of the actual + transfer to their + + external bank account or to the Square balance. + properties: + id: + type: string + docs: A unique ID for the payout. + validation: + minLength: 1 + status: + type: optional + docs: |- + Indicates the payout status. + See [PayoutStatus](#type-payoutstatus) for possible values + location_id: + type: string + docs: The ID of the location associated with the payout. + validation: + minLength: 1 + created_at: + type: optional + docs: >- + The timestamp of when the payout was created and submitted for deposit + to the seller's banking destination, in RFC 3339 format. + updated_at: + type: optional + docs: The timestamp of when the payout was last updated, in RFC 3339 format. + amount_money: + type: optional + docs: >- + The amount of money involved in the payout. A positive amount + indicates a deposit, and a negative amount indicates a withdrawal. + This amount is never zero. + destination: + type: optional + docs: >- + Information about the banking destination (such as a bank account, + Square checking account, or debit card) + + against which the payout was made. + version: + type: optional + docs: >- + The version number, which is incremented each time an update is made + to this payout record. + + The version number helps developers receive event notifications or + feeds out of order. + type: + type: optional + docs: |- + Indicates the payout type. + See [PayoutType](#type-payouttype) for possible values + payout_fee: + type: optional>> + docs: >- + A list of transfer fees and any taxes on the fees assessed by Square + for this payout. + arrival_date: + type: optional> + docs: >- + The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is + due to arrive in the seller’s banking destination. + end_to_end_id: + type: optional> + docs: >- + A unique ID for each `Payout` object that might also appear on the + seller’s bank statement. You can use this ID to automate the process + of reconciling each payout with the corresponding line item on the + bank statement. + source: + openapi: openapi/openapi.json + PayoutEntry: + docs: >- + One or more PayoutEntries that make up a Payout. Each one has a date, + amount, and type of activity. + + The total amount of the payout will equal the sum of the payout entries + for a batch payout + properties: + id: + type: string + docs: A unique ID for the payout entry. + validation: + minLength: 1 + payout_id: + type: string + docs: The ID of the payout entries’ associated payout. + validation: + minLength: 1 + effective_at: + type: optional> + docs: >- + The timestamp of when the payout entry affected the balance, in RFC + 3339 format. + type: + type: optional + docs: |- + The type of activity associated with this payout entry. + See [ActivityType](#type-activitytype) for possible values + gross_amount_money: + type: optional + docs: The amount of money involved in this payout entry. + fee_amount_money: + type: optional + docs: The amount of Square fees associated with this payout entry. + net_amount_money: + type: optional + docs: The net proceeds from this transaction after any fees. + type_app_fee_revenue_details: + type: optional + docs: Details of any developer app fee revenue generated on a payment. + type_app_fee_refund_details: + type: optional + docs: Details of a refund for an app fee on a payment. + type_automatic_savings_details: + type: optional + docs: >- + Details of any automatic transfer from the payment processing balance + to the Square Savings account. These are, generally, proportional to + the merchant's sales. + type_automatic_savings_reversed_details: + type: optional + docs: >- + Details of any automatic transfer from the Square Savings account back + to the processing balance. These are, generally, proportional to the + merchant's refunds. + type_charge_details: + type: optional + docs: Details of credit card payment captures. + type_deposit_fee_details: + type: optional + docs: >- + Details of any fees involved with deposits such as for instant + deposits. + type_deposit_fee_reversed_details: + type: optional + docs: >- + Details of any reversal or refund of fees involved with deposits such + as for instant deposits. + type_dispute_details: + type: optional + docs: Details of any balance change due to a dispute event. + type_fee_details: + type: optional + docs: Details of adjustments due to the Square processing fee. + type_free_processing_details: + type: optional + docs: >- + Square offers Free Payments Processing for a variety of business + scenarios including seller referral or when Square wants to apologize + for a bug, customer service, repricing complication, and so on. This + entry represents details of any credit to the merchant for the + purposes of Free Processing. + type_hold_adjustment_details: + type: optional + docs: >- + Details of any adjustment made by Square related to the holding or + releasing of a payment. + type_open_dispute_details: + type: optional + docs: Details of any open disputes. + type_other_details: + type: optional + docs: >- + Details of any other type that does not belong in the rest of the + types. + type_other_adjustment_details: + type: optional + docs: >- + Details of any other type of adjustments that don't fall under + existing types. + type_refund_details: + type: optional + docs: Details of a refund for an existing card payment. + type_release_adjustment_details: + type: optional + docs: Details of fees released for adjustments. + type_reserve_hold_details: + type: optional + docs: Details of fees paid for funding risk reserve. + type_reserve_release_details: + type: optional + docs: Details of fees released from risk reserve. + type_square_capital_payment_details: + type: optional + docs: >- + Details of capital merchant cash advance (MCA) assessments. These are, + generally, proportional to the merchant's sales but may be issued for + other reasons related to the MCA. + type_square_capital_reversed_payment_details: + type: optional + docs: >- + Details of capital merchant cash advance (MCA) assessment refunds. + These are, generally, proportional to the merchant's refunds but may + be issued for other reasons related to the MCA. + type_tax_on_fee_details: + type: optional + docs: Details of tax paid on fee amounts. + type_third_party_fee_details: + type: optional + docs: Details of fees collected by a 3rd party platform. + type_third_party_fee_refund_details: + type: optional + docs: Details of refunded fees from a 3rd party platform. + type_square_payroll_transfer_details: + type: optional + docs: >- + Details of a payroll payment that was transferred to a team member’s + bank account. + type_square_payroll_transfer_reversed_details: + type: optional + docs: >- + Details of a payroll payment to a team member’s bank account that was + deposited back to the seller’s account by Square. + source: + openapi: openapi/openapi.json + PayoutFailedEvent: + docs: Published when a [Payout](entity:Payout) has failed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event that this represents, `payout.failed`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: The timestamp of when the event was verified, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + PayoutFailedEventData: + properties: + type: + type: optional> + docs: The name of the affected object's type, `payout`. + id: + type: optional + docs: The ID of the failed payout. + object: + type: optional + docs: An object containing the failed payout. + source: + openapi: openapi/openapi.json + PayoutFailedEventObject: + properties: + payout: + type: optional + docs: The payout that failed. + source: + openapi: openapi/openapi.json + PayoutFee: + docs: Represents a payout fee that can incur as part of a payout. + properties: + amount_money: + type: optional + docs: The money amount of the payout fee. + effective_at: + type: optional> + docs: The timestamp of when the fee takes effect, in RFC 3339 format. + type: + type: optional + docs: |- + The type of fee assessed as part of the payout. + See [PayoutFeeType](#type-payoutfeetype) for possible values + source: + openapi: openapi/openapi.json + PayoutFeeType: + enum: + - TRANSFER_FEE + - TAX_ON_TRANSFER_FEE + docs: Represents the type of payout fee that can incur as part of a payout. + source: + openapi: openapi/openapi.json + PayoutPaidEvent: + docs: Published when a [Payout](entity:Payout) is complete. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"payout.paid"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was verified, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + PayoutPaidEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"payout"`. + id: + type: optional + docs: ID of the completed payout. + object: + type: optional + docs: An object containing the completed payout. + source: + openapi: openapi/openapi.json + PayoutPaidEventObject: + properties: + payout: + type: optional + docs: The payout that has completed. + source: + openapi: openapi/openapi.json + PayoutSentEvent: + docs: Published when a [Payout](entity:Payout) is sent. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + location_id: + type: optional> + docs: The ID of the target location associated with the event. + type: + type: optional> + docs: The type of event this represents, `"payout.sent"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was verified, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + PayoutSentEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"payout"`. + id: + type: optional + docs: ID of the sent payout. + object: + type: optional + docs: An object containing the sent payout. + source: + openapi: openapi/openapi.json + PayoutSentEventObject: + properties: + payout: + type: optional + docs: The payout that was sent. + source: + openapi: openapi/openapi.json + PayoutStatus: + enum: + - SENT + - FAILED + - PAID + docs: Payout status types + source: + openapi: openapi/openapi.json + PayoutType: + enum: + - BATCH + - SIMPLE + docs: >- + The type of payout: “BATCH” or “SIMPLE”. + + BATCH payouts include a list of payout entries that can be considered + settled. + + SIMPLE payouts do not have any payout entries associated with them + + and will show up as one of the payout entries in a future BATCH payout. + source: + openapi: openapi/openapi.json + Phase: + docs: >- + Represents a phase, which can override subscription phases as defined by + plan_id + properties: + uid: + type: optional> + docs: id of subscription phase + ordinal: + type: optional> + docs: index of phase in total subscription plan + order_template_id: + type: optional> + docs: id of order to be used in billing + plan_phase_uid: + type: optional> + docs: the uid from the plan's phase in catalog + source: + openapi: openapi/openapi.json + PhaseInput: + docs: Represents the arguments used to construct a new phase. + properties: + ordinal: + type: long + docs: index of phase in total subscription plan + order_template_id: + type: optional> + docs: id of order to be used in billing + source: + openapi: openapi/openapi.json + PrePopulatedData: + docs: >- + Describes buyer data to prepopulate in the payment form. + + For more information, + + see [Optional Checkout + Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). + properties: + buyer_email: + type: optional> + docs: The buyer email to prepopulate in the payment form. + validation: + maxLength: 256 + buyer_phone_number: + type: optional> + docs: The buyer phone number to prepopulate in the payment form. + validation: + maxLength: 17 + buyer_address: + type: optional
+ docs: The buyer address to prepopulate in the payment form. + source: + openapi: openapi/openapi.json + ProcessingFee: + docs: Represents the Square processing fee. + properties: + effective_at: + type: optional> + docs: The timestamp of when the fee takes effect, in RFC 3339 format. + type: + type: optional> + docs: >- + The type of fee assessed or adjusted. The fee type can be `INITIAL` or + `ADJUSTMENT`. + amount_money: + type: optional + docs: >- + The fee amount, which might be negative, that is assessed or adjusted + by Square. + + + Positive values represent funds being assessed, while negative values + represent + + funds being returned. + source: + openapi: openapi/openapi.json + Product: + enum: + - SQUARE_POS + - EXTERNAL_API + - BILLING + - APPOINTMENTS + - INVOICES + - ONLINE_STORE + - PAYROLL + - DASHBOARD + - ITEM_LIBRARY_IMPORT + - OTHER + docs: Indicates the Square product used to generate a change. + source: + openapi: openapi/openapi.json + ProductType: literal<"TERMINAL_API"> + PublishInvoiceResponse: + docs: Describes a `PublishInvoice` response. + properties: + invoice: + type: optional + docs: The published invoice. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + PublishScheduledShiftResponse: + docs: >- + Represents a + [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) + response. + + Either `scheduled_shift` or `errors` is present in the response. + properties: + scheduled_shift: + type: optional + docs: The published scheduled shift. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + QrCodeOptions: + docs: Fields to describe the action that displays QR-Codes. + properties: + title: + type: string + docs: The title text to display in the QR code flow on the Terminal. + validation: + minLength: 1 + maxLength: 250 + body: + type: string + docs: The body text to display in the QR code flow on the Terminal. + validation: + minLength: 1 + maxLength: 10000 + barcode_contents: + type: string + docs: |- + The text representation of the data to show in the QR code + as UTF8-encoded data. + validation: + minLength: 1 + maxLength: 1024 + source: + openapi: openapi/openapi.json + QuickPay: + docs: >- + Describes an ad hoc item and price to generate a quick pay checkout link. + + For more information, + + see [Quick Pay + Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout). + properties: + name: + type: string + docs: >- + The ad hoc item name. In the resulting `Order`, this name appears as + the line item name. + validation: + minLength: 1 + maxLength: 255 + price_money: + type: Money + docs: The price of the item. + location_id: + type: string + docs: The ID of the business location the checkout is associated with. + source: + openapi: openapi/openapi.json + Range: + docs: The range of a number value between the specified lower and upper bounds. + properties: + min: + type: optional> + docs: >- + The lower bound of the number range. At least one of `min` or `max` + must be specified. + + If unspecified, the results will have no minimum value. + max: + type: optional> + docs: >- + The upper bound of the number range. At least one of `min` or `max` + must be specified. + + If unspecified, the results will have no maximum value. + source: + openapi: openapi/openapi.json + ReceiptOptions: + docs: Describes receipt action fields. + properties: + payment_id: + type: string + docs: The reference to the Square payment ID for the receipt. + print_only: + type: optional> + docs: >- + Instructs the device to print the receipt without displaying the + receipt selection screen. + + Requires `printer_enabled` set to true. + + Defaults to false. + is_duplicate: + type: optional> + docs: |- + Identify the receipt as a reprint rather than an original receipt. + Defaults to false. + source: + openapi: openapi/openapi.json + ReceiveTransferOrderResponse: + docs: Response for receiving items for a transfer order + properties: + transfer_order: + type: optional + docs: The updated transfer order + errors: + type: optional> + docs: Any errors that occurred during the request + source: + openapi: openapi/openapi.json + RedeemLoyaltyRewardResponse: + docs: >- + A response that includes the `LoyaltyEvent` published for redeeming the + reward. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + event: + type: optional + docs: The `LoyaltyEvent` for redeeming the reward. + source: + openapi: openapi/openapi.json + Reference: + properties: + type: + type: optional + docs: |- + The type of entity a channel is associated with. + See [Type](#type-type) for possible values + id: + type: optional + docs: The id of the entity a channel is associated with. + source: + openapi: openapi/openapi.json + ReferenceType: + enum: + - UNKNOWN_TYPE + - LOCATION + - FIRST_PARTY_INTEGRATION + - OAUTH_APPLICATION + - ONLINE_SITE + - ONLINE_CHECKOUT + - INVOICE + - GIFT_CARD + - GIFT_CARD_MARKETPLACE + - RECURRING_SUBSCRIPTION + - ONLINE_BOOKING_FLOW + - SQUARE_ASSISTANT + - CASH_LOCAL + - POINT_OF_SALE + - KIOSK + docs: The type of platform concept a channel can represent. + source: + openapi: openapi/openapi.json + Refund: + docs: Represents a refund processed for a Square transaction. + properties: + id: + type: string + docs: The refund's unique ID. + validation: + maxLength: 255 + location_id: + type: string + docs: The ID of the refund's associated location. + validation: + maxLength: 50 + transaction_id: + type: optional> + docs: The ID of the transaction that the refunded tender is part of. + validation: + maxLength: 192 + tender_id: + type: optional> + docs: The ID of the refunded tender. + validation: + maxLength: 192 + created_at: + type: optional + docs: The timestamp for when the refund was created, in RFC 3339 format. + validation: + maxLength: 32 + access: read-only + reason: + type: string + docs: The reason for the refund being issued. + validation: + maxLength: 192 + amount_money: + type: Money + docs: The amount of money refunded to the buyer. + status: + type: RefundStatus + docs: |- + The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`, + or `FAILED`). + See [RefundStatus](#type-refundstatus) for possible values + processing_fee_money: + type: optional + docs: The amount of Square processing fee money refunded to the *merchant*. + additional_recipients: + type: optional>> + docs: >- + Additional recipients (other than the merchant) receiving a portion of + this refund. + + For example, fees assessed on a refund of a purchase by a third party + integration. + source: + openapi: openapi/openapi.json + RefundCreatedEvent: + docs: Published when a [Refund](entity:PaymentRefund) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"refund.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + RefundCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"refund"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected refund. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the created refund. + source: + openapi: openapi/openapi.json + RefundCreatedEventObject: + properties: + refund: + type: optional + docs: The created refund. + source: + openapi: openapi/openapi.json + RefundPaymentResponse: + docs: >- + Defines the response returned by + + [RefundPayment](api-endpoint:Refunds-RefundPayment). + + + If there are errors processing the request, the `refund` field might not + be + + present, or it might be present with a status of `FAILED`. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refund: + type: optional + docs: The successfully created `PaymentRefund`. + source: + openapi: openapi/openapi.json + RefundStatus: + enum: + - PENDING + - APPROVED + - REJECTED + - FAILED + docs: Indicates a refund's current status. + source: + openapi: openapi/openapi.json + RefundUpdatedEvent: + docs: |- + Published when a [Refund](entity:PaymentRefund) is updated. + Typically the `refund.status` changes when a refund is completed. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"refund.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + RefundUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"refund"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected refund. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the updated refund. + source: + openapi: openapi/openapi.json + RefundUpdatedEventObject: + properties: + refund: + type: optional + docs: The updated refund. + source: + openapi: openapi/openapi.json + RegisterDomainResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [RegisterDomain](api-endpoint:ApplePay-RegisterDomain) + endpoint. + + + Either `errors` or `status` are present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + status: + type: optional + docs: >- + The status of the domain registration. + + + See + [RegisterDomainResponseStatus](entity:RegisterDomainResponseStatus) + for possible values. + + See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) + for possible values + source: + openapi: openapi/openapi.json + RegisterDomainResponseStatus: + enum: + - PENDING + - VERIFIED + docs: The status of the domain registration. + source: + openapi: openapi/openapi.json + RemoveGroupFromCustomerResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [RemoveGroupFromCustomer](api-endpoint:Customers-RemoveGroupFromCustomer) + + endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + ResumeSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [ResumeSubscription](api-endpoint:Subscriptions-ResumeSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The resumed subscription. + actions: + type: optional> + docs: >- + A list of `RESUME` actions created by the request and scheduled for + the subscription. + source: + openapi: openapi/openapi.json + RetrieveBookingCustomAttributeDefinitionResponse: + docs: >- + Represents a + [RetrieveBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The retrieved custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveBookingCustomAttributeResponse: + docs: >- + Represents a + [RetrieveBookingCustomAttribute](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: >- + The retrieved custom attribute. If `with_definition` was set to `true` + in the request, + + the custom attribute definition is returned in the `definition` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetBookingResponse: + properties: + booking: + type: optional + docs: The booking that was requested. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetBusinessBookingProfileResponse: + properties: + business_booking_profile: + type: optional + docs: The seller's booking profile. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetCardResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [RetrieveCard](api-endpoint:Cards-RetrieveCard) endpoint. + + + Note: if there are errors processing the request, the card field will not + be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + card: + type: optional + docs: The retrieved card. + source: + openapi: openapi/openapi.json + GetCashDrawerShiftResponse: + properties: + cash_drawer_shift: + type: optional + docs: The cash drawer shift queried for. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetCatalogObjectResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + object: + type: optional + docs: The `CatalogObject`s returned. + related_objects: + type: optional> + docs: >- + A list of `CatalogObject`s referenced by the object in the `object` + field. + source: + openapi: openapi/openapi.json + RetrieveChannelResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + channel: + type: optional + docs: The requested Channel. + source: + openapi: openapi/openapi.json + GetCustomerCustomAttributeDefinitionResponse: + docs: >- + Represents a + [RetrieveCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The retrieved custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetCustomerCustomAttributeResponse: + docs: >- + Represents a + [RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: >- + The retrieved custom attribute. If `with_definition` was set to `true` + in the request, + + the custom attribute definition is returned in the `definition` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetCustomerGroupResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [RetrieveCustomerGroup](api-endpoint:CustomerGroups-RetrieveCustomerGroup) + endpoint. + + + Either `errors` or `group` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + group: + type: optional + docs: The retrieved customer group. + source: + openapi: openapi/openapi.json + GetCustomerResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `RetrieveCustomer` endpoint. + + Either `errors` or `customer` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + customer: + type: optional + docs: The requested customer. + source: + openapi: openapi/openapi.json + GetCustomerSegmentResponse: + docs: >- + Defines the fields that are included in the response body for requests to + the `RetrieveCustomerSegment` endpoint. + + + Either `errors` or `segment` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + segment: + type: optional + docs: The retrieved customer segment. + source: + openapi: openapi/openapi.json + GetDisputeEvidenceResponse: + docs: Defines the fields in a `RetrieveDisputeEvidence` response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + evidence: + type: optional + docs: Metadata about the dispute evidence file. + source: + openapi: openapi/openapi.json + GetDisputeResponse: + docs: Defines fields in a `RetrieveDispute` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + dispute: + type: optional + docs: Details about the requested `Dispute`. + source: + openapi: openapi/openapi.json + GetEmployeeResponse: + properties: + employee: optional + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetGiftCardFromGANResponse: + docs: >- + A response that contains a `GiftCard`. This response might contain a set + of `Error` objects + + if the request resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: >- + A gift card that was fetched, if present. It returns empty if an error + occurred. + source: + openapi: openapi/openapi.json + GetGiftCardFromNonceResponse: + docs: >- + A response that contains a `GiftCard` object. If the request resulted in + errors, + + the response contains a set of `Error` objects. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: The retrieved gift card. + source: + openapi: openapi/openapi.json + GetGiftCardResponse: + docs: >- + A response that contains a `GiftCard`. The response might contain a set of + `Error` objects + + if the request resulted in errors. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: The gift card retrieved. + source: + openapi: openapi/openapi.json + GetInventoryAdjustmentResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + adjustment: + type: optional + docs: The requested [InventoryAdjustment](entity:InventoryAdjustment). + source: + openapi: openapi/openapi.json + GetInventoryChangesResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + changes: + type: optional> + docs: The set of inventory changes for the requested object and locations. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + source: + openapi: openapi/openapi.json + GetInventoryCountResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + counts: + type: optional> + docs: |- + The current calculated inventory counts for the requested object and + locations. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + source: + openapi: openapi/openapi.json + GetInventoryPhysicalCountResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + count: + type: optional + docs: The requested [InventoryPhysicalCount](entity:InventoryPhysicalCount). + source: + openapi: openapi/openapi.json + GetInventoryTransferResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + transfer: + type: optional + docs: The requested [InventoryTransfer](entity:InventoryTransfer). + source: + openapi: openapi/openapi.json + RetrieveJobResponse: + docs: >- + Represents a [RetrieveJob](api-endpoint:Team-RetrieveJob) response. Either + `job` or `errors` + + is present in the response. + properties: + job: + type: optional + docs: The retrieved job. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveLocationBookingProfileResponse: + properties: + location_booking_profile: + type: optional + docs: The requested location booking profile. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveLocationCustomAttributeDefinitionResponse: + docs: >- + Represents a + [RetrieveLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The retrieved custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveLocationCustomAttributeResponse: + docs: >- + Represents a + [RetrieveLocationCustomAttribute](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: >- + The retrieved custom attribute. If `with_definition` was set to `true` + in the request, + + the custom attribute definition is returned in the `definition` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetLocationResponse: + docs: >- + Defines the fields that the + [RetrieveLocation](api-endpoint:Locations-RetrieveLocation) + + endpoint returns in a response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + location: + type: optional + docs: The requested location. + source: + openapi: openapi/openapi.json + RetrieveLocationSettingsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + location_settings: + type: optional + docs: The location settings. + source: + openapi: openapi/openapi.json + GetLoyaltyAccountResponse: + docs: A response that includes the loyalty account. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_account: + type: optional + docs: The loyalty account. + source: + openapi: openapi/openapi.json + GetLoyaltyProgramResponse: + docs: A response that contains the loyalty program. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + program: + type: optional + docs: The loyalty program that was requested. + source: + openapi: openapi/openapi.json + GetLoyaltyPromotionResponse: + docs: >- + Represents a + [RetrieveLoyaltyPromotionPromotions](api-endpoint:Loyalty-RetrieveLoyaltyPromotion) + response. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_promotion: + type: optional + docs: The retrieved loyalty promotion. + source: + openapi: openapi/openapi.json + GetLoyaltyRewardResponse: + docs: A response that includes the loyalty reward. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + reward: + type: optional + docs: The loyalty reward retrieved. + source: + openapi: openapi/openapi.json + RetrieveMerchantCustomAttributeDefinitionResponse: + docs: >- + Represents a + [RetrieveMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The retrieved custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveMerchantCustomAttributeResponse: + docs: >- + Represents a + [RetrieveMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: >- + The retrieved custom attribute. If `with_definition` was set to `true` + in the request, + + the custom attribute definition is returned in the `definition` field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetMerchantResponse: + docs: >- + The response object returned by the + [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) endpoint. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + merchant: + type: optional + docs: The requested `Merchant` object. + source: + openapi: openapi/openapi.json + RetrieveMerchantSettingsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + merchant_settings: + type: optional + docs: The merchant settings. + source: + openapi: openapi/openapi.json + RetrieveOrderCustomAttributeDefinitionResponse: + docs: Represents a response from getting an order custom attribute definition. + properties: + custom_attribute_definition: + type: optional + docs: The retrieved custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveOrderCustomAttributeResponse: + docs: Represents a response from getting an order custom attribute. + properties: + custom_attribute: + type: optional + docs: >- + The retrieved custom attribute. If `with_definition` was set to `true` + in the request, the custom attribute definition is returned in the + `definition field. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetOrderResponse: + properties: + order: + type: optional + docs: The requested order. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetPaymentLinkResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + payment_link: + type: optional + docs: The payment link that is retrieved. + source: + openapi: openapi/openapi.json + RetrieveScheduledShiftResponse: + docs: >- + Represents a + [RetrieveScheduledShift](api-endpoint:Labor-RetrieveScheduledShift) + response. + + Either `scheduled_shift` or `errors` is present in the response. + properties: + scheduled_shift: + type: optional + docs: The requested scheduled shift. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetSnippetResponse: + docs: >- + Represents a `RetrieveSnippet` response. The response can include either + `snippet` or `errors`. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + snippet: + type: optional + docs: The retrieved snippet. + source: + openapi: openapi/openapi.json + GetSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The subscription retrieved. + source: + openapi: openapi/openapi.json + GetTeamMemberBookingProfileResponse: + properties: + team_member_booking_profile: + type: optional + docs: The returned team member booking profile. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetTeamMemberResponse: + docs: >- + Represents a response from a retrieve request containing a `TeamMember` + object or error messages. + properties: + team_member: + type: optional + docs: The successfully retrieved `TeamMember` object. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveTimecardResponse: + docs: >- + A response to a request to get a `Timecard`. The response contains + + the requested `Timecard` object and might contain a set of `Error` objects + if + + the request resulted in errors. + properties: + timecard: + type: optional + docs: The requested `Timecard`. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RetrieveTokenStatusResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the `RetrieveTokenStatus` endpoint. + properties: + scopes: + type: optional> + docs: The list of scopes associated with an access token. + expires_at: + type: optional + docs: "The date and time when the\_`access_token`\_expires, in RFC 3339 format. Empty if the token never expires." + client_id: + type: optional + docs: >- + The Square-issued application ID associated with the access token. + This is the same application ID used to obtain the token. + validation: + maxLength: 191 + merchant_id: + type: optional + docs: The ID of the authorizing merchant's business. + validation: + minLength: 8 + maxLength: 191 + errors: + type: optional> + docs: ' Any errors that occurred during the request.' + source: + openapi: openapi/openapi.json + GetTransactionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [RetrieveTransaction](api-endpoint:Transactions-RetrieveTransaction) + endpoint. + + + One of `errors` or `transaction` is present in a given response (never + both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + transaction: + type: optional + docs: The requested transaction. + source: + openapi: openapi/openapi.json + RetrieveTransferOrderResponse: + docs: Response containing the requested transfer order + properties: + transfer_order: + type: optional + docs: The requested transfer order + errors: + type: optional> + docs: Any errors that occurred during the request + source: + openapi: openapi/openapi.json + GetVendorResponse: + docs: >- + Represents an output from a call to + [RetrieveVendor](api-endpoint:Vendors-RetrieveVendor). + properties: + errors: + type: optional> + docs: Errors encountered when the request fails. + vendor: + type: optional + docs: The successfully retrieved [Vendor](entity:Vendor) object. + source: + openapi: openapi/openapi.json + GetWageSettingResponse: + docs: >- + Represents a response from a retrieve request containing the specified + `WageSetting` object or error messages. + properties: + wage_setting: + type: optional + docs: The successfully retrieved `WageSetting` object. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + GetWebhookSubscriptionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [RetrieveWebhookSubscription](api-endpoint:WebhookSubscriptions-RetrieveWebhookSubscription) + endpoint. + + + Note: if there are errors processing the request, the + [Subscription](entity:WebhookSubscription) will not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + subscription: + type: optional + docs: The requested [Subscription](entity:WebhookSubscription). + source: + openapi: openapi/openapi.json + RevokeTokenResponse: + properties: + success: + type: optional + docs: If the request is successful, this is `true`. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + RiskEvaluation: + docs: >- + Represents fraud risk information for the associated payment. + + + When you take a payment through Square's Payments API (using the + `CreatePayment` + + endpoint), Square evaluates it and assigns a risk level to the payment. + Sellers + + can use this information to determine the course of action (for example, + + provide the goods/services or refund the payment). + properties: + created_at: + type: optional + docs: The timestamp when payment risk was evaluated, in RFC 3339 format. + access: read-only + risk_level: + type: optional + docs: >- + The risk level associated with the payment + + See [RiskEvaluationRiskLevel](#type-riskevaluationrisklevel) for + possible values + source: + openapi: openapi/openapi.json + RiskEvaluationRiskLevel: + enum: + - PENDING + - NORMAL + - MODERATE + - HIGH + source: + openapi: openapi/openapi.json + SaveCardOptions: + docs: Describes save-card action fields. + properties: + customer_id: + type: string + docs: The square-assigned ID of the customer linked to the saved card. + card_id: + type: optional + docs: The id of the created card-on-file. + validation: + maxLength: 64 + access: read-only + reference_id: + type: optional> + docs: >- + An optional user-defined reference ID that can be used to associate + + this `Card` to another entity in an external system. For example, a + customer + + ID generated by a third-party system. + validation: + maxLength: 128 + source: + openapi: openapi/openapi.json + ScheduledShift: + docs: >- + Represents a specific time slot in a work schedule. This object is used to + manage the + + lifecycle of a scheduled shift from the draft to published state. A + scheduled shift contains + + the latest draft shift details and current published shift details. + properties: + id: + type: optional + docs: '**Read only** The Square-issued ID of the scheduled shift.' + validation: + maxLength: 255 + draft_shift_details: + type: optional + docs: >- + The latest draft shift details for the scheduled shift. Draft shift + details are used to + + stage and manage shifts before publishing. This field is always + present. + published_shift_details: + type: optional + docs: >- + The current published (public) shift details for the scheduled shift. + This field is + + present only if the shift was published. + version: + type: optional + docs: >- + **Read only** The current version of the scheduled shift, which is + incremented with each update. + + This field is used for [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control to ensure that requests don't overwrite data from another + request. + created_at: + type: optional + docs: >- + The timestamp of when the scheduled shift was created, in RFC 3339 + format presented as UTC. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the scheduled shift was last updated, in RFC + 3339 format presented as UTC. + access: read-only + source: + openapi: openapi/openapi.json + ScheduledShiftDetails: + docs: >- + Represents shift details for draft and published versions of a [scheduled + shift](entity:ScheduledShift), + + such as job ID, team member assignment, and start and end times. + properties: + team_member_id: + type: optional> + docs: >- + The ID of the [team member](entity:TeamMember) scheduled for the + shift. + validation: + maxLength: 255 + location_id: + type: optional> + docs: The ID of the [location](entity:Location) the shift is scheduled for. + validation: + maxLength: 255 + job_id: + type: optional> + docs: The ID of the [job](entity:Job) the shift is scheduled for. + start_at: + type: optional> + docs: >- + The start time of the shift, in RFC 3339 format in the time zone + + + + offset of the shift location specified in `location_id`. Precision up + to the minute + + is respected; seconds are truncated. + end_at: + type: optional> + docs: >- + The end time for the shift, in RFC 3339 format in the time zone + + + offset of the shift location specified in `location_id`. Precision up + to the minute + + is respected; seconds are truncated. + notes: + type: optional> + docs: Optional notes for the shift. + validation: + maxLength: 1000 + is_deleted: + type: optional> + docs: >- + Indicates whether the draft shift version is deleted. If set to `true` + when the shift + + is published, the entire scheduled shift (including the published + shift) is deleted and + + cannot be accessed using any endpoint. + timezone: + type: optional + docs: >- + The time zone of the shift location, calculated based on the + `location_id`. This field + + is provided for convenience. + access: read-only + source: + openapi: openapi/openapi.json + ScheduledShiftFilter: + docs: >- + Defines filter criteria for a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) + + request. Multiple filters in a query are combined as an `AND` operation. + properties: + location_ids: + type: optional>> + docs: >- + Return shifts for the specified locations. When omitted, shifts for + all + + locations are returned. If needed, call + [ListLocations](api-endpoint:Locations-ListLocations) + + to get location IDs. + start: + type: optional + docs: |- + Return shifts whose `start_at` time is within the specified + time range (inclusive). + end: + type: optional + docs: |- + Return shifts whose `end_at` time is within the specified + time range (inclusive). + workday: + type: optional + docs: Return shifts based on a workday date range. + team_member_ids: + type: optional>> + docs: >- + Return shifts assigned to specified team members. If needed, call + + [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) to get team + member IDs. + + + To return only the shifts assigned to the specified team members, + include the + + `assignment_status` filter in the query. Otherwise, all unassigned + shifts are + + returned along with shifts assigned to the specified team members. + assignment_status: + type: optional + docs: >- + Return shifts based on whether a team member is assigned. A shift is + + assigned if the `team_member_id` field is populated in the + `draft_shift_details` + + or `published_shift details` field of the shift. + + + To return only draft or published shifts, include the + `scheduled_shift_statuses` + + filter in the query. + + See + [ScheduledShiftFilterAssignmentStatus](#type-scheduledshiftfilterassignmentstatus) + for possible values + scheduled_shift_statuses: + type: optional>> + docs: >- + Return shifts based on the draft or published status of the shift. + + A shift is published if the `published_shift_details` field is + present. + + + Note that shifts with `draft_shift_details.is_deleted` set to `true` + are ignored + + with the `DRAFT` filter. + + See + [ScheduledShiftFilterScheduledShiftStatus](#type-scheduledshiftfilterscheduledshiftstatus) + for possible values + source: + openapi: openapi/openapi.json + ScheduledShiftFilterAssignmentStatus: + enum: + - ASSIGNED + - UNASSIGNED + docs: |- + Defines valid values for the `assignment_status` filter in a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. + Assignment status is based on the `draft_shift_details.team_member_id` and + `published_shift_details.team_member_id` fields of the scheduled shift. + source: + openapi: openapi/openapi.json + ScheduledShiftFilterScheduledShiftStatus: + enum: + - DRAFT + - PUBLISHED + docs: |- + Defines valid values for the `scheduled_shift_statuses` filter in a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. + source: + openapi: openapi/openapi.json + ScheduledShiftNotificationAudience: + enum: + - ALL + - AFFECTED + - NONE + docs: >- + Indicates whether Square sends an email notification to team members + + when a scheduled shift is published and which team members receive the + notification. + source: + openapi: openapi/openapi.json + ScheduledShiftQuery: + docs: |- + Represents filter and sort criteria for the `query` field in a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. + properties: + filter: + type: optional + docs: Filtering options for the query. + sort: + type: optional + docs: Sorting options for the query. + source: + openapi: openapi/openapi.json + ScheduledShiftSort: + docs: >- + Defines sort criteria for a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) + + request. + properties: + field: + type: optional + docs: >- + The field to sort on. The default value is `START_AT`. + + See [ScheduledShiftSortField](#type-scheduledshiftsortfield) for + possible values + order: + type: optional + docs: |- + The order in which results are returned. The default value is `ASC`. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + ScheduledShiftSortField: + enum: + - START_AT + - END_AT + - CREATED_AT + - UPDATED_AT + docs: |- + Defines valid values for the `field` sort setting in a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. + source: + openapi: openapi/openapi.json + ScheduledShiftWorkday: + docs: >- + A `ScheduledShift` search query filter parameter that sets a range of days + that + + a `Shift` must start or end in before passing the filter condition. + properties: + date_range: + type: optional + docs: Dates for fetching the scheduled shifts. + match_scheduled_shifts_by: + type: optional + docs: >- + The strategy on which the dates are applied. + + See [ScheduledShiftWorkdayMatcher](#type-scheduledshiftworkdaymatcher) + for possible values + default_timezone: + type: optional> + docs: >- + Location-specific timezones convert workdays to datetime filters. + + Every location included in the query must have a timezone or this + field + + must be provided as a fallback. Format: the IANA timezone database + + identifier for the relevant timezone. + source: + openapi: openapi/openapi.json + ScheduledShiftWorkdayMatcher: + enum: + - START_AT + - END_AT + - INTERSECTION + docs: Defines the logic used to apply a workday filter. + source: + openapi: openapi/openapi.json + SearchAvailabilityFilter: + docs: A query filter to search for buyer-accessible availabilities by. + properties: + start_at_range: + type: TimeRange + docs: >- + The query expression to search for buy-accessible availabilities with + their starting times falling within the specified time range. + + The time range must be at least 24 hours and at most 32 days long. + + For waitlist availabilities, the time range can be 0 or more up to 367 + days long. + location_id: + type: optional> + docs: >- + The query expression to search for buyer-accessible availabilities + with their location IDs matching the specified location ID. + + This query expression cannot be set if `booking_id` is set. + validation: + maxLength: 32 + segment_filters: + type: optional>> + docs: >- + The query expression to search for buyer-accessible availabilities + matching the specified list of segment filters. + + If the size of the `segment_filters` list is `n`, the search returns + availabilities with `n` segments per availability. + + + This query expression cannot be set if `booking_id` is set. + booking_id: + type: optional> + docs: >- + The query expression to search for buyer-accessible availabilities for + an existing booking by matching the specified `booking_id` value. + + This is commonly used to reschedule an appointment. + + If this expression is set, the `location_id` and `segment_filters` + expressions cannot be set. + validation: + maxLength: 36 + source: + openapi: openapi/openapi.json + SearchAvailabilityQuery: + docs: The query used to search for buyer-accessible availabilities of bookings. + properties: + filter: + type: SearchAvailabilityFilter + docs: >- + The query filter to search for buyer-accessible availabilities of + existing bookings. + source: + openapi: openapi/openapi.json + SearchAvailabilityResponse: + properties: + availabilities: + type: optional> + docs: List of appointment slots available for booking. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + SearchCatalogItemsRequestStockLevel: + enum: + - OUT + - LOW + docs: Defines supported stock levels of the item inventory. + source: + openapi: openapi/openapi.json + SearchCatalogItemsResponse: + docs: >- + Defines the response body returned from the + [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + items: + type: optional> + docs: Returned items matching the specified query expressions. + cursor: + type: optional + docs: >- + Pagination token used in the next request to return more of the search + result. + matched_variation_ids: + type: optional> + docs: >- + Ids of returned item variations matching the specified query + expression. + source: + openapi: openapi/openapi.json + SearchCatalogObjectsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + this is the final response. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + objects: + type: optional> + docs: The CatalogObjects returned. + related_objects: + type: optional> + docs: >- + A list of CatalogObjects referenced by the objects in the `objects` + field. + latest_time: + type: optional + docs: >- + When the associated product catalog was last updated. Will + + match the value for `end_time` or `cursor` if either field is included + in the `SearchCatalog` request. + source: + openapi: openapi/openapi.json + SearchCustomersResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the `SearchCustomers` endpoint. + + + Either `errors` or `customers` is present in a given response (never + both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + customers: + type: optional> + docs: >- + The customer profiles that match the search query. If any search + condition is not met, the result is an empty object (`{}`). + + Only customer profiles with public information (`given_name`, + `family_name`, `company_name`, `email_address`, or `phone_number`) + + are included in the response. + cursor: + type: optional + docs: >- + A pagination cursor that can be used during subsequent calls + + to `SearchCustomers` to retrieve the next set of results associated + + with the original query. Pagination cursors are only present when + + a request succeeds and additional results are available. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + count: + type: optional + docs: >- + The total count of customers associated with the Square account that + match the search query. Only customer profiles with + + public information (`given_name`, `family_name`, `company_name`, + `email_address`, or `phone_number`) are counted. This field is + + present only if `count` is set to `true` in the request. + source: + openapi: openapi/openapi.json + SearchEventsFilter: + docs: Criteria to filter events by. + properties: + event_types: + type: optional>> + docs: Filter events by event types. + merchant_ids: + type: optional>> + docs: Filter events by merchant. + location_ids: + type: optional>> + docs: Filter events by location. + created_at: + type: optional + docs: Filter events by when they were created. + source: + openapi: openapi/openapi.json + SearchEventsQuery: + docs: Contains query criteria for the search. + properties: + filter: + type: optional + docs: Criteria to filter events by. + sort: + type: optional + docs: Criteria to sort events by. + source: + openapi: openapi/openapi.json + SearchEventsResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [SearchEvents](api-endpoint:Events-SearchEvents) + endpoint. + + + Note: if there are errors processing the request, the events field will + not be + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + events: + type: optional> + docs: The list of [Event](entity:Event)s returned by the search. + metadata: + type: optional> + docs: >- + Contains the metadata of an event. For more information, see + [Event](entity:Event). + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can use in + a subsequent request to fetch the next set of events. If empty, this + is the final response. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + SearchEventsSort: + docs: Criteria to sort events by. + properties: + field: + type: optional + docs: >- + Sort events by event types. + + See [SearchEventsSortField](#type-searcheventssortfield) for possible + values + order: + type: optional + docs: |- + The order to use for sorting the events. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + SearchEventsSortField: + type: literal<"DEFAULT"> + docs: Specifies the sort key for events returned from a search. + SearchInvoicesResponse: + docs: Describes a `SearchInvoices` response. + properties: + invoices: + type: optional> + docs: The list of invoices returned by the search. + cursor: + type: optional + docs: >- + When a response is truncated, it includes a cursor that you can use in + a + + subsequent request to fetch the next set of invoices. If empty, this + is the final + + response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + SearchLoyaltyAccountsRequestLoyaltyAccountQuery: + docs: The search criteria for the loyalty accounts. + properties: + mappings: + type: optional>> + docs: |- + The set of mappings to use in the loyalty account search. + + This cannot be combined with `customer_ids`. + + Max: 30 mappings + customer_ids: + type: optional>> + docs: |- + The set of customer IDs to use in the loyalty account search. + + This cannot be combined with `mappings`. + + Max: 30 customer IDs + source: + openapi: openapi/openapi.json + SearchLoyaltyAccountsResponse: + docs: >- + A response that includes loyalty accounts that satisfy the search + criteria. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + loyalty_accounts: + type: optional> + docs: |- + The loyalty accounts that met the search criteria, + in order of creation date. + cursor: + type: optional + docs: >- + The pagination cursor to use in a subsequent + + request. If empty, this is the final response. + + For more information, + + see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + SearchLoyaltyEventsResponse: + docs: |- + A response that contains loyalty events that satisfy the search + criteria, in order by the `created_at` date. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + events: + type: optional> + docs: The loyalty events that satisfy the search criteria. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent + + request. If empty, this is the final response. + + For more information, + + see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + SearchLoyaltyRewardsRequestLoyaltyRewardQuery: + docs: The set of search requirements. + properties: + loyalty_account_id: + type: string + docs: >- + The ID of the [loyalty account](entity:LoyaltyAccount) to which the + loyalty reward belongs. + validation: + minLength: 1 + status: + type: optional + docs: >- + The status of the loyalty reward. + + See [LoyaltyRewardStatus](#type-loyaltyrewardstatus) for possible + values + source: + openapi: openapi/openapi.json + SearchLoyaltyRewardsResponse: + docs: >- + A response that includes the loyalty rewards satisfying the search + criteria. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + rewards: + type: optional> + docs: |- + The loyalty rewards that satisfy the search criteria. + These are returned in descending order by `updated_at`. + cursor: + type: optional + docs: |- + The pagination cursor to be used in a subsequent + request. If empty, this is the final response. + source: + openapi: openapi/openapi.json + SearchOrdersCustomerFilter: + docs: |- + A filter based on the order `customer_id` and any tender `customer_id` + associated with the order. It does not filter based on the + [FulfillmentRecipient](entity:FulfillmentRecipient) `customer_id`. + properties: + customer_ids: + type: optional>> + docs: |- + A list of customer IDs to filter by. + + Max: 10 customer ids. + source: + openapi: openapi/openapi.json + SearchOrdersDateTimeFilter: + docs: >- + Filter for `Order` objects based on whether their `CREATED_AT`, + + `CLOSED_AT`, or `UPDATED_AT` timestamps fall within a specified time + range. + + You can specify the time range and which timestamp to filter for. You can + filter + + for only one time range at a time. + + + For each time range, the start time and end time are inclusive. If the end + time + + is absent, it defaults to the time of the first request for the cursor. + + + __Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, + + you must set the `sort_field` in [OrdersSort](entity:SearchOrdersSort) + + to the same field you filter for. For example, if you set the `CLOSED_AT` + field + + in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` + to + + `CLOSED_AT`. Otherwise, `SearchOrders` throws an error. + + [Learn more about filtering orders by time + range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range) + properties: + created_at: + type: optional + docs: >- + The time range for filtering on the `created_at` timestamp. If you use + this + + value, you must set the `sort_field` in the `OrdersSearchSort` object + to + + `CREATED_AT`. + updated_at: + type: optional + docs: >- + The time range for filtering on the `updated_at` timestamp. If you use + this + + value, you must set the `sort_field` in the `OrdersSearchSort` object + to + + `UPDATED_AT`. + closed_at: + type: optional + docs: >- + The time range for filtering on the `closed_at` timestamp. If you use + this + + value, you must set the `sort_field` in the `OrdersSearchSort` object + to + + `CLOSED_AT`. + source: + openapi: openapi/openapi.json + SearchOrdersFilter: + docs: |- + Filtering criteria to use for a `SearchOrders` request. Multiple filters + are ANDed together. + properties: + state_filter: + type: optional + docs: Filter by [OrderState](entity:OrderState). + date_time_filter: + type: optional + docs: >- + Filter for results within a time range. + + + __Important:__ If you filter for orders by time range, you must set + `SearchOrdersSort` + + to sort by the same field. + + [Learn more about filtering orders by time + range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range) + fulfillment_filter: + type: optional + docs: Filter by the fulfillment type or state. + source_filter: + type: optional + docs: Filter by the source of the order. + customer_filter: + type: optional + docs: Filter by customers associated with the order. + source: + openapi: openapi/openapi.json + SearchOrdersFulfillmentFilter: + docs: Filter based on [order fulfillment](entity:Fulfillment) information. + properties: + fulfillment_types: + type: optional>> + docs: >- + A list of [fulfillment types](entity:FulfillmentType) to filter + + for. The list returns orders if any of its fulfillments match any of + the fulfillment types + + listed in this field. + + See [FulfillmentType](#type-fulfillmenttype) for possible values + fulfillment_states: + type: optional>> + docs: >- + A list of [fulfillment states](entity:FulfillmentState) to filter + + for. The list returns orders if any of its fulfillments match any of + the + + fulfillment states listed in this field. + + See [FulfillmentState](#type-fulfillmentstate) for possible values + source: + openapi: openapi/openapi.json + SearchOrdersQuery: + docs: Contains query criteria for the search. + properties: + filter: + type: optional + docs: Criteria to filter results by. + sort: + type: optional + docs: Criteria to sort results by. + source: + openapi: openapi/openapi.json + SearchOrdersResponse: + docs: >- + Either the `order_entries` or `orders` field is set, depending on whether + + `return_entries` is set on the + [SearchOrdersRequest](api-endpoint:Orders-SearchOrders). + properties: + order_entries: + type: optional> + docs: >- + A list of [OrderEntries](entity:OrderEntry) that fit the query + + conditions. The list is populated only if `return_entries` is set to + `true` in the request. + orders: + type: optional> + docs: >- + A list of + + [Order](entity:Order) objects that match the query conditions. The + list is populated only if + + `return_entries` is set to `false` in the request. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + errors: + type: optional> + docs: '[Errors](entity:Error) encountered during the search.' + source: + openapi: openapi/openapi.json + SearchOrdersSort: + docs: |- + Sorting criteria for a `SearchOrders` request. Results can only be sorted + by a timestamp field. + properties: + sort_field: + type: SearchOrdersSortField + docs: >- + The field to sort by. + + + __Important:__ When using a + [DateTimeFilter](entity:SearchOrdersFilter), + + `sort_field` must match the timestamp field that the `DateTimeFilter` + uses to + + filter. For example, if you set your `sort_field` to `CLOSED_AT` and + you use a + + `DateTimeFilter`, your `DateTimeFilter` must filter for orders by + their `CLOSED_AT` date. + + If this field does not match the timestamp field in `DateTimeFilter`, + + `SearchOrders` returns an error. + + + Default: `CREATED_AT`. + + See [SearchOrdersSortField](#type-searchorderssortfield) for possible + values + sort_order: + type: optional + docs: >- + The chronological order in which results are returned. Defaults to + `DESC`. + + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + SearchOrdersSortField: + enum: + - CREATED_AT + - UPDATED_AT + - CLOSED_AT + docs: Specifies which timestamp to use to sort `SearchOrder` results. + source: + openapi: openapi/openapi.json + SearchOrdersSourceFilter: + docs: A filter based on order `source` information. + properties: + source_names: + type: optional>> + docs: >- + Filters by the [Source](entity:OrderSource) `name`. The filter returns + any orders + + with a `source.name` that matches any of the listed source names. + + + Max: 10 source names. + source: + openapi: openapi/openapi.json + SearchOrdersStateFilter: + docs: Filter by the current order `state`. + properties: + states: + docs: |- + States to filter for. + See [OrderState](#type-orderstate) for possible values + type: list + source: + openapi: openapi/openapi.json + SearchScheduledShiftsResponse: + docs: >- + Represents a + [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) + response. + + Either `scheduled_shifts` or `errors` is present in the response. + properties: + scheduled_shifts: + type: optional> + docs: A paginated list of scheduled shifts that match the query conditions. + cursor: + type: optional + docs: >- + The pagination cursor used to retrieve the next page of results. This + field is present + + only if additional results are available. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + SearchShiftsResponse: + docs: >- + The response to a request for `Shift` objects. The response contains + + the requested `Shift` objects and might contain a set of `Error` objects + if + + the request resulted in errors. + properties: + shifts: + type: optional> + docs: Shifts. + cursor: + type: optional + docs: An opaque cursor for fetching the next page. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + SearchSubscriptionsFilter: + docs: >- + Represents a set of query expressions (filters) to narrow the scope of + targeted subscriptions returned by + + the [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) + endpoint. + properties: + customer_ids: + type: optional>> + docs: >- + A filter to select subscriptions based on the subscribing customer + IDs. + location_ids: + type: optional>> + docs: A filter to select subscriptions based on the location. + source_names: + type: optional>> + docs: A filter to select subscriptions based on the source application. + source: + openapi: openapi/openapi.json + SearchSubscriptionsQuery: + docs: >- + Represents a query, consisting of specified query expressions, used to + search for subscriptions. + properties: + filter: + type: optional + docs: A list of query expressions. + source: + openapi: openapi/openapi.json + SearchSubscriptionsResponse: + docs: >- + Defines output parameters in a response from the + + [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscriptions: + type: optional> + docs: The subscriptions matching the specified query expressions. + cursor: + type: optional + docs: >- + When the total number of resulting subscription exceeds the limit of a + paged response, + + the response includes a cursor for you to use in a subsequent request + to fetch the next set of results. + + If the cursor is unset, the response contains the last page of the + results. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + source: + openapi: openapi/openapi.json + SearchTeamMembersFilter: + docs: >- + Represents a filter used in a search for `TeamMember` objects. `AND` logic + is applied + + between the individual fields, and `OR` logic is applied within list-based + fields. + + For example, setting this filter value: + + ``` + + filter = (locations_ids = ["A", "B"], status = ACTIVE) + + ``` + + returns only active team members assigned to either location "A" or "B". + properties: + location_ids: + type: optional>> + docs: >- + When present, filters by team members assigned to the specified + locations. + + When empty, includes team members assigned to any location. + status: + type: optional + docs: |- + When present, filters by team members who match the given status. + When empty, includes team members of all statuses. + See [TeamMemberStatus](#type-teammemberstatus) for possible values + is_owner: + type: optional> + docs: >- + When present and set to true, returns the team member who is the owner + of the Square account. + source: + openapi: openapi/openapi.json + SearchTeamMembersQuery: + docs: Represents the parameters in a search for `TeamMember` objects. + properties: + filter: + type: optional + docs: The options to filter by. + source: + openapi: openapi/openapi.json + SearchTeamMembersResponse: + docs: >- + Represents a response from a search request containing a filtered list of + `TeamMember` objects. + properties: + team_members: + type: optional> + docs: The filtered list of `TeamMember` objects. + cursor: + type: optional + docs: >- + The opaque cursor for fetching the next page. For more information, + see + + [pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + SearchTerminalActionsResponse: + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + action: + type: optional> + docs: The requested search result of `TerminalAction`s. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more + + information. + source: + openapi: openapi/openapi.json + SearchTerminalCheckoutsResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + checkouts: + type: optional> + docs: The requested search result of `TerminalCheckout` objects. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + source: + openapi: openapi/openapi.json + SearchTerminalRefundsResponse: + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + refunds: + type: optional> + docs: The requested search result of `TerminalRefund` objects. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If empty, + + this is the final response. + + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + source: + openapi: openapi/openapi.json + SearchTimecardsResponse: + docs: >- + The response to a request for `Timecard` objects. The response contains + + the requested `Timecard` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + timecards: + type: optional> + docs: Timecards. + cursor: + type: optional + docs: An opaque cursor for fetching the next page. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + SearchTransferOrdersResponse: + docs: Response for searching transfer orders + properties: + transfer_orders: + type: optional> + docs: List of transfer orders matching the search criteria + cursor: + type: optional + docs: Pagination cursor for fetching the next page of results + errors: + type: optional> + docs: Any errors that occurred during the request + source: + openapi: openapi/openapi.json + SearchVendorsRequestFilter: + docs: Defines supported query expressions to search for vendors by. + properties: + name: + type: optional>> + docs: The names of the [Vendor](entity:Vendor) objects to retrieve. + status: + type: optional>> + docs: |- + The statuses of the [Vendor](entity:Vendor) objects to retrieve. + See [VendorStatus](#type-vendorstatus) for possible values + source: + openapi: openapi/openapi.json + SearchVendorsRequestSort: + docs: >- + Defines a sorter used to sort results from + [SearchVendors](api-endpoint:Vendors-SearchVendors). + properties: + field: + type: optional + docs: |- + Specifies the sort key to sort the returned vendors. + See [Field](#type-field) for possible values + order: + type: optional + docs: |- + Specifies the sort order for the returned vendors. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + SearchVendorsRequestSortField: + enum: + - NAME + - CREATED_AT + docs: The field to sort the returned [Vendor](entity:Vendor) objects by. + source: + openapi: openapi/openapi.json + SearchVendorsResponse: + docs: >- + Represents an output from a call to + [SearchVendors](api-endpoint:Vendors-SearchVendors). + properties: + errors: + type: optional> + docs: Errors encountered when the request fails. + vendors: + type: optional> + docs: >- + The [Vendor](entity:Vendor) objects matching the specified search + filter. + cursor: + type: optional + docs: >- + The pagination cursor to be used in a subsequent request. If unset, + + this is the final response. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + source: + openapi: openapi/openapi.json + SegmentFilter: + docs: A query filter to search for buyer-accessible appointment segments by. + properties: + service_variation_id: + type: string + docs: >- + The ID of the [CatalogItemVariation](entity:CatalogItemVariation) + object representing the service booked in this segment. + validation: + minLength: 1 + maxLength: 36 + team_member_id_filter: + type: optional + docs: >- + A query filter to search for buyer-accessible appointment segments + with service-providing team members matching the specified list of + team member IDs. Supported query expressions are + + - `ANY`: return the appointment segments with team members whose IDs + match any member in this list. + + - `NONE`: return the appointment segments with team members whose IDs + are not in this list. + + - `ALL`: not supported. + + + When no expression is specified, any service-providing team member is + eligible to fulfill the Booking. + source: + openapi: openapi/openapi.json + SelectOption: + properties: + reference_id: + type: string + docs: The reference id for the option. + validation: + minLength: 1 + maxLength: 40 + title: + type: string + docs: The title text that displays in the select option button. + validation: + minLength: 1 + maxLength: 250 + source: + openapi: openapi/openapi.json + SelectOptions: + properties: + title: + type: string + docs: The title text to display in the select flow on the Terminal. + validation: + minLength: 1 + maxLength: 250 + body: + type: string + docs: The body text to display in the select flow on the Terminal. + validation: + minLength: 1 + maxLength: 10000 + options: + docs: >- + Represents the buttons/options that should be displayed in the select + flow on the Terminal. + type: list + selected_option: + type: optional + docs: The buyer’s selected option. + source: + openapi: openapi/openapi.json + Shift: + docs: >- + A record of the hourly rate, start, and end times for a single work shift + + for an employee. This might include a record of the start and end times + for breaks + + taken during the shift. + + + Deprecated at Square API version 2025-05-21. Replaced by + [Timecard](entity:Timecard). + + See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + id: + type: optional + docs: The UUID for this object. + validation: + maxLength: 255 + employee_id: + type: optional> + docs: >- + The ID of the employee this shift belongs to. DEPRECATED at version + 2020-08-26. Use `team_member_id` instead. + location_id: + type: string + docs: >- + The ID of the location this shift occurred at. The location should be + based on + + where the employee clocked in. + validation: + minLength: 1 + timezone: + type: optional> + docs: >- + The read-only convenience value that is calculated from the location + based + + on the `location_id`. Format: the IANA timezone database identifier + for the + + location timezone. + start_at: + type: string + docs: >- + RFC 3339; shifted to the location timezone + offset. Precision up to + the + + minute is respected; seconds are truncated. + validation: + minLength: 1 + end_at: + type: optional> + docs: >- + RFC 3339; shifted to the timezone + offset. Precision up to the minute + is + + respected; seconds are truncated. + wage: + type: optional + docs: >- + Job and pay related information. If the wage is not set on create, it + defaults to a wage + + of zero. If the title is not set on create, it defaults to the name of + the role the employee + + is assigned to, if any. + breaks: + type: optional>> + docs: >- + A list of all the paid or unpaid breaks that were taken during this + shift. + status: + type: optional + docs: |- + Describes the working state of the current `Shift`. + See [ShiftStatus](#type-shiftstatus) for possible values + version: + type: optional + docs: >- + Used for resolving concurrency issues. The request fails if the + version + + provided does not match the server version at the time of the request. + If not provided, + + Square executes a blind write; potentially overwriting data from + another + + write. + created_at: + type: optional + docs: A read-only timestamp in RFC 3339 format; presented in UTC. + access: read-only + updated_at: + type: optional + docs: A read-only timestamp in RFC 3339 format; presented in UTC. + access: read-only + team_member_id: + type: optional> + docs: >- + The ID of the team member this shift belongs to. Replaced + `employee_id` at version "2020-08-26". + declared_cash_tip_money: + type: optional + docs: The tips declared by the team member for the shift. + source: + openapi: openapi/openapi.json + ShiftFilter: + docs: >- + Defines a filter used in a search for `Shift` records. `AND` logic is + + used by Square's servers to apply each filter property specified. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + location_ids: + type: optional>> + docs: Fetch shifts for the specified location. + employee_ids: + type: optional>> + docs: >- + Fetch shifts for the specified employees. DEPRECATED at version + 2020-08-26. Use `team_member_ids` instead. + status: + type: optional + docs: |- + Fetch a `Shift` instance by `Shift.status`. + See [ShiftFilterStatus](#type-shiftfilterstatus) for possible values + start: + type: optional + docs: Fetch `Shift` instances that start in the time range - Inclusive. + end: + type: optional + docs: Fetch the `Shift` instances that end in the time range - Inclusive. + workday: + type: optional + docs: Fetch the `Shift` instances based on the workday date range. + team_member_ids: + type: optional>> + docs: >- + Fetch shifts for the specified team members. Replaced `employee_ids` + at version "2020-08-26". + source: + openapi: openapi/openapi.json + ShiftFilterStatus: + enum: + - OPEN + - CLOSED + docs: >- + Specifies the `status` of `Shift` records to be returned. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + source: + openapi: openapi/openapi.json + ShiftQuery: + docs: >- + The parameters of a `Shift` search query, which includes filter and sort + options. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + filter: + type: optional + docs: Query filter options. + sort: + type: optional + docs: Sort order details. + source: + openapi: openapi/openapi.json + ShiftSort: + docs: >- + Sets the sort order of search results. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + field: + type: optional + docs: |- + The field to sort on. + See [ShiftSortField](#type-shiftsortfield) for possible values + order: + type: optional + docs: |- + The order in which results are returned. Defaults to DESC. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + ShiftSortField: + enum: + - START_AT + - END_AT + - CREATED_AT + - UPDATED_AT + docs: >- + Enumerates the `Shift` fields to sort on. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + source: + openapi: openapi/openapi.json + ShiftStatus: + enum: + - OPEN + - CLOSED + docs: >- + Enumerates the possible status of a `Shift`. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + source: + openapi: openapi/openapi.json + ShiftWage: + docs: >- + The hourly wage rate used to compensate an employee for this shift. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + title: + type: optional> + docs: The name of the job performed during this shift. + hourly_rate: + type: optional + docs: |- + Can be a custom-set hourly wage or the calculated effective hourly + wage based on the annual wage and hours worked per week. + job_id: + type: optional + docs: |- + The id of the job performed during this shift. Square + labor-reporting UIs might group shifts together by id. + access: read-only + tip_eligible: + type: optional> + docs: Whether team members are eligible for tips when working this job. + source: + openapi: openapi/openapi.json + ShiftWorkday: + docs: >- + A `Shift` search query filter parameter that sets a range of days that + + a `Shift` must start or end in before passing the filter condition. + + + Deprecated at Square API version 2025-05-21. See the [migration + notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). + properties: + date_range: + type: optional + docs: Dates for fetching the shifts. + match_shifts_by: + type: optional + docs: >- + The strategy on which the dates are applied. + + See [ShiftWorkdayMatcher](#type-shiftworkdaymatcher) for possible + values + default_timezone: + type: optional> + docs: >- + Location-specific timezones convert workdays to datetime filters. + + Every location included in the query must have a timezone or this + field + + must be provided as a fallback. Format: the IANA timezone database + + identifier for the relevant timezone. + source: + openapi: openapi/openapi.json + ShiftWorkdayMatcher: + enum: + - START_AT + - END_AT + - INTERSECTION + docs: Defines the logic used to apply a workday filter. + source: + openapi: openapi/openapi.json + ShippingFee: + properties: + name: + type: optional> + docs: The name for the shipping fee. + charge: + type: Money + docs: The amount and currency for the shipping fee. + source: + openapi: openapi/openapi.json + SignatureImage: + properties: + image_type: + type: optional + docs: |- + The mime/type of the image data. + Use `image/png;base64` for png. + access: read-only + data: + type: optional + docs: The base64 representation of the image. + access: read-only + source: + openapi: openapi/openapi.json + SignatureOptions: + properties: + title: + type: string + docs: >- + The title text to display in the signature capture flow on the + Terminal. + validation: + minLength: 1 + maxLength: 250 + body: + type: string + docs: >- + The body text to display in the signature capture flow on the + Terminal. + validation: + minLength: 1 + maxLength: 10000 + signature: + type: optional> + docs: An image representation of the collected signature. + access: read-only + source: + openapi: openapi/openapi.json + Site: + docs: >- + Represents a Square Online site, which is an online store for a Square + seller. + properties: + id: + type: optional + docs: The Square-assigned ID of the site. + validation: + maxLength: 32 + access: read-only + site_title: + type: optional> + docs: The title of the site. + domain: + type: optional> + docs: >- + The domain of the site (without the protocol). For example, + `mysite1.square.site`. + is_published: + type: optional> + docs: Indicates whether the site is published. + created_at: + type: optional + docs: The timestamp of when the site was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: The timestamp of when the site was last updated, in RFC 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + Snippet: + docs: >- + Represents the snippet that is added to a Square Online site. The snippet + code is injected into the `head` element of all pages on the site, except + for checkout pages. + properties: + id: + type: optional + docs: The Square-assigned ID for the snippet. + validation: + maxLength: 48 + access: read-only + site_id: + type: optional + docs: The ID of the site that contains the snippet. + access: read-only + content: + type: string + docs: The snippet code, which can contain valid HTML, JavaScript, or both. + validation: + minLength: 1 + maxLength: 65535 + created_at: + type: optional + docs: >- + The timestamp of when the snippet was initially added to the site, in + RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the snippet was last updated on the site, in RFC + 3339 format. + access: read-only + source: + openapi: openapi/openapi.json + SortOrder: + enum: + - DESC + - ASC + docs: >- + The order (e.g., chronological or alphabetical) in which results from a + request are returned. + source: + openapi: openapi/openapi.json + SourceApplication: + docs: Represents information about the application used to generate a change. + properties: + product: + type: optional + docs: |- + __Read only__ The [product](entity:Product) type of the application. + See [Product](#type-product) for possible values + application_id: + type: optional> + docs: >- + __Read only__ The Square-assigned ID of the application. This field is + used only if the + + [product](entity:Product) type is `EXTERNAL_API`. + name: + type: optional> + docs: >- + __Read only__ The display name of the application + + (for example, `"Custom Application"` or `"Square POS 4.74 for + Android"`). + source: + openapi: openapi/openapi.json + SquareAccountDetails: + docs: Additional details about Square Account payments. + properties: + payment_source_token: + type: optional> + docs: Unique identifier for the payment source used for this payment. + validation: + maxLength: 255 + errors: + type: optional>> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + StandardUnitDescription: + docs: Contains the name and abbreviation for standard measurement unit. + properties: + unit: + type: optional + docs: Identifies the measurement unit being described. + name: + type: optional> + docs: UI display name of the measurement unit. For example, 'Pound'. + abbreviation: + type: optional> + docs: UI display abbreviation for the measurement unit. For example, 'lb'. + source: + openapi: openapi/openapi.json + StandardUnitDescriptionGroup: + docs: Group of standard measurement units. + properties: + standard_unit_descriptions: + type: optional>> + docs: >- + List of standard (non-custom) measurement units in this description + group. + language_code: + type: optional> + docs: IETF language tag. + source: + openapi: openapi/openapi.json + StartTransferOrderResponse: + docs: Response for starting a transfer order. + properties: + transfer_order: + type: optional + docs: The updated transfer order with status changed to STARTED + errors: + type: optional> + docs: Any errors that occurred during the request + source: + openapi: openapi/openapi.json + SubmitEvidenceResponse: + docs: Defines the fields in a `SubmitEvidence` response. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + dispute: + type: optional + docs: The `Dispute` for which evidence was submitted. + source: + openapi: openapi/openapi.json + Subscription: + docs: >- + Represents a subscription purchased by a customer. + + + For more information, see + + [Manage + Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). + properties: + id: + type: optional + docs: The Square-assigned ID of the subscription. + validation: + maxLength: 255 + access: read-only + location_id: + type: optional + docs: The ID of the location associated with the subscription. + access: read-only + plan_variation_id: + type: optional + docs: >- + The ID of the subscribed-to [subscription plan + variation](entity:CatalogSubscriptionPlanVariation). + access: read-only + customer_id: + type: optional + docs: The ID of the subscribing [customer](entity:Customer) profile. + access: read-only + start_date: + type: optional + docs: >- + The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the + subscription. + access: read-only + canceled_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to cancel + the subscription, + + when the subscription status changes to `CANCELED` and the + subscription billing stops. + + + If this field is not set, the subscription ends according its + subscription plan. + + + This field cannot be updated, other than being cleared. + charged_through_date: + type: optional + docs: >- + The `YYYY-MM-DD`-formatted date up to when the subscriber is invoiced + for the + + subscription. + + + After the invoice is sent for a given billing period, + + this date will be the last day of the billing period. + + For example, + + suppose for the month of May a subscriber gets an invoice + + (or charged the card) on May 1. For the monthly billing scenario, + + this date is then set to May 31. + access: read-only + status: + type: optional + docs: |- + The current status of the subscription. + See [SubscriptionStatus](#type-subscriptionstatus) for possible values + tax_percentage: + type: optional> + docs: |- + The tax amount applied when billing the subscription. The + percentage is expressed in decimal form, using a `'.'` as the decimal + separator and without a `'%'` sign. For example, a value of `7.5` + corresponds to 7.5%. + invoice_ids: + type: optional> + docs: |- + The IDs of the [invoices](entity:Invoice) created for the + subscription, listed in order when the invoices were created + (newest invoices appear first). + access: read-only + price_override_money: + type: optional + docs: >- + A custom price which overrides the cost of a subscription plan + variation with `STATIC` pricing. + + This field does not affect itemized subscriptions with `RELATIVE` + pricing. Instead, + + you should edit the Subscription's [order + template](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#phases-and-order-templates). + version: + type: optional + docs: >- + 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. + created_at: + type: optional + docs: The timestamp when the subscription was created, in RFC 3339 format. + access: read-only + card_id: + type: optional> + docs: |- + The ID of the [subscriber's](entity:Customer) [card](entity:Card) + used to charge for the subscription. + timezone: + type: optional + docs: >- + Timezone that will be used in date calculations for the subscription. + + Defaults to the timezone of the location based on `location_id`. + + Format: the IANA Timezone Database identifier for the location + timezone (for example, `America/Los_Angeles`). + access: read-only + source: + type: optional + docs: The origination details of the subscription. + actions: + type: optional>> + docs: >- + The list of scheduled actions on this subscription. It is set only in + the response from + + [RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) + with the query parameter + + of `include=actions` or from + + [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) + with the input parameter + + of `include:["actions"]`. + monthly_billing_anchor_date: + type: optional + docs: >- + The day of the month on which the subscription will issue invoices and + publish orders. + access: read-only + phases: + type: optional> + docs: array of phases for this subscription + access: read-only + completed_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date when the subscription enters a + terminal state. + source: + openapi: openapi/openapi.json + SubscriptionAction: + docs: Represents an action as a pending change to a subscription. + properties: + id: + type: optional + docs: The ID of an action scoped to a subscription. + type: + type: optional + docs: >- + The type of the action. + + See [SubscriptionActionType](#type-subscriptionactiontype) for + possible values + effective_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date when the action occurs on the + subscription. + monthly_billing_anchor_date: + type: optional> + docs: >- + The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` + action. + phases: + type: optional>> + docs: A list of Phases, to pass phase-specific information used in the swap. + new_plan_variation_id: + type: optional> + docs: >- + The target subscription plan variation that a subscription switches + to, for a `SWAP_PLAN` action. + source: + openapi: openapi/openapi.json + SubscriptionActionType: + enum: + - CANCEL + - PAUSE + - RESUME + - SWAP_PLAN + - CHANGE_BILLING_ANCHOR_DATE + - COMPLETE + docs: Supported types of an action as a pending change to a subscription. + source: + openapi: openapi/openapi.json + SubscriptionCadence: + enum: + - DAILY + - WEEKLY + - EVERY_TWO_WEEKS + - THIRTY_DAYS + - SIXTY_DAYS + - NINETY_DAYS + - MONTHLY + - EVERY_TWO_MONTHS + - QUARTERLY + - EVERY_FOUR_MONTHS + - EVERY_SIX_MONTHS + - ANNUAL + - EVERY_TWO_YEARS + docs: Determines the billing cadence of a [Subscription](entity:Subscription) + source: + openapi: openapi/openapi.json + SubscriptionCreatedEvent: + docs: Published when a [Subscription](entity:Subscription) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"subscription.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + SubscriptionCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"subscription"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected subscription. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the created subscription. + source: + openapi: openapi/openapi.json + SubscriptionCreatedEventObject: + properties: + subscription: + type: optional + docs: The created subscription. + source: + openapi: openapi/openapi.json + SubscriptionEvent: + docs: Describes changes to a subscription and the subscription status. + properties: + id: + type: string + docs: The ID of the subscription event. + subscription_event_type: + type: SubscriptionEventSubscriptionEventType + docs: >- + Type of the subscription event. + + See + [SubscriptionEventSubscriptionEventType](#type-subscriptioneventsubscriptioneventtype) + for possible values + effective_date: + type: string + docs: >- + The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the + subscription event occurred. + monthly_billing_anchor_date: + type: optional + docs: >- + The day-of-the-month the billing anchor date was changed to, if + applicable. + access: read-only + info: + type: optional + docs: Additional information about the subscription event. + phases: + type: optional>> + docs: A list of Phases, to pass phase-specific information used in the swap. + plan_variation_id: + type: string + docs: >- + The ID of the subscription plan variation associated with the + subscription. + source: + openapi: openapi/openapi.json + SubscriptionEventInfo: + docs: Provides information about the subscription event. + properties: + detail: + type: optional> + docs: A human-readable explanation for the event. + code: + type: optional + docs: |- + An info code indicating the subscription event that occurred. + See [InfoCode](#type-infocode) for possible values + source: + openapi: openapi/openapi.json + SubscriptionEventInfoCode: + enum: + - LOCATION_NOT_ACTIVE + - LOCATION_CANNOT_ACCEPT_PAYMENT + - CUSTOMER_DELETED + - CUSTOMER_NO_EMAIL + - CUSTOMER_NO_NAME + - USER_PROVIDED + docs: Supported info codes of a subscription event. + source: + openapi: openapi/openapi.json + SubscriptionEventSubscriptionEventType: + enum: + - START_SUBSCRIPTION + - PLAN_CHANGE + - STOP_SUBSCRIPTION + - DEACTIVATE_SUBSCRIPTION + - RESUME_SUBSCRIPTION + - PAUSE_SUBSCRIPTION + - BILLING_ANCHOR_DATE_CHANGED + docs: Supported types of an event occurred to a subscription. + source: + openapi: openapi/openapi.json + SubscriptionPhase: + docs: >- + Describes a phase in a subscription plan variation. For more information, + see [Subscription Plans and + Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). + properties: + uid: + type: optional> + docs: >- + The Square-assigned ID of the subscription phase. This field cannot be + changed after a `SubscriptionPhase` is created. + cadence: + type: SubscriptionCadence + docs: >- + The billing cadence of the phase. For example, weekly or monthly. This + field cannot be changed after a `SubscriptionPhase` is created. + + See [SubscriptionCadence](#type-subscriptioncadence) for possible + values + periods: + type: optional> + docs: >- + The number of `cadence`s the phase lasts. If not set, the phase never + ends. Only the last phase can be indefinite. This field cannot be + changed after a `SubscriptionPhase` is created. + recurring_price_money: + type: optional + docs: >- + The amount to bill for each `cadence`. Failure to specify this field + results in a `MISSING_REQUIRED_PARAMETER` error at runtime. + ordinal: + type: optional> + docs: >- + The position this phase appears in the sequence of phases defined for + the plan, indexed from 0. This field cannot be changed after a + `SubscriptionPhase` is created. + pricing: + type: optional + docs: The subscription pricing. + source: + openapi: openapi/openapi.json + SubscriptionPricing: + docs: Describes the pricing for the subscription. + properties: + type: + type: optional + docs: >- + RELATIVE or STATIC + + See [SubscriptionPricingType](#type-subscriptionpricingtype) for + possible values + discount_ids: + type: optional>> + docs: The ids of the discount catalog objects + price_money: + type: optional + docs: The price of the subscription, if STATIC + source: + openapi: openapi/openapi.json + SubscriptionPricingType: + enum: + - STATIC + - RELATIVE + docs: Determines the pricing of a [Subscription](entity:Subscription) + source: + openapi: openapi/openapi.json + SubscriptionSource: + docs: The origination details of the subscription. + properties: + name: + type: optional> + docs: |- + The name used to identify the place (physical or digital) that + a subscription originates. If unset, the name defaults to the name + of the application that created the subscription. + validation: + maxLength: 255 + source: + openapi: openapi/openapi.json + SubscriptionStatus: + enum: + - PENDING + - ACTIVE + - CANCELED + - DEACTIVATED + - PAUSED + - COMPLETED + docs: Supported subscription statuses. + source: + openapi: openapi/openapi.json + SubscriptionTestResult: + docs: >- + Represents the details of a webhook subscription, including notification + URL, + + event types, and signature key. + properties: + id: + type: optional + docs: A Square-generated unique ID for the subscription test result. + validation: + maxLength: 64 + access: read-only + status_code: + type: optional> + docs: The status code returned by the subscription notification URL. + payload: + type: optional> + docs: >- + An object containing the payload of the test event. For example, a + `payment.created` event. + created_at: + type: optional + docs: >- + The timestamp of when the subscription was created, in RFC 3339 + format. + + For example, "2016-09-04T23:59:33.123Z". + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the subscription was updated, in RFC 3339 + format. For example, "2016-09-04T23:59:33.123Z". + + Because a subscription test result is unique, this field is the same + as the `created_at` field. + access: read-only + source: + openapi: openapi/openapi.json + SubscriptionUpdatedEvent: + docs: >- + Published when a [Subscription](entity:Subscription) is updated. + + Typically the `subscription.status` is updated as subscriptions become + active + + or cancelled. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"subscription.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + SubscriptionUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"subscription"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected subscription. + validation: + maxLength: 255 + object: + type: optional + docs: An object containing the updated subscription. + source: + openapi: openapi/openapi.json + SubscriptionUpdatedEventObject: + properties: + subscription: + type: optional + docs: The updated subscription. + source: + openapi: openapi/openapi.json + SwapPlanResponse: + docs: |- + Defines output parameters in a response of the + [SwapPlan](api-endpoint:Subscriptions-SwapPlan) endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The subscription with the updated subscription plan. + actions: + type: optional> + docs: A list of a `SWAP_PLAN` action created by the request. + source: + openapi: openapi/openapi.json + TaxCalculationPhase: + enum: + - TAX_SUBTOTAL_PHASE + - TAX_TOTAL_PHASE + docs: When to calculate the taxes due on a cart. + source: + openapi: openapi/openapi.json + TaxIds: + docs: Identifiers for the location used by various governments for tax purposes. + properties: + eu_vat: + type: optional + docs: |- + The EU VAT number for this location. For example, `IE3426675K`. + If the EU VAT number is present, it is well-formed and has been + validated with VIES, the VAT Information Exchange System. + access: read-only + fr_siret: + type: optional + docs: >- + The SIRET (Système d'Identification du Répertoire des Entreprises et + de leurs Etablissements) + + number is a 14-digit code issued by the French INSEE. For example, + `39922799000021`. + access: read-only + fr_naf: + type: optional + docs: >- + The French government uses the NAF (Nomenclature des Activités + Françaises) to display and + + track economic statistical data. This is also called the APE (Activite + Principale de l’Entreprise) code. + + For example, `6910Z`. + access: read-only + es_nif: + type: optional + docs: >- + The NIF (Numero de Identificacion Fiscal) number is a nine-character + tax identifier used in Spain. + + If it is present, it has been validated. For example, `73628495A`. + access: read-only + jp_qii: + type: optional + docs: >- + The QII (Qualified Invoice Issuer) number is a 14-character tax + identifier used in Japan. + + For example, `T1234567890123`. + access: read-only + source: + openapi: openapi/openapi.json + TaxInclusionType: + enum: + - ADDITIVE + - INCLUSIVE + docs: >- + Whether to the tax amount should be additional to or included in the + CatalogItem price. + source: + openapi: openapi/openapi.json + TeamMember: + docs: A record representing an individual team member for a business. + properties: + id: + type: optional + docs: The unique ID for the team member. + access: read-only + reference_id: + type: optional> + docs: >- + A second ID used to associate the team member with an entity in + another system. + is_owner: + type: optional + docs: Whether the team member is the owner of the Square account. + access: read-only + status: + type: optional + docs: |- + Describes the status of the team member. + See [TeamMemberStatus](#type-teammemberstatus) for possible values + given_name: + type: optional> + docs: >- + The given name (that is, the first name) associated with the team + member. + family_name: + type: optional> + docs: >- + The family name (that is, the last name) associated with the team + member. + email_address: + type: optional> + docs: >- + The email address associated with the team member. After accepting the + invitation + + from Square, only the team member can change this value. + phone_number: + type: optional> + docs: |- + The team member's phone number, in E.164 format. For example: + +14155552671 - the country code is 1 for US + +551155256325 - the country code is 55 for BR + created_at: + type: optional + docs: The timestamp when the team member was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp when the team member was last updated, in RFC 3339 + format. + access: read-only + assigned_locations: + type: optional + docs: Describes the team member's assigned locations. + wage_setting: + type: optional + docs: >- + Information about the team member's overtime exemption status, job + assignments, and compensation. + source: + openapi: openapi/openapi.json + TeamMemberAssignedLocations: + docs: An object that represents a team member's assignment to locations. + properties: + assignment_type: + type: optional + docs: >- + The current assignment type of the team member. + + See + [TeamMemberAssignedLocationsAssignmentType](#type-teammemberassignedlocationsassignmenttype) + for possible values + location_ids: + type: optional>> + docs: The explicit locations that the team member is assigned to. + source: + openapi: openapi/openapi.json + TeamMemberAssignedLocationsAssignmentType: + enum: + - ALL_CURRENT_AND_FUTURE_LOCATIONS + - EXPLICIT_LOCATIONS + docs: Enumerates the possible assignment types that the team member can have. + source: + openapi: openapi/openapi.json + TeamMemberBookingProfile: + docs: >- + The booking profile of a seller's team member, including the team member's + ID, display name, description and whether the team member can be booked as + a service provider. + properties: + team_member_id: + type: optional + docs: >- + The ID of the [TeamMember](entity:TeamMember) object for the team + member associated with the booking profile. + validation: + maxLength: 32 + access: read-only + description: + type: optional + docs: The description of the team member. + validation: + maxLength: 65536 + access: read-only + display_name: + type: optional + docs: The display name of the team member. + validation: + maxLength: 512 + access: read-only + is_bookable: + type: optional> + docs: >- + Indicates whether the team member can be booked through the Bookings + API or the seller's online booking channel or site (`true`) or not + (`false`). + profile_image_url: + type: optional + docs: The URL of the team member's image for the bookings profile. + validation: + maxLength: 2048 + access: read-only + source: + openapi: openapi/openapi.json + TeamMemberCreatedEvent: + docs: Published when a Team Member is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"team_member.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TeamMemberCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"team_member"`. + id: + type: optional + docs: ID of the created team member. + object: + type: optional + docs: An object containing the created team member. + source: + openapi: openapi/openapi.json + TeamMemberCreatedEventObject: + properties: + team_member: + type: optional + docs: The created team member. + source: + openapi: openapi/openapi.json + TeamMemberInvitationStatus: + enum: + - UNINVITED + - PENDING + - ACCEPTED + docs: >- + Enumerates the possible invitation statuses the team member can have + within a business. + source: + openapi: openapi/openapi.json + TeamMemberStatus: + enum: + - ACTIVE + - INACTIVE + docs: >- + Enumerates the possible statuses the team member can have within a + business. + source: + openapi: openapi/openapi.json + TeamMemberUpdatedEvent: + docs: Published when a Team Member is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"team_member.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TeamMemberUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"team_member"`. + id: + type: optional + docs: ID of the affected team member. + object: + type: optional + docs: An object containing the updated team member. + source: + openapi: openapi/openapi.json + TeamMemberUpdatedEventObject: + properties: + team_member: + type: optional + docs: The updated team member. + source: + openapi: openapi/openapi.json + TeamMemberWage: + docs: |- + Job and wage information for a [team member](entity:TeamMember). + This convenience object provides details needed to specify the `wage` + field for a [timecard](entity:Timecard). + properties: + id: + type: optional + docs: The UUID for this object. + team_member_id: + type: optional> + docs: The `TeamMember` that this wage is assigned to. + title: + type: optional> + docs: The job title that this wage relates to. + hourly_rate: + type: optional + docs: |- + Can be a custom-set hourly wage or the calculated effective hourly + wage based on the annual wage and hours worked per week. + job_id: + type: optional> + docs: An identifier for the [job](entity:Job) that this wage relates to. + tip_eligible: + type: optional> + docs: Whether team members are eligible for tips when working this job. + source: + openapi: openapi/openapi.json + TeamMemberWageSettingUpdatedEvent: + docs: Published when a Wage Setting is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: >- + The type of event this represents, + `"team_member.wage_setting.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TeamMemberWageSettingUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"wage_setting"`. + id: + type: optional + docs: ID of the updated team member wage setting. + object: + type: optional + docs: An object containing the updated team member wage setting. + source: + openapi: openapi/openapi.json + TeamMemberWageSettingUpdatedEventObject: + properties: + wage_setting: + type: optional + docs: The updated team member wage setting. + source: + openapi: openapi/openapi.json + Tender: + docs: >- + Represents a tender (i.e., a method of payment) used in a Square + transaction. + properties: + id: + type: optional + docs: The tender's unique ID. It is the associated payment ID. + validation: + maxLength: 192 + location_id: + type: optional> + docs: The ID of the transaction's associated location. + validation: + maxLength: 50 + transaction_id: + type: optional> + docs: The ID of the tender's associated transaction. + validation: + maxLength: 192 + created_at: + type: optional + docs: The timestamp for when the tender was created, in RFC 3339 format. + validation: + maxLength: 32 + access: read-only + note: + type: optional> + docs: An optional note associated with the tender at the time of payment. + validation: + maxLength: 500 + amount_money: + type: optional + docs: >- + The total amount of the tender, including `tip_money`. If the tender + has a `payment_id`, + + the `total_money` of the corresponding [Payment](entity:Payment) will + be equal to the + + `amount_money` of the tender. + tip_money: + type: optional + docs: The tip's amount of the tender. + processing_fee_money: + type: optional + docs: >- + The amount of any Square processing fees applied to the tender. + + + This field is not immediately populated when a new transaction is + created. + + It is usually available after about ten seconds. + customer_id: + type: optional> + docs: >- + If the tender is associated with a customer or represents a customer's + card on file, + + this is the ID of the associated customer. + validation: + maxLength: 191 + type: + type: TenderType + docs: |- + The type of tender, such as `CARD` or `CASH`. + See [TenderType](#type-tendertype) for possible values + card_details: + type: optional + docs: |- + The details of the card tender. + + This value is present only if the value of `type` is `CARD`. + cash_details: + type: optional + docs: |- + The details of the cash tender. + + This value is present only if the value of `type` is `CASH`. + bank_account_details: + type: optional + docs: |- + The details of the bank account tender. + + This value is present only if the value of `type` is `BANK_ACCOUNT`. + buy_now_pay_later_details: + type: optional + docs: >- + The details of a Buy Now Pay Later tender. + + + This value is present only if the value of `type` is + `BUY_NOW_PAY_LATER`. + square_account_details: + type: optional + docs: |- + The details of a Square Account tender. + + This value is present only if the value of `type` is `SQUARE_ACCOUNT`. + additional_recipients: + type: optional>> + docs: >- + Additional recipients (other than the merchant) receiving a portion of + this tender. + + For example, fees assessed on the purchase by a third party + integration. + payment_id: + type: optional> + docs: >- + The ID of the [Payment](entity:Payment) that corresponds to this + tender. + + This value is only present for payments created with the v2 Payments + API. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + TenderBankAccountDetails: + docs: |- + Represents the details of a tender with `type` `BANK_ACCOUNT`. + + See [BankAccountPaymentDetails](entity:BankAccountPaymentDetails) + for more exposed details of a bank account payment. + properties: + status: + type: optional + docs: >- + The bank account payment's current state. + + + See + [TenderBankAccountPaymentDetailsStatus](entity:TenderBankAccountDetailsStatus) + for possible values. + + See + [TenderBankAccountDetailsStatus](#type-tenderbankaccountdetailsstatus) + for possible values + source: + openapi: openapi/openapi.json + TenderBankAccountDetailsStatus: + enum: + - PENDING + - COMPLETED + - FAILED + docs: Indicates the bank account payment's current status. + source: + openapi: openapi/openapi.json + TenderBuyNowPayLaterDetails: + docs: Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. + properties: + buy_now_pay_later_brand: + type: optional + docs: |- + The Buy Now Pay Later brand. + See [Brand](#type-brand) for possible values + status: + type: optional + docs: >- + The buy now pay later payment's current state (such as `AUTHORIZED` or + + `CAPTURED`). See + [TenderBuyNowPayLaterDetailsStatus](entity:TenderBuyNowPayLaterDetailsStatus) + + for possible values. + + See [Status](#type-status) for possible values + source: + openapi: openapi/openapi.json + TenderBuyNowPayLaterDetailsBrand: + enum: + - OTHER_BRAND + - AFTERPAY + source: + openapi: openapi/openapi.json + TenderBuyNowPayLaterDetailsStatus: + enum: + - AUTHORIZED + - CAPTURED + - VOIDED + - FAILED + source: + openapi: openapi/openapi.json + TenderCardDetails: + docs: >- + Represents additional details of a tender with `type` `CARD` or + `SQUARE_GIFT_CARD` + properties: + status: + type: optional + docs: >- + The credit card payment's current state (such as `AUTHORIZED` or + + `CAPTURED`). See + [TenderCardDetailsStatus](entity:TenderCardDetailsStatus) + + for possible values. + + See [TenderCardDetailsStatus](#type-tendercarddetailsstatus) for + possible values + card: + type: optional + docs: The credit card's non-confidential details. + entry_method: + type: optional + docs: >- + The method used to enter the card's details for the transaction. + + See [TenderCardDetailsEntryMethod](#type-tendercarddetailsentrymethod) + for possible values + source: + openapi: openapi/openapi.json + TenderCardDetailsEntryMethod: + enum: + - SWIPED + - KEYED + - EMV + - ON_FILE + - CONTACTLESS + docs: Indicates the method used to enter the card's details. + source: + openapi: openapi/openapi.json + TenderCardDetailsStatus: + enum: + - AUTHORIZED + - CAPTURED + - VOIDED + - FAILED + docs: Indicates the card transaction's current status. + source: + openapi: openapi/openapi.json + TenderCashDetails: + docs: Represents the details of a tender with `type` `CASH`. + properties: + buyer_tendered_money: + type: optional + docs: >- + The total amount of cash provided by the buyer, before change is + given. + change_back_money: + type: optional + docs: The amount of change returned to the buyer. + source: + openapi: openapi/openapi.json + TenderSquareAccountDetails: + docs: Represents the details of a tender with `type` `SQUARE_ACCOUNT`. + properties: + status: + type: optional + docs: >- + The Square Account payment's current state (such as `AUTHORIZED` or + + `CAPTURED`). See + [TenderSquareAccountDetailsStatus](entity:TenderSquareAccountDetailsStatus) + + for possible values. + + See [Status](#type-status) for possible values + source: + openapi: openapi/openapi.json + TenderSquareAccountDetailsStatus: + enum: + - AUTHORIZED + - CAPTURED + - VOIDED + - FAILED + source: + openapi: openapi/openapi.json + TenderType: + enum: + - CARD + - CASH + - THIRD_PARTY_CARD + - SQUARE_GIFT_CARD + - NO_SALE + - BANK_ACCOUNT + - WALLET + - BUY_NOW_PAY_LATER + - SQUARE_ACCOUNT + - OTHER + docs: Indicates a tender's type. + source: + openapi: openapi/openapi.json + TerminalAction: + docs: Represents an action processed by the Square Terminal. + properties: + id: + type: optional + docs: A unique ID for this `TerminalAction`. + validation: + minLength: 10 + maxLength: 255 + access: read-only + device_id: + type: optional> + docs: |- + The unique Id of the device intended for this `TerminalAction`. + The Id can be retrieved from /v2/devices api. + deadline_duration: + type: optional> + docs: >- + The duration as an RFC 3339 duration, after which the action will be + automatically canceled. + + TerminalActions that are `PENDING` will be automatically `CANCELED` + and have a cancellation reason + + of `TIMED_OUT` + + + Default: 5 minutes from creation + + + Maximum: 5 minutes + status: + type: optional + docs: >- + The status of the `TerminalAction`. + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, + `COMPLETED` + access: read-only + cancel_reason: + type: optional + docs: >- + The reason why `TerminalAction` is canceled. Present if the status is + `CANCELED`. + + See [ActionCancelReason](#type-actioncancelreason) for possible values + created_at: + type: optional + docs: >- + The time when the `TerminalAction` was created as an RFC 3339 + timestamp. + access: read-only + updated_at: + type: optional + docs: >- + The time when the `TerminalAction` was last updated as an RFC 3339 + timestamp. + access: read-only + app_id: + type: optional + docs: The ID of the application that created the action. + access: read-only + location_id: + type: optional + docs: The location id the action is attached to, if a link can be made. + validation: + maxLength: 64 + access: read-only + type: + type: optional + docs: |- + Represents the type of the action. + See [ActionType](#type-actiontype) for possible values + qr_code_options: + type: optional + docs: >- + Describes configuration for the QR code action. Requires `QR_CODE` + type. + save_card_options: + type: optional + docs: >- + Describes configuration for the save-card action. Requires `SAVE_CARD` + type. + signature_options: + type: optional + docs: >- + Describes configuration for the signature capture action. Requires + `SIGNATURE` type. + confirmation_options: + type: optional + docs: >- + Describes configuration for the confirmation action. Requires + `CONFIRMATION` type. + receipt_options: + type: optional + docs: >- + Describes configuration for the receipt action. Requires `RECEIPT` + type. + data_collection_options: + type: optional + docs: >- + Describes configuration for the data collection action. Requires + `DATA_COLLECTION` type. + select_options: + type: optional + docs: Describes configuration for the select action. Requires `SELECT` type. + device_metadata: + type: optional + docs: >- + Details about the Terminal that received the action request (such as + battery level, + + operating system version, and network connection settings). + + + Only available for `PING` action type. + await_next_action: + type: optional> + docs: >- + Indicates the action will be linked to another action and requires a + waiting dialog to be + + displayed instead of returning to the idle screen on completion of the + action. + + + Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT + types. + await_next_action_duration: + type: optional> + docs: >- + The timeout duration of the waiting dialog as an RFC 3339 duration, + after which the + + waiting dialog will no longer be displayed and the Terminal will + return to the idle screen. + + + Default: 5 minutes from when the waiting dialog is displayed + + + Maximum: 5 minutes + source: + openapi: openapi/openapi.json + TerminalActionActionType: + enum: + - QR_CODE + - PING + - SAVE_CARD + - SIGNATURE + - CONFIRMATION + - RECEIPT + - DATA_COLLECTION + - SELECT + docs: >- + Describes the type of this unit and indicates which field contains the + unit information. This is an ‘open’ enum. + source: + openapi: openapi/openapi.json + TerminalActionCreatedEvent: + docs: Published when a TerminalAction is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.action.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalActionCreatedEventData: + properties: + type: + type: optional> + docs: Name of the created object’s type, `"action"`. + id: + type: optional + docs: ID of the created terminal action. + object: + type: optional + docs: An object containing the created terminal action. + source: + openapi: openapi/openapi.json + TerminalActionCreatedEventObject: + properties: + action: + type: optional + docs: The created terminal action. + source: + openapi: openapi/openapi.json + TerminalActionQuery: + properties: + filter: + type: optional + docs: Options for filtering returned `TerminalAction`s + sort: + type: optional + docs: Option for sorting returned `TerminalAction` objects. + source: + openapi: openapi/openapi.json + TerminalActionQueryFilter: + properties: + device_id: + type: optional> + docs: >- + `TerminalAction`s associated with a specific device. If no device is + specified then all + + `TerminalAction`s for the merchant will be displayed. + created_at: + type: optional + docs: |- + Time range for the beginning of the reporting period. Inclusive. + Default value: The current time minus one day. + Note that `TerminalAction`s are available for 30 days after creation. + status: + type: optional> + docs: >- + Filter results with the desired status of the `TerminalAction` + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, + `COMPLETED` + type: + type: optional + docs: >- + Filter results with the requested ActionType. + + See [TerminalActionActionType](#type-terminalactionactiontype) for + possible values + source: + openapi: openapi/openapi.json + TerminalActionQuerySort: + properties: + sort_order: + type: optional + docs: |- + The order in which results are listed. + - `ASC` - Oldest to newest. + - `DESC` - Newest to oldest (default). + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + TerminalActionUpdatedEvent: + docs: Published when a TerminalAction is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.action.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalActionUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the updated object’s type, `"action"`. + id: + type: optional + docs: ID of the updated terminal action. + object: + type: optional + docs: An object containing the updated terminal action. + source: + openapi: openapi/openapi.json + TerminalActionUpdatedEventObject: + properties: + action: + type: optional + docs: The updated terminal action. + source: + openapi: openapi/openapi.json + TerminalCheckout: + docs: Represents a checkout processed by the Square Terminal. + properties: + id: + type: optional + docs: A unique ID for this `TerminalCheckout`. + validation: + minLength: 10 + maxLength: 255 + access: read-only + amount_money: + type: Money + docs: >- + The amount of money (including the tax amount) that the Square + Terminal device should try to collect. + reference_id: + type: optional> + docs: >- + An optional user-defined reference ID that can be used to associate + + this `TerminalCheckout` to another entity in an external system. For + example, an order + + ID generated by a third-party shopping cart. The ID is also associated + with any payments + + used to complete the checkout. + validation: + maxLength: 40 + note: + type: optional> + docs: >- + An optional note to associate with the checkout, as well as with any + payments used to complete the checkout. + + Note: maximum 500 characters + validation: + maxLength: 500 + order_id: + type: optional> + docs: The reference to the Square order ID for the checkout request. + payment_options: + type: optional + docs: Payment-specific options for the checkout request. + device_options: + type: DeviceCheckoutOptions + docs: >- + Options to control the display and behavior of the Square Terminal + device. + deadline_duration: + type: optional> + docs: >- + An RFC 3339 duration, after which the checkout is automatically + canceled. + + A `TerminalCheckout` that is `PENDING` is automatically `CANCELED` and + has a cancellation reason + + of `TIMED_OUT`. + + + Default: 5 minutes from creation + + + Maximum: 5 minutes + status: + type: optional + docs: >- + The status of the `TerminalCheckout`. + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, + `COMPLETED` + access: read-only + cancel_reason: + type: optional + docs: >- + The reason why `TerminalCheckout` is canceled. Present if the status + is `CANCELED`. + + See [ActionCancelReason](#type-actioncancelreason) for possible values + payment_ids: + type: optional> + docs: A list of IDs for payments created by this `TerminalCheckout`. + access: read-only + created_at: + type: optional + docs: >- + The time when the `TerminalCheckout` was created, as an RFC 3339 + timestamp. + access: read-only + updated_at: + type: optional + docs: >- + The time when the `TerminalCheckout` was last updated, as an RFC 3339 + timestamp. + access: read-only + app_id: + type: optional + docs: The ID of the application that created the checkout. + access: read-only + location_id: + type: optional + docs: The location of the device where the `TerminalCheckout` was directed. + validation: + maxLength: 64 + access: read-only + payment_type: + type: optional + docs: >- + The type of payment the terminal should attempt to capture from. + Defaults to `CARD_PRESENT`. + + See [CheckoutOptionsPaymentType](#type-checkoutoptionspaymenttype) for + possible values + team_member_id: + type: optional> + docs: >- + An optional ID of the team member associated with creating the + checkout. + customer_id: + type: optional> + docs: An optional ID of the customer associated with the checkout. + app_fee_money: + type: optional + docs: >- + The amount the developer is taking as a fee for facilitating the + payment on behalf + + of the seller. + + + The amount cannot be more than 90% of the total amount of the payment. + + + The amount must be specified in the smallest denomination of the + applicable currency (for example, US dollar amounts are specified in + cents). For more information, see [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + + + The fee currency code must match the currency associated with the + seller that is accepting the payment. The application must be from a + developer account in the same country and using the same currency code + as the seller. + + + For more information about the application fee scenario, see [Take + Payments and Collect + Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + + + To set this field, PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS OAuth + permission is required. For more information, see + [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions). + statement_description_identifier: + type: optional> + docs: >- + Optional additional payment information to include on the customer's + card statement as + + part of the statement description. This can be, for example, an + invoice number, ticket number, + + or short description that uniquely identifies the purchase. + validation: + maxLength: 20 + tip_money: + type: optional + docs: >- + The amount designated as a tip, in addition to `amount_money`. This + may only be set for a + + checkout that has tipping disabled (`tip_settings.allow_tipping` is + `false`). + source: + openapi: openapi/openapi.json + TerminalCheckoutCreatedEvent: + docs: Published when a [TerminalCheckout](entity:TerminalCheckout) is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.checkout.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalCheckoutCreatedEventData: + properties: + type: + type: optional> + docs: Name of the created object’s type, `"checkout"`. + id: + type: optional + docs: ID of the created terminal checkout. + validation: + minLength: 10 + maxLength: 255 + object: + type: optional + docs: An object containing the created terminal checkout + source: + openapi: openapi/openapi.json + TerminalCheckoutCreatedEventObject: + properties: + checkout: + type: optional + docs: The created terminal checkout + source: + openapi: openapi/openapi.json + TerminalCheckoutQuery: + properties: + filter: + type: optional + docs: Options for filtering returned `TerminalCheckout` objects. + sort: + type: optional + docs: Option for sorting returned `TerminalCheckout` objects. + source: + openapi: openapi/openapi.json + TerminalCheckoutQueryFilter: + properties: + device_id: + type: optional> + docs: >- + The `TerminalCheckout` objects associated with a specific device. If + no device is specified, then all + + `TerminalCheckout` objects for the merchant are displayed. + created_at: + type: optional + docs: >- + The time range for the beginning of the reporting period, which is + inclusive. + + Default value: The current time minus one day. + + Note that `TerminalCheckout`s are available for 30 days after + creation. + status: + type: optional> + docs: >- + Filtered results with the desired status of the `TerminalCheckout`. + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, + `COMPLETED` + source: + openapi: openapi/openapi.json + TerminalCheckoutQuerySort: + properties: + sort_order: + type: optional + docs: |- + The order in which results are listed. + Default: `DESC` + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + TerminalCheckoutUpdatedEvent: + docs: Published when a [TerminalCheckout](entity:TerminalCheckout) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.checkout.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalCheckoutUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the updated object’s type, `"checkout"`. + id: + type: optional + docs: ID of the updated terminal checkout. + validation: + minLength: 10 + maxLength: 255 + object: + type: optional + docs: An object containing the updated terminal checkout + source: + openapi: openapi/openapi.json + TerminalCheckoutUpdatedEventObject: + properties: + checkout: + type: optional + docs: The updated terminal checkout + source: + openapi: openapi/openapi.json + TerminalRefund: + docs: >- + Represents a payment refund processed by the Square Terminal. Only + supports Interac (Canadian debit network) payment refunds. + properties: + id: + type: optional + docs: A unique ID for this `TerminalRefund`. + validation: + minLength: 10 + maxLength: 255 + access: read-only + refund_id: + type: optional + docs: >- + The reference to the payment refund created by completing this + `TerminalRefund`. + access: read-only + payment_id: + type: string + docs: The unique ID of the payment being refunded. + validation: + minLength: 1 + order_id: + type: optional + docs: >- + The reference to the Square order ID for the payment identified by the + `payment_id`. + access: read-only + amount_money: + type: Money + docs: >- + The amount of money, inclusive of `tax_money`, that the + `TerminalRefund` should return. + + This value is limited to the amount taken in the original payment + minus any completed or + + pending refunds. + reason: + type: string + docs: A description of the reason for the refund. + validation: + maxLength: 192 + device_id: + type: string + docs: |- + The unique ID of the device intended for this `TerminalRefund`. + The Id can be retrieved from /v2/devices api. + deadline_duration: + type: optional> + docs: >- + The RFC 3339 duration, after which the refund is automatically + canceled. + + A `TerminalRefund` that is `PENDING` is automatically `CANCELED` and + has a cancellation reason + + of `TIMED_OUT`. + + + Default: 5 minutes from creation. + + + Maximum: 5 minutes + status: + type: optional + docs: >- + The status of the `TerminalRefund`. + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or + `COMPLETED`. + access: read-only + cancel_reason: + type: optional + docs: |- + Present if the status is `CANCELED`. + See [ActionCancelReason](#type-actioncancelreason) for possible values + created_at: + type: optional + docs: >- + The time when the `TerminalRefund` was created, as an RFC 3339 + timestamp. + access: read-only + updated_at: + type: optional + docs: >- + The time when the `TerminalRefund` was last updated, as an RFC 3339 + timestamp. + access: read-only + app_id: + type: optional + docs: The ID of the application that created the refund. + access: read-only + location_id: + type: optional + docs: The location of the device where the `TerminalRefund` was directed. + validation: + maxLength: 64 + access: read-only + source: + openapi: openapi/openapi.json + TerminalRefundCreatedEvent: + docs: Published when a Terminal API refund is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.refund.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalRefundCreatedEventData: + properties: + type: + type: optional> + docs: Name of the created object’s type, `"refund"`. + id: + type: optional + docs: ID of the created terminal refund. + object: + type: optional + docs: An object containing the created terminal refund. + source: + openapi: openapi/openapi.json + TerminalRefundCreatedEventObject: + properties: + refund: + type: optional + docs: The created terminal refund. + source: + openapi: openapi/openapi.json + TerminalRefundQuery: + properties: + filter: + type: optional + docs: The filter for the Terminal refund query. + sort: + type: optional + docs: The sort order for the Terminal refund query. + source: + openapi: openapi/openapi.json + TerminalRefundQueryFilter: + properties: + device_id: + type: optional> + docs: >- + `TerminalRefund` objects associated with a specific device. If no + device is specified, then all + + `TerminalRefund` objects for the signed-in account are displayed. + created_at: + type: optional + docs: >- + The timestamp for the beginning of the reporting period, in RFC 3339 + format. Inclusive. + + Default value: The current time minus one day. + + Note that `TerminalRefund`s are available for 30 days after creation. + status: + type: optional> + docs: >- + Filtered results with the desired status of the `TerminalRefund`. + + Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or + `COMPLETED`. + source: + openapi: openapi/openapi.json + TerminalRefundQuerySort: + properties: + sort_order: + type: optional> + docs: |- + The order in which results are listed. + - `ASC` - Oldest to newest. + - `DESC` - Newest to oldest (default). + source: + openapi: openapi/openapi.json + TerminalRefundUpdatedEvent: + docs: Published when a Terminal API refund is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"terminal.refund.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: RFC 3339 timestamp of when the event was created. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TerminalRefundUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the updated object’s type, `"refund"`. + id: + type: optional + docs: ID of the updated terminal refund. + object: + type: optional + docs: An object containing the updated terminal refund. + source: + openapi: openapi/openapi.json + TerminalRefundUpdatedEventObject: + properties: + refund: + type: optional + docs: The updated terminal refund. + source: + openapi: openapi/openapi.json + TestWebhookSubscriptionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [TestWebhookSubscription](api-endpoint:WebhookSubscriptions-TestWebhookSubscription) + endpoint. + + + Note: If there are errors processing the request, the + [SubscriptionTestResult](entity:SubscriptionTestResult) field is not + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + subscription_test_result: + type: optional + docs: The [SubscriptionTestResult](entity:SubscriptionTestResult). + source: + openapi: openapi/openapi.json + TimeRange: + docs: |- + Represents a generic time range. The start and end values are + represented in RFC 3339 format. Time ranges are customized to be + inclusive or exclusive based on the needs of a particular endpoint. + Refer to the relevant endpoint-specific documentation to determine + how time ranges are handled. + properties: + start_at: + type: optional> + docs: |- + A datetime value in RFC 3339 format indicating when the time range + starts. + end_at: + type: optional> + docs: |- + A datetime value in RFC 3339 format indicating when the time range + ends. + source: + openapi: openapi/openapi.json + Timecard: + docs: >- + A record of the hourly rate, start time, and end time of a single timecard + (shift) + + for a team member. This might include a record of the start and end times + of breaks + + taken during the shift. + properties: + id: + type: optional + docs: '**Read only** The Square-issued UUID for this object.' + validation: + maxLength: 255 + location_id: + type: string + docs: >- + The ID of the [location](entity:Location) for this timecard. The + location should be based on + + where the team member clocked in. + validation: + minLength: 1 + timezone: + type: optional> + docs: >- + **Read only** The time zone calculated from the location based on the + `location_id`, + + provided as a convenience value. Format: the IANA time zone database + identifier for the + + location time zone. + start_at: + type: string + docs: >- + The start time of the timecard, in RFC 3339 format and shifted to the + location + + timezone + offset. Precision up to the minute is respected; seconds + are truncated. + validation: + minLength: 1 + end_at: + type: optional> + docs: >- + The end time of the timecard, in RFC 3339 format and shifted to the + location + + timezone + offset. Precision up to the minute is respected; seconds + are truncated. + wage: + type: optional + docs: >- + Job and pay related information. If the wage is not set on create, it + defaults to a wage + + of zero. If the title is not set on create, it defaults to the name of + the role the team member + + is assigned to, if any. + breaks: + type: optional>> + docs: >- + A list of all the paid or unpaid breaks that were taken during this + timecard. + status: + type: optional + docs: |- + Describes the working state of the timecard. + See [TimecardStatus](#type-timecardstatus) for possible values + version: + type: optional + docs: >- + **Read only** The current version of the timecard, which is + incremented with each update. + + This field is used for [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control to ensure that requests don't overwrite data from another + request. + created_at: + type: optional + docs: >- + The timestamp of when the timecard was created, in RFC 3339 format + presented as UTC. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the timecard was last updated, in RFC 3339 + format presented as UTC. + access: read-only + team_member_id: + type: string + docs: >- + The ID of the [team member](entity:TeamMember) this timecard belongs + to. + validation: + minLength: 1 + declared_cash_tip_money: + type: optional + docs: The cash tips declared by the team member for this timecard. + source: + openapi: openapi/openapi.json + TimecardFilter: + docs: |- + Defines a filter used in a search for `Timecard` records. `AND` logic is + used by Square's servers to apply each filter property specified. + properties: + location_ids: + type: optional>> + docs: Fetch timecards for the specified location. + status: + type: optional + docs: >- + Fetch a `Timecard` instance by `Timecard.status`. + + See [TimecardFilterStatus](#type-timecardfilterstatus) for possible + values + start: + type: optional + docs: Fetch `Timecard` instances that start in the time range - Inclusive. + end: + type: optional + docs: Fetch the `Timecard` instances that end in the time range - Inclusive. + workday: + type: optional + docs: Fetch the `Timecard` instances based on the workday date range. + team_member_ids: + type: optional>> + docs: Fetch timecards for the specified team members. + source: + openapi: openapi/openapi.json + TimecardFilterStatus: + enum: + - OPEN + - CLOSED + docs: Specifies the `status` of `Timecard` records to be returned. + source: + openapi: openapi/openapi.json + TimecardQuery: + docs: >- + The parameters of a `Timecard` search query, which includes filter and + sort options. + properties: + filter: + type: optional + docs: Query filter options. + sort: + type: optional + docs: Sort order details. + source: + openapi: openapi/openapi.json + TimecardSort: + docs: Sets the sort order of search results. + properties: + field: + type: optional + docs: |- + The field to sort on. + See [TimecardSortField](#type-timecardsortfield) for possible values + order: + type: optional + docs: |- + The order in which results are returned. Defaults to DESC. + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + TimecardSortField: + enum: + - START_AT + - END_AT + - CREATED_AT + - UPDATED_AT + docs: Enumerates the `Timecard` fields to sort on. + source: + openapi: openapi/openapi.json + TimecardStatus: + enum: + - OPEN + - CLOSED + docs: >- + **Read only** Enumerates the possible status of a + [timecard](entity:Timecard). + source: + openapi: openapi/openapi.json + TimecardWage: + docs: >- + The hourly wage rate used to compensate a team member for a + [timecard](entity:Timecard). + properties: + title: + type: optional> + docs: The name of the job performed during this timecard. + hourly_rate: + type: optional + docs: |- + Can be a custom-set hourly wage or the calculated effective hourly + wage based on the annual wage and hours worked per week. + job_id: + type: optional + docs: |- + The ID of the [job](entity:Job) performed for this timecard. Square + labor-reporting UIs might group timecards together by ID. + access: read-only + tip_eligible: + type: optional> + docs: Whether team members are eligible for tips when working this job. + source: + openapi: openapi/openapi.json + TimecardWorkday: + docs: |- + A `Timecard` search query filter parameter that sets a range of days that + a `Timecard` must start or end in before passing the filter condition. + properties: + date_range: + type: optional + docs: Dates for fetching the timecards. + match_timecards_by: + type: optional + docs: >- + The strategy on which the dates are applied. + + See [TimecardWorkdayMatcher](#type-timecardworkdaymatcher) for + possible values + default_timezone: + type: optional> + docs: >- + Location-specific timezones convert workdays to datetime filters. + + Every location included in the query must have a timezone or this + field + + must be provided as a fallback. Format: the IANA timezone database + + identifier for the relevant timezone. + source: + openapi: openapi/openapi.json + TimecardWorkdayMatcher: + enum: + - START_AT + - END_AT + - INTERSECTION + docs: Defines the logic used to apply a workday filter. + source: + openapi: openapi/openapi.json + TipSettings: + properties: + allow_tipping: + type: optional> + docs: >- + Indicates whether tipping is enabled for this checkout. Defaults to + false. + separate_tip_screen: + type: optional> + docs: >- + Indicates whether tip options should be presented on the screen before + presenting + + the signature screen during card payment. Defaults to false. + custom_tip_field: + type: optional> + docs: >- + Indicates whether custom tip amounts are allowed during the checkout + flow. Defaults to false. + tip_percentages: + type: optional>> + docs: >- + A list of tip percentages that should be presented during the checkout + flow, specified as + + up to 3 non-negative integers from 0 to 100 (inclusive). Defaults to + 15, 20, and 25. + smart_tipping: + type: optional> + docs: >- + Enables the "Smart Tip Amounts" behavior. + + Exact tipping options depend on the region in which the Square seller + is active. + + + For payments under 10.00, in the Australia, Canada, Ireland, United + Kingdom, and United States, tipping options are presented as no tip, + .50, 1.00 or 2.00. + + + For payment amounts of 10.00 or greater, tipping options are presented + as the following percentages: 0%, 5%, 10%, 15%. + + + If set to true, the `tip_percentages` settings is ignored. + + Defaults to false. + + + To learn more about smart tipping, see [Accept Tips with the Square + App](https://squareup.com/help/us/en/article/5069-accept-tips-with-the-square-app). + source: + openapi: openapi/openapi.json + Transaction: + docs: >- + Represents a transaction processed with Square, either with the + + Connect API or with Square Point of Sale. + + + The `tenders` field of this object lists all methods of payment used to + pay in + + the transaction. + properties: + id: + type: optional + docs: The transaction's unique ID, issued by Square payments servers. + validation: + maxLength: 192 + location_id: + type: optional> + docs: The ID of the transaction's associated location. + validation: + maxLength: 50 + created_at: + type: optional + docs: >- + The timestamp for when the transaction was created, in RFC 3339 + format. + validation: + maxLength: 32 + tenders: + type: optional>> + docs: The tenders used to pay in the transaction. + refunds: + type: optional>> + docs: Refunds that have been applied to any tender in the transaction. + reference_id: + type: optional> + docs: >- + If the transaction was created with the + [Charge](api-endpoint:Transactions-Charge) + + endpoint, this value is the same as the value provided for the + `reference_id` + + parameter in the request to that endpoint. Otherwise, it is not set. + validation: + maxLength: 40 + product: + type: optional + docs: |- + The Square product that processed the transaction. + See [TransactionProduct](#type-transactionproduct) for possible values + client_id: + type: optional> + docs: >- + If the transaction was created in the Square Point of Sale app, this + value + + is the ID generated for the transaction by Square Point of Sale. + + + This ID has no relationship to the transaction's canonical `id`, which + is + + generated by Square's backend servers. This value is generated for + bookkeeping + + purposes, in case the transaction cannot immediately be completed (for + example, + + if the transaction is processed in offline mode). + + + It is not currently possible with the Connect API to perform a + transaction + + lookup by this value. + validation: + maxLength: 192 + shipping_address: + type: optional
+ docs: The shipping address provided in the request, if any. + order_id: + type: optional> + docs: >- + The order_id is an identifier for the order associated with this + transaction, if any. + validation: + maxLength: 192 + source: + openapi: openapi/openapi.json + TransactionProduct: + enum: + - REGISTER + - EXTERNAL_API + - BILLING + - APPOINTMENTS + - INVOICES + - ONLINE_STORE + - PAYROLL + - OTHER + docs: Indicates the Square product used to process a transaction. + source: + openapi: openapi/openapi.json + TransactionType: + enum: + - DEBIT + - CREDIT + docs: The transaction type used in the disputed payment. + source: + openapi: openapi/openapi.json + TransferOrder: + docs: >- + Represents a transfer order for moving + [CatalogItemVariation](entity:CatalogItemVariation)s + + between [Location](entity:Location)s. Transfer orders track the entire + lifecycle of an inventory + + transfer, including: + + - What items and quantities are being moved + + - Source and destination locations + + - Current [TransferOrderStatus](entity:TransferOrderStatus) + + - Shipping information and tracking + + - Which [TeamMember](entity:TeamMember) initiated the transfer + + + This object is commonly used to: + + - Track [CatalogItemVariation](entity:CatalogItemVariation) movements + between [Location](entity:Location)s + + - Reconcile expected vs received quantities + + - Monitor transfer progress and shipping status + + - Audit inventory movement history + properties: + id: + type: optional + docs: >- + Unique system-generated identifier for this transfer order. Use this + ID for: + + - Retrieving transfer order details + + - Tracking status changes via webhooks + + - Linking transfers in external systems + access: read-only + source_location_id: + type: optional> + docs: >- + The source [Location](entity:Location) sending the + [CatalogItemVariation](entity:CatalogItemVariation)s. + + This location must: + + - Be active in your Square organization + + - Have sufficient inventory for the items being transferred + + - Not be the same as the destination location + + + This field is not updatable. + destination_location_id: + type: optional> + docs: >- + The destination [Location](entity:Location) receiving the + [CatalogItemVariation](entity:CatalogItemVariation)s. + + This location must: + + - Be active in your Square organization + + - Not be the same as the source location + + + This field is not updatable. + status: + type: optional + docs: >- + Current [TransferOrderStatus](entity:TransferOrderStatus) indicating + where the order is in its lifecycle. + + Status transitions follow this progression: + + 1. [DRAFT](entity:TransferOrderStatus) -> + [STARTED](entity:TransferOrderStatus) via + [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder) + + 2. [STARTED](entity:TransferOrderStatus) -> + [PARTIALLY_RECEIVED](entity:TransferOrderStatus) via + [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) + + 3. [PARTIALLY_RECEIVED](entity:TransferOrderStatus) -> + [COMPLETED](entity:TransferOrderStatus) after all items received + + + Orders can be [CANCELED](entity:TransferOrderStatus) from + [STARTED](entity:TransferOrderStatus) or + + [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. + + + This field is read-only and reflects the current state of the transfer + order, and cannot be updated directly. Use the appropriate + + endpoints (e.g. + [StartPurchaseOrder](api-endpoint:TransferOrders-StartTransferOrder), + to change the status. + + See [TransferOrderStatus](#type-transferorderstatus) for possible + values + created_at: + type: optional + docs: |- + Timestamp when the transfer order was created, in RFC 3339 format. + Used for: + - Auditing transfer history + - Tracking order age + - Reporting and analytics + access: read-only + updated_at: + type: optional + docs: >- + Timestamp when the transfer order was last updated, in RFC 3339 + format. + + Updated when: + + - Order status changes + + - Items are received + + - Notes or metadata are modified + access: read-only + expected_at: + type: optional> + docs: |- + Expected transfer completion date, in RFC 3339 format. + Used for: + - Planning inventory availability + - Scheduling receiving staff + - Monitoring transfer timeliness + completed_at: + type: optional + docs: >- + Timestamp when the transfer order was completed or canceled, in RFC + 3339 format (e.g. "2023-10-01T12:00:00Z"). + access: read-only + notes: + type: optional> + docs: Optional notes about the transfer. + tracking_number: + type: optional> + docs: Shipment tracking number for monitoring transfer progress. + created_by_team_member_id: + type: optional + docs: >- + ID of the [TeamMember](entity:TeamMember) who created this transfer + order. This field is not writeable by the Connect V2 API. + access: read-only + line_items: + type: optional>> + docs: >- + List of [CatalogItemVariation](entity:CatalogItemVariation)s being + transferred. + version: + type: optional + docs: >- + Version for optimistic concurrency control. This is a monotonically + increasing integer + + that changes whenever the transfer order is modified. Use this when + calling + + [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder) + and other endpoints to ensure you're + + not overwriting concurrent changes. + source: + openapi: openapi/openapi.json + TransferOrderCreatedEvent: + docs: Published when a transfer_order is created. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"transfer_order.created"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TransferOrderCreatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"transfer_order"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected transfer_order. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the created transfer_order. + source: + openapi: openapi/openapi.json + TransferOrderCreatedEventObject: + properties: + transfer_order: + type: optional + docs: The created transfer_order. + source: + openapi: openapi/openapi.json + TransferOrderDeletedEvent: + docs: Published when a transfer_order is deleted. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"transfer_order.deleted"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TransferOrderDeletedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"transfer_order"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected transfer_order. + validation: + maxLength: 192 + deleted: + type: optional> + docs: Is true if the affected object was deleted. Otherwise absent. + source: + openapi: openapi/openapi.json + TransferOrderFilter: + docs: Filter criteria for searching transfer orders + properties: + source_location_ids: + type: optional>> + docs: Filter by source location IDs + destination_location_ids: + type: optional>> + docs: Filter by destination location IDs + statuses: + type: optional>> + docs: >- + Filter by order statuses + + See [TransferOrderStatus](#type-transferorderstatus) for possible + values + source: + openapi: openapi/openapi.json + TransferOrderGoodsReceipt: + docs: >- + The goods receipt details for a transfer order. This object represents a + single receipt + + of goods against a transfer order, tracking: + + + - Which [CatalogItemVariation](entity:CatalogItemVariation)s were received + + - Quantities received in good condition + + - Quantities damaged during transit/handling + + - Quantities canceled during receipt + + + Multiple goods receipts can be created for a single transfer order to + handle: + + - Partial deliveries + + - Multiple shipments + + - Split receipts across different dates + + - Cancellations of specific quantities + + + Each receipt automatically: + + - Updates the transfer order status + + - Adjusts received quantities + + - Updates inventory levels at both source and destination + [Location](entity:Location)s + properties: + line_items: + type: optional>> + docs: >- + Line items being received. Each line item specifies: + + - The item being received + + - Quantity received in good condition + + - Quantity received damaged + + - Quantity canceled + + + Constraints: + + - Must include at least one line item + + - Maximum of 1000 line items per receipt + + - Each line item must reference a valid item from the transfer order + + - Total of received, damaged, and canceled quantities cannot exceed + ordered quantity + source: + openapi: openapi/openapi.json + TransferOrderGoodsReceiptLineItem: + docs: A simplified line item for goods receipts in transfer orders + properties: + transfer_order_line_uid: + type: string + docs: The unique identifier of the Transfer Order line being received + validation: + maxLength: 64 + quantity_received: + type: optional> + docs: >- + The quantity received for this line item as a decimal string (e.g. + "10.5"). + + These items will be added to the destination + [Location](entity:Location)'s inventory with + [InventoryState](entity:InventoryState) of IN_STOCK. + validation: + pattern: ^(0|[1-9]\d*)(\.\d{1,4})?$ + minLength: 1 + maxLength: 16 + quantity_damaged: + type: optional> + docs: >- + The quantity that was damaged during shipping/handling as a decimal + string (e.g. "1.5"). + + These items will be added to the destination + [Location](entity:Location)'s inventory with + [InventoryState](entity:InventoryState) of WASTE. + validation: + pattern: ^(0|[1-9]\d*)(\.\d{1,4})?$ + minLength: 1 + maxLength: 16 + quantity_canceled: + type: optional> + docs: >- + The quantity that was canceled during shipping/handling as a decimal + string (e.g. "1.5"). These will be immediately added to inventory in + the source location. + validation: + pattern: ^(0|[1-9]\d*)(\.\d{1,4})?$ + minLength: 1 + maxLength: 16 + source: + openapi: openapi/openapi.json + TransferOrderLine: + docs: >- + Represents a line item in a transfer order. Each line item tracks a + specific + + [CatalogItemVariation](entity:CatalogItemVariation) being transferred, + including ordered quantities + + and receipt status. + properties: + uid: + type: optional + docs: >- + Unique system-generated identifier for the line item. Provide when + updating/removing a line via + [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder). + access: read-only + item_variation_id: + type: string + docs: >- + The required identifier of the + [CatalogItemVariation](entity:CatalogItemVariation) being transferred. + Must reference + + a valid catalog item variation that exists in the + [Catalog](api:Catalog). + validation: + pattern: ^[a-zA-Z0-9_:\-]+$ + minLength: 1 + maxLength: 64 + quantity_ordered: + type: string + docs: >- + Total quantity ordered, formatted as a decimal string (e.g. "10 or + 10.0000"). Required to be a positive number. + + + To remove a line item, set `remove` to `true` in + [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder). + validation: + pattern: ^\d*\.?\d*$ + minLength: 1 + quantity_pending: + type: optional + docs: >- + Calculated quantity of this line item's yet to be received stock. This + is the difference between the total quantity ordered and the sum of + quantities received, canceled, and damaged. + access: read-only + quantity_received: + type: optional + docs: >- + Quantity received at destination. These items are added to the + destination + + [Location](entity:Location)'s inventory with + [InventoryState](entity:InventoryState) of IN_STOCK. + + + This field cannot be updated directly in Create/Update operations, + instead use + [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder). + access: read-only + quantity_damaged: + type: optional + docs: >- + Quantity received in damaged condition. These items are added to the + destination + + [Location](entity:Location)'s inventory with + [InventoryState](entity:InventoryState) of WASTE. + + + This field cannot be updated directly in Create/Update operations, + instead use + [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder). + access: read-only + quantity_canceled: + type: optional + docs: >- + Quantity that was canceled. These items will be immediately added to + inventory in the source location. + + + This field cannot be updated directly in Create/Update operations, + instead use + [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) + or + [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). + access: read-only + source: + openapi: openapi/openapi.json + TransferOrderQuery: + docs: Query parameters for searching transfer orders + properties: + filter: + type: optional + docs: Filter criteria + sort: + type: optional + docs: Sort configuration + source: + openapi: openapi/openapi.json + TransferOrderSort: + docs: Sort configuration for search results + properties: + field: + type: optional + docs: >- + Field to sort by + + See [TransferOrderSortField](#type-transferordersortfield) for + possible values + order: + type: optional + docs: |- + Sort order direction + See [SortOrder](#type-sortorder) for possible values + source: + openapi: openapi/openapi.json + TransferOrderSortField: + enum: + - CREATED_AT + - UPDATED_AT + docs: >- + Fields that can be used for sorting [TransferOrder](entity:TransferOrder)s + in search results. + + Used with + [SearchTransferOrders](api-endpoint:TransferOrders-SearchTransferOrders) + to control + + the order of returned results. + source: + openapi: openapi/openapi.json + TransferOrderStatus: + enum: + - DRAFT + - STARTED + - PARTIALLY_RECEIVED + - COMPLETED + - CANCELED + docs: >- + Status values for transfer orders. Represents the current state of a + + [TransferOrder](entity:TransferOrder) in its lifecycle from creation to + completion. + + Each status determines what actions are available and how inventory is + affected. + source: + openapi: openapi/openapi.json + TransferOrderUpdatedEvent: + docs: Published when a transfer_order is updated. + properties: + merchant_id: + type: optional> + docs: The ID of the target merchant associated with the event. + type: + type: optional> + docs: The type of event this represents, `"transfer_order.updated"`. + event_id: + type: optional> + docs: A unique ID for the event. + created_at: + type: optional + docs: Timestamp of when the event was created, in RFC 3339 format. + access: read-only + data: + type: optional + docs: Data associated with the event. + source: + openapi: openapi/openapi.json + TransferOrderUpdatedEventData: + properties: + type: + type: optional> + docs: Name of the affected object’s type, `"transfer_order"`. + validation: + maxLength: 50 + id: + type: optional + docs: ID of the affected transfer_order. + validation: + maxLength: 192 + object: + type: optional + docs: An object containing the updated transfer_order. + source: + openapi: openapi/openapi.json + TransferOrderUpdatedEventObject: + properties: + transfer_order: + type: optional + docs: The updated transfer_order. + source: + openapi: openapi/openapi.json + UnlinkCustomerFromGiftCardResponse: + docs: >- + A response that contains the unlinked `GiftCard` object. If the request + resulted in errors, + + the response contains a set of `Error` objects. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + gift_card: + type: optional + docs: >- + The gift card with the ID of the unlinked customer removed from the + `customer_ids` field. + + If no other customers are linked, the `customer_ids` field is also + removed. + source: + openapi: openapi/openapi.json + UpdateBookingCustomAttributeDefinitionResponse: + docs: >- + Represents an + [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The updated custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateBookingResponse: + properties: + booking: + type: optional + docs: The booking that was updated. + errors: + type: optional> + docs: Errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateBreakTypeResponse: + docs: >- + A response to a request to update a `BreakType`. The response contains + + the requested `BreakType` objects and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + break_type: + type: optional + docs: The response object. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateCatalogImageRequest: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this UpdateCatalogImage request. + + Keys can be any valid string but must be unique for every + UpdateCatalogImage request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 128 + source: + openapi: openapi/openapi.json + UpdateCatalogImageResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + image: + type: optional + docs: |- + The newly updated `CatalogImage` including a Square-generated + URL for the encapsulated image file. + source: + openapi: openapi/openapi.json + UpdateCustomerCustomAttributeDefinitionResponse: + docs: >- + Represents an + [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The updated custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateCustomerGroupResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [UpdateCustomerGroup](api-endpoint:CustomerGroups-UpdateCustomerGroup) + endpoint. + + + Either `errors` or `group` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + group: + type: optional + docs: The successfully updated customer group. + source: + openapi: openapi/openapi.json + UpdateCustomerResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the [UpdateCustomer](api-endpoint:Customers-UpdateCustomer) + or + + [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) + endpoint. + + + Either `errors` or `customer` is present in a given response (never both). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + customer: + type: optional + docs: The updated customer. + source: + openapi: openapi/openapi.json + UpdateInvoiceResponse: + docs: Describes a `UpdateInvoice` response. + properties: + invoice: + type: optional + docs: The updated invoice. + errors: + type: optional> + docs: Information about errors encountered during the request. + source: + openapi: openapi/openapi.json + UpdateItemModifierListsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + updated_at: + type: optional + docs: >- + The database + [timestamp](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates) + of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. + source: + openapi: openapi/openapi.json + UpdateItemTaxesResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + updated_at: + type: optional + docs: >- + The database + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`. + source: + openapi: openapi/openapi.json + UpdateJobResponse: + docs: >- + Represents an [UpdateJob](api-endpoint:Team-UpdateJob) response. Either + `job` or `errors` + + is present in the response. + properties: + job: + type: optional + docs: The updated job. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateLocationCustomAttributeDefinitionResponse: + docs: >- + Represents an + [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The updated custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateLocationResponse: + docs: >- + The response object returned by the + [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint. + properties: + errors: + type: optional> + docs: Information about errors encountered during the request. + location: + type: optional + docs: The updated `Location` object. + source: + openapi: openapi/openapi.json + UpdateLocationSettingsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred when updating the location settings. + location_settings: + type: optional + docs: The updated location settings. + source: + openapi: openapi/openapi.json + UpdateMerchantCustomAttributeDefinitionResponse: + docs: >- + Represents an + [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute_definition: + type: optional + docs: The updated custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateMerchantSettingsResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred when updating the merchant settings. + merchant_settings: + type: optional + docs: The updated merchant settings. + source: + openapi: openapi/openapi.json + UpdateOrderCustomAttributeDefinitionResponse: + docs: Represents a response from updating an order custom attribute definition. + properties: + custom_attribute_definition: + type: optional + docs: The updated order custom attribute definition. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateOrderResponse: + docs: |- + Defines the fields that are included in the response body of + a request to the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. + properties: + order: + type: optional + docs: The updated order. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdatePaymentLinkResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred when updating the payment link. + payment_link: + type: optional + docs: The updated payment link. + source: + openapi: openapi/openapi.json + UpdatePaymentResponse: + docs: |- + Defines the response returned by + [UpdatePayment](api-endpoint:Payments-UpdatePayment). + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + payment: + type: optional + docs: The updated payment. + source: + openapi: openapi/openapi.json + UpdateScheduledShiftResponse: + docs: >- + Represents an + [UpdateScheduledShift](api-endpoint:Labor-UpdateScheduledShift) response. + + Either `scheduled_shift` or `errors` is present in the response. + properties: + scheduled_shift: + type: optional + docs: >- + The updated scheduled shift. To make the changes public, call + + [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) or + + [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts). + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateShiftResponse: + docs: |- + The response to a request to update a `Shift`. The response contains + the updated `Shift` object and might contain a set of `Error` objects if + the request resulted in errors. + properties: + shift: + type: optional + docs: The updated `Shift`. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateSubscriptionResponse: + docs: >- + Defines output parameters in a response from the + + [UpdateSubscription](api-endpoint:Subscriptions-UpdateSubscription) + endpoint. + properties: + errors: + type: optional> + docs: Errors encountered during the request. + subscription: + type: optional + docs: The updated subscription. + source: + openapi: openapi/openapi.json + UpdateTeamMemberRequest: + docs: Represents an update request for a `TeamMember` object. + properties: + team_member: + type: optional + docs: >- + The team member fields to add, change, or clear. Fields can be cleared + using a null value. To update + + `wage_setting.job_assignments`, you must provide the complete list of + job assignments. If needed, call + + [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` + values. + source: + openapi: openapi/openapi.json + UpdateTeamMemberResponse: + docs: >- + Represents a response from an update request containing the updated + `TeamMember` object or error messages. + properties: + team_member: + type: optional + docs: The successfully updated `TeamMember` object. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateTimecardResponse: + docs: >- + The response to a request to update a `Timecard`. The response contains + + the updated `Timecard` object and might contain a set of `Error` objects + if + + the request resulted in errors. + properties: + timecard: + type: optional + docs: The updated `Timecard`. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateTransferOrderData: + docs: Data model for updating a transfer order. All fields are optional. + properties: + source_location_id: + type: optional> + docs: >- + The source [Location](entity:Location) that will send the items. Must + be an active location + + in your Square account with sufficient inventory of the requested + items. + validation: + minLength: 1 + maxLength: 64 + destination_location_id: + type: optional> + docs: >- + The destination [Location](entity:Location) that will receive the + items. Must be an active location + + in your Square account. + validation: + minLength: 1 + maxLength: 64 + expected_at: + type: optional> + docs: >- + Expected transfer date in RFC 3339 format (e.g. + "2023-10-01T12:00:00Z"). + notes: + type: optional> + docs: Optional notes about the transfer + validation: + maxLength: 4096 + tracking_number: + type: optional> + docs: Shipment tracking number + validation: + maxLength: 64 + line_items: + type: optional>> + docs: List of items being transferred + source: + openapi: openapi/openapi.json + UpdateTransferOrderLineData: + docs: Represents a line item update in a transfer order + properties: + uid: + type: optional> + docs: >- + Line item id being updated. Required for updating/removing existing + line items, but should not be set for new line items. + validation: + minLength: 1 + maxLength: 64 + item_variation_id: + type: optional> + docs: |- + Catalog item variation being transferred + + Required for new line items, but otherwise is not updatable. + validation: + minLength: 1 + maxLength: 64 + quantity_ordered: + type: optional> + docs: Total quantity ordered + validation: + pattern: ^(0|[1-9]\d*)(\.\d{1,4})?$ + minLength: 1 + maxLength: 16 + remove: + type: optional> + docs: >- + Flag to remove the line item during update. Must include `uid` in + removal request + source: + openapi: openapi/openapi.json + UpdateTransferOrderResponse: + docs: Response for updating a transfer order + properties: + transfer_order: + type: optional + docs: The updated transfer order + errors: + type: optional> + docs: Any errors that occurred during the request + source: + openapi: openapi/openapi.json + UpdateVendorRequest: + docs: >- + Represents an input to a call to + [UpdateVendor](api-endpoint:Vendors-UpdateVendor). + properties: + idempotency_key: + type: optional> + docs: >- + A client-supplied, universally unique identifier (UUID) for the + + request. + + + See + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + in the + + [API Development 101](https://developer.squareup.com/docs/buildbasics) + section for more + + information. + validation: + maxLength: 128 + vendor: + type: Vendor + docs: The specified [Vendor](entity:Vendor) to be updated. + source: + openapi: openapi/openapi.json + UpdateVendorResponse: + docs: >- + Represents an output from a call to + [UpdateVendor](api-endpoint:Vendors-UpdateVendor). + properties: + errors: + type: optional> + docs: Errors occurred when the request fails. + vendor: + type: optional + docs: The [Vendor](entity:Vendor) that has been updated. + source: + openapi: openapi/openapi.json + UpdateWageSettingResponse: + docs: >- + Represents a response from an update request containing the updated + `WageSetting` object + + or error messages. + properties: + wage_setting: + type: optional + docs: The successfully updated `WageSetting` object. + errors: + type: optional> + docs: The errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpdateWebhookSubscriptionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [UpdateWebhookSubscription](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscription) + endpoint. + + + Note: If there are errors processing the request, the + [Subscription](entity:WebhookSubscription) is not + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + subscription: + type: optional + docs: The updated [Subscription](entity:WebhookSubscription). + source: + openapi: openapi/openapi.json + UpdateWebhookSubscriptionSignatureKeyResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) + endpoint. + + + Note: If there are errors processing the request, the + [Subscription](entity:WebhookSubscription) is not + + present. + properties: + errors: + type: optional> + docs: Information on errors encountered during the request. + signature_key: + type: optional + docs: >- + The new Square-generated signature key used to validate the origin of + the webhook event. + access: read-only + source: + openapi: openapi/openapi.json + UpdateWorkweekConfigResponse: + docs: >- + The response to a request to update a `WorkweekConfig` object. The + response contains + + the updated `WorkweekConfig` object and might contain a set of `Error` + objects if + + the request resulted in errors. + properties: + workweek_config: + type: optional + docs: The response object. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertBookingCustomAttributeResponse: + docs: >- + Represents an + [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertCatalogObjectResponse: + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + catalog_object: + type: optional + docs: The successfully created or updated CatalogObject. + id_mappings: + type: optional> + docs: The mapping between client and server IDs for this upsert. + source: + openapi: openapi/openapi.json + UpsertCustomerCustomAttributeResponse: + docs: >- + Represents an + [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertLocationCustomAttributeResponse: + docs: >- + Represents an + [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertMerchantCustomAttributeResponse: + docs: >- + Represents an + [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) + response. + + Either `custom_attribute_definition` or `errors` is present in the + response. + properties: + custom_attribute: + type: optional + docs: The new or updated custom attribute. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertOrderCustomAttributeResponse: + docs: Represents a response from upserting order custom attribute definitions. + properties: + custom_attribute: + type: optional + docs: The order custom attribute that was created or modified. + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + UpsertSnippetResponse: + docs: >- + Represents an `UpsertSnippet` response. The response can include either + `snippet` or `errors`. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + snippet: + type: optional + docs: The new or updated snippet. + source: + openapi: openapi/openapi.json + V1Money: + properties: + amount: + type: optional> + docs: >- + Amount in the lowest denominated value of this Currency. E.g. in USD + + these are cents, in JPY they are Yen (which do not have a 'cent' + concept). + currency_code: + type: optional + docs: |- + + See [Currency](#type-currency) for possible values + source: + openapi: openapi/openapi.json + V1Order: + docs: V1Order + properties: + errors: + type: optional>> + docs: Any errors that occurred during the request. + id: + type: optional + docs: The order's unique identifier. + buyer_email: + type: optional> + docs: The email address of the order's buyer. + recipient_name: + type: optional> + docs: The name of the order's buyer. + recipient_phone_number: + type: optional> + docs: The phone number to use for the order's delivery. + state: + type: optional + docs: |- + Whether the tax is an ADDITIVE tax or an INCLUSIVE tax. + See [V1OrderState](#type-v1orderstate) for possible values + shipping_address: + type: optional
+ docs: The address to ship the order to. + subtotal_money: + type: optional + docs: >- + The amount of all items purchased in the order, before taxes and + shipping. + total_shipping_money: + type: optional + docs: The shipping cost for the order. + total_tax_money: + type: optional + docs: The total of all taxes applied to the order. + total_price_money: + type: optional + docs: The total cost of the order. + total_discount_money: + type: optional + docs: The total of all discounts applied to the order. + created_at: + type: optional + docs: The time when the order was created, in ISO 8601 format. + updated_at: + type: optional + docs: The time when the order was last modified, in ISO 8601 format. + expires_at: + type: optional> + docs: >- + The time when the order expires if no action is taken, in ISO 8601 + format. + payment_id: + type: optional> + docs: The unique identifier of the payment associated with the order. + buyer_note: + type: optional> + docs: A note provided by the buyer when the order was created, if any. + completed_note: + type: optional> + docs: >- + A note provided by the merchant when the order's state was set to + COMPLETED, if any + refunded_note: + type: optional> + docs: >- + A note provided by the merchant when the order's state was set to + REFUNDED, if any. + canceled_note: + type: optional> + docs: >- + A note provided by the merchant when the order's state was set to + CANCELED, if any. + tender: + type: optional + docs: The tender used to pay for the order. + order_history: + type: optional>> + docs: The history of actions associated with the order. + promo_code: + type: optional> + docs: The promo code provided by the buyer, if any. + btc_receive_address: + type: optional> + docs: For Bitcoin transactions, the address that the buyer sent Bitcoin to. + btc_price_satoshi: + type: optional> + docs: >- + For Bitcoin transactions, the price of the buyer's order in satoshi + (100 million satoshi equals 1 BTC). + source: + openapi: openapi/openapi.json + V1OrderHistoryEntry: + docs: V1OrderHistoryEntry + properties: + action: + type: optional + docs: >- + The type of action performed on the order. + + See [V1OrderHistoryEntryAction](#type-v1orderhistoryentryaction) for + possible values + created_at: + type: optional + docs: The time when the action was performed, in ISO 8601 format. + source: + openapi: openapi/openapi.json + V1OrderHistoryEntryAction: + enum: + - ORDER_PLACED + - DECLINED + - PAYMENT_RECEIVED + - CANCELED + - COMPLETED + - REFUNDED + - EXPIRED + source: + openapi: openapi/openapi.json + V1OrderState: + enum: + - PENDING + - OPEN + - COMPLETED + - CANCELED + - REFUNDED + - REJECTED + source: + openapi: openapi/openapi.json + V1Tender: + docs: >- + 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. + properties: + id: + type: optional + docs: The tender's unique ID. + type: + type: optional + docs: |- + The type of tender. + See [V1TenderType](#type-v1tendertype) for possible values + name: + type: optional> + docs: A human-readable description of the tender. + employee_id: + type: optional> + docs: The ID of the employee that processed the tender. + receipt_url: + type: optional> + docs: The URL of the receipt for the tender. + card_brand: + type: optional + docs: |- + The brand of credit card provided. + See [V1TenderCardBrand](#type-v1tendercardbrand) for possible values + pan_suffix: + type: optional> + docs: The last four digits of the provided credit card's account number. + entry_method: + type: optional + docs: >- + The tender's unique ID. + + See [V1TenderEntryMethod](#type-v1tenderentrymethod) for possible + values + payment_note: + type: optional> + docs: >- + Notes entered by the merchant about the tender at the time of payment, + if any. Typically only present for tender with the type: OTHER. + total_money: + type: optional + docs: The total amount of money provided in this form of tender. + tendered_money: + type: optional + docs: The amount of total_money applied to the payment. + tendered_at: + type: optional> + docs: The time when the tender was created, in ISO 8601 format. + settled_at: + type: optional> + docs: The time when the tender was settled, in ISO 8601 format. + change_back_money: + type: optional + docs: The amount of total_money returned to the buyer as change. + refunded_money: + type: optional + docs: >- + The total of all refunds applied to this tender. This amount is always + negative or zero. + is_exchange: + type: optional> + docs: >- + Indicates whether or not the tender is associated with an exchange. If + is_exchange is true, the tender represents the value of goods returned + in an exchange not the actual money paid. The exchange value reduces + the tender amounts needed to pay for items purchased in the exchange. + source: + openapi: openapi/openapi.json + V1TenderCardBrand: + enum: + - OTHER_BRAND + - VISA + - MASTER_CARD + - AMERICAN_EXPRESS + - DISCOVER + - DISCOVER_DINERS + - JCB + - CHINA_UNIONPAY + - SQUARE_GIFT_CARD + docs: The brand of a credit card. + source: + openapi: openapi/openapi.json + V1TenderEntryMethod: + enum: + - MANUAL + - SCANNED + - SQUARE_CASH + - SQUARE_WALLET + - SWIPED + - WEB_FORM + - OTHER + source: + openapi: openapi/openapi.json + V1TenderType: + enum: + - CREDIT_CARD + - CASH + - THIRD_PARTY_CARD + - NO_SALE + - SQUARE_WALLET + - SQUARE_GIFT_CARD + - UNKNOWN + - OTHER + source: + openapi: openapi/openapi.json + V1UpdateOrderRequestAction: + enum: + - COMPLETE + - CANCEL + - REFUND + source: + openapi: openapi/openapi.json + Vendor: + docs: Represents a supplier to a seller. + properties: + id: + type: optional + docs: >- + A unique Square-generated ID for the [Vendor](entity:Vendor). + + This field is required when attempting to update a + [Vendor](entity:Vendor). + validation: + maxLength: 100 + created_at: + type: optional + docs: |- + An RFC 3339-formatted timestamp that indicates when the + [Vendor](entity:Vendor) was created. + validation: + maxLength: 34 + access: read-only + updated_at: + type: optional + docs: |- + An RFC 3339-formatted timestamp that indicates when the + [Vendor](entity:Vendor) was last updated. + validation: + maxLength: 34 + access: read-only + name: + type: optional> + docs: >- + The name of the [Vendor](entity:Vendor). + + This field is required when attempting to create or update a + [Vendor](entity:Vendor). + validation: + maxLength: 100 + address: + type: optional
+ docs: The address of the [Vendor](entity:Vendor). + contacts: + type: optional>> + docs: The contacts of the [Vendor](entity:Vendor). + account_number: + type: optional> + docs: The account number of the [Vendor](entity:Vendor). + validation: + maxLength: 100 + note: + type: optional> + docs: A note detailing information about the [Vendor](entity:Vendor). + validation: + maxLength: 4096 + version: + type: optional + docs: The version of the [Vendor](entity:Vendor). + status: + type: optional + docs: |- + The status of the [Vendor](entity:Vendor). + See [Status](#type-status) for possible values + source: + openapi: openapi/openapi.json + VendorContact: + docs: Represents a contact of a [Vendor](entity:Vendor). + properties: + id: + type: optional + docs: >- + A unique Square-generated ID for the + [VendorContact](entity:VendorContact). + + This field is required when attempting to update a + [VendorContact](entity:VendorContact). + validation: + maxLength: 100 + name: + type: optional> + docs: >- + The name of the [VendorContact](entity:VendorContact). + + This field is required when attempting to create a + [Vendor](entity:Vendor). + validation: + maxLength: 255 + email_address: + type: optional> + docs: The email address of the [VendorContact](entity:VendorContact). + validation: + maxLength: 255 + phone_number: + type: optional> + docs: The phone number of the [VendorContact](entity:VendorContact). + validation: + maxLength: 255 + removed: + type: optional> + docs: The state of the [VendorContact](entity:VendorContact). + ordinal: + type: integer + docs: The ordinal of the [VendorContact](entity:VendorContact). + source: + openapi: openapi/openapi.json + VendorCreatedEvent: + docs: Published when a [Vendor](entity:Vendor) is created. + properties: + merchant_id: + type: optional> + docs: The ID of a seller associated with this event. + location_id: + type: optional> + docs: >- + The ID of a location associated with the event, if the event is + associated with the location of the seller. + type: + type: optional> + docs: The type of this event. The value is `"vendor.created".` + event_id: + type: optional> + docs: A unique ID for this event. + created_at: + type: optional + docs: >- + The RFC 3339-formatted time when the underlying event data object is + created. + access: read-only + data: + type: optional + docs: The data associated with this event. + source: + openapi: openapi/openapi.json + VendorCreatedEventData: + docs: Defines the `vendor.created` event data structure. + properties: + type: + type: optional> + docs: The type of the event data object. The value is `vendor` + id: + type: optional + docs: The ID of the event data object. + object: + type: optional + docs: An object containing the created vendor. + source: + openapi: openapi/openapi.json + VendorCreatedEventObject: + properties: + operation: + type: optional + docs: >- + The operation on the vendor that caused the event to be published. The + value is `CREATED`. + + See [Operation](#type-operation) for possible values + vendor: + type: optional + docs: The created vendor as the result of the specified operation. + source: + openapi: openapi/openapi.json + VendorCreatedEventObjectOperation: + type: literal<"CREATED"> + docs: >- + The operation that can be performed against a vendor to cause the event to + be published. + VendorStatus: + enum: + - ACTIVE + - INACTIVE + docs: |- + The status of the [Vendor](entity:Vendor), + whether a [Vendor](entity:Vendor) is active or inactive. + source: + openapi: openapi/openapi.json + VendorUpdatedEvent: + docs: Published when a [Vendor](entity:Vendor) is updated. + properties: + merchant_id: + type: optional> + docs: The ID of a seller associated with this event. + location_id: + type: optional> + docs: >- + The ID of a seller location associated with this event, if the event + is associated with the location. + type: + type: optional> + docs: The type of this event. The value is `"vendor.updated".` + event_id: + type: optional> + docs: A unique ID for this webhoook event. + created_at: + type: optional + docs: >- + The RFC 3339-formatted time when the underlying event data object is + created. + access: read-only + data: + type: optional + docs: The data associated with this event. + source: + openapi: openapi/openapi.json + VendorUpdatedEventData: + docs: Defines the `vendor.updated` event data structure. + properties: + type: + type: optional> + docs: The type of the event data object. The value is `vendor`. + id: + type: optional + docs: The ID of the event data object. + object: + type: optional + docs: An object containing updated vendor. + source: + openapi: openapi/openapi.json + VendorUpdatedEventObject: + properties: + operation: + type: optional + docs: >- + The operation on the vendor that caused the event to be published. The + value is `UPDATED`. + + See [Operation](#type-operation) for possible values + vendor: + type: optional + docs: The updated vendor as the result of the specified operation. + source: + openapi: openapi/openapi.json + VendorUpdatedEventObjectOperation: + type: literal<"UPDATED"> + docs: >- + The operation that can be performed against a vendor to cause the event to + be published. + VisibilityFilter: + enum: + - ALL + - READ + - READ_WRITE + docs: >- + Enumeration of visibility-filter values used to set the ability to view + custom attributes or custom attribute definitions. + source: + openapi: openapi/openapi.json + VoidTransactionResponse: + docs: >- + Defines the fields that are included in the response body of + + a request to the + [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint. + properties: + errors: + type: optional> + docs: Any errors that occurred during the request. + source: + openapi: openapi/openapi.json + WageSetting: + docs: >- + Represents information about the overtime exemption status, job + assignments, and compensation + + for a [team member](entity:TeamMember). + properties: + team_member_id: + type: optional> + docs: The ID of the team member associated with the wage setting. + job_assignments: + type: optional>> + docs: >- + **Required** The ordered list of jobs that the team member is assigned + to. + + The first job assignment is considered the team member's primary job. + is_overtime_exempt: + type: optional> + docs: >- + Whether the team member is exempt from the overtime rules of the + seller's country. + version: + type: optional + docs: >- + **Read only** Used for resolving concurrency issues. The request fails + if the version + + provided does not match the server version at the time of the request. + If not provided, + + Square executes a blind write, potentially overwriting data from + another write. For more information, + + see [optimistic + concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency). + created_at: + type: optional + docs: The timestamp when the wage setting was created, in RFC 3339 format. + access: read-only + updated_at: + type: optional + docs: >- + The timestamp when the wage setting was last updated, in RFC 3339 + format. + access: read-only + source: + openapi: openapi/openapi.json + WebhookSubscription: + docs: >- + Represents the details of a webhook subscription, including notification + URL, + + event types, and signature key. + properties: + id: + type: optional + docs: A Square-generated unique ID for the subscription. + validation: + maxLength: 64 + access: read-only + name: + type: optional> + docs: The name of this subscription. + validation: + maxLength: 64 + enabled: + type: optional> + docs: >- + Indicates whether the subscription is enabled (`true`) or not + (`false`). + event_types: + type: optional>> + docs: The event types associated with this subscription. + notification_url: + type: optional> + docs: The URL to which webhooks are sent. + api_version: + type: optional> + docs: |- + The API version of the subscription. + This field is optional for `CreateWebhookSubscription`. + The value defaults to the API version used by the application. + signature_key: + type: optional + docs: >- + The Square-generated signature key used to validate the origin of the + webhook event. + access: read-only + created_at: + type: optional + docs: >- + The timestamp of when the subscription was created, in RFC 3339 + format. For example, "2016-09-04T23:59:33.123Z". + access: read-only + updated_at: + type: optional + docs: >- + The timestamp of when the subscription was last updated, in RFC 3339 + format. + + For example, "2016-09-04T23:59:33.123Z". + access: read-only + source: + openapi: openapi/openapi.json + Weekday: + enum: + - MON + - TUE + - WED + - THU + - FRI + - SAT + - SUN + docs: The days of the week. + source: + openapi: openapi/openapi.json + WorkweekConfig: + docs: |- + Sets the day of the week and hour of the day that a business starts a + workweek. This is used to calculate overtime pay. + properties: + id: + type: optional + docs: The UUID for this object. + start_of_week: + type: Weekday + docs: |- + The day of the week on which a business week starts for + compensation purposes. + See [Weekday](#type-weekday) for possible values + start_of_day_local_time: + type: string + docs: |- + The local time at which a business week starts. Represented as a + string in `HH:MM` format (`HH:MM:SS` is also accepted, but seconds are + truncated). + validation: + minLength: 1 + version: + type: optional + docs: >- + Used for resolving concurrency issues. The request fails if the + version + + provided does not match the server version at the time of the request. + If not provided, + + Square executes a blind write; potentially overwriting data from + another + + write. + created_at: + type: optional + docs: A read-only timestamp in RFC 3339 format; presented in UTC. + access: read-only + updated_at: + type: optional + docs: A read-only timestamp in RFC 3339 format; presented in UTC. + access: read-only + source: + openapi: openapi/openapi.json + CatalogObjectItem: + properties: + item_data: + type: optional + docs: >- + Structured data for a `CatalogItem`, set for CatalogObjects of type + `ITEM`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectImage: + properties: + image_data: + type: optional + docs: >- + Structured data for a `CatalogImage`, set for CatalogObjects of type + `IMAGE`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectItemVariation: + properties: + item_variation_data: + type: optional + docs: >- + Structured data for a `CatalogItemVariation`, set for CatalogObjects + of type `ITEM_VARIATION`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectTax: + properties: + tax_data: + type: optional + docs: >- + Structured data for a `CatalogTax`, set for CatalogObjects of type + `TAX`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectDiscount: + properties: + discount_data: + type: optional + docs: >- + Structured data for a `CatalogDiscount`, set for CatalogObjects of + type `DISCOUNT`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectModifierList: + properties: + modifier_list_data: + type: optional + docs: >- + Structured data for a `CatalogModifierList`, set for CatalogObjects of + type `MODIFIER_LIST`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectModifier: + properties: + modifier_data: + type: optional + docs: >- + Structured data for a `CatalogModifier`, set for CatalogObjects of + type `MODIFIER`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectPricingRule: + properties: + pricing_rule_data: + type: optional + docs: >- + Structured data for a `CatalogPricingRule`, set for CatalogObjects of + type `PRICING_RULE`. + + A `CatalogPricingRule` object often works with a `CatalogProductSet` + object or a `CatalogTimePeriod` object. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectProductSet: + properties: + product_set_data: + type: optional + docs: >- + Structured data for a `CatalogProductSet`, set for CatalogObjects of + type `PRODUCT_SET`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectTimePeriod: + properties: + time_period_data: + type: optional + docs: >- + Structured data for a `CatalogTimePeriod`, set for CatalogObjects of + type `TIME_PERIOD`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectMeasurementUnit: + properties: + measurement_unit_data: + type: optional + docs: >- + Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects + of type `MEASUREMENT_UNIT`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectSubscriptionPlanVariation: + properties: + subscription_plan_variation_data: + type: optional + docs: >- + Structured data for a `CatalogSubscriptionPlanVariation`, set for + CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectItemOption: + properties: + item_option_data: + type: optional + docs: >- + Structured data for a `CatalogItemOption`, set for CatalogObjects of + type `ITEM_OPTION`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectItemOptionValue: + properties: + item_option_value_data: + type: optional + docs: >- + Structured data for a `CatalogItemOptionValue`, set for CatalogObjects + of type `ITEM_OPTION_VAL`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectCustomAttributeDefinition: + properties: + custom_attribute_definition_data: + type: optional + docs: >- + Structured data for a `CatalogCustomAttributeDefinition`, set for + CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectQuickAmountsSettings: + properties: + quick_amounts_settings_data: + type: optional + docs: >- + Structured data for a `CatalogQuickAmountsSettings`, set for + CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectSubscriptionPlan: + properties: + subscription_plan_data: + type: optional + docs: >- + Structured data for a `CatalogSubscriptionPlan`, set for + CatalogObjects of type `SUBSCRIPTION_PLAN`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + CatalogObjectAvailabilityPeriod: + properties: + availability_period_data: + type: optional + docs: >- + Structured data for a `CatalogAvailabilityPeriod`, set for + CatalogObjects of type `AVAILABILITY_PERIOD`. + extends: + - CatalogObjectBase + source: + openapi: openapi/openapi.json + GetLoyaltyAccountRequest: unknown + GetLoyaltyProgramRequest: unknown + GetLoyaltyPromotionRequest: unknown + GetLoyaltyRewardRequest: unknown + GetCardRequest: unknown + GetDisputeEvidenceRequest: unknown + GetDisputeRequest: unknown + V1GetPaymentRequest: unknown + V1GetSettlementRequest: unknown + GetCustomerGroupRequest: unknown + GetCustomerRequest: unknown + GetCustomerSegmentRequest: unknown + GetTransactionRequest: unknown + GetBookingRequest: unknown + GetBusinessBookingProfileRequest: unknown + GetTeamMemberBookingProfileRequest: unknown + GetSnippetRequest: unknown + GetInventoryAdjustmentRequest: unknown + GetInventoryPhysicalCountRequest: unknown + GetInventoryTransferRequest: unknown + GetVendorRequest: unknown + GetPaymentLinkRequest: unknown + GetGiftCardRequest: unknown + GetOrderRequest: unknown + GetEmployeeRequest: unknown + GetLocationRequest: unknown + GetMerchantRequest: unknown + GetTeamMemberRequest: unknown + GetWageSettingRequest: unknown + GetWebhookSubscriptionRequest: unknown diff --git a/.mock/definition/api.yml b/.mock/definition/api.yml new file mode 100644 index 000000000..b1e07d59f --- /dev/null +++ b/.mock/definition/api.yml @@ -0,0 +1,19 @@ +name: api +error-discrimination: + strategy: status-code +display-name: Square +environments: + Production: https://connect.squareup.com + Sandbox: https://connect.squareupsandbox.com +default-environment: Production +headers: + Square-Version: + name: version + env: VERSION + type: literal<"2025-10-16"> +auth-schemes: + Bearer: + scheme: bearer + token: + env: SQUARE_TOKEN +auth: Bearer diff --git a/.mock/definition/applePay.yml b/.mock/definition/applePay.yml new file mode 100644 index 000000000..2036a58c2 --- /dev/null +++ b/.mock/definition/applePay.yml @@ -0,0 +1,81 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + RegisterDomain: + path: /v2/apple-pay/domains + method: POST + auth: + - oauth2: [] + docs: >- + Activates a domain for use with Apple Pay on the Web and Square. A + validation + + is performed on this domain by Apple to ensure that it is properly set + up as + + an Apple Pay enabled domain. + + + This endpoint provides an easy way for platform developers to bulk + activate + + Apple Pay on the Web with Square for merchants using their platform. + + + Note: You will need to host a valid domain verification file on your + domain to support Apple Pay. The + + current version of this file is always available at + https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association, + + and should be hosted at + `.well_known/apple-developer-merchantid-domain-association` on your + + domain. This file is subject to change; we strongly recommend checking + for updates regularly and avoiding + + long-lived caches that might not keep in sync with the correct file + version. + + + To learn more about the Web Payments SDK and how to add Apple Pay, see + [Take an Apple Pay + Payment](https://developer.squareup.com/docs/web-payments/apple-pay). + source: + openapi: openapi/openapi.json + display-name: RegisterDomain + request: + name: RegisterDomainRequest + body: + properties: + domain_name: + type: string + docs: >- + A domain name as described in RFC-1034 that will be registered + with ApplePay. + validation: + minLength: 1 + maxLength: 255 + content-type: application/json + response: + docs: Success + type: root.RegisterDomainResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + domain_name: example.com + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + status: VERIFIED + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bankAccounts.yml b/.mock/definition/bankAccounts.yml new file mode 100644 index 000000000..98f8ab123 --- /dev/null +++ b/.mock/definition/bankAccounts.yml @@ -0,0 +1,222 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/bank-accounts + method: GET + auth: + - oauth2: + - BANK_ACCOUNTS_READ + docs: >- + Returns a list of [BankAccount](entity:BankAccount) objects linked to a + Square account. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.bank_accounts + source: + openapi: openapi/openapi.json + display-name: ListBankAccounts + request: + name: ListBankAccountsRequest + query-parameters: + cursor: + type: optional> + docs: >- + The pagination cursor returned by a previous call to this + endpoint. + + Use it in the next `ListBankAccounts` request to retrieve the next + set + + of results. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + limit: + type: optional> + docs: >- + Upper limit on the number of bank accounts to return in the + response. + + Currently, 1000 is the largest supported limit. You can specify a + limit + + of up to 1000 bank accounts. This is also the default limit. + location_id: + type: optional> + docs: >- + Location ID. You can specify this optional filter + + to retrieve only the linked bank accounts belonging to a specific + location. + response: + docs: Success + type: root.ListBankAccountsResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + limit: 1 + location_id: location_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + bank_accounts: + - id: ao6iaQ9vhDiaQD7n3GB + account_number_suffix: '971' + country: US + currency: USD + account_type: CHECKING + holder_name: Jane Doe + primary_bank_identification_number: '112200303' + secondary_bank_identification_number: secondary_bank_identification_number + debit_mandate_reference_id: debit_mandate_reference_id + reference_id: reference_id + location_id: S8GWD5example + status: VERIFICATION_IN_PROGRESS + creditable: false + debitable: false + fingerprint: fingerprint + version: 5 + bank_name: Bank Name + - id: 4x7WXuaxrkQkVlka3GB + account_number_suffix: '972' + country: US + currency: USD + account_type: CHECKING + holder_name: Jane Doe + primary_bank_identification_number: '112200303' + secondary_bank_identification_number: secondary_bank_identification_number + debit_mandate_reference_id: debit_mandate_reference_id + reference_id: reference_id + location_id: S8GWD5example + status: VERIFICATION_IN_PROGRESS + creditable: false + debitable: false + fingerprint: fingerprint + version: 5 + bank_name: Bank Name + cursor: cursor + GetByV1Id: + path: /v2/bank-accounts/by-v1-id/{v1_bank_account_id} + method: GET + auth: + - oauth2: + - BANK_ACCOUNTS_READ + docs: >- + Returns details of a [BankAccount](entity:BankAccount) identified by V1 + bank account ID. + source: + openapi: openapi/openapi.json + display-name: GetBankAccountByV1Id + request: + name: GetByV1IdBankAccountsRequest + path-parameters: + v1_bank_account_id: + type: string + docs: >- + Connect V1 ID of the desired `BankAccount`. For more information, + see + + [Retrieve a bank account by using an ID issued by V1 Bank Accounts + API](https://developer.squareup.com/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api). + response: + docs: Success + type: root.GetBankAccountByV1IdResponse + status-code: 200 + examples: + - path-parameters: + v1_bank_account_id: v1_bank_account_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + bank_account: + id: w3yRgCGYQnwmdl0R3GB + account_number_suffix: '971' + country: US + currency: USD + account_type: CHECKING + holder_name: Jane Doe + primary_bank_identification_number: '112200303' + secondary_bank_identification_number: secondary_bank_identification_number + debit_mandate_reference_id: debit_mandate_reference_id + reference_id: reference_id + location_id: S8GWD5example + status: VERIFICATION_IN_PROGRESS + creditable: false + debitable: false + fingerprint: fingerprint + version: 5 + bank_name: Bank Name + get: + path: /v2/bank-accounts/{bank_account_id} + method: GET + auth: + - oauth2: + - BANK_ACCOUNTS_READ + docs: |- + Returns details of a [BankAccount](entity:BankAccount) + linked to a Square account. + source: + openapi: openapi/openapi.json + display-name: GetBankAccount + request: + name: GetBankAccountsRequest + path-parameters: + bank_account_id: + type: string + docs: Square-issued ID of the desired `BankAccount`. + response: + docs: Success + type: root.GetBankAccountResponse + status-code: 200 + examples: + - path-parameters: + bank_account_id: bank_account_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + bank_account: + id: w3yRgCGYQnwmdl0R3GB + account_number_suffix: '971' + country: US + currency: USD + account_type: CHECKING + holder_name: Jane Doe + primary_bank_identification_number: '112200303' + secondary_bank_identification_number: secondary_bank_identification_number + debit_mandate_reference_id: debit_mandate_reference_id + reference_id: reference_id + location_id: S8GWD5example + status: VERIFICATION_IN_PROGRESS + creditable: false + debitable: false + fingerprint: fingerprint + version: 5 + bank_name: Bank Name + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bookings.yml b/.mock/definition/bookings.yml new file mode 100644 index 000000000..8ee15b4aa --- /dev/null +++ b/.mock/definition/bookings.yml @@ -0,0 +1,909 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/bookings + method: GET + auth: + - oauth2: + - APPOINTMENTS_READ + docs: >- + Retrieve a collection of bookings. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.bookings + source: + openapi: openapi/openapi.json + display-name: ListBookings + request: + name: ListBookingsRequest + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of results per page to return in a paged + response. + cursor: + type: optional> + docs: >- + The pagination cursor from the preceding response to return the + next page of the results. Do not set this when retrieving the + first page of the results. + customer_id: + type: optional> + docs: >- + The [customer](entity:Customer) for whom to retrieve bookings. If + this is not set, bookings for all customers are retrieved. + team_member_id: + type: optional> + docs: >- + The team member for whom to retrieve bookings. If this is not set, + bookings of all members are retrieved. + location_id: + type: optional> + docs: >- + The location for which to retrieve bookings. If this is not set, + all locations' bookings are retrieved. + start_at_min: + type: optional> + docs: >- + The RFC 3339 timestamp specifying the earliest of the start time. + If this is not set, the current time is used. + start_at_max: + type: optional> + docs: >- + The RFC 3339 timestamp specifying the latest of the start time. If + this is not set, the time of 31 days after `start_at_min` is used. + response: + docs: Success + type: root.ListBookingsResponse + status-code: 200 + examples: + - query-parameters: + limit: 1 + cursor: cursor + customer_id: customer_id + team_member_id: team_member_id + location_id: location_id + start_at_min: start_at_min + start_at_max: start_at_max + headers: + Square-Version: '2025-10-16' + response: + body: + bookings: + - id: zkras0xv0xwswx + version: 1 + status: ACCEPTED + created_at: '2020-10-28T15:47:41Z' + updated_at: '2020-10-28T15:49:25Z' + start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + customer_id: EX2QSVGTZN4K1E5QE1CBFNVQ8M + customer_note: '' + seller_note: '' + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + transition_time_minutes: 1 + all_day: true + location_type: BUSINESS_LOCATION + source: FIRST_PARTY_MERCHANT + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/bookings + method: POST + auth: + - oauth2: + - APPOINTMENTS_WRITE + docs: >- + Creates a booking. + + + The required input must include the following: + + - `Booking.location_id` + + - `Booking.start_at` + + - `Booking.AppointmentSegment.team_member_id` + + - `Booking.AppointmentSegment.service_variation_id` + + - `Booking.AppointmentSegment.service_variation_version` + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: CreateBooking + request: + name: CreateBookingRequest + body: + properties: + idempotency_key: + type: optional + docs: A unique key to make this request an idempotent operation. + validation: + maxLength: 255 + booking: + type: root.Booking + docs: The details of the booking to be created. + content-type: application/json + response: + docs: Success + type: root.CreateBookingResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + booking: {} + response: + body: + booking: + id: zkras0xv0xwswx + version: 0 + status: ACCEPTED + created_at: '2020-10-28T15:47:41Z' + updated_at: '2020-10-28T15:47:41Z' + start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + customer_id: EX2QSVGTZN4K1E5QE1CBFNVQ8M + customer_note: '' + seller_note: '' + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + transition_time_minutes: 1 + all_day: true + location_type: BUSINESS_LOCATION + creator_details: + creator_type: TEAM_MEMBER + team_member_id: team_member_id + customer_id: customer_id + source: FIRST_PARTY_MERCHANT + address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + SearchAvailability: + path: /v2/bookings/availability/search + method: POST + auth: + - oauth2: + - APPOINTMENTS_READ + docs: >- + Searches for availabilities for booking. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: SearchAvailability + request: + name: SearchAvailabilityRequest + body: + properties: + query: + type: root.SearchAvailabilityQuery + docs: >- + Query conditions used to filter buyer-accessible booking + availabilities. + content-type: application/json + response: + docs: Success + type: root.SearchAvailabilityResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + start_at_range: {} + response: + body: + availabilities: + - start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-26T13:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-26T14:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-26T14:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-26T15:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-26T15:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-26T16:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-27T09:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T09:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-27T10:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T10:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T11:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T11:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-27T12:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-27T12:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + - start_at: '2020-11-27T13:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T13:30:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + - start_at: '2020-11-27T14:00:00Z' + location_id: LEQHH0YY8B42M + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMaJcbiRqPIGZuS9 + service_variation_version: 1599775456731 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkRetrieveBookings: + path: /v2/bookings/bulk-retrieve + method: POST + auth: + - oauth2: + - APPOINTMENTS_READ + docs: >- + Bulk-Retrieves a list of bookings by booking IDs. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: BulkRetrieveBookings + request: + name: BulkRetrieveBookingsRequest + body: + properties: + booking_ids: + docs: >- + A non-empty list of [Booking](entity:Booking) IDs specifying + bookings to retrieve. + type: list + content-type: application/json + response: + docs: Success + type: root.BulkRetrieveBookingsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + booking_ids: + - booking_ids + response: + body: + bookings: + sc3p3m7dvctfr1: + booking: + id: sc3p3m7dvctfr1 + version: 0 + status: ACCEPTED + created_at: '2023-04-26T18:19:21Z' + updated_at: '2023-04-26T18:19:21Z' + start_at: '2023-05-01T14:00:00Z' + location_id: LY6WNBPVM6VGV + customer_id: 4TDWKN9E8165X8Z77MRS0VFMJM + appointment_segments: + - duration_minutes: 60 + service_variation_id: VG4FYBKK3UL6UITOEYQ6MFLS + team_member_id: TMjiqI3PxyLMKr4k + service_variation_version: 1641341724039 + any_team_member: false + all_day: false + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + tdegug1dvctdef: + errors: + - category: INVALID_REQUEST_ERROR + code: NOT_FOUND + detail: Specified booking was not found. + field: booking_id + tdegug1fqni3wh: + booking: + id: tdegug1fqni3wh + version: 0 + status: ACCEPTED + created_at: '2023-04-26T18:19:30Z' + updated_at: '2023-04-26T18:19:30Z' + start_at: '2023-05-02T14:00:00Z' + location_id: LY6WNBPVM6VGV + customer_id: 4TDWKN9E8165X8Z77MRS0VFMJM + appointment_segments: + - duration_minutes: 60 + service_variation_id: VG4FYBKK3UL6UITOEYQ6MFLS + team_member_id: TMjiqI3PxyLMKr4k + service_variation_version: 1641341724039 + any_team_member: false + all_day: false + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + getBusinessProfile: + path: /v2/bookings/business-booking-profile + method: GET + auth: + - oauth2: + - APPOINTMENTS_BUSINESS_SETTINGS_READ + docs: Retrieves a seller's booking profile. + source: + openapi: openapi/openapi.json + display-name: RetrieveBusinessBookingProfile + response: + docs: Success + type: root.GetBusinessBookingProfileResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + response: + body: + business_booking_profile: + seller_id: MLJQYZZRM0D3Y + created_at: '2020-09-10T21:40:38Z' + booking_enabled: true + customer_timezone_choice: CUSTOMER_CHOICE + booking_policy: ACCEPT_ALL + allow_user_cancel: true + business_appointment_settings: + location_types: + - BUSINESS_LOCATION + alignment_time: HALF_HOURLY + min_booking_lead_time_seconds: 0 + max_booking_lead_time_seconds: 31536000 + any_team_member_booking_enabled: true + multiple_service_booking_enabled: true + max_appointments_per_day_limit_type: PER_TEAM_MEMBER + max_appointments_per_day_limit: 1 + cancellation_window_seconds: 1 + cancellation_fee_money: + currency: USD + cancellation_policy: CUSTOM_POLICY + cancellation_policy_text: cancellation_policy_text + skip_booking_flow_staff_selection: false + support_seller_level_writes: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + RetrieveLocationBookingProfile: + path: /v2/bookings/location-booking-profiles/{location_id} + method: GET + auth: + - oauth2: + - APPOINTMENTS_BUSINESS_SETTINGS_READ + docs: Retrieves a seller's location booking profile. + source: + openapi: openapi/openapi.json + display-name: RetrieveLocationBookingProfile + request: + name: RetrieveLocationBookingProfileRequest + path-parameters: + location_id: + type: string + docs: The ID of the location to retrieve the booking profile. + response: + docs: Success + type: root.RetrieveLocationBookingProfileResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-10-16' + response: + body: + location_booking_profile: + location_id: L3HETDGYQ4A2C + booking_site_url: https://square.site/book/L3HETDGYQ4A2C/prod-business + online_booking_enabled: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkRetrieveTeamMemberBookingProfiles: + path: /v2/bookings/team-member-booking-profiles/bulk-retrieve + method: POST + auth: + - oauth2: + - APPOINTMENTS_BUSINESS_SETTINGS_READ + docs: Retrieves one or more team members' booking profiles. + source: + openapi: openapi/openapi.json + display-name: BulkRetrieveTeamMemberBookingProfiles + request: + name: BulkRetrieveTeamMemberBookingProfilesRequest + body: + properties: + team_member_ids: + docs: >- + A non-empty list of IDs of team members whose booking profiles + you want to retrieve. + type: list + content-type: application/json + response: + docs: Success + type: root.BulkRetrieveTeamMemberBookingProfilesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + team_member_ids: + - team_member_ids + response: + body: + team_member_booking_profiles: + TMXUrsBWWcHTt79t: + errors: + - category: INVALID_REQUEST_ERROR + code: NOT_FOUND + detail: Resource not found. + TMaJcbiRqPIGZuS9: + team_member_booking_profile: + team_member_id: TMaJcbiRqPIGZuS9 + display_name: Sandbox Staff 1 + is_bookable: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + TMtdegug1fqni3wh: + team_member_booking_profile: + team_member_id: TMtdegug1fqni3wh + display_name: Sandbox Staff 2 + is_bookable: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/bookings/{booking_id} + method: GET + auth: + - oauth2: + - APPOINTMENTS_READ + docs: >- + Retrieves a booking. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: RetrieveBooking + request: + name: GetBookingsRequest + path-parameters: + booking_id: + type: string + docs: >- + The ID of the [Booking](entity:Booking) object representing the + to-be-retrieved booking. + response: + docs: Success + type: root.GetBookingResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + headers: + Square-Version: '2025-10-16' + response: + body: + booking: + id: zkras0xv0xwswx + version: 1 + status: ACCEPTED + created_at: '2020-10-28T15:47:41Z' + updated_at: '2020-10-28T15:49:25Z' + start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + customer_id: EX2QSVGTZN4K1E5QE1CBFNVQ8M + customer_note: '' + seller_note: '' + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + transition_time_minutes: 1 + all_day: true + location_type: BUSINESS_LOCATION + creator_details: + creator_type: TEAM_MEMBER + team_member_id: team_member_id + customer_id: customer_id + source: FIRST_PARTY_MERCHANT + address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/bookings/{booking_id} + method: PUT + auth: + - oauth2: + - APPOINTMENTS_WRITE + docs: >- + Updates a booking. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: UpdateBooking + request: + name: UpdateBookingRequest + path-parameters: + booking_id: + type: string + docs: >- + The ID of the [Booking](entity:Booking) object representing the + to-be-updated booking. + body: + properties: + idempotency_key: + type: optional> + docs: A unique key to make this request an idempotent operation. + validation: + maxLength: 255 + booking: + type: root.Booking + docs: >- + The booking to be updated. Individual attributes explicitly + specified here override the corresponding values of the existing + booking. + content-type: application/json + response: + docs: Success + type: root.UpdateBookingResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + headers: + Square-Version: '2025-10-16' + request: + booking: {} + response: + body: + booking: + id: zkras0xv0xwswx + version: 2 + status: ACCEPTED + created_at: '2020-10-28T15:47:41Z' + updated_at: '2020-10-28T15:49:25Z' + start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + customer_id: EX2QSVGTZN4K1E5QE1CBFNVQ8M + customer_note: I would like to sit near the window please + seller_note: '' + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + transition_time_minutes: 1 + all_day: true + location_type: CUSTOMER_LOCATION + creator_details: + creator_type: TEAM_MEMBER + team_member_id: team_member_id + customer_id: customer_id + source: FIRST_PARTY_MERCHANT + address: + address_line_1: 1955 Broadway + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: Oakland + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: CA + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '94612' + country: ZZ + first_name: first_name + last_name: last_name + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cancel: + path: /v2/bookings/{booking_id}/cancel + method: POST + auth: + - oauth2: + - APPOINTMENTS_WRITE + docs: >- + Cancels an existing booking. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: CancelBooking + request: + name: CancelBookingRequest + path-parameters: + booking_id: + type: string + docs: >- + The ID of the [Booking](entity:Booking) object representing the + to-be-cancelled booking. + body: + properties: + idempotency_key: + type: optional> + docs: A unique key to make this request an idempotent operation. + validation: + maxLength: 255 + booking_version: + type: optional> + docs: >- + The revision number for the booking used for optimistic + concurrency. + content-type: application/json + response: + docs: Success + type: root.CancelBookingResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + headers: + Square-Version: '2025-10-16' + request: {} + response: + body: + booking: + id: zkras0xv0xwswx + version: 1 + status: CANCELLED_BY_CUSTOMER + created_at: '2020-10-28T15:47:41Z' + updated_at: '2020-10-28T15:49:25Z' + start_at: '2020-11-26T13:00:00Z' + location_id: LEQHH0YY8B42M + customer_id: EX2QSVGTZN4K1E5QE1CBFNVQ8M + customer_note: '' + seller_note: '' + appointment_segments: + - duration_minutes: 60 + service_variation_id: RU3PBTZTK7DXZDQFCJHOK2MC + team_member_id: TMXUrsBWWcHTt79t + service_variation_version: 1599775456731 + transition_time_minutes: 1 + all_day: true + location_type: BUSINESS_LOCATION + creator_details: + creator_type: TEAM_MEMBER + team_member_id: team_member_id + customer_id: customer_id + source: FIRST_PARTY_MERCHANT + address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bookings/customAttributeDefinitions.yml b/.mock/definition/bookings/customAttributeDefinitions.yml new file mode 100644 index 000000000..8d0e377ae --- /dev/null +++ b/.mock/definition/bookings/customAttributeDefinitions.yml @@ -0,0 +1,413 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/bookings/custom-attribute-definitions + method: GET + auth: + - oauth2: + - APPOINTMENTS_READ + docs: >- + Get all bookings custom attribute definitions. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attribute_definitions + source: + openapi: openapi/openapi.json + display-name: ListBookingCustomAttributeDefinitions + request: + name: ListCustomAttributeDefinitionsRequest + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListBookingCustomAttributeDefinitionsResponse + status-code: 200 + examples: + - query-parameters: + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute_definitions: + - key: favoriteShampoo + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite shampoo + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 3 + updated_at: '2022-11-16T15:39:38Z' + created_at: '2022-11-16T15:27:30Z' + - key: partySize + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Party size + description: Number of people in the party for dine-in + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: '2022-11-16T15:49:05Z' + created_at: '2022-11-16T15:49:05Z' + cursor: >- + YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/bookings/custom-attribute-definitions + method: POST + auth: + - oauth2: + - APPOINTMENTS_WRITE + docs: >- + Creates a bookings custom attribute definition. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: CreateBookingCustomAttributeDefinition + request: + name: CreateBookingCustomAttributeDefinitionRequest + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition to create, with the following + fields: + + + - `key` + + + - `name`. If provided, `name` must be unique (case-sensitive) + across all visible booking-related custom attribute + + definitions for the seller. + + + - `description` + + + - `visibility`. Note that all custom attributes are visible in + exported booking data, including those set to + + `VISIBILITY_HIDDEN`. + + + - `schema`. With the exception of the `Selection` data type, the + `schema` is specified as a + + simple URL to the JSON schema definition hosted on the Square + CDN. For more information, see + + [Specifying the + schema](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attribute-definitions#specify-schema). + idempotency_key: + type: optional + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateBookingCustomAttributeDefinitionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + custom_attribute_definition: {} + response: + body: + custom_attribute_definition: + key: favoriteShampoo + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Shampoo + description: The favorite shampoo of the customer. + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: '2022-11-16T15:27:30Z' + created_at: '2022-11-16T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/bookings/custom-attribute-definitions/{key} + method: GET + auth: + - oauth2: + - APPOINTMENTS_READ + docs: >- + Retrieves a bookings custom attribute definition. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: RetrieveBookingCustomAttributeDefinition + request: + name: GetCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: >- + The key of the custom attribute definition to retrieve. If the + requesting application + + is not the definition owner, you must use the qualified key. + query-parameters: + version: + type: optional> + docs: >- + The current version of the custom attribute definition, which is + used for strongly consistent + + reads to guarantee that you receive the most up-to-date data. When + included in the request, + + Square returns the specified version or a higher version if one + exists. If the specified version + + is higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveBookingCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + query-parameters: + version: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute_definition: + key: favoriteShampoo + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite shampoo + description: The favorite shampoo of the customer. + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-11-16T15:27:30Z' + created_at: '2022-11-16T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/bookings/custom-attribute-definitions/{key} + method: PUT + auth: + - oauth2: + - APPOINTMENTS_WRITE + docs: >- + Updates a bookings custom attribute definition. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: UpdateBookingCustomAttributeDefinition + request: + name: UpdateBookingCustomAttributeDefinitionRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to update. + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition that contains the fields to + update. Only the following fields can be updated: + + - `name` + + - `description` + + - `visibility` + + - `schema` for a `Selection` data type. Only changes to the + named options or the maximum number of allowed + + selections are supported. + + + For more information, see + + [Updatable definition + fields](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields). + + + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include the optional `version` field and specify the + current version of the custom attribute definition. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateBookingCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-10-16' + request: + custom_attribute_definition: {} + response: + body: + custom_attribute_definition: + key: favoriteShampoo + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite shampoo + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 2 + updated_at: '2022-11-16T15:39:38Z' + created_at: '2022-11-16T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/bookings/custom-attribute-definitions/{key} + method: DELETE + auth: + - oauth2: + - APPOINTMENTS_WRITE + docs: >- + Deletes a bookings custom attribute definition. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: DeleteBookingCustomAttributeDefinition + request: + name: DeleteCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to delete. + response: + docs: Success + type: root.DeleteBookingCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bookings/customAttributes.yml b/.mock/definition/bookings/customAttributes.yml new file mode 100644 index 000000000..53a188008 --- /dev/null +++ b/.mock/definition/bookings/customAttributes.yml @@ -0,0 +1,565 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + batchDelete: + path: /v2/bookings/custom-attributes/bulk-delete + method: POST + auth: + - oauth2: + - APPOINTMENTS_WRITE + docs: >- + Bulk deletes bookings custom attributes. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: BulkDeleteBookingCustomAttributes + request: + name: BulkDeleteBookingCustomAttributesRequest + body: + properties: + values: + type: map + docs: >- + A map containing 1 to 25 individual Delete requests. For each + request, provide an + + arbitrary ID that is unique for this + `BulkDeleteBookingCustomAttributes` request and the + + information needed to delete a custom attribute. + content-type: application/json + response: + docs: Success + type: root.BulkDeleteBookingCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + values: + key: + booking_id: booking_id + key: key + response: + body: + values: + id1: + booking_id: N3NCVYY3WS27HF0HKANA3R9FP8 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + booking_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id3: + booking_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchUpsert: + path: /v2/bookings/custom-attributes/bulk-upsert + method: POST + auth: + - oauth2: + - APPOINTMENTS_WRITE + docs: >- + Bulk upserts bookings custom attributes. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: BulkUpsertBookingCustomAttributes + request: + name: BulkUpsertBookingCustomAttributesRequest + body: + properties: + values: + type: map + docs: >- + A map containing 1 to 25 individual upsert requests. For each + request, provide an + + arbitrary ID that is unique for this + `BulkUpsertBookingCustomAttributes` request and the + + information needed to create or update a custom attribute. + content-type: application/json + response: + docs: Success + type: root.BulkUpsertBookingCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + values: + key: + booking_id: booking_id + custom_attribute: {} + response: + body: + values: + id1: + booking_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: favoriteShampoo + value: Spring Fresh + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-16T00:16:23Z' + created_at: '2022-11-16T23:14:47Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + booking_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: hasShoes + value: false + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-16T00:16:23Z' + created_at: '2022-11-16T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id3: + booking_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: favoriteShampoo + value: Hydro-Cool + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-16T00:16:23Z' + created_at: '2022-11-16T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id4: + booking_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: partySize + value: 4 + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-16T00:16:23Z' + created_at: '2022-11-16T23:14:47Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id5: + booking_id: 70548QG1HN43B05G0KCZ4MMC1G + custom_attribute: + key: celebrating + value: birthday + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-16T00:16:23Z' + created_at: '2022-11-16T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + list: + path: /v2/bookings/{booking_id}/custom-attributes + method: GET + auth: + - oauth2: + - APPOINTMENTS_READ + docs: >- + Lists a booking's custom attributes. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attributes + source: + openapi: openapi/openapi.json + display-name: ListBookingCustomAttributes + request: + name: ListCustomAttributesRequest + path-parameters: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. For more + + information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + with_definitions: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + response: + docs: Success + type: root.ListBookingCustomAttributesResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + query-parameters: + limit: 1 + cursor: cursor + with_definitions: true + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attributes: + - key: favoriteShampoo + value: Hydro-Cool + version: 1 + visibility: VISIBILITY_READ_ONLY + updated_at: '2022-11-16T15:50:27Z' + created_at: '2022-11-16T15:50:27Z' + - key: hasShoes + value: false + version: 1 + visibility: VISIBILITY_HIDDEN + updated_at: '2022-11-16T15:51:53Z' + created_at: '2022-11-16T15:51:53Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/bookings/{booking_id}/custom-attributes/{key} + method: GET + auth: + - oauth2: + - APPOINTMENTS_READ + docs: >- + Retrieves a bookings custom attribute. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_READ` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: RetrieveBookingCustomAttribute + request: + name: GetCustomAttributesRequest + path-parameters: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + key: + type: string + docs: >- + The key of the custom attribute to retrieve. This key must match + the `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + query-parameters: + with_definition: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of + + the custom attribute. Set this parameter to `true` to get the name + and description of the custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + version: + type: optional> + docs: >- + The current version of the custom attribute, which is used for + strongly consistent reads to + + guarantee that you receive the most up-to-date data. When included + in the request, Square + + returns the specified version or a higher version if one exists. + If the specified version is + + higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveBookingCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + key: key + query-parameters: + with_definition: true + version: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute: + key: favoriteShampoo + value: Dune + version: 1 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-11-16T15:50:27Z' + created_at: '2022-11-16T15:50:27Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + upsert: + path: /v2/bookings/{booking_id}/custom-attributes/{key} + method: PUT + auth: + - oauth2: + - APPOINTMENTS_WRITE + docs: >- + Upserts a bookings custom attribute. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: UpsertBookingCustomAttribute + request: + name: UpsertBookingCustomAttributeRequest + path-parameters: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + key: + type: string + docs: >- + The key of the custom attribute to create or update. This key must + match the `key` of a + + custom attribute definition in the Square seller account. If the + requesting application is not + + the definition owner, you must use the qualified key. + body: + properties: + custom_attribute: + type: root.CustomAttribute + docs: >- + The custom attribute to create or update, with the following + fields: + + + - `value`. This value must conform to the `schema` specified by + the definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for an update operation, include this optional field and + specify the current version + + of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpsertBookingCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + key: key + headers: + Square-Version: '2025-10-16' + request: + custom_attribute: {} + response: + body: + custom_attribute: + key: favoriteShampoo + value: Spring Fresh + version: 1 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-11-16T15:50:27Z' + created_at: '2022-11-16T15:50:27Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/bookings/{booking_id}/custom-attributes/{key} + method: DELETE + auth: + - oauth2: + - APPOINTMENTS_WRITE + docs: >- + Deletes a bookings custom attribute. + + + To call this endpoint with buyer-level permissions, set + `APPOINTMENTS_WRITE` for the OAuth scope. + + To call this endpoint with seller-level permissions, set + `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. + + + For calls to this endpoint with seller-level permissions to succeed, the + seller must have subscribed to *Appointments Plus* + + or *Appointments Premium*. + source: + openapi: openapi/openapi.json + display-name: DeleteBookingCustomAttribute + request: + name: DeleteCustomAttributesRequest + path-parameters: + booking_id: + type: string + docs: The ID of the target [booking](entity:Booking). + key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match the + `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + response: + docs: Success + type: root.DeleteBookingCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + booking_id: booking_id + key: key + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bookings/locationProfiles.yml b/.mock/definition/bookings/locationProfiles.yml new file mode 100644 index 000000000..00e37e131 --- /dev/null +++ b/.mock/definition/bookings/locationProfiles.yml @@ -0,0 +1,59 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/bookings/location-booking-profiles + method: GET + auth: + - oauth2: + - APPOINTMENTS_BUSINESS_SETTINGS_READ + docs: Lists location booking profiles of a seller. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.location_booking_profiles + source: + openapi: openapi/openapi.json + display-name: ListLocationBookingProfiles + request: + name: ListLocationProfilesRequest + query-parameters: + limit: + type: optional> + docs: The maximum number of results to return in a paged response. + cursor: + type: optional> + docs: >- + The pagination cursor from the preceding response to return the + next page of the results. Do not set this when retrieving the + first page of the results. + response: + docs: Success + type: root.ListLocationBookingProfilesResponse + status-code: 200 + examples: + - query-parameters: + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + location_booking_profiles: + - location_id: LY6WNBPVM6VGV + booking_site_url: https://squareup.com/book/LY6WNBPVM6VGV/testbusiness + online_booking_enabled: true + - location_id: PYTRNBPVMJUPV + booking_site_url: booking_site_url + online_booking_enabled: false + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/bookings/teamMemberProfiles.yml b/.mock/definition/bookings/teamMemberProfiles.yml new file mode 100644 index 000000000..85a1e061c --- /dev/null +++ b/.mock/definition/bookings/teamMemberProfiles.yml @@ -0,0 +1,114 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/bookings/team-member-booking-profiles + method: GET + auth: + - oauth2: + - APPOINTMENTS_BUSINESS_SETTINGS_READ + docs: Lists booking profiles for team members. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.team_member_booking_profiles + source: + openapi: openapi/openapi.json + display-name: ListTeamMemberBookingProfiles + request: + name: ListTeamMemberProfilesRequest + query-parameters: + bookable_only: + type: optional> + default: false + docs: >- + Indicates whether to include only bookable team members in the + returned result (`true`) or not (`false`). + limit: + type: optional> + docs: The maximum number of results to return in a paged response. + cursor: + type: optional> + docs: >- + The pagination cursor from the preceding response to return the + next page of the results. Do not set this when retrieving the + first page of the results. + location_id: + type: optional> + docs: >- + Indicates whether to include only team members enabled at the + given location in the returned result. + response: + docs: Success + type: root.ListTeamMemberBookingProfilesResponse + status-code: 200 + examples: + - query-parameters: + bookable_only: true + limit: 1 + cursor: cursor + location_id: location_id + headers: + Square-Version: '2025-10-16' + response: + body: + team_member_booking_profiles: + - team_member_id: TMXUrsBWWcHTt79t + description: description + display_name: Sandbox Seller + is_bookable: true + profile_image_url: profile_image_url + - team_member_id: TMaJcbiRqPIGZuS9 + description: description + display_name: Sandbox Staff + is_bookable: true + profile_image_url: profile_image_url + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/bookings/team-member-booking-profiles/{team_member_id} + method: GET + auth: + - oauth2: + - APPOINTMENTS_BUSINESS_SETTINGS_READ + docs: Retrieves a team member's booking profile. + source: + openapi: openapi/openapi.json + display-name: RetrieveTeamMemberBookingProfile + request: + name: GetTeamMemberProfilesRequest + path-parameters: + team_member_id: + type: string + docs: The ID of the team member to retrieve. + response: + docs: Success + type: root.GetTeamMemberBookingProfileResponse + status-code: 200 + examples: + - path-parameters: + team_member_id: team_member_id + headers: + Square-Version: '2025-10-16' + response: + body: + team_member_booking_profile: + team_member_id: TMaJcbiRqPIGZuS9 + description: description + display_name: Sandbox Staff + is_bookable: true + profile_image_url: profile_image_url + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/cards.yml b/.mock/definition/cards.yml new file mode 100644 index 000000000..ac6b78e11 --- /dev/null +++ b/.mock/definition/cards.yml @@ -0,0 +1,365 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/cards + method: GET + auth: + - oauth2: [] + docs: |- + Retrieves a list of cards owned by the account making the request. + A max of 25 cards will be returned. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.cards + source: + openapi: openapi/openapi.json + display-name: ListCards + request: + name: ListCardsRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for your original + query. + + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + customer_id: + type: optional> + docs: |- + Limit results to cards associated with the customer supplied. + By default, all cards owned by the merchant are returned. + include_disabled: + type: optional> + default: false + docs: |- + Includes disabled cards. + By default, all enabled cards owned by the merchant are returned. + reference_id: + type: optional> + docs: Limit results to cards associated with the reference_id supplied. + sort_order: + type: optional> + docs: >- + Sorts the returned list by when the card was created with the + specified order. + + This field defaults to ASC. + response: + docs: Success + type: root.ListCardsResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + customer_id: customer_id + include_disabled: true + reference_id: reference_id + sort_order: DESC + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cards: + - id: ccof:uIbfJXhXETSP197M3GB + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + fingerprint: >- + ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q + customer_id: VDKXEEKPJN48QDG3BGGFAK05P8 + merchant_id: 6SSW7HV8K2ST5 + reference_id: user-id-1 + enabled: true + card_type: CREDIT + prepaid_type: NOT_PREPAID + bin: '411111' + version: 1 + card_co_brand: UNKNOWN + issuer_alert: ISSUER_ALERT_CARD_CLOSED + issuer_alert_at: issuer_alert_at + hsa_fsa: false + cursor: cursor + create: + path: /v2/cards + method: POST + auth: + - oauth2: [] + docs: Adds a card on file to an existing merchant. + source: + openapi: openapi/openapi.json + display-name: CreateCard + request: + name: CreateCardRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this CreateCard request. Keys + can be + + any valid string and must be unique for every request. + + + Max: 45 characters + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + source_id: + type: string + docs: >- + The ID of the source which represents the card information to be + stored. This can be a card nonce or a payment id. + validation: + minLength: 1 + maxLength: 16384 + verification_token: + type: optional + docs: >- + An identifying token generated by + [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). + + Verification tokens encapsulate customer device information and + 3-D Secure + + challenge results to indicate that Square has verified the buyer + identity. + + + See the [SCA + Overview](https://developer.squareup.com/docs/sca-overview). + card: + type: root.Card + docs: Payment details associated with the card to be stored. + content-type: application/json + response: + docs: Success + type: root.CreateCardResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 4935a656-a929-4792-b97c-8848be85c27c + source_id: cnon:uIbfJXhXETSP197M3GB + card: + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + customer_id: VDKXEEKPJN48QDG3BGGFAK05P8 + reference_id: user-id-1 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + card: + id: ccof:uIbfJXhXETSP197M3GB + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + fingerprint: >- + ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q + customer_id: VDKXEEKPJN48QDG3BGGFAK05P8 + merchant_id: 6SSW7HV8K2ST5 + reference_id: user-id-1 + enabled: true + card_type: CREDIT + prepaid_type: NOT_PREPAID + bin: '411111' + version: 1 + card_co_brand: UNKNOWN + issuer_alert: ISSUER_ALERT_CARD_CLOSED + issuer_alert_at: issuer_alert_at + hsa_fsa: false + get: + path: /v2/cards/{card_id} + method: GET + auth: + - oauth2: [] + docs: Retrieves details for a specific Card. + source: + openapi: openapi/openapi.json + display-name: RetrieveCard + request: + name: GetCardsRequest + path-parameters: + card_id: + type: string + docs: Unique ID for the desired Card. + response: + docs: Success + type: root.GetCardResponse + status-code: 200 + examples: + - path-parameters: + card_id: card_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + card: + id: ccof:uIbfJXhXETSP197M3GB + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + fingerprint: >- + ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q + customer_id: VDKXEEKPJN48QDG3BGGFAK05P8 + merchant_id: 6SSW7HV8K2ST5 + reference_id: user-id-1 + enabled: true + card_type: CREDIT + prepaid_type: NOT_PREPAID + bin: '411111' + version: 1 + card_co_brand: UNKNOWN + issuer_alert: ISSUER_ALERT_CARD_CLOSED + issuer_alert_at: issuer_alert_at + hsa_fsa: false + disable: + path: /v2/cards/{card_id}/disable + method: POST + auth: + - oauth2: [] + docs: |- + Disables the card, preventing any further updates or charges. + Disabling an already disabled card is allowed but has no effect. + source: + openapi: openapi/openapi.json + display-name: DisableCard + request: + name: DisableCardsRequest + path-parameters: + card_id: + type: string + docs: Unique ID for the desired Card. + response: + docs: Success + type: root.DisableCardResponse + status-code: 200 + examples: + - path-parameters: + card_id: card_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + card: + id: ccof:uIbfJXhXETSP197M3GB + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + fingerprint: >- + ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q + customer_id: VDKXEEKPJN48QDG3BGGFAK05P8 + merchant_id: 6SSW7HV8K2ST5 + reference_id: user-id-1 + enabled: false + card_type: CREDIT + prepaid_type: NOT_PREPAID + bin: '411111' + version: 2 + card_co_brand: UNKNOWN + issuer_alert: ISSUER_ALERT_CARD_CLOSED + issuer_alert_at: issuer_alert_at + hsa_fsa: false + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/cashDrawers/shifts.yml b/.mock/definition/cashDrawers/shifts.yml new file mode 100644 index 000000000..a84f3b882 --- /dev/null +++ b/.mock/definition/cashDrawers/shifts.yml @@ -0,0 +1,277 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/cash-drawers/shifts + method: GET + auth: + - oauth2: + - CASH_DRAWER_READ + docs: |- + Provides the details for all of the cash drawer shifts for a location + in a date range. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.cash_drawer_shifts + source: + openapi: openapi/openapi.json + display-name: ListCashDrawerShifts + request: + name: ListShiftsRequest + query-parameters: + location_id: + type: string + docs: The ID of the location to query for a list of cash drawer shifts. + sort_order: + type: optional> + docs: |- + The order in which cash drawer shifts are listed in the response, + based on their opened_at field. Default value: ASC + begin_time: + type: optional> + docs: >- + The inclusive start time of the query on opened_at, in ISO 8601 + format. + end_time: + type: optional> + docs: >- + The exclusive end date of the query on opened_at, in ISO 8601 + format. + limit: + type: optional> + docs: |- + Number of cash drawer shift events in a page of results (200 by + default, 1000 max). + cursor: + type: optional> + docs: Opaque cursor for fetching the next page of results. + response: + docs: Success + type: root.ListCashDrawerShiftsResponse + status-code: 200 + examples: + - query-parameters: + location_id: location_id + sort_order: DESC + begin_time: begin_time + end_time: end_time + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cash_drawer_shifts: + - id: DCC99978-09A6-4926-849F-300BE9C5793A + state: CLOSED + opened_at: '2019-11-22T00:42:54.000Z' + ended_at: '2019-11-22T00:44:49.000Z' + closed_at: '2019-11-22T00:44:49.000Z' + description: Misplaced some change + opened_cash_money: + amount: 10000 + currency: USD + expected_cash_money: + amount: 10000 + currency: USD + closed_cash_money: + amount: 9970 + currency: USD + created_at: created_at + updated_at: updated_at + location_id: location_id + get: + path: /v2/cash-drawers/shifts/{shift_id} + method: GET + auth: + - oauth2: + - CASH_DRAWER_READ + docs: >- + Provides the summary details for a single cash drawer shift. See + + [ListCashDrawerShiftEvents](api-endpoint:CashDrawers-ListCashDrawerShiftEvents) + for a list of cash drawer shift events. + source: + openapi: openapi/openapi.json + display-name: RetrieveCashDrawerShift + request: + name: GetShiftsRequest + path-parameters: + shift_id: + type: string + docs: The shift ID. + query-parameters: + location_id: + type: string + docs: The ID of the location to retrieve cash drawer shifts from. + response: + docs: Success + type: root.GetCashDrawerShiftResponse + status-code: 200 + examples: + - path-parameters: + shift_id: shift_id + query-parameters: + location_id: location_id + headers: + Square-Version: '2025-10-16' + response: + body: + cash_drawer_shift: + id: DCC99978-09A6-4926-849F-300BE9C5793A + state: CLOSED + opened_at: '2019-11-22T00:42:54.000Z' + ended_at: '2019-11-22T00:44:49.000Z' + closed_at: '2019-11-22T00:44:49.000Z' + description: Misplaced some change + opened_cash_money: + amount: 10000 + currency: USD + cash_payment_money: + amount: 100 + currency: USD + cash_refunds_money: + amount: -100 + currency: USD + cash_paid_in_money: + amount: 10000 + currency: USD + cash_paid_out_money: + amount: -10000 + currency: USD + expected_cash_money: + amount: 10000 + currency: USD + closed_cash_money: + amount: 9970 + currency: USD + device: + id: id + name: My iPad + created_at: created_at + updated_at: updated_at + location_id: location_id + team_member_ids: + - team_member_ids + opening_team_member_id: '' + ending_team_member_id: '' + closing_team_member_id: '' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + listEvents: + path: /v2/cash-drawers/shifts/{shift_id}/events + method: GET + auth: + - oauth2: + - CASH_DRAWER_READ + docs: Provides a paginated list of events for a single cash drawer shift. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.cash_drawer_shift_events + source: + openapi: openapi/openapi.json + display-name: ListCashDrawerShiftEvents + request: + name: ListEventsShiftsRequest + path-parameters: + shift_id: + type: string + docs: The shift ID. + query-parameters: + location_id: + type: string + docs: The ID of the location to list cash drawer shifts for. + limit: + type: optional> + docs: |- + Number of resources to be returned in a page of results (200 by + default, 1000 max). + cursor: + type: optional> + docs: Opaque cursor for fetching the next page of results. + response: + docs: Success + type: root.ListCashDrawerShiftEventsResponse + status-code: 200 + examples: + - path-parameters: + shift_id: shift_id + query-parameters: + location_id: location_id + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cash_drawer_shift_events: + - id: 9F07DB01-D85A-4B77-88C3-D5C64CEB5155 + event_type: CASH_TENDER_PAYMENT + event_money: + amount: 100 + currency: USD + created_at: '2019-11-22T00:43:02.000Z' + description: '' + team_member_id: '' + - id: B2854CEA-A781-49B3-8F31-C64558231F48 + event_type: CASH_TENDER_PAYMENT + event_money: + amount: 250 + currency: USD + created_at: '2019-11-22T00:43:12.000Z' + description: '' + team_member_id: '' + - id: B5FB7F72-95CD-44A3-974D-26C41064D042 + event_type: CASH_TENDER_CANCELLED_PAYMENT + event_money: + amount: 250 + currency: USD + created_at: '2019-11-22T00:43:23.000Z' + description: '' + team_member_id: '' + - id: 0B425480-8504-40B4-A867-37B23543931B + event_type: CASH_TENDER_REFUND + event_money: + amount: 100 + currency: USD + created_at: '2019-11-22T00:43:46.000Z' + description: '' + team_member_id: '' + - id: 8C66E60E-FDCF-4EEF-A98D-3B14B7ED5CBE + event_type: PAID_IN + event_money: + amount: 10000 + currency: USD + created_at: '2019-11-22T00:44:18.000Z' + description: Transfer from another drawer + team_member_id: '' + - id: D5ACA7FE-C64D-4ADA-8BC8-82118A2DAE4F + event_type: PAID_OUT + event_money: + amount: 10000 + currency: USD + created_at: '2019-11-22T00:44:29.000Z' + description: Transfer out to another drawer + team_member_id: '' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/catalog.yml b/.mock/definition/catalog.yml new file mode 100644 index 000000000..33448c354 --- /dev/null +++ b/.mock/definition/catalog.yml @@ -0,0 +1,1226 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + batchDelete: + path: /v2/catalog/batch-delete + method: POST + auth: + - oauth2: + - ITEMS_WRITE + docs: >- + Deletes a set of [CatalogItem](entity:CatalogItem)s based on the + + provided list of target IDs and returns a set of successfully deleted + IDs in + + the response. Deletion is a cascading event such that all children of + the + + targeted object are also deleted. For example, deleting a CatalogItem + will + + also delete all of its + [CatalogItemVariation](entity:CatalogItemVariation) + + children. + + + `BatchDeleteCatalogObjects` succeeds even if only a portion of the + targeted + + IDs can be deleted. The response will only include IDs that were + + actually deleted. + + + To ensure consistency, only one delete request is processed at a time + per seller account. + + While one (batch or non-batch) delete request is being processed, other + (batched and non-batched) + + delete requests are rejected with the `429` error code. + source: + openapi: openapi/openapi.json + display-name: BatchDeleteCatalogObjects + request: + name: BatchDeleteCatalogObjectsRequest + body: + properties: + object_ids: + docs: >- + The IDs of the CatalogObjects to be deleted. When an object is + deleted, other objects + + in the graph that depend on that object will be deleted as well + (for example, deleting a + + CatalogItem will delete its CatalogItemVariation. + type: list + content-type: application/json + response: + docs: Success + type: root.BatchDeleteCatalogObjectsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + - AA27W3M2GGTF3H6AVPNB77CK + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + deleted_object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + - AA27W3M2GGTF3H6AVPNB77CK + deleted_at: '2016-11-16T22:25:24.878Z' + batchGet: + path: /v2/catalog/batch-retrieve + method: POST + auth: + - oauth2: + - ITEMS_READ + docs: >- + Returns a set of objects based on the provided ID. + + Each [CatalogItem](entity:CatalogItem) returned in the set includes all + of its + + child information including: all of its + + [CatalogItemVariation](entity:CatalogItemVariation) objects, references + to + + its [CatalogModifierList](entity:CatalogModifierList) objects, and the + ids of + + any [CatalogTax](entity:CatalogTax) objects that apply to it. + source: + openapi: openapi/openapi.json + display-name: BatchRetrieveCatalogObjects + request: + name: BatchGetCatalogObjectsRequest + body: + properties: + object_ids: + docs: The IDs of the CatalogObjects to be retrieved. + type: list + include_related_objects: + type: optional> + docs: >- + If `true`, the response will include additional objects that are + related to the + + requested objects. Related objects are defined as any objects + referenced by ID by the results in the `objects` field + + of the response. These objects are put in the `related_objects` + field. Setting this to `true` is + + helpful when the objects are needed for immediate display to a + user. + + This process only goes one level deep. Objects referenced by the + related objects will not be included. For example, + + + if the `objects` field of the response contains a CatalogItem, + its associated + + CatalogCategory objects, CatalogTax objects, CatalogImage + objects and + + CatalogModifierLists will be returned in the `related_objects` + field of the + + response. If the `objects` field of the response contains a + CatalogItemVariation, + + its parent CatalogItem will be returned in the `related_objects` + field of + + the response. + + + Default value: `false` + catalog_version: + type: optional> + docs: >- + The specific version of the catalog objects to be included in + the response. + + This allows you to retrieve historical versions of objects. The + specified version value is matched against + + the [CatalogObject](entity:CatalogObject)s' `version` attribute. + If not included, results will + + be from the current version of the catalog. + include_deleted_objects: + type: optional> + docs: >- + Indicates whether to include (`true`) or not (`false`) in the + response deleted objects, namely, those with the `is_deleted` + attribute set to `true`. + include_category_path_to_root: + type: optional> + docs: >- + Specifies whether or not to include the `path_to_root` list for + each returned category instance. The `path_to_root` list + consists + + of `CategoryPathToRootNode` objects and specifies the path that + starts with the immediate parent category of the returned + category + + and ends with its root category. If the returned category is a + top-level category, the `path_to_root` list is empty and is not + returned + + in the response payload. + content-type: application/json + response: + docs: Success + type: root.BatchGetCatalogObjectsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + - AA27W3M2GGTF3H6AVPNB77CK + include_related_objects: true + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + related_objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + ordinal: 1000000 + type: CATEGORY + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: TAX + batchUpsert: + path: /v2/catalog/batch-upsert + method: POST + auth: + - oauth2: + - ITEMS_WRITE + docs: >- + Creates or updates up to 10,000 target objects based on the provided + + list of objects. The target objects are grouped into batches and each + batch is + + inserted/updated in an all-or-nothing manner. If an object within a + batch is + + malformed in some way, or violates a database constraint, the entire + batch + + containing that item will be disregarded. However, other batches in the + same + + request may still succeed. Each batch may contain up to 1,000 objects, + and + + batches will be processed in order as long as the total object count for + the + + request (items, variations, modifier lists, discounts, and taxes) is no + more + + than 10,000. + + + To ensure consistency, only one update request is processed at a time + per seller account. + + While one (batch or non-batch) update request is being processed, other + (batched and non-batched) + + update requests are rejected with the `429` error code. + source: + openapi: openapi/openapi.json + display-name: BatchUpsertCatalogObjects + request: + name: BatchUpsertCatalogObjectsRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A value you specify that uniquely identifies this + + request among all your requests. A common way to create + + a valid idempotency key is to use a Universally unique + + identifier (UUID). + + + If you're unsure whether a particular request was successful, + + you can reattempt it with the same idempotency key without + + worrying about creating duplicate objects. + + + See + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 128 + batches: + docs: >- + A batch of CatalogObjects to be inserted/updated atomically. + + The objects within a batch will be inserted in an all-or-nothing + fashion, i.e., if an error occurs + + attempting to insert or update an object within a batch, the + entire batch will be rejected. However, an error + + in one batch will not affect other batches within the same + request. + + + For each object, its `updated_at` field is ignored and replaced + with a current + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), + and its + + `is_deleted` field must not be set to `true`. + + + To modify an existing object, supply its ID. To create a new + object, use an ID starting + + with `#`. These IDs may be used to create relationships between + an object and attributes of + + other objects that reference it. For example, you can create a + CatalogItem with + + ID `#ABC` and a CatalogItemVariation with its `item_id` + attribute set to + + `#ABC` in order to associate the CatalogItemVariation with its + parent + + CatalogItem. + + + Any `#`-prefixed IDs are valid only within a single atomic + batch, and will be replaced by server-generated IDs. + + + Each batch may contain up to 1,000 objects. The total number of + objects across all batches for a single request + + may not exceed 10,000. If either of these limits is violated, an + error will be returned and no objects will + + be inserted or updated. + type: list + content-type: application/json + response: + docs: Success + type: root.BatchUpsertCatalogObjectsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 789ff020-f723-43a9-b4b5-43b5dc1fa3dc + batches: + - objects: + - id: id + type: ITEM + - id: id + type: ITEM + - id: id + type: ITEM + - id: id + type: TAX + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + ordinal: 1000000 + type: CATEGORY + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: TAX + updated_at: updated_at + id_mappings: + - client_object_id: '#Tea' + object_id: 67GA7XA2FWMRYY2VCONTYZJR + - client_object_id: '#Coffee' + object_id: MQ4TZKOG3SR2EQI3TWEK4AH7 + - client_object_id: '#Beverages' + object_id: XCS4SCGN4WQYE2VU4U3TKXEH + - client_object_id: '#SalesTax' + object_id: HP5VNYPKZKTNCKZ2Z5NPUH6A + - client_object_id: '#Tea_Mug' + object_id: CAJBHUIQH7ONTSZI2KTVOUP6 + - client_object_id: '#Coffee_Regular' + object_id: GY2GXJTVVPQAPW43GFRR3NG6 + - client_object_id: '#Coffee_Large' + object_id: JE6VHPSRQL6IWSN26C36CJ7W + info: + path: /v2/catalog/info + method: GET + auth: + - oauth2: + - ITEMS_READ + docs: |- + Retrieves information about the Square Catalog API, such as batch size + limits that can be used by the `BatchUpsertCatalogObjects` endpoint. + source: + openapi: openapi/openapi.json + display-name: CatalogInfo + response: + docs: Success + type: root.CatalogInfoResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + limits: + batch_upsert_max_objects_per_batch: 1000 + batch_upsert_max_total_objects: 10000 + batch_retrieve_max_object_ids: 1000 + search_max_page_limit: 1000 + batch_delete_max_object_ids: 200 + update_item_taxes_max_item_ids: 1000 + update_item_taxes_max_taxes_to_enable: 1000 + update_item_taxes_max_taxes_to_disable: 1000 + update_item_modifier_lists_max_item_ids: 1000 + update_item_modifier_lists_max_modifier_lists_to_enable: 1000 + update_item_modifier_lists_max_modifier_lists_to_disable: 1000 + standard_unit_description_group: + standard_unit_descriptions: + - {} + language_code: language_code + list: + path: /v2/catalog/list + method: GET + auth: + - oauth2: + - ITEMS_READ + docs: >- + Returns a list of all [CatalogObject](entity:CatalogObject)s of the + specified types in the catalog. + + + The `types` parameter is specified as a comma-separated list of the + [CatalogObjectType](entity:CatalogObjectType) values, + + for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, + `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". + + + __Important:__ ListCatalog does not return deleted catalog items. To + retrieve + + deleted catalog items, use + [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) + + and set the `include_deleted_objects` attribute value to `true`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.objects + source: + openapi: openapi/openapi.json + display-name: ListCatalog + request: + name: ListCatalogRequest + query-parameters: + cursor: + type: optional> + docs: >- + The pagination cursor returned in the previous response. Leave + unset for an initial request. + + The page size is currently set to be 100. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + types: + type: optional> + docs: >- + An optional case-insensitive, comma-separated list of object types + to retrieve. + + + The valid values are defined in the + [CatalogObjectType](entity:CatalogObjectType) enum, for example, + + `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, + + `MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc. + + + If this is unspecified, the operation returns objects of all the + top level types at the version + + of the Square API used to make the request. Object types that are + nested onto other object types + + are not included in the defaults. + + + At the current API version the default object types are: + + ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, + + PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, + + SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, + QUICK_AMOUNT_SETTINGS. + catalog_version: + type: optional> + docs: >- + The specific version of the catalog objects to be included in the + response. + + This allows you to retrieve historical versions of objects. The + specified version value is matched against + + the [CatalogObject](entity:CatalogObject)s' `version` attribute. + If not included, results will be from the + + current version of the catalog. + response: + docs: Success + type: root.ListCatalogResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + types: types + catalog_version: 1000000 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cursor: cursor + objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + ordinal: 1000000 + type: CATEGORY + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: TAX + search: + path: /v2/catalog/search + method: POST + auth: + - oauth2: + - ITEMS_READ + docs: >- + Searches for [CatalogObject](entity:CatalogObject) of any type by + matching supported search attribute values, + + excluding custom attribute values on items or item variations, against + one or more of the specified query filters. + + + This (`SearchCatalogObjects`) endpoint differs from the + [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + + endpoint in the following aspects: + + + - `SearchCatalogItems` can only search for items or item variations, + whereas `SearchCatalogObjects` can search for any type of catalog + objects. + + - `SearchCatalogItems` supports the custom attribute query filters to + return items or item variations that contain custom attribute values, + where `SearchCatalogObjects` does not. + + - `SearchCatalogItems` does not support the `include_deleted_objects` + filter to search for deleted items or item variations, whereas + `SearchCatalogObjects` does. + + - The both endpoints have different call conventions, including the + query filter formats. + source: + openapi: openapi/openapi.json + display-name: SearchCatalogObjects + request: + name: SearchCatalogObjectsRequest + body: + properties: + cursor: + type: optional + docs: >- + The pagination cursor returned in the previous response. Leave + unset for an initial request. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + object_types: + type: optional> + docs: >- + The desired set of object types to appear in the search results. + + + If this is unspecified, the operation returns objects of all the + top level types at the version + + of the Square API used to make the request. Object types that + are nested onto other object types + + are not included in the defaults. + + + At the current API version the default object types are: + + ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, + + PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, + + SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, + QUICK_AMOUNT_SETTINGS. + + + Note that if you wish for the query to return objects belonging + to nested types (i.e., COMPONENT, IMAGE, + + ITEM_OPTION_VAL, ITEM_VARIATION, or MODIFIER), you must + explicitly include all the types of interest + + in this field. + include_deleted_objects: + type: optional + docs: >- + If `true`, deleted objects will be included in the results. + Defaults to `false`. Deleted objects will have their + `is_deleted` field set to `true`. If `include_deleted_objects` + is `true`, then the `include_category_path_to_root` request + parameter must be `false`. Both properties cannot be `true` at + the same time. + include_related_objects: + type: optional + docs: >- + If `true`, the response will include additional objects that are + related to the + + requested objects. Related objects are objects that are + referenced by object ID by the objects + + in the response. This is helpful if the objects are being + fetched for immediate display to a user. + + This process only goes one level deep. Objects referenced by the + related objects will not be included. + + For example: + + + If the `objects` field of the response contains a CatalogItem, + its associated + + CatalogCategory objects, CatalogTax objects, CatalogImage + objects and + + CatalogModifierLists will be returned in the `related_objects` + field of the + + response. If the `objects` field of the response contains a + CatalogItemVariation, + + its parent CatalogItem will be returned in the `related_objects` + field of + + the response. + + + Default value: `false` + begin_time: + type: optional + docs: >- + Return objects modified after this + [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), + in RFC 3339 + + format, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is + exclusive - objects with a + + timestamp equal to `begin_time` will not be included in the + response. + query: + type: optional + docs: >- + A query to be used to filter or sort the results. If no query is + specified, the entire catalog will be returned. + limit: + type: optional + docs: >- + A limit on the number of results to be returned in a single + page. The limit is advisory - + + the implementation may return more or fewer results. If the + supplied limit is negative, zero, or + + is higher than the maximum limit of 1,000, it will be ignored. + include_category_path_to_root: + type: optional + docs: >- + Specifies whether or not to include the `path_to_root` list for + each returned category instance. The `path_to_root` list + consists of `CategoryPathToRootNode` objects and specifies the + path that starts with the immediate parent category of the + returned category and ends with its root category. If the + returned category is a top-level category, the `path_to_root` + list is empty and is not returned in the response payload. If + `include_category_path_to_root` is `true`, then the + `include_deleted_objects` request parameter must be `false`. + Both properties cannot be `true` at the same time. + content-type: application/json + response: + docs: Success + type: root.SearchCatalogObjectsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + object_types: + - ITEM + query: + prefix_query: + attribute_name: name + attribute_prefix: tea + limit: 100 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cursor: cursor + objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + related_objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + latest_time: latest_time + SearchItems: + path: /v2/catalog/search-catalog-items + method: POST + auth: + - oauth2: + - ITEMS_READ + docs: >- + Searches for catalog items or item variations by matching supported + search attribute values, including + + custom attribute values, against one or more of the specified query + filters. + + + This (`SearchCatalogItems`) endpoint differs from the + [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) + + endpoint in the following aspects: + + + - `SearchCatalogItems` can only search for items or item variations, + whereas `SearchCatalogObjects` can search for any type of catalog + objects. + + - `SearchCatalogItems` supports the custom attribute query filters to + return items or item variations that contain custom attribute values, + where `SearchCatalogObjects` does not. + + - `SearchCatalogItems` does not support the `include_deleted_objects` + filter to search for deleted items or item variations, whereas + `SearchCatalogObjects` does. + + - The both endpoints use different call conventions, including the query + filter formats. + source: + openapi: openapi/openapi.json + display-name: SearchCatalogItems + request: + name: SearchCatalogItemsRequest + body: + properties: + text_filter: + type: optional + docs: >- + The text filter expression to return items or item variations + containing specified text in + + the `name`, `description`, or `abbreviation` attribute value of + an item, or in + + the `name`, `sku`, or `upc` attribute value of an item + variation. + category_ids: + type: optional> + docs: >- + The category id query expression to return items containing the + specified category IDs. + stock_levels: + type: optional> + docs: >- + The stock-level query expression to return item variations with + the specified stock levels. + + See + [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) + for possible values + enabled_location_ids: + type: optional> + docs: >- + The enabled-location query expression to return items and item + variations having specified enabled locations. + cursor: + type: optional + docs: >- + The pagination token, returned in the previous response, used to + fetch the next batch of pending results. + limit: + type: optional + docs: >- + The maximum number of results to return per page. The default + value is 100. + validation: + max: 100 + sort_order: + type: optional + docs: >- + The order to sort the results by item names. The default sort + order is ascending (`ASC`). + + See [SortOrder](#type-sortorder) for possible values + product_types: + type: optional> + docs: >- + The product types query expression to return items or item + variations having the specified product types. + custom_attribute_filters: + type: optional> + docs: >- + The customer-attribute filter to return items or item variations + matching the specified + + custom attribute expressions. A maximum number of 10 custom + attribute expressions are supported in + + a single call to the + [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) + endpoint. + archived_state: + type: optional + docs: >- + The query filter to return not archived + (`ARCHIVED_STATE_NOT_ARCHIVED`), archived + (`ARCHIVED_STATE_ARCHIVED`), or either type + (`ARCHIVED_STATE_ALL`) of items. + content-type: application/json + response: + docs: Success + type: root.SearchCatalogItemsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + text_filter: red + category_ids: + - WINE_CATEGORY_ID + stock_levels: + - OUT + - LOW + enabled_location_ids: + - ATL_LOCATION_ID + limit: 100 + sort_order: ASC + product_types: + - REGULAR + custom_attribute_filters: + - custom_attribute_definition_id: VEGAN_DEFINITION_ID + bool_filter: true + - custom_attribute_definition_id: BRAND_DEFINITION_ID + string_filter: Dark Horse + - key: VINTAGE + number_filter: + min: min + max: max + - custom_attribute_definition_id: VARIETAL_DEFINITION_ID + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + items: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: ITEM + cursor: cursor + matched_variation_ids: + - VBJNPHCOKDFECR6VU25WRJUD + UpdateItemModifierLists: + path: /v2/catalog/update-item-modifier-lists + method: POST + auth: + - oauth2: + - ITEMS_WRITE + docs: >- + Updates the [CatalogModifierList](entity:CatalogModifierList) objects + + that apply to the targeted [CatalogItem](entity:CatalogItem) without + having + + to perform an upsert on the entire item. + source: + openapi: openapi/openapi.json + display-name: UpdateItemModifierLists + request: + name: UpdateItemModifierListsRequest + body: + properties: + item_ids: + docs: >- + The IDs of the catalog items associated with the + CatalogModifierList objects being updated. + type: list + modifier_lists_to_enable: + type: optional>> + docs: >- + The IDs of the CatalogModifierList objects to enable for the + CatalogItem. + + At least one of `modifier_lists_to_enable` or + `modifier_lists_to_disable` must be specified. + modifier_lists_to_disable: + type: optional>> + docs: >- + The IDs of the CatalogModifierList objects to disable for the + CatalogItem. + + At least one of `modifier_lists_to_enable` or + `modifier_lists_to_disable` must be specified. + content-type: application/json + response: + docs: Success + type: root.UpdateItemModifierListsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + item_ids: + - H42BRLUJ5KTZTTMPVSLFAACQ + - 2JXOBJIHCWBQ4NZ3RIXQGJA6 + modifier_lists_to_enable: + - H42BRLUJ5KTZTTMPVSLFAACQ + - 2JXOBJIHCWBQ4NZ3RIXQGJA6 + modifier_lists_to_disable: + - 7WRC16CJZDVLSNDQ35PP6YAD + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + updated_at: '2016-11-16T22:25:24.878Z' + UpdateItemTaxes: + path: /v2/catalog/update-item-taxes + method: POST + auth: + - oauth2: + - ITEMS_WRITE + docs: |- + Updates the [CatalogTax](entity:CatalogTax) objects that apply to the + targeted [CatalogItem](entity:CatalogItem) without having to perform an + upsert on the entire item. + source: + openapi: openapi/openapi.json + display-name: UpdateItemTaxes + request: + name: UpdateItemTaxesRequest + body: + properties: + item_ids: + docs: >- + IDs for the CatalogItems associated with the CatalogTax objects + being updated. + + No more than 1,000 IDs may be provided. + type: list + taxes_to_enable: + type: optional>> + docs: >- + IDs of the CatalogTax objects to enable. + + At least one of `taxes_to_enable` or `taxes_to_disable` must be + specified. + taxes_to_disable: + type: optional>> + docs: >- + IDs of the CatalogTax objects to disable. + + At least one of `taxes_to_enable` or `taxes_to_disable` must be + specified. + content-type: application/json + response: + docs: Success + type: root.UpdateItemTaxesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + item_ids: + - H42BRLUJ5KTZTTMPVSLFAACQ + - 2JXOBJIHCWBQ4NZ3RIXQGJA6 + taxes_to_enable: + - 4WRCNHCJZDVLSNDQ35PP6YAD + taxes_to_disable: + - AQCEGCEBBQONINDOHRGZISEX + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + updated_at: '2016-11-16T22:25:24.878Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/catalog/images.yml b/.mock/definition/catalog/images.yml new file mode 100644 index 000000000..80297023a --- /dev/null +++ b/.mock/definition/catalog/images.yml @@ -0,0 +1,152 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/catalog/images + method: POST + auth: + - oauth2: + - ITEMS_WRITE + docs: >- + Uploads an image file to be represented by a + [CatalogImage](entity:CatalogImage) object that can be linked to an + existing + + [CatalogObject](entity:CatalogObject) instance. The resulting + `CatalogImage` is unattached to any `CatalogObject` if the `object_id` + + is not specified. + + + This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data + requests with a JSON part and an image file part in + + JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. + source: + openapi: openapi/openapi.json + display-name: CreateCatalogImage + request: + name: CreateImagesRequest + body: + properties: + request: + type: optional + content-type: application/json; charset=utf-8 + image_file: + type: optional + content-type: image/jpeg + content-type: multipart/form-data + response: + docs: Success + type: root.CreateCatalogImageResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + image: + id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + image_data: + name: name + url: url + caption: caption + photo_studio_order_id: photo_studio_order_id + type: IMAGE + update: + path: /v2/catalog/images/{image_id} + method: PUT + auth: + - oauth2: + - ITEMS_WRITE + docs: >- + Uploads a new image file to replace the existing one in the specified + [CatalogImage](entity:CatalogImage) object. + + + This `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data + requests with a JSON part and an image file part in + + JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. + source: + openapi: openapi/openapi.json + display-name: UpdateCatalogImage + request: + name: UpdateImagesRequest + path-parameters: + image_id: + type: string + docs: >- + The ID of the `CatalogImage` object to update the encapsulated + image file. + body: + properties: + request: + type: optional + content-type: application/json; charset=utf-8 + image_file: + type: optional + content-type: image/jpeg + content-type: multipart/form-data + response: + docs: Success + type: root.UpdateCatalogImageResponse + status-code: 200 + examples: + - path-parameters: + image_id: image_id + headers: + Square-Version: '2025-10-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + image: + id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + image_data: + name: name + url: url + caption: caption + photo_studio_order_id: photo_studio_order_id + type: IMAGE + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/catalog/object.yml b/.mock/definition/catalog/object.yml new file mode 100644 index 000000000..726678fcc --- /dev/null +++ b/.mock/definition/catalog/object.yml @@ -0,0 +1,400 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + upsert: + path: /v2/catalog/object + method: POST + auth: + - oauth2: + - ITEMS_WRITE + docs: >- + Creates a new or updates the specified + [CatalogObject](entity:CatalogObject). + + + To ensure consistency, only one update request is processed at a time + per seller account. + + While one (batch or non-batch) update request is being processed, other + (batched and non-batched) + + update requests are rejected with the `429` error code. + source: + openapi: openapi/openapi.json + display-name: UpsertCatalogObject + request: + name: UpsertCatalogObjectRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A value you specify that uniquely identifies this + + request among all your requests. A common way to create + + a valid idempotency key is to use a Universally unique + + identifier (UUID). + + + If you're unsure whether a particular request was successful, + + you can reattempt it with the same idempotency key without + + worrying about creating duplicate objects. + + + See + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 128 + object: + type: root.CatalogObject + docs: >- + A CatalogObject to be created or updated. + + + - For updates, the object must be active (the `is_deleted` field + is not `true`). + + - For creates, the object ID must start with `#`. The provided + ID is replaced with a server-generated ID. + content-type: application/json + response: + docs: Success + type: root.UpsertCatalogObjectResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: af3d1afc-7212-4300-b463-0bfc5314a5ae + object: + id: id + type: ITEM + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + catalog_object: + id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + item_data: + name: name + description: description + abbreviation: abbreviation + label_color: label_color + is_taxable: true + category_id: category_id + tax_ids: + - tax_ids + modifier_list_info: + - modifier_list_id: modifier_list_id + product_type: REGULAR + skip_modifier_screen: true + item_options: + - {} + ecom_uri: ecom_uri + ecom_image_uris: + - ecom_image_uris + image_ids: + - image_ids + sort_name: sort_name + description_html: description_html + description_plaintext: description_plaintext + channels: + - channels + is_archived: true + is_alcoholic: true + type: ITEM + id_mappings: + - client_object_id: '#Cocoa' + object_id: R2TA2FOBUGCJZNIWJSOSNAI4 + - client_object_id: '#Small' + object_id: QRT53UP4LITLWGOGBZCUWP63 + - client_object_id: '#Large' + object_id: NS77DKEIQ3AEQTCP727DSA7U + get: + path: /v2/catalog/object/{object_id} + method: GET + auth: + - oauth2: + - ITEMS_READ + docs: >- + Returns a single [CatalogItem](entity:CatalogItem) as a + + [CatalogObject](entity:CatalogObject) based on the provided ID. The + returned + + object includes all of the relevant [CatalogItem](entity:CatalogItem) + + information including: + [CatalogItemVariation](entity:CatalogItemVariation) + + children, references to its + + [CatalogModifierList](entity:CatalogModifierList) objects, and the ids + of + + any [CatalogTax](entity:CatalogTax) objects that apply to it. + source: + openapi: openapi/openapi.json + display-name: RetrieveCatalogObject + request: + name: GetObjectRequest + path-parameters: + object_id: + type: string + docs: The object ID of any type of catalog objects to be retrieved. + query-parameters: + include_related_objects: + type: optional> + default: false + docs: >- + If `true`, the response will include additional objects that are + related to the + + requested objects. Related objects are defined as any objects + referenced by ID by the results in the `objects` field + + of the response. These objects are put in the `related_objects` + field. Setting this to `true` is + + helpful when the objects are needed for immediate display to a + user. + + This process only goes one level deep. Objects referenced by the + related objects will not be included. For example, + + + if the `objects` field of the response contains a CatalogItem, its + associated + + CatalogCategory objects, CatalogTax objects, CatalogImage objects + and + + CatalogModifierLists will be returned in the `related_objects` + field of the + + response. If the `objects` field of the response contains a + CatalogItemVariation, + + its parent CatalogItem will be returned in the `related_objects` + field of + + the response. + + + Default value: `false` + catalog_version: + type: optional> + docs: >- + Requests objects as of a specific version of the catalog. This + allows you to retrieve historical + + versions of objects. The value to retrieve a specific version of + an object can be found + + in the version field of [CatalogObject](entity:CatalogObject)s. If + not included, results will + + be from the current version of the catalog. + include_category_path_to_root: + type: optional> + default: false + docs: >- + Specifies whether or not to include the `path_to_root` list for + each returned category instance. The `path_to_root` list consists + + of `CategoryPathToRootNode` objects and specifies the path that + starts with the immediate parent category of the returned category + + and ends with its root category. If the returned category is a + top-level category, the `path_to_root` list is empty and is not + returned + + in the response payload. + response: + docs: Success + type: root.GetCatalogObjectResponse + status-code: 200 + examples: + - path-parameters: + object_id: object_id + query-parameters: + include_related_objects: true + catalog_version: 1000000 + include_category_path_to_root: true + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + object: + id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + item_data: + name: name + description: description + abbreviation: abbreviation + label_color: label_color + is_taxable: true + category_id: category_id + tax_ids: + - tax_ids + modifier_list_info: + - modifier_list_id: modifier_list_id + product_type: REGULAR + skip_modifier_screen: true + item_options: + - {} + ecom_uri: ecom_uri + ecom_image_uris: + - ecom_image_uris + image_ids: + - image_ids + sort_name: sort_name + description_html: description_html + description_plaintext: description_plaintext + channels: + - channels + is_archived: true + is_alcoholic: true + type: ITEM + related_objects: + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + ordinal: 1000000 + type: CATEGORY + - id: id + updated_at: updated_at + version: 1000000 + is_deleted: true + custom_attribute_values: + key: {} + catalog_v1_ids: + - {} + present_at_all_locations: true + present_at_location_ids: + - present_at_location_ids + absent_at_location_ids: + - absent_at_location_ids + image_id: image_id + type: TAX + delete: + path: /v2/catalog/object/{object_id} + method: DELETE + auth: + - oauth2: + - ITEMS_WRITE + docs: >- + Deletes a single [CatalogObject](entity:CatalogObject) based on the + + provided ID and returns the set of successfully deleted IDs in the + response. + + Deletion is a cascading event such that all children of the targeted + object + + are also deleted. For example, deleting a + [CatalogItem](entity:CatalogItem) + + will also delete all of its + + [CatalogItemVariation](entity:CatalogItemVariation) children. + + + To ensure consistency, only one delete request is processed at a time + per seller account. + + While one (batch or non-batch) delete request is being processed, other + (batched and non-batched) + + delete requests are rejected with the `429` error code. + source: + openapi: openapi/openapi.json + display-name: DeleteCatalogObject + request: + name: DeleteObjectRequest + path-parameters: + object_id: + type: string + docs: >- + The ID of the catalog object to be deleted. When an object is + deleted, other + + objects in the graph that depend on that object will be deleted as + well (for example, deleting a + + catalog item will delete its catalog item variations). + response: + docs: Success + type: root.DeleteCatalogObjectResponse + status-code: 200 + examples: + - path-parameters: + object_id: object_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + deleted_object_ids: + - 7SB3ZQYJ5GDMVFL7JK46JCHT + - KQLFFHA6K6J3YQAQAWDQAL57 + deleted_at: '2016-11-16T22:25:24.878Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/channels.yml b/.mock/definition/channels.yml new file mode 100644 index 000000000..e7c43d321 --- /dev/null +++ b/.mock/definition/channels.yml @@ -0,0 +1,189 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/channels + method: GET + auth: + - oauth2: + - CHANNELS_READ + docs: '' + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.channels + source: + openapi: openapi/openapi.json + display-name: ListChannels + request: + name: ListChannelsRequest + query-parameters: + reference_type: + type: optional> + docs: Type of reference associated to channel + reference_id: + type: optional> + docs: id of reference associated to channel + status: + type: optional> + docs: Status of channel + cursor: + type: optional> + docs: Cursor to fetch the next result + limit: + type: optional> + docs: >- + Maximum number of results to return. + + When not provided the returned results will be cap at 100 + channels. + response: + docs: Success + type: root.ListChannelsResponse + status-code: 200 + examples: + - query-parameters: + reference_type: UNKNOWN_TYPE + reference_id: reference_id + status: ACTIVE + cursor: cursor + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + channels: + - id: CH_9C03D0B59 + merchant_id: ML64FACEA + name: Contoso Fulfillment Application + version: 1 + reference: + type: OAUTH_APPLICATION + id: OA_9C03D0444 + status: ACTIVE + created_at: '2022-10-25T16:27:00Z' + updated_at: '2022-10-25T16:48:00Z' + cursor: cursor + bulkRetrieve: + path: /v2/channels/bulk-retrieve + method: POST + auth: + - oauth2: + - CHANNELS_READ + docs: '' + source: + openapi: openapi/openapi.json + display-name: BulkRetrieveChannels + request: + name: BulkRetrieveChannelsRequest + body: + properties: + channel_ids: list + content-type: application/json + response: + docs: Success + type: root.BulkRetrieveChannelsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + channel_ids: + - CH_9C03D0B59 + - CH_6X139B5MN + - NOT_EXISTING + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + responses: + CH_6X139B5MN: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + channel: + id: CH_6X139B5MN + merchant_id: ML64FACEA + name: Contoso Fulfillment Application + version: 1 + reference: + type: OAUTH_APPLICATION + id: OA_9C03D0444 + status: ACTIVE + created_at: '2022-10-25T16:27:00Z' + updated_at: '2022-10-25T16:48:00Z' + CH_9C03D0B59: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + channel: + id: CH_9C03D0B59 + merchant_id: ML64FACEA + name: State Street Store + version: 1 + reference: + type: LOCATION + id: OA_9C03D0B59 + status: ACTIVE + created_at: '2022-10-25T16:27:00Z' + updated_at: '2022-10-25T16:48:00Z' + NOT_EXISTING: + errors: + - category: API_ERROR + code: NOT_FOUND + get: + path: /v2/channels/{channel_id} + method: GET + auth: + - oauth2: + - CHANNELS_READ + docs: '' + source: + openapi: openapi/openapi.json + display-name: RetrieveChannel + request: + name: GetChannelsRequest + path-parameters: + channel_id: + type: string + docs: A channel id + response: + docs: Success + type: root.RetrieveChannelResponse + status-code: 200 + examples: + - path-parameters: + channel_id: channel_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + channel: + id: CH_9C03D0B59 + merchant_id: ML64FACEA + name: Contoso Fulfillment Application + version: 1 + reference: + type: OAUTH_APPLICATION + id: OA_9C03D0444 + status: ACTIVE + created_at: '2022-10-25T16:27:00Z' + updated_at: '2022-10-25T16:48:00Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/checkout.yml b/.mock/definition/checkout.yml new file mode 100644 index 000000000..4283cf086 --- /dev/null +++ b/.mock/definition/checkout.yml @@ -0,0 +1,241 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + RetrieveLocationSettings: + path: /v2/online-checkout/location-settings/{location_id} + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: Retrieves the location-level settings for a Square-hosted checkout page. + source: + openapi: openapi/openapi.json + display-name: RetrieveLocationSettings + request: + name: RetrieveLocationSettingsRequest + path-parameters: + location_id: + type: string + docs: The ID of the location for which to retrieve settings. + response: + docs: Success + type: root.RetrieveLocationSettingsResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + location_settings: + location_id: LOCATION_ID_1 + customer_notes_enabled: true + policies: + - uid: POLICY_ID_1 + title: Return Policy + description: This is my Return Policy + branding: + header_type: FRAMED_LOGO + button_color: '#ffffff' + button_shape: ROUNDED + tipping: + percentages: + - 10 + - 15 + - 20 + smart_tipping_enabled: true + default_percent: 15 + smart_tips: + - {} + coupons: + enabled: true + updated_at: '2022-06-16T22:25:35Z' + UpdateLocationSettings: + path: /v2/online-checkout/location-settings/{location_id} + method: PUT + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + - MERCHANT_PROFILE_READ + docs: Updates the location-level settings for a Square-hosted checkout page. + source: + openapi: openapi/openapi.json + display-name: UpdateLocationSettings + request: + name: UpdateLocationSettingsRequest + path-parameters: + location_id: + type: string + docs: The ID of the location for which to retrieve settings. + body: + properties: + location_settings: + type: root.CheckoutLocationSettings + docs: >- + Describe your updates using the `location_settings` object. Make + sure it contains only the fields that have changed. + content-type: application/json + response: + docs: Success + type: root.UpdateLocationSettingsResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-10-16' + request: + location_settings: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + location_settings: + location_id: LOCATION_ID_1 + customer_notes_enabled: false + policies: + - uid: POLICY_ID_1 + title: Return Policy + description: This is my Return Policy + - uid: POLICY_ID_2 + title: Return Policy + description: Items may be returned within 30 days of purchase. + branding: + header_type: FRAMED_LOGO + button_color: '#00b23b' + button_shape: ROUNDED + tipping: + percentages: + - 15 + - 20 + - 25 + smart_tipping_enabled: true + default_percent: 20 + smart_tips: + - {} + coupons: + enabled: true + updated_at: '2022-06-16T22:25:35Z' + RetrieveMerchantSettings: + path: /v2/online-checkout/merchant-settings + method: GET + auth: + - oauth2: + - PAYMENT_METHODS_READ + - MERCHANT_PROFILE_READ + docs: Retrieves the merchant-level settings for a Square-hosted checkout page. + source: + openapi: openapi/openapi.json + display-name: RetrieveMerchantSettings + response: + docs: Success + type: root.RetrieveMerchantSettingsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + merchant_settings: + payment_methods: + apple_pay: + enabled: true + google_pay: + enabled: true + afterpay_clearpay: + order_eligibility_range: + min: + amount: 100 + currency: USD + max: + amount: 10000 + currency: USD + item_eligibility_range: + min: + amount: 100 + currency: USD + max: + amount: 10000 + currency: USD + enabled: true + updated_at: '2022-06-16T22:25:35Z' + UpdateMerchantSettings: + path: /v2/online-checkout/merchant-settings + method: PUT + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + - PAYMENT_METHODS_READ + - MERCHANT_PROFILE_READ + docs: Updates the merchant-level settings for a Square-hosted checkout page. + source: + openapi: openapi/openapi.json + display-name: UpdateMerchantSettings + request: + name: UpdateMerchantSettingsRequest + body: + properties: + merchant_settings: + type: root.CheckoutMerchantSettings + docs: >- + Describe your updates using the `merchant_settings` object. Make + sure it contains only the fields that have changed. + content-type: application/json + response: + docs: Success + type: root.UpdateMerchantSettingsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + merchant_settings: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + merchant_settings: + payment_methods: + apple_pay: + enabled: false + google_pay: + enabled: true + afterpay_clearpay: + order_eligibility_range: + min: + amount: 100 + currency: USD + max: + amount: 10000 + currency: USD + item_eligibility_range: + min: + amount: 100 + currency: USD + max: + amount: 10000 + currency: USD + enabled: true + updated_at: '2022-06-16T22:25:35Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/checkout/paymentLinks.yml b/.mock/definition/checkout/paymentLinks.yml new file mode 100644 index 000000000..4356a597f --- /dev/null +++ b/.mock/definition/checkout/paymentLinks.yml @@ -0,0 +1,466 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/online-checkout/payment-links + method: GET + auth: + - oauth2: + - ORDERS_READ + docs: Lists all payment links. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.payment_links + source: + openapi: openapi/openapi.json + display-name: ListPaymentLinks + request: + name: ListPaymentLinksRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + If a cursor is not provided, the endpoint returns the first page + of the results. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + A limit on the number of results to return per page. The limit is + advisory and + + the implementation might return more or less results. If the + supplied limit is negative, zero, or + + greater than the maximum limit of 1000, it is ignored. + + + Default value: `100` + response: + docs: Success + type: root.ListPaymentLinksResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment_links: + - id: TN4BWEDJ9AI5MBIV + version: 2 + description: description + order_id: Qqc6yppGvxVwc46Cch4zHTaJqc4F + checkout_options: + ask_for_shipping_address: true + url: https://square.link/u/EXAMPLE + long_url: long_url + created_at: '2022-04-26T00:15:15Z' + updated_at: '2022-04-26T00:18:24Z' + payment_note: test + - id: RY5UNCUMPJN5XKCT + version: 1 + description: '' + order_id: EmBmGt3zJD15QeO1dxzBTxMxtwfZY + url: https://square.link/u/EXAMPLE + long_url: long_url + created_at: '2022-04-11T23:14:59Z' + updated_at: updated_at + payment_note: payment_note + cursor: MTY1NQ== + create: + path: /v2/online-checkout/payment-links + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + - ORDERS_READ + - ORDERS_WRITE + docs: >- + Creates a Square-hosted checkout page. Applications can share the + resulting payment link with their buyer to pay for goods and services. + source: + openapi: openapi/openapi.json + display-name: CreatePaymentLink + request: + name: CreatePaymentLinkRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies this `CreatePaymentLinkRequest` + request. + + If you do not provide a unique string (or provide an empty + string as the value), + + the endpoint treats each request as independent. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + maxLength: 192 + description: + type: optional + docs: >- + A description of the payment link. You provide this optional + description that is useful in your + + application context. It is not used anywhere. + validation: + maxLength: 4096 + quick_pay: + type: optional + docs: >- + Describes an ad hoc item and price for which to generate a quick + pay checkout link. + + For more information, + + see [Quick Pay + Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout). + order: + type: optional + docs: >- + Describes the `Order` for which to create a checkout link. + + For more information, + + see [Square Order + Checkout](https://developer.squareup.com/docs/checkout-api/square-order-checkout). + checkout_options: + type: optional + docs: >- + Describes optional fields to add to the resulting checkout page. + + For more information, + + see [Optional Checkout + Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). + pre_populated_data: + type: optional + docs: >- + Describes fields to prepopulate in the resulting checkout page. + + For more information, see [Prepopulate the shipping + address](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#prepopulate-the-shipping-address). + payment_note: + type: optional + docs: >- + A note for the payment. After processing the payment, Square + adds this note to the resulting `Payment`. + validation: + maxLength: 500 + content-type: application/json + response: + docs: Success + type: root.CreatePaymentLinkResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: cd9e25dc-d9f2-4430-aedb-61605070e95f + quick_pay: + name: Auto Detailing + price_money: + amount: 10000 + currency: USD + location_id: A9Y43N9ABXZBP + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment_link: + id: PKVT6XGJZXYUP3NZ + version: 1 + description: description + order_id: o4b7saqp4HzhNttf5AJxC0Srjd4F + checkout_options: + allow_tipping: true + custom_fields: + - title: title + subscription_plan_id: subscription_plan_id + redirect_url: redirect_url + merchant_support_email: merchant_support_email + ask_for_shipping_address: true + shipping_fee: + charge: {} + enable_coupon: true + enable_loyalty: true + pre_populated_data: + buyer_email: buyer_email + buyer_phone_number: buyer_phone_number + url: https://square.link/u/EXAMPLE + long_url: https://checkout.square.site/EXAMPLE + created_at: '2022-04-25T23:58:01Z' + updated_at: updated_at + payment_note: payment_note + related_resources: + orders: + - id: o4b7saqp4HzhNttf5AJxC0Srjd4F + location_id: '{LOCATION_ID}' + source: + name: Test Online Checkout Application + line_items: + - uid: 8YX13D1U3jO7czP8JVrAR + name: Auto Detailing + quantity: '1' + item_type: ITEM + base_price_money: + amount: 12500 + currency: USD + variation_total_price_money: + amount: 12500 + currency: USD + gross_sales_money: + amount: 12500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_money: + amount: 12500 + currency: USD + fulfillments: + - uid: bBpNrxjdQxGQP16sTmdzi + type: PICKUP + state: PROPOSED + net_amounts: + total_money: + amount: 12500 + currency: USD + tax_money: + amount: 0 + currency: USD + discount_money: + amount: 0 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + created_at: '2022-03-03T00:53:15.829Z' + updated_at: '2022-03-03T00:53:15.829Z' + state: DRAFT + version: 1 + total_money: + amount: 12500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_tip_money: + amount: 0 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + subscription_plans: + - id: id + type: ITEM + get: + path: /v2/online-checkout/payment-links/{id} + method: GET + auth: + - oauth2: + - ORDERS_READ + docs: Retrieves a payment link. + source: + openapi: openapi/openapi.json + display-name: RetrievePaymentLink + request: + name: GetPaymentLinksRequest + path-parameters: + id: + type: string + docs: The ID of link to retrieve. + response: + docs: Success + type: root.GetPaymentLinkResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment_link: + id: LLO5Q3FRCFICDB4B + version: 1 + description: description + order_id: 4uKASDATqSd1QQ9jV86sPhMdVEbSJc4F + checkout_options: + allow_tipping: true + custom_fields: + - title: title + subscription_plan_id: subscription_plan_id + redirect_url: redirect_url + merchant_support_email: merchant_support_email + ask_for_shipping_address: true + shipping_fee: + charge: {} + enable_coupon: true + enable_loyalty: true + pre_populated_data: + buyer_email: buyer_email + buyer_phone_number: buyer_phone_number + url: https://square.link/u/EXAMPLE + long_url: https://checkout.square.site/EXAMPLE + created_at: '2022-04-26T00:10:29Z' + updated_at: updated_at + payment_note: payment_note + update: + path: /v2/online-checkout/payment-links/{id} + method: PUT + auth: + - oauth2: + - PAYMENTS_WRITE + - ORDERS_READ + - ORDERS_WRITE + docs: >- + Updates a payment link. You can update the `payment_link` fields such as + + `description`, `checkout_options`, and `pre_populated_data`. + + You cannot update other fields such as the `order_id`, `version`, `URL`, + or `timestamp` field. + source: + openapi: openapi/openapi.json + display-name: UpdatePaymentLink + request: + name: UpdatePaymentLinkRequest + path-parameters: + id: + type: string + docs: The ID of the payment link to update. + body: + properties: + payment_link: + type: root.PaymentLink + docs: >- + The `payment_link` object describing the updates to apply. + + For more information, see [Update a payment + link](https://developer.squareup.com/docs/checkout-api/manage-checkout#update-a-payment-link). + content-type: application/json + response: + docs: Success + type: root.UpdatePaymentLinkResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + request: + payment_link: + version: 1 + checkout_options: + ask_for_shipping_address: true + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment_link: + id: TY4BWEDJ6AI5MBIV + version: 2 + description: description + order_id: Qqc8ypQGvxVwc46Cch4zHTaJqc4F + checkout_options: + allow_tipping: true + custom_fields: + - title: title + subscription_plan_id: subscription_plan_id + redirect_url: redirect_url + merchant_support_email: merchant_support_email + ask_for_shipping_address: true + shipping_fee: + charge: {} + enable_coupon: true + enable_loyalty: true + pre_populated_data: + buyer_email: buyer_email + buyer_phone_number: buyer_phone_number + url: https://square.link/u/EXAMPLE + long_url: https://checkout.square.site/EXAMPLE + created_at: '2022-04-26T00:15:15Z' + updated_at: '2022-04-26T00:18:24Z' + payment_note: test + delete: + path: /v2/online-checkout/payment-links/{id} + method: DELETE + auth: + - oauth2: + - ORDERS_READ + - ORDERS_WRITE + docs: Deletes a payment link. + source: + openapi: openapi/openapi.json + display-name: DeletePaymentLink + request: + name: DeletePaymentLinksRequest + path-parameters: + id: + type: string + docs: The ID of the payment link to delete. + response: + docs: Success + type: root.DeletePaymentLinkResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + id: MQASNYL6QB6DFCJ3 + cancelled_order_id: asx8LgZ6MRzD0fObfkJ6obBmSh4F + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers.yml b/.mock/definition/customers.yml new file mode 100644 index 000000000..93af73a09 --- /dev/null +++ b/.mock/definition/customers.yml @@ -0,0 +1,1180 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/customers + method: GET + auth: + - oauth2: + - CUSTOMERS_READ + docs: >- + Lists customer profiles associated with a Square account. + + + Under normal operating conditions, newly created or updated customer + profiles become available + + for the listing operation in well under 30 seconds. Occasionally, + propagation of the new or updated + + profiles can take closer to one minute or longer, especially during + network incidents and outages. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.customers + source: + openapi: openapi/openapi.json + display-name: ListCustomers + request: + name: ListCustomersRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for your + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single page. This + limit is advisory. The response might contain more or fewer + results. + + If the specified limit is less than 1 or greater than 100, Square + returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The + default value is 100. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + sort_field: + type: optional> + docs: |- + Indicates how customers should be sorted. + + The default value is `DEFAULT`. + sort_order: + type: optional> + docs: >- + Indicates whether customers should be sorted in ascending (`ASC`) + or + + descending (`DESC`) order. + + + The default value is `ASC`. + count: + type: optional> + default: false + docs: >- + Indicates whether to return the total count of customers in the + `count` field of the response. + + + The default value is `false`. + response: + docs: Success + type: root.ListCustomersResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + limit: 1 + sort_field: DEFAULT + sort_order: DESC + count: true + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + customers: + - id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2016-03-23T20:21:54.859Z' + updated_at: '2016-03-23T20:21:55Z' + given_name: Amelia + family_name: Earhart + nickname: nickname + company_name: company_name + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-4240 + birthday: birthday + reference_id: YOUR_REFERENCE_ID + note: a customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + group_ids: + - 545AXB44B4XXWMVQ4W8SBT3HHF + segment_ids: + - 1KB9JE5EGJXCW.REACHABLE + version: 1 + cursor: cursor + count: 1000000 + create: + path: /v2/customers + method: POST + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Creates a new customer for a business. + + + You must provide at least one of the following values in your request to + this + + endpoint: + + + - `given_name` + + - `family_name` + + - `company_name` + + - `email_address` + + - `phone_number` + source: + openapi: openapi/openapi.json + display-name: CreateCustomer + request: + name: CreateCustomerRequest + body: + properties: + idempotency_key: + type: optional + docs: "The idempotency key for the request.\tFor more information, see\n[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)." + given_name: + type: optional + docs: >- + The given name (that is, the first name) associated with the + customer profile. + + + The maximum length for this value is 300 characters. + family_name: + type: optional + docs: >- + The family name (that is, the last name) associated with the + customer profile. + + + The maximum length for this value is 300 characters. + company_name: + type: optional + docs: |- + A business name associated with the customer profile. + + The maximum length for this value is 500 characters. + nickname: + type: optional + docs: |- + A nickname for the customer profile. + + The maximum length for this value is 100 characters. + email_address: + type: optional + docs: |- + The email address associated with the customer profile. + + The maximum length for this value is 254 characters. + address: + type: optional + docs: >- + The physical address associated with the customer profile. For + maximum length constraints, see + + [Customer + addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address). + + The `first_name` and `last_name` fields are ignored if they are + present in the request. + phone_number: + type: optional + docs: >- + The phone number associated with the customer profile. The phone + number must be valid and can contain + + 9–16 digits, with an optional `+` prefix and country code. For + more information, see + + [Customer phone + numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + reference_id: + type: optional + docs: >- + An optional second ID used to associate the customer profile + with an + + entity in another system. + + + The maximum length for this value is 100 characters. + note: + type: optional + docs: A custom note associated with the customer profile. + birthday: + type: optional + docs: >- + The birthday associated with the customer profile, in + `YYYY-MM-DD` or `MM-DD` format. For example, + + specify `1998-09-21` for September 21, 1998, or `09-21` for + September 21. Birthdays are returned in `YYYY-MM-DD` + + format, where `YYYY` is the specified birth year or `0000` if a + birth year is not specified. + tax_ids: + type: optional + docs: >- + The tax ID associated with the customer profile. This field is + available only for customers of sellers + + in EU countries or the United Kingdom. For more information, + + see [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + content-type: application/json + response: + docs: Success + type: root.CreateCustomerResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-4240 + reference_id: YOUR_REFERENCE_ID + note: a customer + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + customer: + id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2016-03-23T20:21:54.859Z' + updated_at: '2016-03-23T20:21:54.859Z' + given_name: Amelia + family_name: Earhart + nickname: nickname + company_name: company_name + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + phone_number: +1-212-555-4240 + birthday: birthday + reference_id: YOUR_REFERENCE_ID + note: a customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + group_ids: + - group_ids + segment_ids: + - segment_ids + version: 0 + tax_ids: + eu_vat: eu_vat + batchCreate: + path: /v2/customers/bulk-create + method: POST + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Creates multiple [customer profiles](entity:Customer) for a business. + + + This endpoint takes a map of individual create requests and returns a + map of responses. + + + You must provide at least one of the following values in each create + request: + + + - `given_name` + + - `family_name` + + - `company_name` + + - `email_address` + + - `phone_number` + source: + openapi: openapi/openapi.json + display-name: BulkCreateCustomers + request: + name: BulkCreateCustomersRequest + body: + properties: + customers: + type: map + docs: >- + A map of 1 to 100 individual create requests, represented by + `idempotency key: { customer data }` + + key-value pairs. + + + Each key is an [idempotency + key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + + that uniquely identifies the create request. Each value contains + the customer data used to create the + + customer profile. + content-type: application/json + response: + docs: Success + type: root.BulkCreateCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + customers: + 8bb76c4f-e35d-4c5b-90de-1194cd9179f0: + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-4240 + reference_id: YOUR_REFERENCE_ID + note: a customer + d1689f23-b25d-4932-b2f0-aed00f5e2029: + given_name: Marie + family_name: Curie + email_address: Marie.Curie@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 601 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-444-4240 + reference_id: YOUR_REFERENCE_ID + note: another customer + response: + body: + responses: + 8bb76c4f-e35d-4c5b-90de-1194cd9179f4: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: 8DDA5NZVBZFGAX0V3HPF81HHE0 + created_at: '2024-03-23T20:21:54.859Z' + updated_at: '2024-03-23T20:21:54.859Z' + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-4240 + reference_id: YOUR_REFERENCE_ID + note: a customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 0 + d1689f23-b25d-4932-b2f0-aed00f5e2029: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: N18CPRVXR5214XPBBA6BZQWF3C + created_at: '2024-03-23T20:21:54.859Z' + updated_at: '2024-03-23T20:21:54.859Z' + given_name: Marie + family_name: Curie + email_address: Marie.Curie@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 601 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-444-4240 + reference_id: YOUR_REFERENCE_ID + note: another customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 0 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkDeleteCustomers: + path: /v2/customers/bulk-delete + method: POST + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Deletes multiple customer profiles. + + + The endpoint takes a list of customer IDs and returns a map of + responses. + source: + openapi: openapi/openapi.json + display-name: BulkDeleteCustomers + request: + name: BulkDeleteCustomersRequest + body: + properties: + customer_ids: + docs: The IDs of the [customer profiles](entity:Customer) to delete. + type: list + content-type: application/json + response: + docs: Success + type: root.BulkDeleteCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + customer_ids: + - 8DDA5NZVBZFGAX0V3HPF81HHE0 + - N18CPRVXR5214XPBBA6BZQWF3C + - 2GYD7WNXF7BJZW1PMGNXZ3Y8M8 + response: + body: + responses: + 2GYD7WNXF7BJZW1PMGNXZ3Y8M8: + errors: + - category: INVALID_REQUEST_ERROR + code: NOT_FOUND + detail: Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found. + 8DDA5NZVBZFGAX0V3HPF81HHE0: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + N18CPRVXR5214XPBBA6BZQWF3C: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkRetrieveCustomers: + path: /v2/customers/bulk-retrieve + method: POST + auth: + - oauth2: + - CUSTOMERS_READ + docs: >- + Retrieves multiple customer profiles. + + + This endpoint takes a list of customer IDs and returns a map of + responses. + source: + openapi: openapi/openapi.json + display-name: BulkRetrieveCustomers + request: + name: BulkRetrieveCustomersRequest + body: + properties: + customer_ids: + docs: The IDs of the [customer profiles](entity:Customer) to retrieve. + type: list + content-type: application/json + response: + docs: Success + type: root.BulkRetrieveCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + customer_ids: + - 8DDA5NZVBZFGAX0V3HPF81HHE0 + - N18CPRVXR5214XPBBA6BZQWF3C + - 2GYD7WNXF7BJZW1PMGNXZ3Y8M8 + response: + body: + responses: + 2GYD7WNXF7BJZW1PMGNXZ3Y8M8: + errors: + - category: INVALID_REQUEST_ERROR + code: NOT_FOUND + detail: Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found. + 8DDA5NZVBZFGAX0V3HPF81HHE0: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: 8DDA5NZVBZFGAX0V3HPF81HHE0 + created_at: '2024-01-19T00:27:54.59Z' + updated_at: '2024-01-19T00:38:06Z' + given_name: Amelia + family_name: Earhart + email_address: New.Amelia.Earhart@example.com + birthday: '1897-07-24' + note: updated customer note + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 3 + N18CPRVXR5214XPBBA6BZQWF3C: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: N18CPRVXR5214XPBBA6BZQWF3C + created_at: '2024-01-19T00:27:54.59Z' + updated_at: '2024-01-19T00:38:06Z' + given_name: Marie + family_name: Curie + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 1 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkUpdateCustomers: + path: /v2/customers/bulk-update + method: POST + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Updates multiple customer profiles. + + + This endpoint takes a map of individual update requests and returns a + map of responses. + source: + openapi: openapi/openapi.json + display-name: BulkUpdateCustomers + request: + name: BulkUpdateCustomersRequest + body: + properties: + customers: + type: map + docs: >- + A map of 1 to 100 individual update requests, represented by + `customer ID: { customer data }` + + key-value pairs. + + + Each key is the ID of the [customer profile](entity:Customer) to + update. To update a customer profile + + that was created by merging existing profiles, provide the ID of + the newly created profile. + + + Each value contains the updated customer data. Only new or + changed fields are required. To add or + + update a field, specify the new value. To remove a field, + specify `null`. + content-type: application/json + response: + docs: Success + type: root.BulkUpdateCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + customers: + 8DDA5NZVBZFGAX0V3HPF81HHE0: + email_address: New.Amelia.Earhart@example.com + note: updated customer note + version: 2 + N18CPRVXR5214XPBBA6BZQWF3C: + given_name: Marie + family_name: Curie + version: 0 + response: + body: + responses: + 8DDA5NZVBZFGAX0V3HPF81HHE0: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: 8DDA5NZVBZFGAX0V3HPF81HHE0 + created_at: '2024-01-19T00:27:54.59Z' + updated_at: '2024-01-19T00:38:06Z' + given_name: Amelia + family_name: Earhart + email_address: New.Amelia.Earhart@example.com + birthday: '1897-07-24' + note: updated customer note + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 3 + N18CPRVXR5214XPBBA6BZQWF3C: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + customer: + id: N18CPRVXR5214XPBBA6BZQWF3C + created_at: '2024-01-19T00:27:54.59Z' + updated_at: '2024-01-19T00:38:06Z' + given_name: Marie + family_name: Curie + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + version: 1 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/customers/search + method: POST + auth: + - oauth2: + - CUSTOMERS_READ + docs: >- + Searches the customer profiles associated with a Square account using + one or more supported query filters. + + + Calling `SearchCustomers` without any explicit query filter returns all + + customer profiles ordered alphabetically based on `given_name` and + + `family_name`. + + + Under normal operating conditions, newly created or updated customer + profiles become available + + for the search operation in well under 30 seconds. Occasionally, + propagation of the new or updated + + profiles can take closer to one minute or longer, especially during + network incidents and outages. + source: + openapi: openapi/openapi.json + display-name: SearchCustomers + request: + name: SearchCustomersRequest + body: + properties: + cursor: + type: optional + docs: >- + Include the pagination cursor in subsequent calls to this + endpoint to retrieve + + the next set of results associated with the original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional + docs: >- + The maximum number of results to return in a single page. This + limit is advisory. The response might contain more or fewer + results. + + If the specified limit is invalid, Square returns a `400 + VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value + is 100. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + query: + type: optional + docs: >- + The filtering and sorting criteria for the search request. If a + query is not specified, + + Square returns all customer profiles ordered alphabetically by + `given_name` and `family_name`. + count: + type: optional + docs: >- + Indicates whether to return the total count of matching + customers in the `count` field of the response. + + + The default value is `false`. + content-type: application/json + response: + docs: Success + type: root.SearchCustomersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + limit: 2 + query: + filter: + creation_source: + values: + - THIRD_PARTY + rule: INCLUDE + created_at: + start_at: '2018-01-01T00:00:00-00:00' + end_at: '2018-02-01T00:00:00-00:00' + email_address: + fuzzy: example.com + group_ids: + all: + - 545AXB44B4XXWMVQ4W8SBT3HHF + sort: + field: CREATED_AT + order: ASC + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + customers: + - id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2018-01-23T20:21:54.859Z' + updated_at: '2020-04-20T10:02:43.083Z' + given_name: James + family_name: Bond + nickname: nickname + company_name: company_name + email_address: james.bond@example.com + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-4250 + birthday: birthday + reference_id: YOUR_REFERENCE_ID_2 + note: note + preferences: + email_unsubscribed: false + creation_source: DIRECTORY + group_ids: + - 545AXB44B4XXWMVQ4W8SBT3HHF + segment_ids: + - 1KB9JE5EGJXCW.REACHABLE + version: 7 + - id: A9641GZW2H7Z56YYSD41Q12HDW + created_at: '2018-01-30T14:10:54.859Z' + updated_at: '2018-03-08T18:25:21.342Z' + given_name: Amelia + family_name: Earhart + nickname: nickname + company_name: company_name + email_address: amelia.earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + phone_number: +1-212-555-9238 + birthday: birthday + reference_id: YOUR_REFERENCE_ID_1 + note: a customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + group_ids: + - 545AXB44B4XXWMVQ4W8SBT3HHF + segment_ids: + - 1KB9JE5EGJXCW.REACHABLE + version: 1 + cursor: 9dpS093Uy12AzeE + count: 1000000 + get: + path: /v2/customers/{customer_id} + method: GET + auth: + - oauth2: + - CUSTOMERS_READ + docs: Returns details for a single customer. + source: + openapi: openapi/openapi.json + display-name: RetrieveCustomer + request: + name: GetCustomersRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer to retrieve. + response: + docs: Success + type: root.GetCustomerResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + customer: + id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2016-03-23T20:21:54.859Z' + updated_at: '2016-03-23T20:21:54.859Z' + given_name: Amelia + family_name: Earhart + nickname: nickname + company_name: company_name + email_address: Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + phone_number: +1-212-555-4240 + birthday: birthday + reference_id: YOUR_REFERENCE_ID + note: a customer + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + group_ids: + - 545AXB44B4XXWMVQ4W8SBT3HHF + segment_ids: + - 1KB9JE5EGJXCW.REACHABLE + version: 1 + tax_ids: + eu_vat: eu_vat + update: + path: /v2/customers/{customer_id} + method: PUT + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Updates a customer profile. This endpoint supports sparse updates, so + only new or changed fields are required in the request. + + To add or update a field, specify the new value. To remove a field, + specify `null`. + + + To update a customer profile that was created by merging existing + profiles, you must use the ID of the newly created profile. + source: + openapi: openapi/openapi.json + display-name: UpdateCustomer + request: + name: UpdateCustomerRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer to update. + body: + properties: + given_name: + type: optional> + docs: >- + The given name (that is, the first name) associated with the + customer profile. + + + The maximum length for this value is 300 characters. + family_name: + type: optional> + docs: >- + The family name (that is, the last name) associated with the + customer profile. + + + The maximum length for this value is 300 characters. + company_name: + type: optional> + docs: |- + A business name associated with the customer profile. + + The maximum length for this value is 500 characters. + nickname: + type: optional> + docs: |- + A nickname for the customer profile. + + The maximum length for this value is 100 characters. + email_address: + type: optional> + docs: |- + The email address associated with the customer profile. + + The maximum length for this value is 254 characters. + address: + type: optional + docs: >- + The physical address associated with the customer profile. Only + new or changed fields are required in the request. + + + For maximum length constraints, see [Customer + addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address). + + The `first_name` and `last_name` fields are ignored if they are + present in the request. + phone_number: + type: optional> + docs: >- + The phone number associated with the customer profile. The phone + number must be valid and can contain + + 9–16 digits, with an optional `+` prefix and country code. For + more information, see + + [Customer phone + numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number). + reference_id: + type: optional> + docs: >- + An optional second ID used to associate the customer profile + with an + + entity in another system. + + + The maximum length for this value is 100 characters. + note: + type: optional> + docs: A custom note associated with the customer profile. + birthday: + type: optional> + docs: >- + The birthday associated with the customer profile, in + `YYYY-MM-DD` or `MM-DD` format. For example, + + specify `1998-09-21` for September 21, 1998, or `09-21` for + September 21. Birthdays are returned in `YYYY-MM-DD` + + format, where `YYYY` is the specified birth year or `0000` if a + birth year is not specified. + version: + type: optional + docs: >- + The current version of the customer profile. + + + As a best practice, you should include this field to enable + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + control. For more information, see [Update a customer + profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#update-a-customer-profile). + tax_ids: + type: optional + docs: >- + The tax ID associated with the customer profile. This field is + available only for customers of sellers + + in EU countries or the United Kingdom. For more information, + + see [Customer tax + IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). + content-type: application/json + response: + docs: Success + type: root.UpdateCustomerResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + headers: + Square-Version: '2025-10-16' + request: + email_address: New.Amelia.Earhart@example.com + note: updated customer note + version: 2 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + customer: + id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2016-03-23T20:21:54.859Z' + updated_at: '2016-05-15T20:21:55Z' + given_name: Amelia + family_name: Earhart + nickname: nickname + company_name: company_name + email_address: New.Amelia.Earhart@example.com + address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + phone_number: phone_number + birthday: birthday + reference_id: YOUR_REFERENCE_ID + note: updated customer note + preferences: + email_unsubscribed: false + creation_source: THIRD_PARTY + group_ids: + - group_ids + segment_ids: + - segment_ids + version: 3 + tax_ids: + eu_vat: eu_vat + delete: + path: /v2/customers/{customer_id} + method: DELETE + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Deletes a customer profile from a business. + + + To delete a customer profile that was created by merging existing + profiles, you must use the ID of the newly created profile. + source: + openapi: openapi/openapi.json + display-name: DeleteCustomer + request: + name: DeleteCustomersRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer to delete. + query-parameters: + version: + type: optional> + docs: >- + The current version of the customer profile. + + + As a best practice, you should include this parameter to enable + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + control. For more information, see [Delete a customer + profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile). + response: + docs: Success + type: root.DeleteCustomerResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + query-parameters: + version: 1000000 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers/cards.yml b/.mock/definition/customers/cards.yml new file mode 100644 index 000000000..6bf342c6a --- /dev/null +++ b/.mock/definition/customers/cards.yml @@ -0,0 +1,181 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/customers/{customer_id}/cards + method: POST + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Adds a card on file to an existing customer. + + + As with charges, calls to `CreateCustomerCard` are idempotent. Multiple + + calls with the same card nonce return the same card record that was + created + + with the provided nonce during the _first_ call. + source: + openapi: openapi/openapi.json + display-name: CreateCustomerCard + request: + name: CreateCustomerCardRequest + path-parameters: + customer_id: + type: string + docs: The Square ID of the customer profile the card is linked to. + body: + properties: + card_nonce: + type: string + docs: >- + A card nonce representing the credit card to link to the + customer. + + + Card nonces are generated by the Square payment form when + customers enter + + their card information. For more information, see + + [Walkthrough: Integrate Square Payments in a + Website](https://developer.squareup.com/docs/web-payments/take-card-payment). + + + __NOTE:__ Card nonces generated by digital wallets (such as + Apple Pay) + + cannot be used to create a customer card. + billing_address: + type: optional + docs: >- + Address information for the card on file. + + + __NOTE:__ If a billing address is provided in the request, the + + `CreateCustomerCardRequest.billing_address.postal_code` must + match + + the postal code encoded in the card nonce. + cardholder_name: + type: optional + docs: The full name printed on the credit card. + verification_token: + type: optional + docs: >- + An identifying token generated by + [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). + + Verification tokens encapsulate customer device information and + 3-D Secure + + challenge results to indicate that Square has verified the buyer + identity. + content-type: application/json + response: + docs: Success + type: root.CreateCustomerCardResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + customer_id: customer_id + headers: + Square-Version: '2025-10-16' + request: + card_nonce: YOUR_CARD_NONCE + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + cardholder_name: Amelia Earhart + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + card: + id: icard-card_id + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2018 + cardholder_name: Amelia Earhart + billing_address: + address_line_1: 500 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + fingerprint: fingerprint + customer_id: customer_id + merchant_id: merchant_id + reference_id: reference_id + enabled: true + card_type: UNKNOWN_CARD_TYPE + prepaid_type: UNKNOWN_PREPAID_TYPE + bin: bin + version: 1000000 + card_co_brand: UNKNOWN + issuer_alert: ISSUER_ALERT_CARD_CLOSED + issuer_alert_at: issuer_alert_at + hsa_fsa: true + delete: + path: /v2/customers/{customer_id}/cards/{card_id} + method: DELETE + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: Removes a card on file from a customer. + source: + openapi: openapi/openapi.json + display-name: DeleteCustomerCard + request: + name: DeleteCardsRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer that the card on file belongs to. + card_id: + type: string + docs: The ID of the card on file to delete. + response: + docs: Success + type: root.DeleteCustomerCardResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + customer_id: customer_id + card_id: card_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers/customAttributeDefinitions.yml b/.mock/definition/customers/customAttributeDefinitions.yml new file mode 100644 index 000000000..7634971e1 --- /dev/null +++ b/.mock/definition/customers/customAttributeDefinitions.yml @@ -0,0 +1,605 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/customers/custom-attribute-definitions + method: GET + auth: + - oauth2: + - CUSTOMERS_READ + docs: >- + Lists the customer-related [custom attribute + definitions](entity:CustomAttributeDefinition) that belong to a Square + seller account. + + + When all response pages are retrieved, the results include all custom + attribute definitions + + that are visible to the requesting application, including those that are + created by other + + applications and set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. Note that + + seller-defined custom attributes (also known as custom fields) are + always set to `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attribute_definitions + source: + openapi: openapi/openapi.json + display-name: ListCustomerCustomAttributeDefinitions + request: + name: ListCustomAttributeDefinitionsRequest + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListCustomerCustomAttributeDefinitionsResponse + status-code: 200 + examples: + - query-parameters: + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute_definitions: + - key: favoritemovie + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Movie + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 3 + updated_at: '2022-04-26T15:39:38Z' + created_at: '2022-04-26T15:27:30Z' + - key: ownsmovie + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean + name: Owns Movie + description: Customer owns movie. + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: '2022-04-26T15:49:05Z' + created_at: '2022-04-26T15:49:05Z' + cursor: >- + YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/customers/custom-attribute-definitions + method: POST + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Creates a customer-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + Use this endpoint to define a custom attribute that can be associated + with customer profiles. + + + A custom attribute definition specifies the `key`, `visibility`, + `schema`, and other properties + + for a custom attribute. After the definition is created, you can call + + [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) + or + + [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) + + to set the custom attribute for customer profiles in the seller's + Customer Directory. + + + Sellers can view all custom attributes in exported customer data, + including those set to + + `VISIBILITY_HIDDEN`. + source: + openapi: openapi/openapi.json + display-name: CreateCustomerCustomAttributeDefinition + request: + name: CreateCustomerCustomAttributeDefinitionRequest + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition to create. Note the following: + + - With the exception of the `Selection` data type, the `schema` + is specified as a simple URL to the JSON schema + + definition hosted on the Square CDN. For more information, + including supported values and constraints, see + + [Specifying the + schema](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#specify-schema). + + - If provided, `name` must be unique (case-sensitive) across all + visible customer-related custom attribute definitions for the + seller. + + - All custom attributes are visible in exported customer data, + including those set to `VISIBILITY_HIDDEN`. + idempotency_key: + type: optional + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateCustomerCustomAttributeDefinitionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + custom_attribute_definition: + key: favoritemovie + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Movie + description: The favorite movie of the customer. + visibility: VISIBILITY_HIDDEN + response: + body: + custom_attribute_definition: + key: favoritemovie + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Movie + description: The favorite movie of the customer. + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: '2022-04-26T15:27:30Z' + created_at: '2022-04-26T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/customers/custom-attribute-definitions/{key} + method: GET + auth: + - oauth2: + - CUSTOMERS_READ + docs: >- + Retrieves a customer-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + + To retrieve a custom attribute definition created by another + application, the `visibility` + + setting must be `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveCustomerCustomAttributeDefinition + request: + name: GetCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: >- + The key of the custom attribute definition to retrieve. If the + requesting application + + is not the definition owner, you must use the qualified key. + query-parameters: + version: + type: optional> + docs: >- + The current version of the custom attribute definition, which is + used for strongly consistent + + reads to guarantee that you receive the most up-to-date data. When + included in the request, + + Square returns the specified version or a higher version if one + exists. If the specified version + + is higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.GetCustomerCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + query-parameters: + version: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute_definition: + key: favoritemovie + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Movie + description: The favorite movie of the customer. + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-04-26T15:27:30Z' + created_at: '2022-04-26T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/customers/custom-attribute-definitions/{key} + method: PUT + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Updates a customer-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + + Use this endpoint to update the following fields: `name`, `description`, + `visibility`, or the + + `schema` for a `Selection` data type. + + + Only the definition owner can update a custom attribute definition. Note + that sellers can view + + all custom attributes in exported customer data, including those set to + `VISIBILITY_HIDDEN`. + source: + openapi: openapi/openapi.json + display-name: UpdateCustomerCustomAttributeDefinition + request: + name: UpdateCustomerCustomAttributeDefinitionRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to update. + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition that contains the fields to + update. This endpoint + + supports sparse updates, so only new or changed fields need to + be included in the request. + + Only the following fields can be updated: + + + - `name` + + - `description` + + - `visibility` + + - `schema` for a `Selection` data type. Only changes to the + named options or the maximum number of allowed + + selections are supported. + + + For more information, see + + [Updatable definition + fields](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields). + + + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include the optional `version` field and specify the + current version of the custom attribute definition. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateCustomerCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-10-16' + request: + custom_attribute_definition: + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + response: + body: + custom_attribute_definition: + key: favoritemovie + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Favorite Movie + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 2 + updated_at: '2022-04-26T15:39:38Z' + created_at: '2022-04-26T15:27:30Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/customers/custom-attribute-definitions/{key} + method: DELETE + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Deletes a customer-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + + Deleting a custom attribute definition also deletes the corresponding + custom attribute from + + all customer profiles in the seller's Customer Directory. + + + Only the definition owner can delete a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: DeleteCustomerCustomAttributeDefinition + request: + name: DeleteCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to delete. + response: + docs: Success + type: root.DeleteCustomerCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchUpsert: + path: /v2/customers/custom-attributes/bulk-upsert + method: POST + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Creates or updates [custom attributes](entity:CustomAttribute) for + customer profiles as a bulk operation. + + + Use this endpoint to set the value of one or more custom attributes for + one or more customer profiles. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which is + + created using the + [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) + endpoint. + + + This `BulkUpsertCustomerCustomAttributes` endpoint accepts a map of 1 to + 25 individual upsert + + requests and returns a map of individual upsert responses. Each upsert + request has a unique ID + + and provides a customer ID and custom attribute. Each upsert response is + returned with the ID + + of the corresponding request. + + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkUpsertCustomerCustomAttributes + request: + name: BatchUpsertCustomerCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + A map containing 1 to 25 individual upsert requests. For each + request, provide an + + arbitrary ID that is unique for this + `BulkUpsertCustomerCustomAttributes` request and the + + information needed to create or update a custom attribute. + content-type: application/json + response: + docs: Success + type: root.BatchUpsertCustomerCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + values: + id1: + customer_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: favoritemovie + value: Dune + id2: + customer_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: ownsmovie + value: false + id3: + customer_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: favoritemovie + value: Star Wars + id4: + customer_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: square:a0f1505a-2aa1-490d-91a8-8d31ff181808 + value: '10.5' + id5: + customer_id: 70548QG1HN43B05G0KCZ4MMC1G + custom_attribute: + key: sq0ids-0evKIskIGaY45fCyNL66aw:backupemail + value: fake-email@squareup.com + response: + body: + values: + id1: + customer_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: favoritemovie + value: Dune + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2021-12-09T00:16:23Z' + created_at: '2021-12-08T23:14:47Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + customer_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: ownsmovie + value: false + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2021-12-09T00:16:23Z' + created_at: '2021-12-09T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id3: + customer_id: SY8EMWRNDN3TQDP2H4KS1QWMMM + custom_attribute: + key: favoritemovie + value: Star Wars + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2021-12-09T00:16:23Z' + created_at: '2021-12-09T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id4: + customer_id: N3NCVYY3WS27HF0HKANA3R9FP8 + custom_attribute: + key: square:a0f1505a-2aa1-490d-91a8-8d31ff181808 + value: '10.5' + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2021-12-09T00:16:23Z' + created_at: '2021-12-08T23:14:47Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id5: + customer_id: 70548QG1HN43B05G0KCZ4MMC1G + custom_attribute: + key: sq0ids-0evKIskIGaY45fCyNL66aw:backupemail + value: fake-email@squareup.com + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2021-12-09T00:16:23Z' + created_at: '2021-12-09T00:16:20Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers/customAttributes.yml b/.mock/definition/customers/customAttributes.yml new file mode 100644 index 000000000..1208989a4 --- /dev/null +++ b/.mock/definition/customers/customAttributes.yml @@ -0,0 +1,399 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/customers/{customer_id}/custom-attributes + method: GET + auth: + - oauth2: + - CUSTOMERS_READ + docs: >- + Lists the [custom attributes](entity:CustomAttribute) associated with a + customer profile. + + + You can use the `with_definitions` query parameter to also retrieve + custom attribute definitions + + in the same call. + + + When all response pages are retrieved, the results include all custom + attributes that are + + visible to the requesting application, including those that are owned by + other applications + + and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attributes + source: + openapi: openapi/openapi.json + display-name: ListCustomerCustomAttributes + request: + name: ListCustomAttributesRequest + path-parameters: + customer_id: + type: string + docs: The ID of the target [customer profile](entity:Customer). + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. For more + + information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + with_definitions: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + response: + docs: Success + type: root.ListCustomerCustomAttributesResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + query-parameters: + limit: 1 + cursor: cursor + with_definitions: true + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attributes: + - key: favoritemovie + value: Dune + version: 1 + visibility: VISIBILITY_READ_ONLY + updated_at: '2022-04-26T15:50:27Z' + created_at: '2022-04-26T15:50:27Z' + - key: ownsmovie + value: false + version: 1 + visibility: VISIBILITY_HIDDEN + updated_at: '2022-04-26T15:51:53Z' + created_at: '2022-04-26T15:51:53Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/customers/{customer_id}/custom-attributes/{key} + method: GET + auth: + - oauth2: + - CUSTOMERS_READ + docs: >- + Retrieves a [custom attribute](entity:CustomAttribute) associated with a + customer profile. + + + You can use the `with_definition` query parameter to also retrieve the + custom attribute definition + + in the same call. + + + To retrieve a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that + seller-defined custom attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveCustomerCustomAttribute + request: + name: GetCustomAttributesRequest + path-parameters: + customer_id: + type: string + docs: The ID of the target [customer profile](entity:Customer). + key: + type: string + docs: >- + The key of the custom attribute to retrieve. This key must match + the `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + query-parameters: + with_definition: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of + + the custom attribute. Set this parameter to `true` to get the name + and description of the custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + version: + type: optional> + docs: >- + The current version of the custom attribute, which is used for + strongly consistent reads to + + guarantee that you receive the most up-to-date data. When included + in the request, Square + + returns the specified version or a higher version if one exists. + If the specified version is + + higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.GetCustomerCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + key: key + query-parameters: + with_definition: true + version: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute: + key: favoritemovie + value: Dune + version: 1 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-04-26T15:50:27Z' + created_at: '2022-04-26T15:50:27Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + upsert: + path: /v2/customers/{customer_id}/custom-attributes/{key} + method: POST + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Creates or updates a [custom attribute](entity:CustomAttribute) for a + customer profile. + + + Use this endpoint to set the value of a custom attribute for a specified + customer profile. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which + + is created using the + [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) + endpoint. + + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: UpsertCustomerCustomAttribute + request: + name: UpsertCustomerCustomAttributeRequest + path-parameters: + customer_id: + type: string + docs: The ID of the target [customer profile](entity:Customer). + key: + type: string + docs: >- + The key of the custom attribute to create or update. This key must + match the `key` of a + + custom attribute definition in the Square seller account. If the + requesting application is not + + the definition owner, you must use the qualified key. + body: + properties: + custom_attribute: + type: root.CustomAttribute + docs: >- + The custom attribute to create or update, with the following + fields: + + + - `value`. This value must conform to the `schema` specified by + the definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for an update operation, include this optional field and + specify the current version + + of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpsertCustomerCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + key: key + headers: + Square-Version: '2025-10-16' + request: + custom_attribute: + value: Dune + response: + body: + custom_attribute: + key: favoritemovie + value: Dune + version: 1 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-04-26T15:50:27Z' + created_at: '2022-04-26T15:50:27Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/customers/{customer_id}/custom-attributes/{key} + method: DELETE + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: >- + Deletes a [custom attribute](entity:CustomAttribute) associated with a + customer profile. + + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: DeleteCustomerCustomAttribute + request: + name: DeleteCustomAttributesRequest + path-parameters: + customer_id: + type: string + docs: The ID of the target [customer profile](entity:Customer). + key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match the + `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + response: + docs: Success + type: root.DeleteCustomerCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + key: key + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers/groups.yml b/.mock/definition/customers/groups.yml new file mode 100644 index 000000000..952e10cb9 --- /dev/null +++ b/.mock/definition/customers/groups.yml @@ -0,0 +1,324 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/customers/groups + method: GET + auth: + - oauth2: + - CUSTOMERS_READ + docs: Retrieves the list of customer groups of a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.groups + source: + openapi: openapi/openapi.json + display-name: ListCustomerGroups + request: + name: ListGroupsRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for your + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single page. This + limit is advisory. The response might contain more or fewer + results. + + If the limit is less than 1 or greater than 50, Square returns a + `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default + value is 50. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListCustomerGroupsResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + groups: + - id: 2TAT3CMH4Q0A9M87XJZED0WMR3 + name: Loyal Customers + created_at: '2020-04-13T21:54:57.863Z' + updated_at: '2020-04-13T21:54:58Z' + - id: 4XMEHESXJBNE9S9JAKZD2FGB14 + name: Super Loyal Customers + created_at: '2020-04-13T21:55:18.795Z' + updated_at: '2020-04-13T21:55:19Z' + cursor: cursor + create: + path: /v2/customers/groups + method: POST + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: |- + Creates a new customer group for a business. + + The request must include the `name` value of the group. + source: + openapi: openapi/openapi.json + display-name: CreateCustomerGroup + request: + name: CreateCustomerGroupRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + The idempotency key for the request. For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + group: + type: root.CustomerGroup + docs: The customer group to create. + content-type: application/json + response: + docs: Success + type: root.CreateCustomerGroupResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + group: + name: Loyal Customers + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + group: + id: 2TAT3CMH4Q0A9M87XJZED0WMR3 + name: Loyal Customers + created_at: '2020-04-13T21:54:57.863Z' + updated_at: '2020-04-13T21:54:58Z' + get: + path: /v2/customers/groups/{group_id} + method: GET + auth: + - oauth2: + - CUSTOMERS_READ + docs: >- + Retrieves a specific customer group as identified by the `group_id` + value. + source: + openapi: openapi/openapi.json + display-name: RetrieveCustomerGroup + request: + name: GetGroupsRequest + path-parameters: + group_id: + type: string + docs: The ID of the customer group to retrieve. + response: + docs: Success + type: root.GetCustomerGroupResponse + status-code: 200 + examples: + - path-parameters: + group_id: group_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + group: + id: 2TAT3CMH4Q0A9M87XJZED0WMR3 + name: Loyal Customers + created_at: '2020-04-13T21:54:57.863Z' + updated_at: '2020-04-13T21:54:58Z' + update: + path: /v2/customers/groups/{group_id} + method: PUT + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: Updates a customer group as identified by the `group_id` value. + source: + openapi: openapi/openapi.json + display-name: UpdateCustomerGroup + request: + name: UpdateCustomerGroupRequest + path-parameters: + group_id: + type: string + docs: The ID of the customer group to update. + body: + properties: + group: + type: root.CustomerGroup + docs: >- + The `CustomerGroup` object including all the updates you want to + make. + content-type: application/json + response: + docs: Success + type: root.UpdateCustomerGroupResponse + status-code: 200 + examples: + - path-parameters: + group_id: group_id + headers: + Square-Version: '2025-10-16' + request: + group: + name: Loyal Customers + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + group: + id: 2TAT3CMH4Q0A9M87XJZED0WMR3 + name: Loyal Customers + created_at: '2020-04-13T21:54:57.863Z' + updated_at: '2020-04-13T21:54:58Z' + delete: + path: /v2/customers/groups/{group_id} + method: DELETE + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: Deletes a customer group as identified by the `group_id` value. + source: + openapi: openapi/openapi.json + display-name: DeleteCustomerGroup + request: + name: DeleteGroupsRequest + path-parameters: + group_id: + type: string + docs: The ID of the customer group to delete. + response: + docs: Success + type: root.DeleteCustomerGroupResponse + status-code: 200 + examples: + - path-parameters: + group_id: group_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + add: + path: /v2/customers/{customer_id}/groups/{group_id} + method: PUT + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: |- + Adds a group membership to a customer. + + The customer is identified by the `customer_id` value + and the customer group is identified by the `group_id` value. + source: + openapi: openapi/openapi.json + display-name: AddGroupToCustomer + request: + name: AddGroupsRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer to add to a group. + group_id: + type: string + docs: The ID of the customer group to add the customer to. + response: + docs: Success + type: root.AddGroupToCustomerResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + group_id: group_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + remove: + path: /v2/customers/{customer_id}/groups/{group_id} + method: DELETE + auth: + - oauth2: + - CUSTOMERS_WRITE + docs: |- + Removes a group membership from a customer. + + The customer is identified by the `customer_id` value + and the customer group is identified by the `group_id` value. + source: + openapi: openapi/openapi.json + display-name: RemoveGroupFromCustomer + request: + name: RemoveGroupsRequest + path-parameters: + customer_id: + type: string + docs: The ID of the customer to remove from the group. + group_id: + type: string + docs: The ID of the customer group to remove the customer from. + response: + docs: Success + type: root.RemoveGroupFromCustomerResponse + status-code: 200 + examples: + - path-parameters: + customer_id: customer_id + group_id: group_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/customers/segments.yml b/.mock/definition/customers/segments.yml new file mode 100644 index 000000000..02f7db412 --- /dev/null +++ b/.mock/definition/customers/segments.yml @@ -0,0 +1,124 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/customers/segments + method: GET + auth: + - oauth2: + - CUSTOMERS_READ + docs: Retrieves the list of customer segments of a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.segments + source: + openapi: openapi/openapi.json + display-name: ListCustomerSegments + request: + name: ListSegmentsRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by previous calls to + `ListCustomerSegments`. + + This cursor is used to retrieve the next set of query results. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single page. This + limit is advisory. The response might contain more or fewer + results. + + If the specified limit is less than 1 or greater than 50, Square + returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The + default value is 50. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListCustomerSegmentsResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + segments: + - id: GMNXRZVEXNQDF.CHURN_RISK + name: Lapsed + created_at: '2020-01-09T19:33:24.469Z' + updated_at: '2020-04-13T21:47:04Z' + - id: GMNXRZVEXNQDF.LOYAL + name: Regulars + created_at: '2020-01-09T19:33:24.486Z' + updated_at: '2020-04-13T21:47:04Z' + - id: GMNXRZVEXNQDF.REACHABLE + name: Reachable + created_at: '2020-01-09T19:33:21.813Z' + updated_at: '2020-04-13T21:47:04Z' + - id: gv2:KF92J19VXN5FK30GX2E8HSGQ20 + name: Instant Profile + created_at: '2020-01-09T19:33:25Z' + updated_at: '2020-04-13T23:01:03Z' + cursor: cursor + get: + path: /v2/customers/segments/{segment_id} + method: GET + auth: + - oauth2: + - CUSTOMERS_READ + docs: >- + Retrieves a specific customer segment as identified by the `segment_id` + value. + source: + openapi: openapi/openapi.json + display-name: RetrieveCustomerSegment + request: + name: GetSegmentsRequest + path-parameters: + segment_id: + type: string + docs: The Square-issued ID of the customer segment. + response: + docs: Success + type: root.GetCustomerSegmentResponse + status-code: 200 + examples: + - path-parameters: + segment_id: segment_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + segment: + id: GMNXRZVEXNQDF.CHURN_RISK + name: Lapsed + created_at: '2020-01-09T19:33:24.469Z' + updated_at: '2020-04-13T23:01:13Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/devices.yml b/.mock/definition/devices.yml new file mode 100644 index 000000000..0d2b57d7f --- /dev/null +++ b/.mock/definition/devices.yml @@ -0,0 +1,212 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/devices + method: GET + auth: + - oauth2: + - DEVICES_READ + docs: |- + List devices associated with the merchant. Currently, only Terminal API + devices are supported. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.devices + source: + openapi: openapi/openapi.json + display-name: ListDevices + request: + name: ListDevicesRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + sort_order: + type: optional> + docs: |- + The order in which results are listed. + - `ASC` - Oldest to newest. + - `DESC` - Newest to oldest (default). + limit: + type: optional> + docs: The number of results to return in a single page. + location_id: + type: optional> + docs: If present, only returns devices at the target location. + response: + docs: Success + type: root.ListDevicesResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + sort_order: DESC + limit: 1 + location_id: location_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + devices: + - id: device:995CS397A6475287 + attributes: + type: TERMINAL + manufacturer: Square + model: Square Terminal (1st Gen, v2) + name: Square Terminal 5287 + manufacturers_id: 995CS397A6475287 + updated_at: '2025-08-19T13:04:56.335762883Z' + version: 5.57.0067 + merchant_token: MLCHNZCBWFDZB + components: + - type: APPLICATION + application_details: + application_type: TERMINAL_API + version: '6.77' + session_location: LMN2K7S3RTOU3 + - type: CARD_READER + card_reader_details: + version: 4.1.51 + - type: BATTERY + battery_details: + visible_percent: 77 + external_power: AVAILABLE_CHARGING + - type: WIFI + wifi_details: + active: true + ssid: Staff Network + ip_address_v4: 10.0.0.7 + secure_connection: WPA/WPA2 PSK + signal_strength: + value: 2 + - type: ETHERNET + ethernet_details: + active: false + status: + category: AVAILABLE + - id: device:998WS21803L03559 + attributes: + type: HANDHELD + manufacturer: Square + model: Square Handheld (1st Gen, v1) + name: Square Terminal 3559 + manufacturers_id: 998WS21803L03559 + updated_at: '2025-08-19T12:39:56.335742073Z' + version: 7.21.0017 + merchant_token: MLCHXZCBWFGDW + components: + - type: APPLICATION + application_details: + application_type: TERMINAL_API + version: '6.77' + session_location: LMN2K7S3RTOU3 + - type: CARD_READER + card_reader_details: + version: 4.5.58 + - type: BATTERY + battery_details: + visible_percent: 22 + external_power: AVAILABLE_CHARGING + - type: WIFI + wifi_details: + active: true + ssid: Staff Network + ip_address_v4: 10.0.0.7 + secure_connection: WPA/WPA2 PSK + signal_strength: + value: 2 + - type: ETHERNET + ethernet_details: + active: false + status: + category: NEEDS_ATTENTION + cursor: GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM + get: + path: /v2/devices/{device_id} + method: GET + auth: + - oauth2: + - DEVICES_READ + docs: Retrieves Device with the associated `device_id`. + source: + openapi: openapi/openapi.json + display-name: GetDevice + request: + name: GetDevicesRequest + path-parameters: + device_id: + type: string + docs: The unique ID for the desired `Device`. + response: + docs: Success + type: root.GetDeviceResponse + status-code: 200 + examples: + - path-parameters: + device_id: device_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + device: + id: device:995CS397A6475287 + attributes: + type: TERMINAL + manufacturer: Square + model: T2 + name: Square Terminal 995 + manufacturers_id: 995CS397A6475287 + updated_at: '2023-09-29T13:12:22.365049321Z' + version: 5.41.0085 + merchant_token: MLCHXZCBWFGDW + components: + - type: APPLICATION + application_details: + application_type: TERMINAL_API + version: '6.25' + session_location: LMN2K7S3RTOU3 + - type: CARD_READER + card_reader_details: + version: 3.53.70 + - type: BATTERY + battery_details: + visible_percent: 5 + external_power: AVAILABLE_CHARGING + - type: WIFI + wifi_details: + active: true + ssid: Staff Network + ip_address_v4: 10.0.0.7 + secure_connection: WPA/WPA2 PSK + signal_strength: + value: 2 + - type: ETHERNET + ethernet_details: + active: false + status: + category: AVAILABLE + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/devices/codes.yml b/.mock/definition/devices/codes.yml new file mode 100644 index 000000000..251b9647b --- /dev/null +++ b/.mock/definition/devices/codes.yml @@ -0,0 +1,211 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/devices/codes + method: GET + auth: + - oauth2: + - DEVICE_CREDENTIAL_MANAGEMENT + docs: Lists all DeviceCodes associated with the merchant. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.device_codes + source: + openapi: openapi/openapi.json + display-name: ListDeviceCodes + request: + name: ListCodesRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for your original + query. + + + See [Paginating + results](https://developer.squareup.com/docs/working-with-apis/pagination) + for more information. + location_id: + type: optional> + docs: |- + If specified, only returns DeviceCodes of the specified location. + Returns DeviceCodes of all locations if empty. + product_type: + type: optional> + docs: >- + If specified, only returns DeviceCodes targeting the specified + product type. + + Returns DeviceCodes of all product types if empty. + status: + type: optional> + docs: |- + If specified, returns DeviceCodes with the specified statuses. + Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. + response: + docs: Success + type: root.ListDeviceCodesResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + location_id: location_id + product_type: TERMINAL_API + status: UNKNOWN + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + device_codes: + - id: B3Z6NAMYQSMTM + name: Counter 1 + code: EBCARJ + device_id: 907CS13101300122 + product_type: TERMINAL_API + location_id: B5E4484SHHNYH + status: PAIRED + pair_by: '2020-02-06T18:49:33.000Z' + created_at: '2020-02-06T18:44:33.000Z' + status_changed_at: '2020-02-06T18:47:28.000Z' + paired_at: paired_at + - id: YKGMJMYK8H4PQ + name: Unused device code + code: GVXNYN + device_id: device_id + product_type: TERMINAL_API + location_id: A6SYFRSV4WAFW + status: UNPAIRED + pair_by: '2020-02-07T20:00:04.000Z' + created_at: '2020-02-07T19:55:04.000Z' + status_changed_at: '2020-02-07T19:55:04.000Z' + paired_at: paired_at + cursor: cursor + create: + path: /v2/devices/codes + method: POST + auth: + - oauth2: + - DEVICE_CREDENTIAL_MANAGEMENT + docs: >- + Creates a DeviceCode that can be used to login to a Square Terminal + device to enter the connected + + terminal mode. + source: + openapi: openapi/openapi.json + display-name: CreateDeviceCode + request: + name: CreateDeviceCodeRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this CreateDeviceCode request. + Keys can + + be any valid string but must be unique for every + CreateDeviceCode request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 128 + device_code: + type: root.DeviceCode + docs: The device code to create. + content-type: application/json + response: + docs: Success + type: root.CreateDeviceCodeResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 01bb00a6-0c86-4770-94ed-f5fca973cd56 + device_code: + name: Counter 1 + product_type: TERMINAL_API + location_id: B5E4484SHHNYH + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + device_code: + id: B3Z6NAMYQSMTM + name: Counter 1 + code: EBCARJ + device_id: device_id + product_type: TERMINAL_API + location_id: B5E4484SHHNYH + status: UNPAIRED + pair_by: '2020-02-06T18:49:33.000Z' + created_at: '2020-02-06T18:44:33.000Z' + status_changed_at: '2020-02-06T18:44:33.000Z' + paired_at: paired_at + get: + path: /v2/devices/codes/{id} + method: GET + auth: + - oauth2: + - DEVICE_CREDENTIAL_MANAGEMENT + docs: Retrieves DeviceCode with the associated ID. + source: + openapi: openapi/openapi.json + display-name: GetDeviceCode + request: + name: GetCodesRequest + path-parameters: + id: + type: string + docs: The unique identifier for the device code. + response: + docs: Success + type: root.GetDeviceCodeResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + device_code: + id: B3Z6NAMYQSMTM + name: Counter 1 + code: EBCARJ + device_id: 907CS13101300122 + product_type: TERMINAL_API + location_id: B5E4484SHHNYH + status: PAIRED + pair_by: '2020-02-06T18:49:33.000Z' + created_at: '2020-02-06T18:44:33.000Z' + status_changed_at: '2020-02-06T18:47:28.000Z' + paired_at: paired_at + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/disputes.yml b/.mock/definition/disputes.yml new file mode 100644 index 000000000..2d974f93a --- /dev/null +++ b/.mock/definition/disputes.yml @@ -0,0 +1,422 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/disputes + method: GET + auth: + - oauth2: + - DISPUTES_READ + docs: Returns a list of disputes associated with a particular account. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.disputes + source: + openapi: openapi/openapi.json + display-name: ListDisputes + request: + name: ListDisputesRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + states: + type: optional> + docs: >- + The dispute states used to filter the result. If not specified, + the endpoint returns all disputes. + location_id: + type: optional> + docs: >- + The ID of the location for which to return a list of disputes. + + If not specified, the endpoint returns disputes associated with + all locations. + response: + docs: Success + type: root.ListDisputesResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + states: INQUIRY_EVIDENCE_REQUIRED + location_id: location_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + disputes: + - dispute_id: dispute_id + id: XDgyFu7yo1E2S5lQGGpYn + amount_money: + amount: 2500 + currency: USD + reason: NO_KNOWLEDGE + state: ACCEPTED + due_at: '2022-07-13T00:00:00.000Z' + disputed_payment: + payment_id: zhyh1ch64kRBrrlfVhwjCEjZWzNZY + evidence_ids: + - evidence_ids + card_brand: VISA + created_at: '2022-06-29T18:45:22.265Z' + updated_at: '2022-07-07T19:14:42.650Z' + brand_dispute_id: '100000809947' + reported_date: reported_date + reported_at: '2022-06-29T00:00:00.000Z' + version: 2 + location_id: L1HN3ZMQK64X9 + - dispute_id: dispute_id + id: jLGg7aXC7lvKPr9PISt0T + amount_money: + amount: 2209 + currency: USD + reason: NOT_AS_DESCRIBED + state: EVIDENCE_REQUIRED + due_at: '2022-05-13T00:00:00.000Z' + disputed_payment: + payment_id: zhyh1ch64kRBrrlfVhwjCEjZWzNZY + evidence_ids: + - evidence_ids + card_brand: VISA + created_at: '2022-04-29T18:45:22.265Z' + updated_at: '2022-04-29T18:45:22.265Z' + brand_dispute_id: r5Of6YaGT7AdeRaVoAGCJw + reported_date: reported_date + reported_at: '2022-04-29T00:00:00.000Z' + version: 1 + location_id: 18YC4JDH91E1H + cursor: G1aSTRm48CLjJsg6Sg3hQN1b1OMaoVuG + get: + path: /v2/disputes/{dispute_id} + method: GET + auth: + - oauth2: + - DISPUTES_READ + docs: Returns details about a specific dispute. + source: + openapi: openapi/openapi.json + display-name: RetrieveDispute + request: + name: GetDisputesRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute you want more details about. + response: + docs: Success + type: root.GetDisputeResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + dispute: + dispute_id: dispute_id + id: XDgyFu7yo1E2S5lQGGpYn + amount_money: + amount: 2500 + currency: USD + reason: NO_KNOWLEDGE + state: ACCEPTED + due_at: '2022-07-13T00:00:00.000Z' + disputed_payment: + payment_id: zhyh1ch64kRBrrlfVhwjCEjZWzNZY + evidence_ids: + - evidence_ids + card_brand: VISA + created_at: '2022-06-29T18:45:22.265Z' + updated_at: '2022-07-07T19:14:42.650Z' + brand_dispute_id: '100000809947' + reported_date: reported_date + reported_at: '2022-06-29T00:00:00.000Z' + version: 2 + location_id: L1HN3ZMQK64X9 + accept: + path: /v2/disputes/{dispute_id}/accept + method: POST + auth: + - oauth2: + - DISPUTES_WRITE + docs: >- + Accepts the loss on a dispute. Square returns the disputed amount to the + cardholder and + + updates the dispute state to ACCEPTED. + + + Square debits the disputed amount from the seller’s Square account. If + the Square account + + does not have sufficient funds, Square debits the associated bank + account. + source: + openapi: openapi/openapi.json + display-name: AcceptDispute + request: + name: AcceptDisputesRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute you want to accept. + response: + docs: Success + type: root.AcceptDisputeResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + dispute: + dispute_id: dispute_id + id: XDgyFu7yo1E2S5lQGGpYn + amount_money: + amount: 2500 + currency: USD + reason: NO_KNOWLEDGE + state: ACCEPTED + due_at: '2022-07-13T00:00:00.000Z' + disputed_payment: + payment_id: zhyh1ch64kRBrrlfVhwjCEjZWzNZY + evidence_ids: + - evidence_ids + card_brand: VISA + created_at: '2022-06-29T18:45:22.265Z' + updated_at: '2022-07-07T19:14:42.650Z' + brand_dispute_id: '100000809947' + reported_date: reported_date + reported_at: '2022-06-29T00:00:00.000Z' + version: 2 + location_id: L1HN3ZMQK64X9 + CreateEvidenceFile: + path: /v2/disputes/{dispute_id}/evidence-files + method: POST + auth: + - oauth2: + - DISPUTES_WRITE + docs: >- + Uploads a file to use as evidence in a dispute challenge. The endpoint + accepts HTTP + + multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF + formats. + source: + openapi: openapi/openapi.json + display-name: CreateDisputeEvidenceFile + request: + name: CreateEvidenceFileDisputesRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute for which you want to upload evidence. + body: + properties: + request: + type: optional + content-type: application/json; charset=utf-8 + image_file: + type: optional + content-type: image/jpeg + content-type: multipart/form-data + response: + docs: Success + type: root.CreateDisputeEvidenceFileResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-10-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + evidence: + evidence_id: evidence_id + id: TOomLInj6iWmP3N8qfCXrB + dispute_id: bVTprrwk0gygTLZ96VX1oB + evidence_file: + filename: customer-interaction.jpg + filetype: image/jpeg + evidence_text: evidence_text + uploaded_at: '2022-05-18T16:01:10.000Z' + evidence_type: GENERIC_EVIDENCE + CreateEvidenceText: + path: /v2/disputes/{dispute_id}/evidence-text + method: POST + auth: + - oauth2: + - DISPUTES_WRITE + docs: Uploads text to use as evidence for a dispute challenge. + source: + openapi: openapi/openapi.json + display-name: CreateDisputeEvidenceText + request: + name: CreateDisputeEvidenceTextRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute for which you want to upload evidence. + body: + properties: + idempotency_key: + type: string + docs: >- + A unique key identifying the request. For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + maxLength: 45 + evidence_type: + type: optional + docs: >- + The type of evidence you are uploading. + + See [DisputeEvidenceType](#type-disputeevidencetype) for + possible values + evidence_text: + type: string + docs: The evidence string. + validation: + minLength: 1 + maxLength: 500 + content-type: application/json + response: + docs: Success + type: root.CreateDisputeEvidenceTextResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: ed3ee3933d946f1514d505d173c82648 + evidence_type: TRACKING_NUMBER + evidence_text: 1Z8888888888888888 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + evidence: + evidence_id: evidence_id + id: TOomLInj6iWmP3N8qfCXrB + dispute_id: bVTprrwk0gygTLZ96VX1oB + evidence_file: + filename: filename + filetype: filetype + evidence_text: >- + The customer purchased the item twice, on April 11 and April + 28. + uploaded_at: '2022-05-18T16:01:10.000Z' + evidence_type: REBUTTAL_EXPLANATION + SubmitEvidence: + path: /v2/disputes/{dispute_id}/submit-evidence + method: POST + auth: + - oauth2: + - DISPUTES_WRITE + docs: >- + Submits evidence to the cardholder's bank. + + + The evidence submitted by this endpoint includes evidence uploaded + + using the + [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) + and + + [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText) + endpoints and + + evidence automatically provided by Square, when available. Evidence + cannot be removed from + + a dispute after submission. + source: + openapi: openapi/openapi.json + display-name: SubmitEvidence + request: + name: SubmitEvidenceDisputesRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute for which you want to submit evidence. + response: + docs: Success + type: root.SubmitEvidenceResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + dispute: + dispute_id: dispute_id + id: EAZoK70gX3fyvibecLwIGB + amount_money: + amount: 4350 + currency: USD + reason: CUSTOMER_REQUESTS_CREDIT + state: PROCESSING + due_at: '2022-06-01T00:00:00.000Z' + disputed_payment: + payment_id: 2yeBUWJzllJTpmnSqtMRAL19taB + evidence_ids: + - evidence_ids + card_brand: VISA + created_at: '2022-05-18T16:02:15.313Z' + updated_at: '2022-05-18T16:02:15.313Z' + brand_dispute_id: '100000399240' + reported_date: reported_date + reported_at: '2022-05-18T00:00:00.000Z' + version: 4 + location_id: LSY8XKGSMMX94 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/disputes/evidence.yml b/.mock/definition/disputes/evidence.yml new file mode 100644 index 000000000..54c9c9056 --- /dev/null +++ b/.mock/definition/disputes/evidence.yml @@ -0,0 +1,168 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/disputes/{dispute_id}/evidence + method: GET + auth: + - oauth2: + - DISPUTES_READ + docs: Returns a list of evidence associated with a dispute. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.evidence + source: + openapi: openapi/openapi.json + display-name: ListDisputeEvidence + request: + name: ListEvidenceRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute. + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListDisputeEvidenceResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + query-parameters: + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + evidence: + - evidence_id: evidence_id + id: CpfnkwGselCwS8QFvxN6 + dispute_id: bVTprrwk0gygTLZ96VX1oB + evidence_file: + filename: customer-interaction + filetype: JPG + evidence_text: evidence_text + uploaded_at: '2022-05-10T15:57:13.802Z' + evidence_type: CARDHOLDER_COMMUNICATION + - evidence_id: evidence_id + id: TOomLInj6iWmP3N8qfCXrB + dispute_id: bVTprrwk0gygTLZ96VX1oB + evidence_file: + filename: '' + filetype: '' + evidence_text: evidence_text + uploaded_at: '2022-05-18T16:01:10.000Z' + evidence_type: REBUTTAL_EXPLANATION + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cursor: cursor + get: + path: /v2/disputes/{dispute_id}/evidence/{evidence_id} + method: GET + auth: + - oauth2: + - DISPUTES_READ + docs: >- + Returns the metadata for the evidence specified in the request URL path. + + + You must maintain a copy of any evidence uploaded if you want to + reference it later. Evidence cannot be downloaded after you upload it. + source: + openapi: openapi/openapi.json + display-name: RetrieveDisputeEvidence + request: + name: GetEvidenceRequest + path-parameters: + dispute_id: + type: string + docs: >- + The ID of the dispute from which you want to retrieve evidence + metadata. + evidence_id: + type: string + docs: The ID of the evidence to retrieve. + response: + docs: Success + type: root.GetDisputeEvidenceResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + evidence_id: evidence_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + evidence: + evidence_id: evidence_id + id: TOomLInj6iWmP3N8qfCXrB + dispute_id: bVTprrwk0gygTLZ96VX1oB + evidence_file: + filename: customer-interaction.jpg + filetype: image/jpeg + evidence_text: evidence_text + uploaded_at: '2022-05-18T16:01:10.000Z' + evidence_type: CARDHOLDER_COMMUNICATION + delete: + path: /v2/disputes/{dispute_id}/evidence/{evidence_id} + method: DELETE + auth: + - oauth2: + - DISPUTES_WRITE + docs: |- + Removes specified evidence from a dispute. + Square does not send the bank any evidence that is removed. + source: + openapi: openapi/openapi.json + display-name: DeleteDisputeEvidence + request: + name: DeleteEvidenceRequest + path-parameters: + dispute_id: + type: string + docs: The ID of the dispute from which you want to remove evidence. + evidence_id: + type: string + docs: The ID of the evidence you want to remove. + response: + docs: Success + type: root.DeleteDisputeEvidenceResponse + status-code: 200 + examples: + - path-parameters: + dispute_id: dispute_id + evidence_id: evidence_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/employees.yml b/.mock/definition/employees.yml new file mode 100644 index 000000000..b3a3a34ef --- /dev/null +++ b/.mock/definition/employees.yml @@ -0,0 +1,115 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/employees + method: GET + auth: + - oauth2: + - EMPLOYEES_READ + docs: '' + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.employees + source: + openapi: openapi/openapi.json + display-name: ListEmployees + request: + name: ListEmployeesRequest + query-parameters: + location_id: + type: optional> + docs: '' + status: + type: optional> + docs: Specifies the EmployeeStatus to filter the employee by. + limit: + type: optional> + docs: The number of employees to be returned on each page. + cursor: + type: optional> + docs: The token required to retrieve the specified page of results. + response: + docs: Success + type: root.ListEmployeesResponse + status-code: 200 + availability: deprecated + examples: + - query-parameters: + location_id: location_id + status: ACTIVE + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + employees: + - id: id + first_name: first_name + last_name: last_name + email: email + phone_number: phone_number + location_ids: + - location_ids + status: ACTIVE + is_owner: true + created_at: created_at + updated_at: updated_at + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/employees/{id} + method: GET + auth: + - oauth2: + - EMPLOYEES_READ + docs: '' + source: + openapi: openapi/openapi.json + display-name: RetrieveEmployee + request: + name: GetEmployeesRequest + path-parameters: + id: + type: string + docs: UUID for the employee that was requested. + response: + docs: Success + type: root.GetEmployeeResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + employee: + id: id + first_name: first_name + last_name: last_name + email: email + phone_number: phone_number + location_ids: + - location_ids + status: ACTIVE + is_owner: true + created_at: created_at + updated_at: updated_at + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/events.yml b/.mock/definition/events.yml new file mode 100644 index 000000000..5a11a8163 --- /dev/null +++ b/.mock/definition/events.yml @@ -0,0 +1,198 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + SearchEvents: + path: /v2/events + method: POST + auth: + - oauth2: [] + docs: Search for Square API events that occur within a 28-day timeframe. + source: + openapi: openapi/openapi.json + display-name: SearchEvents + request: + name: SearchEventsRequest + body: + properties: + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. Provide this cursor to retrieve the next set of events + for your original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + validation: + maxLength: 256 + limit: + type: optional + docs: >- + The maximum number of events to return in a single page. The + response might contain fewer events. The default value is 100, + which is also the maximum allowed value. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + + + Default: 100 + validation: + min: 1 + max: 100 + query: + type: optional + docs: >- + The filtering and sorting criteria for the search request. To + retrieve additional pages using a cursor, you must use the + original query. + content-type: application/json + response: + docs: Success + type: root.SearchEventsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + events: + - merchant_id: 0HPGX5JYE6EE1 + location_id: VJDQQP3CG14EY + type: dispute.state.updated + event_id: 73ecd468-0aba-424f-b862-583d44efe7c8 + created_at: '2022-04-26T10:08:40.454726' + data: + type: dispute + id: ORSEVtZAJxb37RA1EiGw + object: + dispute: + amount_money: + amount: 8801 + currency: USD + brand_dispute_id: r9rKGSBBQbywBNnWWIiGFg + card_brand: VISA + created_at: '2020-02-19T21:24:53.258Z' + disputed_payment: + payment_id: fbmsaEOpoARDKxiSGH1fqPuqoqFZY + due_at: '2020-03-04T00:00:00.000Z' + id: ORSEVtZAJxb37RA1EiGw + location_id: VJDQQP3CG14EY + reason: AMOUNT_DIFFERS + reported_at: '2020-02-19T00:00:00.000Z' + state: WON + updated_at: '2020-02-19T21:34:41.851Z' + version: 6 + metadata: + - event_id: 73ecd468-0aba-424f-b862-583d44efe7c8 + api_version: '2022-12-13' + cursor: 6b571fc9773647f= + DisableEvents: + path: /v2/events/disable + method: PUT + auth: + - oauth2: [] + docs: >- + Disables events to prevent them from being searchable. + + All events are disabled by default. You must enable events to make them + searchable. + + Disabling events for a specific time period prevents them from being + searchable, even if you re-enable them later. + source: + openapi: openapi/openapi.json + display-name: DisableEvents + response: + docs: Success + type: root.DisableEventsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + EnableEvents: + path: /v2/events/enable + method: PUT + auth: + - oauth2: [] + docs: >- + Enables events to make them searchable. Only events that occur while in + the enabled state are searchable. + source: + openapi: openapi/openapi.json + display-name: EnableEvents + response: + docs: Success + type: root.EnableEventsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + ListEventTypes: + path: /v2/events/types + method: GET + auth: + - oauth2: [] + docs: >- + Lists all event types that you can subscribe to as webhooks or query + using the Events API. + source: + openapi: openapi/openapi.json + display-name: ListEventTypes + request: + name: ListEventTypesRequest + query-parameters: + api_version: + type: optional> + docs: >- + The API version for which to list event types. Setting this field + overrides the default version used by the application. + response: + docs: Success + type: root.ListEventTypesResponse + status-code: 200 + examples: + - query-parameters: + api_version: api_version + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + event_types: + - inventory.count.updated + metadata: + - event_type: inventory.count.updated + api_version_introduced: '2018-07-12' + release_status: PUBLIC + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/giftCards.yml b/.mock/definition/giftCards.yml new file mode 100644 index 000000000..5f06c8c1d --- /dev/null +++ b/.mock/definition/giftCards.yml @@ -0,0 +1,502 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/gift-cards + method: GET + auth: + - oauth2: + - GIFTCARDS_READ + docs: >- + Lists all gift cards. You can specify optional filters to retrieve + + a subset of the gift cards. Results are sorted by `created_at` in + ascending order. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.gift_cards + source: + openapi: openapi/openapi.json + display-name: ListGiftCards + request: + name: ListGiftCardsRequest + query-parameters: + type: + type: optional> + docs: >- + If a [type](entity:GiftCardType) is provided, the endpoint returns + gift cards of the specified type. + + Otherwise, the endpoint returns gift cards of all types. + state: + type: optional> + docs: >- + If a [state](entity:GiftCardStatus) is provided, the endpoint + returns the gift cards in the specified state. + + Otherwise, the endpoint returns the gift cards of all states. + limit: + type: optional> + docs: >- + If a limit is provided, the endpoint returns only the specified + number of results per page. + + The maximum value is 200. The default value is 30. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + If a cursor is not provided, the endpoint returns the first page + of the results. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + customer_id: + type: optional> + docs: >- + If a customer ID is provided, the endpoint returns only the gift + cards linked to the specified customer. + response: + docs: Success + type: root.ListGiftCardsResponse + status-code: 200 + examples: + - query-parameters: + type: type + state: state + limit: 1 + cursor: cursor + customer_id: customer_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_cards: + - id: gftc:00113070ba5745f0b2377c1b9570cb03 + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 3900 + currency: USD + gan: '7783320008524605' + created_at: '2021-06-09T22:26:54.000Z' + customer_ids: + - customer_ids + - id: gftc:00128a12725b41e58e0de1d20497a9dd + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 2000 + currency: USD + gan: '7783320002692465' + created_at: '2021-05-20T22:26:54.000Z' + customer_ids: + - customer_ids + cursor: JbFmyvUpaNKsfC1hoLSA4WlqkgkZXTWeKuStajR5BkP7OE0ETAbeWSi6U6u7sH + create: + path: /v2/gift-cards + method: POST + auth: + - oauth2: + - GIFTCARDS_WRITE + docs: >- + Creates a digital gift card or registers a physical (plastic) gift card. + The resulting gift card + + has a `PENDING` state. To activate a gift card so that it can be + redeemed for purchases, call + + [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) + and create an `ACTIVATE` + + activity with the initial balance. Alternatively, you can use + [RefundPayment](api-endpoint:Refunds-RefundPayment) + + to refund a payment to the new gift card. + source: + openapi: openapi/openapi.json + display-name: CreateGiftCard + request: + name: CreateGiftCardRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 128 + location_id: + type: string + docs: >- + The ID of the [location](entity:Location) where the gift card + should be registered for + + reporting purposes. Gift cards can be redeemed at any of the + seller's locations. + validation: + minLength: 1 + gift_card: + type: root.GiftCard + docs: >- + The gift card to create. The `type` field is required for this + request. The `gan_source` + + and `gan` fields are included as follows: + + + To direct Square to generate a 16-digit GAN, omit `gan_source` + and `gan`. + + + To provide a custom GAN, include `gan_source` and `gan`. + + - For `gan_source`, specify `OTHER`. + + - For `gan`, provide a custom GAN containing 8 to 20 + alphanumeric characters. The GAN must be + + unique for the seller and cannot start with the same bank + identification number (BIN) as major + + credit cards. Do not use GANs that are easy to guess (such as + 12345678) because they greatly + + increase the risk of fraud. It is the responsibility of the + developer to ensure the security + + of their custom GANs. For more information, see + + [Custom + GANs](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#custom-gans). + + + To register an unused, physical gift card that the seller + previously ordered from Square, + + include `gan` and provide the GAN that is printed on the gift + card. + content-type: application/json + response: + docs: Success + type: root.CreateGiftCardResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: NC9Tm69EjbjtConu + location_id: 81FN9BNFZTKS4 + gift_card: + type: DIGITAL + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:6cbacbb64cf54e2ca9f573d619038059 + type: DIGITAL + gan_source: SQUARE + state: PENDING + balance_money: + amount: 0 + currency: USD + gan: '7783320006753271' + created_at: '2021-05-20T22:26:54.000Z' + customer_ids: + - customer_ids + getFromGAN: + path: /v2/gift-cards/from-gan + method: POST + auth: + - oauth2: + - GIFTCARDS_READ + docs: Retrieves a gift card using the gift card account number (GAN). + source: + openapi: openapi/openapi.json + display-name: RetrieveGiftCardFromGAN + request: + name: GetGiftCardFromGANRequest + body: + properties: + gan: + type: string + docs: >- + The gift card account number (GAN) of the gift card to retrieve. + + The maximum length of a GAN is 255 digits to account for + third-party GANs that have been imported. + + Square-issued gift cards have 16-digit GANs. + validation: + minLength: 1 + maxLength: 255 + content-type: application/json + response: + docs: Success + type: root.GetGiftCardFromGANResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + gan: '7783320001001635' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:6944163553804e439d89adb47caf806a + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 5000 + currency: USD + gan: '7783320001001635' + created_at: '2021-05-20T22:26:54.000Z' + customer_ids: + - customer_ids + getFromNonce: + path: /v2/gift-cards/from-nonce + method: POST + auth: + - oauth2: + - GIFTCARDS_READ + docs: >- + Retrieves a gift card using a secure payment token that represents the + gift card. + source: + openapi: openapi/openapi.json + display-name: RetrieveGiftCardFromNonce + request: + name: GetGiftCardFromNonceRequest + body: + properties: + nonce: + type: string + docs: >- + The payment token of the gift card to retrieve. Payment tokens + are generated by the + + Web Payments SDK or In-App Payments SDK. + validation: + minLength: 1 + content-type: application/json + response: + docs: Success + type: root.GetGiftCardFromNonceResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + nonce: cnon:7783322135245171 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:6944163553804e439d89adb47caf806a + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 5000 + currency: USD + gan: '7783320001001635' + created_at: '2021-05-20T22:26:54.000Z' + customer_ids: + - customer_ids + LinkCustomer: + path: /v2/gift-cards/{gift_card_id}/link-customer + method: POST + auth: + - oauth2: + - GIFTCARDS_WRITE + docs: >- + Links a customer to a gift card, which is also referred to as adding a + card on file. + source: + openapi: openapi/openapi.json + display-name: LinkCustomerToGiftCard + request: + name: LinkCustomerToGiftCardRequest + path-parameters: + gift_card_id: + type: string + docs: The ID of the gift card to be linked. + body: + properties: + customer_id: + type: string + docs: The ID of the customer to link to the gift card. + validation: + minLength: 1 + maxLength: 191 + content-type: application/json + response: + docs: Success + type: root.LinkCustomerToGiftCardResponse + status-code: 200 + examples: + - path-parameters: + gift_card_id: gift_card_id + headers: + Square-Version: '2025-10-16' + request: + customer_id: GKY0FZ3V717AH8Q2D821PNT2ZW + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:71ea002277a34f8a945e284b04822edb + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 2500 + currency: USD + gan: '7783320005440920' + created_at: '2021-03-25T05:13:01Z' + customer_ids: + - GKY0FZ3V717AH8Q2D821PNT2ZW + UnlinkCustomer: + path: /v2/gift-cards/{gift_card_id}/unlink-customer + method: POST + auth: + - oauth2: + - GIFTCARDS_WRITE + docs: >- + Unlinks a customer from a gift card, which is also referred to as + removing a card on file. + source: + openapi: openapi/openapi.json + display-name: UnlinkCustomerFromGiftCard + request: + name: UnlinkCustomerFromGiftCardRequest + path-parameters: + gift_card_id: + type: string + docs: The ID of the gift card to be unlinked. + body: + properties: + customer_id: + type: string + docs: The ID of the customer to unlink from the gift card. + validation: + minLength: 1 + maxLength: 191 + content-type: application/json + response: + docs: Success + type: root.UnlinkCustomerFromGiftCardResponse + status-code: 200 + examples: + - path-parameters: + gift_card_id: gift_card_id + headers: + Square-Version: '2025-10-16' + request: + customer_id: GKY0FZ3V717AH8Q2D821PNT2ZW + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:71ea002277a34f8a945e284b04822edb + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 2500 + currency: USD + gan: '7783320005440920' + created_at: '2021-03-25T05:13:01Z' + customer_ids: + - customer_ids + get: + path: /v2/gift-cards/{id} + method: GET + auth: + - oauth2: + - GIFTCARDS_READ + docs: Retrieves a gift card using the gift card ID. + source: + openapi: openapi/openapi.json + display-name: RetrieveGiftCard + request: + name: GetGiftCardsRequest + path-parameters: + id: + type: string + docs: The ID of the gift card to retrieve. + response: + docs: Success + type: root.GetGiftCardResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card: + id: gftc:00113070ba5745f0b2377c1b9570cb03 + type: DIGITAL + gan_source: SQUARE + state: ACTIVE + balance_money: + amount: 1000 + currency: USD + gan: '7783320001001635' + created_at: '2021-05-20T22:26:54.000Z' + customer_ids: + - customer_ids + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/giftCards/activities.yml b/.mock/definition/giftCards/activities.yml new file mode 100644 index 000000000..e84448e0d --- /dev/null +++ b/.mock/definition/giftCards/activities.yml @@ -0,0 +1,337 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/gift-cards/activities + method: GET + auth: + - oauth2: + - GIFTCARDS_READ + docs: >- + Lists gift card activities. By default, you get gift card activities for + all + + gift cards in the seller's account. You can optionally specify query + parameters to + + filter the list. For example, you can get a list of gift card activities + for a gift card, + + for all gift cards in a specific region, or for activities within a time + window. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.gift_card_activities + source: + openapi: openapi/openapi.json + display-name: ListGiftCardActivities + request: + name: ListActivitiesRequest + query-parameters: + gift_card_id: + type: optional> + docs: >- + If a gift card ID is provided, the endpoint returns activities + related + + to the specified gift card. Otherwise, the endpoint returns all + gift card activities for + + the seller. + type: + type: optional> + docs: >- + If a [type](entity:GiftCardActivityType) is provided, the endpoint + returns gift card activities of the specified type. + + Otherwise, the endpoint returns all types of gift card activities. + location_id: + type: optional> + docs: >- + If a location ID is provided, the endpoint returns gift card + activities for the specified location. + + Otherwise, the endpoint returns gift card activities for all + locations. + begin_time: + type: optional> + docs: >- + The timestamp for the beginning of the reporting period, in RFC + 3339 format. + + This start time is inclusive. The default value is the current + time minus one year. + end_time: + type: optional> + docs: >- + The timestamp for the end of the reporting period, in RFC 3339 + format. + + This end time is inclusive. The default value is the current time. + limit: + type: optional> + docs: >- + If a limit is provided, the endpoint returns the specified number + + of results (or fewer) per page. The maximum value is 100. The + default value is 50. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + If a cursor is not provided, the endpoint returns the first page + of the results. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + sort_order: + type: optional> + docs: >- + The order in which the endpoint returns the activities, based on + `created_at`. + + - `ASC` - Oldest to newest. + + - `DESC` - Newest to oldest (default). + response: + docs: Success + type: root.ListGiftCardActivitiesResponse + status-code: 200 + examples: + - query-parameters: + gift_card_id: gift_card_id + type: type + location_id: location_id + begin_time: begin_time + end_time: end_time + limit: 1 + cursor: cursor + sort_order: sort_order + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card_activities: + - id: gcact_897698f894b44b3db46c6147e26a0e19 + type: REDEEM + location_id: 81FN9BNFZTKS4 + created_at: '2021-06-02T22:26:38.000Z' + gift_card_id: gftc:6d55a72470d940c6ba09c0ab8ad08d20 + gift_card_gan: '7783320002929081' + gift_card_balance_money: + amount: 700 + currency: USD + redeem_activity_details: + amount_money: + amount: 300 + currency: USD + clear_balance_activity_details: + reason: SUSPICIOUS_ACTIVITY + deactivate_activity_details: + reason: SUSPICIOUS_ACTIVITY + adjust_increment_activity_details: + amount_money: {} + reason: COMPLIMENTARY + adjust_decrement_activity_details: + amount_money: {} + reason: SUSPICIOUS_ACTIVITY + unlinked_activity_refund_activity_details: + amount_money: {} + import_activity_details: + amount_money: {} + block_activity_details: + reason: CHARGEBACK_BLOCK + unblock_activity_details: + reason: CHARGEBACK_UNBLOCK + import_reversal_activity_details: + amount_money: {} + transfer_balance_to_activity_details: + transfer_from_gift_card_id: transfer_from_gift_card_id + amount_money: {} + transfer_balance_from_activity_details: + transfer_to_gift_card_id: transfer_to_gift_card_id + amount_money: {} + - id: gcact_b968ebfc7d46437b945be7b9e09123b4 + type: ACTIVATE + location_id: 81FN9BNFZTKS4 + created_at: '2021-05-20T22:26:54.000Z' + gift_card_id: gftc:6d55a72470d940c6ba09c0ab8ad08d20 + gift_card_gan: '7783320002929081' + gift_card_balance_money: + amount: 1000 + currency: USD + activate_activity_details: + amount_money: + amount: 1000 + currency: USD + order_id: jJNGHm4gLI6XkFbwtiSLqK72KkAZY + line_item_uid: eIWl7X0nMuO9Ewbh0ChIx + redeem_activity_details: + amount_money: {} + clear_balance_activity_details: + reason: SUSPICIOUS_ACTIVITY + deactivate_activity_details: + reason: SUSPICIOUS_ACTIVITY + adjust_increment_activity_details: + amount_money: {} + reason: COMPLIMENTARY + adjust_decrement_activity_details: + amount_money: {} + reason: SUSPICIOUS_ACTIVITY + unlinked_activity_refund_activity_details: + amount_money: {} + import_activity_details: + amount_money: {} + block_activity_details: + reason: CHARGEBACK_BLOCK + unblock_activity_details: + reason: CHARGEBACK_UNBLOCK + import_reversal_activity_details: + amount_money: {} + transfer_balance_to_activity_details: + transfer_from_gift_card_id: transfer_from_gift_card_id + amount_money: {} + transfer_balance_from_activity_details: + transfer_to_gift_card_id: transfer_to_gift_card_id + amount_money: {} + cursor: cursor + create: + path: /v2/gift-cards/activities + method: POST + auth: + - oauth2: + - GIFTCARDS_WRITE + docs: >- + Creates a gift card activity to manage the balance or state of a [gift + card](entity:GiftCard). + + For example, create an `ACTIVATE` activity to activate a gift card with + an initial balance before first use. + source: + openapi: openapi/openapi.json + display-name: CreateGiftCardActivity + request: + name: CreateGiftCardActivityRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies the `CreateGiftCardActivity` + request. + validation: + minLength: 1 + maxLength: 128 + gift_card_activity: + type: root.GiftCardActivity + docs: >- + The activity to create for the gift card. This activity must + specify `gift_card_id` or `gift_card_gan` for the target + + gift card, the `location_id` where the activity occurred, and + the activity `type` along with the corresponding activity + details. + content-type: application/json + response: + docs: Success + type: root.CreateGiftCardActivityResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: U16kfr-kA70er-q4Rsym-7U7NnY + gift_card_activity: + type: ACTIVATE + location_id: 81FN9BNFZTKS4 + gift_card_id: gftc:6d55a72470d940c6ba09c0ab8ad08d20 + activate_activity_details: + order_id: jJNGHm4gLI6XkFbwtiSLqK72KkAZY + line_item_uid: eIWl7X0nMuO9Ewbh0ChIx + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + gift_card_activity: + id: gcact_c8f8cbf1f24b448d8ecf39ed03f97864 + type: ACTIVATE + location_id: 81FN9BNFZTKS4 + created_at: '2021-05-20T22:26:54.000Z' + gift_card_id: gftc:6d55a72470d940c6ba09c0ab8ad08d20 + gift_card_gan: '7783320002929081' + gift_card_balance_money: + amount: 1000 + currency: USD + load_activity_details: + order_id: order_id + line_item_uid: line_item_uid + reference_id: reference_id + buyer_payment_instrument_ids: + - buyer_payment_instrument_ids + activate_activity_details: + amount_money: + amount: 1000 + currency: USD + order_id: jJNGHm4gLI6XkFbwtiSLqK72KkAZY + line_item_uid: eIWl7X0nMuO9Ewbh0ChIx + reference_id: reference_id + buyer_payment_instrument_ids: + - buyer_payment_instrument_ids + redeem_activity_details: + amount_money: {} + payment_id: payment_id + reference_id: reference_id + status: PENDING + clear_balance_activity_details: + reason: SUSPICIOUS_ACTIVITY + deactivate_activity_details: + reason: SUSPICIOUS_ACTIVITY + adjust_increment_activity_details: + amount_money: {} + reason: COMPLIMENTARY + adjust_decrement_activity_details: + amount_money: {} + reason: SUSPICIOUS_ACTIVITY + refund_activity_details: + redeem_activity_id: redeem_activity_id + reference_id: reference_id + payment_id: payment_id + unlinked_activity_refund_activity_details: + amount_money: {} + reference_id: reference_id + payment_id: payment_id + import_activity_details: + amount_money: {} + block_activity_details: + reason: CHARGEBACK_BLOCK + unblock_activity_details: + reason: CHARGEBACK_UNBLOCK + import_reversal_activity_details: + amount_money: {} + transfer_balance_to_activity_details: + transfer_from_gift_card_id: transfer_from_gift_card_id + amount_money: {} + transfer_balance_from_activity_details: + transfer_to_gift_card_id: transfer_to_gift_card_id + amount_money: {} + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/inventory.yml b/.mock/definition/inventory.yml new file mode 100644 index 000000000..be1b75dc9 --- /dev/null +++ b/.mock/definition/inventory.yml @@ -0,0 +1,847 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + DeprecatedGetAdjustment: + path: /v2/inventory/adjustment/{adjustment_id} + method: GET + auth: + - oauth2: + - INVENTORY_READ + docs: >- + Deprecated version of + [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) + after the endpoint URL + + is updated to conform to the standard convention. + source: + openapi: openapi/openapi.json + display-name: DeprecatedRetrieveInventoryAdjustment + request: + name: DeprecatedGetAdjustmentInventoryRequest + path-parameters: + adjustment_id: + type: string + docs: >- + ID of the [InventoryAdjustment](entity:InventoryAdjustment) to + retrieve. + response: + docs: Success + type: root.GetInventoryAdjustmentResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + adjustment_id: adjustment_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + adjustment: + id: UDMOEO78BG6GYWA2XDRYX3KB + reference_id: 4a366069-4096-47a2-99a5-0084ac879509 + from_state: IN_STOCK + to_state: SOLD + location_id: C6W5YS5QM06F5 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + quantity: '7' + total_price_money: + amount: 4550 + currency: USD + occurred_at: '2016-11-16T25:44:22.837Z' + created_at: '2016-11-17T13:02:15.142Z' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + employee_id: employee_id + team_member_id: LRK57NSQ5X7PUD05 + transaction_id: transaction_id + refund_id: refund_id + purchase_order_id: purchase_order_id + goods_receipt_id: goods_receipt_id + adjustment_group: + id: id + root_adjustment_id: root_adjustment_id + from_state: CUSTOM + to_state: CUSTOM + getAdjustment: + path: /v2/inventory/adjustments/{adjustment_id} + method: GET + auth: + - oauth2: + - INVENTORY_READ + docs: |- + Returns the [InventoryAdjustment](entity:InventoryAdjustment) object + with the provided `adjustment_id`. + source: + openapi: openapi/openapi.json + display-name: RetrieveInventoryAdjustment + request: + name: GetAdjustmentInventoryRequest + path-parameters: + adjustment_id: + type: string + docs: >- + ID of the [InventoryAdjustment](entity:InventoryAdjustment) to + retrieve. + response: + docs: Success + type: root.GetInventoryAdjustmentResponse + status-code: 200 + examples: + - path-parameters: + adjustment_id: adjustment_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + adjustment: + id: UDMOEO78BG6GYWA2XDRYX3KB + reference_id: 4a366069-4096-47a2-99a5-0084ac879509 + from_state: IN_STOCK + to_state: SOLD + location_id: C6W5YS5QM06F5 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + quantity: '7' + total_price_money: + amount: 4550 + currency: USD + occurred_at: '2016-11-16T25:44:22.837Z' + created_at: '2016-11-17T13:02:15.142Z' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + employee_id: employee_id + team_member_id: LRK57NSQ5X7PUD05 + transaction_id: transaction_id + refund_id: refund_id + purchase_order_id: purchase_order_id + goods_receipt_id: goods_receipt_id + adjustment_group: + id: id + root_adjustment_id: root_adjustment_id + from_state: CUSTOM + to_state: CUSTOM + DeprecatedBatchChange: + path: /v2/inventory/batch-change + method: POST + auth: + - oauth2: + - INVENTORY_WRITE + docs: >- + Deprecated version of + [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) + after the endpoint URL + + is updated to conform to the standard convention. + source: + openapi: openapi/openapi.json + display-name: DeprecatedBatchChangeInventory + request: + body: root.BatchChangeInventoryRequest + content-type: application/json + response: + docs: Success + type: root.BatchChangeInventoryResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe + changes: + - type: PHYSICAL_COUNT + physical_count: + reference_id: 1536bfbf-efed-48bf-b17d-a197141b2a92 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '53' + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:25:24.878Z' + ignore_unchanged_counts: true + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + counts: + - catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '53' + calculated_at: '2016-11-16T22:28:01.223Z' + is_estimated: true + changes: + - type: PHYSICAL_COUNT + measurement_unit_id: measurement_unit_id + DeprecatedBatchGetChanges: + path: /v2/inventory/batch-retrieve-changes + method: POST + auth: + - oauth2: + - INVENTORY_READ + docs: >- + Deprecated version of + [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) + after the endpoint URL + + is updated to conform to the standard convention. + source: + openapi: openapi/openapi.json + display-name: DeprecatedBatchRetrieveInventoryChanges + request: + body: root.BatchRetrieveInventoryChangesRequest + content-type: application/json + response: + docs: Success + type: root.BatchGetInventoryChangesResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-10-16' + request: + catalog_object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + location_ids: + - C6W5YS5QM06F5 + types: + - PHYSICAL_COUNT + states: + - IN_STOCK + updated_after: '2016-11-01T00:00:00.000Z' + updated_before: '2016-12-01T00:00:00.000Z' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + changes: + - type: PHYSICAL_COUNT + physical_count: + id: 46YDTW253DWGGK9HMAE6XCAO + reference_id: 22c07cf4-5626-4224-89f9-691112019399 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '86' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:24:49.028Z' + created_at: '2016-11-16T22:25:24.878Z' + measurement_unit_id: measurement_unit_id + cursor: cursor + DeprecatedBatchGetCounts: + path: /v2/inventory/batch-retrieve-counts + method: POST + auth: + - oauth2: + - INVENTORY_READ + docs: >- + Deprecated version of + [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) + after the endpoint URL + + is updated to conform to the standard convention. + source: + openapi: openapi/openapi.json + display-name: DeprecatedBatchRetrieveInventoryCounts + request: + body: root.BatchGetInventoryCountsRequest + content-type: application/json + response: + docs: Success + type: root.BatchGetInventoryCountsResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-10-16' + request: + catalog_object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + location_ids: + - 59TNP9SA8VGDA + updated_after: '2016-11-16T00:00:00.000Z' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + counts: + - catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: 59TNP9SA8VGDA + quantity: '79' + calculated_at: '2016-11-16T22:28:01.223Z' + is_estimated: true + cursor: cursor + BatchCreateChanges: + path: /v2/inventory/changes/batch-create + method: POST + auth: + - oauth2: + - INVENTORY_WRITE + docs: |- + 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. + source: + openapi: openapi/openapi.json + display-name: BatchChangeInventory + request: + body: root.BatchChangeInventoryRequest + content-type: application/json + response: + docs: Success + type: root.BatchChangeInventoryResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe + changes: + - type: PHYSICAL_COUNT + physical_count: + reference_id: 1536bfbf-efed-48bf-b17d-a197141b2a92 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '53' + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:25:24.878Z' + ignore_unchanged_counts: true + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + counts: + - catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '53' + calculated_at: '2016-11-16T22:28:01.223Z' + is_estimated: true + changes: + - type: PHYSICAL_COUNT + measurement_unit_id: measurement_unit_id + BatchGetChanges: + path: /v2/inventory/changes/batch-retrieve + method: POST + auth: + - oauth2: + - INVENTORY_READ + docs: |- + 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. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.changes + source: + openapi: openapi/openapi.json + display-name: BatchRetrieveInventoryChanges + request: + body: root.BatchRetrieveInventoryChangesRequest + content-type: application/json + response: + docs: Success + type: root.BatchGetInventoryChangesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + catalog_object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + location_ids: + - C6W5YS5QM06F5 + types: + - PHYSICAL_COUNT + states: + - IN_STOCK + updated_after: '2016-11-01T00:00:00.000Z' + updated_before: '2016-12-01T00:00:00.000Z' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + changes: + - type: PHYSICAL_COUNT + physical_count: + id: 46YDTW253DWGGK9HMAE6XCAO + reference_id: 22c07cf4-5626-4224-89f9-691112019399 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '86' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:24:49.028Z' + created_at: '2016-11-16T22:25:24.878Z' + measurement_unit_id: measurement_unit_id + cursor: cursor + BatchGetCounts: + path: /v2/inventory/counts/batch-retrieve + method: POST + auth: + - oauth2: + - INVENTORY_READ + docs: >- + Returns current counts for the provided + + [CatalogObject](entity:CatalogObject)s at the requested + + [Location](entity: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. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.counts + source: + openapi: openapi/openapi.json + display-name: BatchRetrieveInventoryCounts + request: + body: root.BatchGetInventoryCountsRequest + content-type: application/json + response: + docs: Success + type: root.BatchGetInventoryCountsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + catalog_object_ids: + - W62UWFY35CWMYGVWK6TWJDNI + location_ids: + - 59TNP9SA8VGDA + updated_after: '2016-11-16T00:00:00.000Z' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + counts: + - catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: 59TNP9SA8VGDA + quantity: '79' + calculated_at: '2016-11-16T22:28:01.223Z' + is_estimated: true + cursor: cursor + deprecatedGetPhysicalCount: + path: /v2/inventory/physical-count/{physical_count_id} + method: GET + auth: + - oauth2: + - INVENTORY_READ + docs: >- + Deprecated version of + [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) + after the endpoint URL + + is updated to conform to the standard convention. + source: + openapi: openapi/openapi.json + display-name: DeprecatedRetrieveInventoryPhysicalCount + request: + name: DeprecatedGetPhysicalCountInventoryRequest + path-parameters: + physical_count_id: + type: string + docs: >- + ID of the + + [InventoryPhysicalCount](entity:InventoryPhysicalCount) to + retrieve. + response: + docs: Success + type: root.GetInventoryPhysicalCountResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + physical_count_id: physical_count_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + count: + id: ANZADNPLKADOJKJIUANKLMLQ + reference_id: f857ec37-f9a0-4458-8e23-5b5e0bea4e53 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '15' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + employee_id: employee_id + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:25:24.878Z' + created_at: '2016-11-16T22:25:24.878Z' + getPhysicalCount: + path: /v2/inventory/physical-counts/{physical_count_id} + method: GET + auth: + - oauth2: + - INVENTORY_READ + docs: |- + Returns the [InventoryPhysicalCount](entity:InventoryPhysicalCount) + object with the provided `physical_count_id`. + source: + openapi: openapi/openapi.json + display-name: RetrieveInventoryPhysicalCount + request: + name: GetPhysicalCountInventoryRequest + path-parameters: + physical_count_id: + type: string + docs: >- + ID of the + + [InventoryPhysicalCount](entity:InventoryPhysicalCount) to + retrieve. + response: + docs: Success + type: root.GetInventoryPhysicalCountResponse + status-code: 200 + examples: + - path-parameters: + physical_count_id: physical_count_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + count: + id: ANZADNPLKADOJKJIUANKLMLQ + reference_id: f857ec37-f9a0-4458-8e23-5b5e0bea4e53 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '15' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + employee_id: employee_id + team_member_id: LRK57NSQ5X7PUD05 + occurred_at: '2016-11-16T22:25:24.878Z' + created_at: '2016-11-16T22:25:24.878Z' + getTransfer: + path: /v2/inventory/transfers/{transfer_id} + method: GET + auth: + - oauth2: + - INVENTORY_READ + docs: |- + Returns the [InventoryTransfer](entity:InventoryTransfer) object + with the provided `transfer_id`. + source: + openapi: openapi/openapi.json + display-name: RetrieveInventoryTransfer + request: + name: GetTransferInventoryRequest + path-parameters: + transfer_id: + type: string + docs: >- + ID of the [InventoryTransfer](entity:InventoryTransfer) to + retrieve. + response: + docs: Success + type: root.GetInventoryTransferResponse + status-code: 200 + examples: + - path-parameters: + transfer_id: transfer_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + transfer: + id: UDMOEO78BG6GYWA2XDRYX3KB + reference_id: 4a366069-4096-47a2-99a5-0084ac879509 + state: IN_STOCK + from_location_id: C6W5YS5QM06F5 + to_location_id: 59TNP9SA8VGDA + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + quantity: '7' + occurred_at: '2016-11-16T25:44:22.837Z' + created_at: '2016-11-17T13:02:15.142Z' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + employee_id: employee_id + team_member_id: LRK57NSQ5X7PUD05 + get: + path: /v2/inventory/{catalog_object_id} + method: GET + auth: + - oauth2: + - INVENTORY_READ + docs: |- + Retrieves the current calculated stock count for a given + [CatalogObject](entity:CatalogObject) at a given set of + [Location](entity:Location)s. Responses are paginated and unsorted. + For more sophisticated queries, use a batch endpoint. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.counts + source: + openapi: openapi/openapi.json + display-name: RetrieveInventoryCount + request: + name: GetInventoryRequest + path-parameters: + catalog_object_id: + type: string + docs: ID of the [CatalogObject](entity:CatalogObject) to retrieve. + query-parameters: + location_ids: + type: optional> + docs: >- + The [Location](entity:Location) IDs to look up as a + comma-separated + + list. An empty list queries all locations. + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for the original + query. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + response: + docs: Success + type: root.GetInventoryCountResponse + status-code: 200 + examples: + - path-parameters: + catalog_object_id: catalog_object_id + query-parameters: + location_ids: location_ids + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + counts: + - catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + state: IN_STOCK + location_id: C6W5YS5QM06F5 + quantity: '22' + calculated_at: '2016-11-16T22:28:01.223Z' + is_estimated: true + cursor: cursor + changes: + path: /v2/inventory/{catalog_object_id}/changes + method: GET + auth: + - oauth2: + - INVENTORY_READ + docs: >- + Returns a set of physical counts and inventory adjustments for the + + provided [CatalogObject](entity:CatalogObject) at the requested + + [Location](entity:Location)s. + + + You can achieve the same result by calling + [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) + + and having the `catalog_object_ids` list contain a single element of the + `CatalogObject` ID. + + + 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 + can be + + used to display recent changes for a specific item. For more + + sophisticated queries, use a batch endpoint. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.changes + source: + openapi: openapi/openapi.json + display-name: RetrieveInventoryChanges + request: + name: ChangesInventoryRequest + path-parameters: + catalog_object_id: + type: string + docs: ID of the [CatalogObject](entity:CatalogObject) to retrieve. + query-parameters: + location_ids: + type: optional> + docs: >- + The [Location](entity:Location) IDs to look up as a + comma-separated + + list. An empty list queries all locations. + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for the original + query. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + response: + docs: Success + type: root.GetInventoryChangesResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + catalog_object_id: catalog_object_id + query-parameters: + location_ids: location_ids + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + changes: + - type: ADJUSTMENT + adjustment: + id: OJKJIUANKLMLQANZADNPLKAD + reference_id: d8207693-168f-4b44-a2fd-a7ff533ddd26 + from_state: IN_STOCK + to_state: SOLD + location_id: C6W5YS5QM06F5 + catalog_object_id: W62UWFY35CWMYGVWK6TWJDNI + catalog_object_type: ITEM_VARIATION + quantity: '3' + total_price_money: + amount: 5000 + currency: USD + occurred_at: '2016-11-16T22:25:24.878Z' + created_at: '2016-11-16T22:25:24.878Z' + source: + product: SQUARE_POS + application_id: 416ff29c-86c4-4feb-b58c-9705f21f3ea0 + name: Square Point of Sale 4.37 + team_member_id: AV7YRCGI2H1J5NQ8E1XIZCNA + transaction_id: 5APV6JYK1SNCZD11AND2RX1Z + measurement_unit_id: measurement_unit_id + cursor: cursor + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/invoices.yml b/.mock/definition/invoices.yml new file mode 100644 index 000000000..61db343fb --- /dev/null +++ b/.mock/definition/invoices.yml @@ -0,0 +1,1236 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/invoices + method: GET + auth: + - oauth2: + - INVOICES_READ + docs: >- + Returns a list of invoices for a given location. The response + + is paginated. If truncated, the response includes a `cursor` that + you + + use in a subsequent request to retrieve the next set of invoices. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.invoices + source: + openapi: openapi/openapi.json + display-name: ListInvoices + request: + name: ListInvoicesRequest + query-parameters: + location_id: + type: string + docs: The ID of the location for which to list invoices. + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for your + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + The maximum number of invoices to return (200 is the maximum + `limit`). + + If not provided, the server uses a default limit of 100 invoices. + response: + docs: Success + type: root.ListInvoicesResponse + status-code: 200 + examples: + - query-parameters: + location_id: location_id + cursor: cursor + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + invoices: + - id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 1 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + status: DRAFT + timezone: America/Los_Angeles + created_at: '2030-01-13T17:45:13Z' + updated_at: '2030-01-13T21:24:10Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - id: inva:0-3bB9ZuDHiziThQhuC4fwWt + filename: file.jpg + description: Service contract + filesize: 102705 + hash: 273ee02cb6f5f8a3a8ca23604930dd53 + mime_type: image/jpeg + uploaded_at: '2030-01-13T21:24:10Z' + creator_team_member_id: creator_team_member_id + - id: inv:0-ChC366qAfskpGrBI_1bozs9mEA3 + version: 3 + location_id: ES0RJRZYEC39A + order_id: a65jnS8NXbfprvGJzY9F4fQTuaB + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + payment_requests: + - uid: 66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176 + request_type: DEPOSIT + due_date: '2021-01-23' + percentage_requested: '25' + tipping_enabled: false + automatic_payment_source: CARD_ON_FILE + card_id: ccof:IkWfpLj4tNHMyFii3GB + computed_amount_money: + amount: 1000 + currency: USD + total_completed_amount_money: + amount: 1000 + currency: USD + - uid: 120c5e18-4f80-4f6b-b159-774cb9bf8f99 + request_type: BALANCE + due_date: '2021-06-15' + tipping_enabled: false + automatic_payment_source: CARD_ON_FILE + card_id: ccof:IkWfpLj4tNHMyFii3GB + computed_amount_money: + amount: 3000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-455 + title: title + description: description + scheduled_at: scheduled_at + public_url: >- + https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9 + next_payment_amount_money: + amount: 3000 + currency: USD + status: PARTIALLY_PAID + timezone: America/Los_Angeles + created_at: '2021-01-23T15:29:12Z' + updated_at: '2021-01-23T15:29:56Z' + accepted_payment_methods: + card: true + square_gift_card: true + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - {} + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + cursor: ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/invoices + method: POST + auth: + - oauth2: + - ORDERS_WRITE + - INVOICES_WRITE + docs: >- + Creates a draft [invoice](entity:Invoice) + + for an order created using the Orders API. + + + A draft invoice remains in your account and no action is taken. + + You must publish the invoice before Square can process it (send it to + the customer's email address or charge the customer’s card on file). + source: + openapi: openapi/openapi.json + display-name: CreateInvoice + request: + name: CreateInvoiceRequest + body: + properties: + invoice: + type: root.Invoice + docs: The invoice to create. + idempotency_key: + type: optional + docs: >- + A unique string that identifies the `CreateInvoice` request. If + you do not + + provide `idempotency_key` (or provide an empty string as the + value), the endpoint + + treats each request as independent. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 128 + content-type: application/json + response: + docs: Success + type: root.CreateInvoiceResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + invoice: + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + payment_requests: + - request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - relative_scheduled_days: -1 + message: Your invoice is due tomorrow + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + sale_or_service_date: '2030-01-24' + store_payment_method_enabled: false + idempotency_key: ce3748f9-5fc1-4762-aa12-aae5e843f1f4 + response: + body: + invoice: + id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 0 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + company_name: company_name + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + next_payment_amount_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: DRAFT + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T17:45:13Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/invoices/search + method: POST + auth: + - oauth2: + - INVOICES_READ + docs: >- + Searches for invoices from a location specified in + + the filter. You can optionally specify customers in the filter for whom + to + + retrieve invoices. In the current implementation, you can only specify + one location and + + optionally one customer. + + + The response is paginated. If truncated, the response includes a + `cursor` + + that you use in a subsequent request to retrieve the next set of + invoices. + source: + openapi: openapi/openapi.json + display-name: SearchInvoices + request: + name: SearchInvoicesRequest + body: + properties: + query: + type: root.InvoiceQuery + docs: Describes the query criteria for searching invoices. + limit: + type: optional + docs: >- + The maximum number of invoices to return (200 is the maximum + `limit`). + + If not provided, the server uses a default limit of 100 + invoices. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this cursor to retrieve the next set of results for your + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchInvoicesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + location_ids: + - ES0RJRZYEC39A + customer_ids: + - JDKYHBWT1D4F8MFH63DBMEN8Y4 + sort: + field: INVOICE_SORT_DATE + order: DESC + limit: 100 + response: + body: + invoices: + - id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 0 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + status: DRAFT + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T17:45:13Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + - id: inv:0-ChC366qAfskpGrBI_1bozs9mEA3 + version: 3 + location_id: ES0RJRZYEC39A + order_id: a65jnS8NXbfprvGJzY9F4fQTuaB + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + payment_requests: + - uid: 66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176 + request_type: DEPOSIT + due_date: '2021-01-23' + percentage_requested: '25' + tipping_enabled: false + automatic_payment_source: CARD_ON_FILE + card_id: ccof:IkWfpLj4tNHMyFii3GB + computed_amount_money: + amount: 1000 + currency: USD + total_completed_amount_money: + amount: 1000 + currency: USD + - uid: 120c5e18-4f80-4f6b-b159-774cb9bf8f99 + request_type: BALANCE + due_date: '2021-06-15' + tipping_enabled: false + automatic_payment_source: CARD_ON_FILE + card_id: ccof:IkWfpLj4tNHMyFii3GB + computed_amount_money: + amount: 3000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-455 + title: title + description: description + scheduled_at: scheduled_at + public_url: >- + https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9 + next_payment_amount_money: + amount: 3000 + currency: USD + status: PARTIALLY_PAID + timezone: America/Los_Angeles + created_at: '2021-01-23T15:29:12Z' + updated_at: '2021-01-23T15:29:56Z' + accepted_payment_methods: + card: true + square_gift_card: true + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - {} + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + cursor: ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/invoices/{invoice_id} + method: GET + auth: + - oauth2: + - INVOICES_READ + docs: Retrieves an invoice by invoice ID. + source: + openapi: openapi/openapi.json + display-name: GetInvoice + request: + name: GetInvoicesRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the invoice to retrieve. + response: + docs: Success + type: root.GetInvoiceResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-10-16' + response: + body: + invoice: + id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 0 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + company_name: company_name + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + next_payment_amount_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: DRAFT + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T17:45:13Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/invoices/{invoice_id} + method: PUT + auth: + - oauth2: + - ORDERS_WRITE + - INVOICES_WRITE + docs: >- + Updates an invoice. This endpoint supports sparse updates, so you only + need + + to specify the fields you want to change along with the required + `version` field. + + Some restrictions apply to updating invoices. For example, you cannot + change the + + `order_id` or `location_id` field. + source: + openapi: openapi/openapi.json + display-name: UpdateInvoice + request: + name: UpdateInvoiceRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the invoice to update. + body: + properties: + invoice: + type: root.Invoice + docs: >- + The invoice fields to add, change, or clear. Fields can be + cleared using + + null values or the `remove` field (for individual payment + requests or reminders). + + The current invoice `version` is also required. For more + information, including requirements, + + limitations, and more examples, see [Update an + Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). + idempotency_key: + type: optional> + docs: >- + A unique string that identifies the `UpdateInvoice` request. If + you do not + + provide `idempotency_key` (or provide an empty string as the + value), the endpoint + + treats each request as independent. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 128 + fields_to_clear: + type: optional>> + docs: >- + The list of fields to clear. Although this field is currently + supported, we + + recommend using null values or the `remove` field when possible. + For examples, see + + [Update an + Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). + content-type: application/json + response: + docs: Success + type: root.UpdateInvoiceResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-10-16' + request: + invoice: + version: 1 + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + tipping_enabled: false + idempotency_key: 4ee82288-0910-499e-ab4c-5d0071dad1be + response: + body: + invoice: + id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 2 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + company_name: company_name + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: false + automatic_payment_source: NONE + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + next_payment_amount_money: + amount: 10000 + currency: USD + status: UNPAID + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T18:23:11Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/invoices/{invoice_id} + method: DELETE + auth: + - oauth2: + - ORDERS_WRITE + - INVOICES_WRITE + docs: >- + Deletes the specified invoice. When an invoice is deleted, the + + associated order status changes to CANCELED. You can only delete a + draft + + invoice (you cannot delete a published invoice, including one that is + scheduled for processing). + source: + openapi: openapi/openapi.json + display-name: DeleteInvoice + request: + name: DeleteInvoicesRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the invoice to delete. + query-parameters: + version: + type: optional> + docs: >- + The version of the [invoice](entity:Invoice) to delete. + + If you do not know the version, you can call + [GetInvoice](api-endpoint:Invoices-GetInvoice) or + + [ListInvoices](api-endpoint:Invoices-ListInvoices). + response: + docs: Success + type: root.DeleteInvoiceResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + query-parameters: + version: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + CreateInvoiceAttachment: + path: /v2/invoices/{invoice_id}/attachments + method: POST + auth: + - oauth2: + - INVOICES_WRITE + docs: >- + Uploads a file and attaches it to an invoice. This endpoint accepts HTTP + multipart/form-data file uploads + + with a JSON `request` part and a `file` part. The `file` part must be a + `readable stream` that contains a file + + in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF. + + + Invoices can have up to 10 attachments with a total file size of 25 MB. + Attachments can be added only to invoices + + in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. + + + __NOTE:__ When testing in the Sandbox environment, the total file size + is limited to 1 KB. + source: + openapi: openapi/openapi.json + display-name: CreateInvoiceAttachment + request: + name: CreateInvoiceAttachmentRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the [invoice](entity:Invoice) to attach the file to. + body: + properties: + request: + type: optional + content-type: application/json; charset=utf-8 + image_file: + type: optional + content-type: image/jpeg + content-type: multipart/form-data + response: + docs: Success + type: root.CreateInvoiceAttachmentResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-10-16' + request: {} + response: + body: + attachment: + id: inva:0-3bB9ZuDHiziThQhuC4fwWt + filename: file.jpg + description: Service contract + filesize: 102705 + hash: 273ee02cb6f5f8a3a8ca23604930dd53 + mime_type: image/jpeg + uploaded_at: '2023-02-03T20:28:14Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + DeleteInvoiceAttachment: + path: /v2/invoices/{invoice_id}/attachments/{attachment_id} + method: DELETE + auth: + - oauth2: + - INVOICES_WRITE + docs: >- + Removes an attachment from an invoice and permanently deletes the file. + Attachments can be removed only + + from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` + state. + source: + openapi: openapi/openapi.json + display-name: DeleteInvoiceAttachment + request: + name: DeleteInvoiceAttachmentRequest + path-parameters: + invoice_id: + type: string + docs: >- + The ID of the [invoice](entity:Invoice) to delete the attachment + from. + attachment_id: + type: string + docs: The ID of the [attachment](entity:InvoiceAttachment) to delete. + response: + docs: Success + type: root.DeleteInvoiceAttachmentResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + attachment_id: attachment_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cancel: + path: /v2/invoices/{invoice_id}/cancel + method: POST + auth: + - oauth2: + - ORDERS_WRITE + - INVOICES_WRITE + docs: >- + Cancels an invoice. The seller cannot collect payments for + + the canceled invoice. + + + You cannot cancel an invoice in the `DRAFT` state or in a terminal + state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`. + source: + openapi: openapi/openapi.json + display-name: CancelInvoice + request: + name: CancelInvoiceRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the [invoice](entity:Invoice) to cancel. + body: + properties: + version: + type: integer + docs: >- + The version of the [invoice](entity:Invoice) to cancel. + + If you do not know the version, you can call + + [GetInvoice](api-endpoint:Invoices-GetInvoice) or + [ListInvoices](api-endpoint:Invoices-ListInvoices). + content-type: application/json + response: + docs: Success + type: root.CancelInvoiceResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-10-16' + request: + version: 0 + response: + body: + invoice: + id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 1 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + company_name: company_name + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: public_url + next_payment_amount_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: CANCELED + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T18:23:11Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + publish: + path: /v2/invoices/{invoice_id}/publish + method: POST + auth: + - oauth2: + - ORDERS_WRITE + - INVOICES_WRITE + docs: >- + Publishes the specified draft invoice. + + + After an invoice is published, Square + + follows up based on the invoice configuration. For example, Square + + sends the invoice to the customer's email address, charges the + customer's card on file, or does + + nothing. Square also makes the invoice available on a Square-hosted + invoice page. + + + The invoice `status` also changes from `DRAFT` to a status + + based on the invoice configuration. For example, the status changes to + `UNPAID` if + + Square emails the invoice or `PARTIALLY_PAID` if Square charges a card + on file for a portion of the + + invoice amount. + + + In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` + permissions, `CUSTOMERS_READ` + + and `PAYMENTS_WRITE` are required when publishing invoices configured + for card-on-file payments. + source: + openapi: openapi/openapi.json + display-name: PublishInvoice + request: + name: PublishInvoiceRequest + path-parameters: + invoice_id: + type: string + docs: The ID of the invoice to publish. + body: + properties: + version: + type: integer + docs: >- + The version of the [invoice](entity:Invoice) to publish. + + This must match the current version of the invoice; otherwise, + the request is rejected. + idempotency_key: + type: optional> + docs: >- + A unique string that identifies the `PublishInvoice` request. If + you do not + + provide `idempotency_key` (or provide an empty string as the + value), the endpoint + + treats each request as independent. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 128 + content-type: application/json + response: + docs: Success + type: root.PublishInvoiceResponse + status-code: 200 + examples: + - path-parameters: + invoice_id: invoice_id + headers: + Square-Version: '2025-10-16' + request: + version: 1 + idempotency_key: 32da42d0-1997-41b0-826b-f09464fc2c2e + response: + body: + invoice: + id: inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + version: 1 + location_id: ES0RJRZYEC39A + order_id: CAISENgvlJ6jLWAzERDzjyHVybY + primary_recipient: + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + given_name: Amelia + family_name: Earhart + email_address: Amelia.Earhart@example.com + phone_number: 1-212-555-4240 + company_name: company_name + payment_requests: + - uid: 2da7964f-f3d2-4f43-81e8-5aa220bf3355 + request_type: BALANCE + due_date: '2030-01-24' + tipping_enabled: true + automatic_payment_source: NONE + reminders: + - uid: beebd363-e47f-4075-8785-c235aaa7df11 + relative_scheduled_days: -1 + message: Your invoice is due tomorrow + status: PENDING + computed_amount_money: + amount: 10000 + currency: USD + total_completed_amount_money: + amount: 0 + currency: USD + delivery_method: EMAIL + invoice_number: inv-100 + title: Event Planning Services + description: We appreciate your business! + scheduled_at: '2030-01-13T10:00:00Z' + public_url: >- + https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9 + next_payment_amount_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: SCHEDULED + timezone: America/Los_Angeles + created_at: '2020-06-18T17:45:13Z' + updated_at: '2020-06-18T18:23:11Z' + accepted_payment_methods: + card: true + square_gift_card: false + bank_account: false + buy_now_pay_later: false + cash_app_pay: false + custom_fields: + - label: Event Reference Number + value: 'Ref. #1234' + placement: ABOVE_LINE_ITEMS + - label: Terms of Service + value: The terms of service are... + placement: BELOW_LINE_ITEMS + subscription_id: subscription_id + sale_or_service_date: '2030-01-24' + payment_conditions: payment_conditions + store_payment_method_enabled: false + attachments: + - {} + creator_team_member_id: creator_team_member_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor.yml b/.mock/definition/labor.yml new file mode 100644 index 000000000..f89627eb3 --- /dev/null +++ b/.mock/definition/labor.yml @@ -0,0 +1,1046 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + CreateScheduledShift: + path: /v2/labor/scheduled-shifts + method: POST + auth: + - oauth2: + - TIMECARDS_WRITE + docs: >- + Creates a scheduled shift by providing draft shift details such as job + ID, + + team member assignment, and start and end times. + + + The following `draft_shift_details` fields are required: + + - `location_id` + + - `job_id` + + - `start_at` + + - `end_at` + source: + openapi: openapi/openapi.json + display-name: CreateScheduledShift + request: + name: CreateScheduledShiftRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique identifier for the `CreateScheduledShift` request, used + to ensure the + + [idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + + of the operation. + validation: + maxLength: 128 + scheduled_shift: + type: root.ScheduledShift + docs: >- + The scheduled shift with `draft_shift_details`. + + If needed, call + [ListLocations](api-endpoint:Locations-ListLocations) to get + location IDs, + + [ListJobs](api-endpoint:Team-ListJobs) to get job IDs, and + [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) + + to get team member IDs and current job assignments. + + + The `start_at` and `end_at` timestamps must be provided in the + time zone + offset of the + + shift location specified in `location_id`. Example for Pacific + Standard Time: 2024-10-31T12:30:00-08:00 + content-type: application/json + response: + docs: Success + type: root.CreateScheduledShiftResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: HIDSNG5KS478L + scheduled_shift: + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + response: + body: + scheduled_shift: + id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + timezone: America/New_York + published_shift_details: + team_member_id: team_member_id + location_id: location_id + job_id: job_id + start_at: start_at + end_at: end_at + notes: notes + is_deleted: true + timezone: timezone + version: 1 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:00-05:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + BulkPublishScheduledShifts: + path: /v2/labor/scheduled-shifts/bulk-publish + method: POST + auth: + - oauth2: + - TIMECARDS_WRITE + docs: >- + Publishes 1 - 100 scheduled shifts. This endpoint takes a map of + individual publish + + requests and returns a map of responses. When a scheduled shift is + published, Square keeps + + the `draft_shift_details` field as is and copies it to the + `published_shift_details` field. + + + The minimum `start_at` and maximum `end_at` timestamps of all shifts in + a + + `BulkPublishScheduledShifts` request must fall within a two-week period. + source: + openapi: openapi/openapi.json + display-name: BulkPublishScheduledShifts + request: + name: BulkPublishScheduledShiftsRequest + body: + properties: + scheduled_shifts: + type: map + docs: >- + A map of 1 to 100 key-value pairs that represent individual + publish requests. + + + - Each key is the ID of a scheduled shift you want to publish. + + - Each value is a `BulkPublishScheduledShiftsData` object that + contains the + + `version` field or is an empty object. + scheduled_shift_notification_audience: + type: optional + docs: >- + Indicates whether Square should send email notifications to team + members and + + which team members should receive the notifications. This + setting applies to all shifts + + specified in the bulk operation. The default value is + `AFFECTED`. + + See + [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudience) + for possible values + content-type: application/json + response: + docs: Success + type: root.BulkPublishScheduledShiftsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + scheduled_shifts: + key: {} + scheduled_shift_notification_audience: AFFECTED + response: + body: + responses: + idp_key_1: + scheduled_shift: + id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-03-25T03:11:00-05:00' + end_at: '2019-03-25T13:18:00-05:00' + notes: Don't forget to prep the vegetables + is_deleted: false + timezone: America/New_York + published_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-03-25T03:11:00-05:00' + end_at: '2019-03-25T13:18:00-05:00' + notes: Don't forget to prep the vegetables + is_deleted: false + timezone: America/New_York + version: 3 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:15-05:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + idp_key_2: + errors: + - category: INVALID_REQUEST_ERROR + code: INVALID_VALUE + detail: Scheduled shift with id 'scheduled-shift-2' not found + field: scheduled-shifts.scheduled-shift-2 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + SearchScheduledShifts: + path: /v2/labor/scheduled-shifts/search + method: POST + auth: + - oauth2: + - TIMECARDS_READ + docs: >- + Returns a paginated list of scheduled shifts, with optional filter and + sort settings. + + By default, results are sorted by `start_at` in ascending order. + source: + openapi: openapi/openapi.json + display-name: SearchScheduledShifts + request: + name: SearchScheduledShiftsRequest + body: + properties: + query: + type: optional + docs: Query conditions used to filter and sort the results. + limit: + type: optional + docs: >- + The maximum number of results to return in a single response + page. The default value is 50. + validation: + min: 1 + max: 50 + cursor: + type: optional + docs: >- + The pagination cursor returned by the previous call to this + endpoint. Provide + + this cursor to retrieve the next page of results for your + original request. For more + + information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchScheduledShiftsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + assignment_status: ASSIGNED + sort: + field: CREATED_AT + order: ASC + limit: 2 + cursor: xoxp-1234-5678-90123 + response: + body: + scheduled_shifts: + - id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + timezone: America/New_York + version: 1 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:00-05:00' + cursor: xoxp-123-2123-123232 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + RetrieveScheduledShift: + path: /v2/labor/scheduled-shifts/{id} + method: GET + auth: + - oauth2: + - TIMECARDS_READ + docs: Retrieves a scheduled shift by ID. + source: + openapi: openapi/openapi.json + display-name: RetrieveScheduledShift + request: + name: RetrieveScheduledShiftRequest + path-parameters: + id: + type: string + docs: The ID of the scheduled shift to retrieve. + response: + docs: Success + type: root.RetrieveScheduledShiftResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + scheduled_shift: + id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-03-25T03:11:00-05:00' + end_at: '2019-03-25T13:18:00-05:00' + notes: Don't forget to prep the vegetables + is_deleted: false + timezone: America/New_York + published_shift_details: + team_member_id: team_member_id + location_id: location_id + job_id: job_id + start_at: start_at + end_at: end_at + notes: notes + is_deleted: true + timezone: timezone + version: 2 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:15-05:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + UpdateScheduledShift: + path: /v2/labor/scheduled-shifts/{id} + method: PUT + auth: + - oauth2: + - TIMECARDS_WRITE + docs: >- + Updates the draft shift details for a scheduled shift. This endpoint + supports + + sparse updates, so only new, changed, or removed fields are required in + the request. + + You must publish the shift to make updates public. + + + You can make the following updates to `draft_shift_details`: + + - Change the `location_id`, `job_id`, `start_at`, and `end_at` fields. + + - Add, change, or clear the `team_member_id` and `notes` fields. To + clear these fields, + + set the value to null. + + - Change the `is_deleted` field. To delete a scheduled shift, set + `is_deleted` to true + + and then publish the shift. + source: + openapi: openapi/openapi.json + display-name: UpdateScheduledShift + request: + name: UpdateScheduledShiftRequest + path-parameters: + id: + type: string + docs: The ID of the scheduled shift to update. + body: + properties: + scheduled_shift: + type: root.ScheduledShift + docs: >- + The scheduled shift with any updates in the + `draft_shift_details` field. + + If needed, call + [ListLocations](api-endpoint:Locations-ListLocations) to get + location IDs, + + [ListJobs](api-endpoint:Team-ListJobs) to get job IDs, and + [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) + + to get team member IDs and current job assignments. Updates made + to `published_shift_details` + + are ignored. + + + If provided, the `start_at` and `end_at` timestamps must be in + the time zone + offset of the + + shift location specified in `location_id`. Example for Pacific + Standard Time: 2024-10-31T12:30:00-08:00 + + + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for the request, provide the current version of the + shift in the `version` field. + + If the provided version doesn't match the server version, the + request fails. If `version` is + + omitted, Square executes a blind write, potentially overwriting + data from another publish request. + content-type: application/json + response: + docs: Success + type: root.UpdateScheduledShiftResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + request: + scheduled_shift: + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-03-25T03:11:00-05:00' + end_at: '2019-03-25T13:18:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + version: 1 + response: + body: + scheduled_shift: + id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-03-25T03:11:00-05:00' + end_at: '2019-03-25T13:18:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + timezone: America/New_York + published_shift_details: + team_member_id: team_member_id + location_id: location_id + job_id: job_id + start_at: start_at + end_at: end_at + notes: notes + is_deleted: true + timezone: timezone + version: 2 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:15-05:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + PublishScheduledShift: + path: /v2/labor/scheduled-shifts/{id}/publish + method: POST + auth: + - oauth2: + - TIMECARDS_WRITE + docs: >- + Publishes a scheduled shift. When a scheduled shift is published, Square + keeps the + + `draft_shift_details` field as is and copies it to the + `published_shift_details` field. + source: + openapi: openapi/openapi.json + display-name: PublishScheduledShift + request: + name: PublishScheduledShiftRequest + path-parameters: + id: + type: string + docs: The ID of the scheduled shift to publish. + body: + properties: + idempotency_key: + type: string + docs: >- + A unique identifier for the `PublishScheduledShift` request, + used to ensure the + + [idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + + of the operation. + validation: + minLength: 1 + maxLength: 128 + version: + type: optional + docs: >- + The current version of the scheduled shift, used to enable + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control. If the provided version doesn't match the server + version, the request fails. + + If omitted, Square executes a blind write, potentially + overwriting data from another publish request. + scheduled_shift_notification_audience: + type: optional + docs: >- + Indicates whether Square should send an email notification to + team members and + + which team members should receive the notification. The default + value is `AFFECTED`. + + See + [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudience) + for possible values + content-type: application/json + response: + docs: Success + type: root.PublishScheduledShiftResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: HIDSNG5KS478L + version: 2 + scheduled_shift_notification_audience: ALL + response: + body: + scheduled_shift: + id: K0YH4CV5462JB + draft_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + timezone: America/New_York + published_shift_details: + team_member_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + notes: Dont forget to prep the vegetables + is_deleted: false + timezone: America/New_York + version: 2 + created_at: '2019-02-25T03:11:00-05:00' + updated_at: '2019-02-25T03:11:00-05:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + CreateTimecard: + path: /v2/labor/timecards + method: POST + auth: + - oauth2: + - TIMECARDS_WRITE + docs: >- + Creates a new `Timecard`. + + + A `Timecard` represents a complete workday for a single team member. + + You must provide the following values in your request to this + + endpoint: + + + - `location_id` + + - `team_member_id` + + - `start_at` + + + An attempt to create a new `Timecard` can result in a `BAD_REQUEST` + error when: + + - The `status` of the new `Timecard` is `OPEN` and the team member has + another + + timecard with an `OPEN` status. + + - The `start_at` date is in the future. + + - The `start_at` or `end_at` date overlaps another timecard for the same + team member. + + - The `Break` instances are set in the request and a break `start_at` + + is before the `Timecard.start_at`, a break `end_at` is after + + the `Timecard.end_at`, or both. + source: + openapi: openapi/openapi.json + display-name: CreateTimecard + request: + name: CreateTimecardRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string value to ensure the idempotency of the + operation. + validation: + maxLength: 128 + timecard: + type: root.Timecard + docs: The `Timecard` to be created. + content-type: application/json + response: + docs: Success + type: root.CreateTimecardResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: HIDSNG5KS478L + timecard: + location_id: PAA1RJZZKXBFG + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + tip_eligible: true + breaks: + - start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + response: + body: + timecard: + id: K0YH4CV5462JB + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + status: CLOSED + version: 1 + created_at: '2019-02-28T00:39:02Z' + updated_at: '2019-02-28T00:39:02Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + SearchTimecards: + path: /v2/labor/timecards/search + method: POST + auth: + - oauth2: + - TIMECARDS_READ + docs: |- + Returns a paginated list of `Timecard` records for a business. + The list to be returned can be filtered by: + - Location IDs + - Team member IDs + - Timecard status (`OPEN` or `CLOSED`) + - Timecard start + - Timecard end + - Workday details + + The list can be sorted by: + - `START_AT` + - `END_AT` + - `CREATED_AT` + - `UPDATED_AT` + source: + openapi: openapi/openapi.json + display-name: SearchTimecards + request: + name: SearchTimecardsRequest + body: + properties: + query: + type: optional + docs: Query filters. + limit: + type: optional + docs: The number of resources in a page (200 by default). + validation: + min: 1 + max: 200 + cursor: + type: optional + docs: An opaque cursor for fetching the next page. + content-type: application/json + response: + docs: Success + type: root.SearchTimecardsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + workday: + date_range: + start_date: '2019-01-20' + end_date: '2019-02-03' + match_timecards_by: START_AT + default_timezone: America/Los_Angeles + limit: 100 + response: + body: + timecards: + - id: X714F3HA6D1PT + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-21T03:11:00-05:00' + end_at: '2019-01-21T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + tip_eligible: true + breaks: + - id: SJW7X6AKEJQ65 + start_at: '2019-01-21T06:11:00-05:00' + end_at: '2019-01-21T06:11:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT10M + is_paid: true + status: CLOSED + version: 6 + created_at: '2019-01-24T01:12:03Z' + updated_at: '2019-02-07T22:21:08Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + - id: GDHYBZYWK0P2V + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-22T12:02:00-05:00' + end_at: '2019-01-22T13:02:00-05:00' + wage: + title: Cook + hourly_rate: + amount: 1600 + currency: USD + job_id: gcbz15vKGnMKmaWJJ152kjim + tip_eligible: true + breaks: + - id: BKS6VR7WR748A + start_at: '2019-01-22T14:30:00-05:00' + end_at: '2019-01-22T14:40:00-05:00' + break_type_id: WQX00VR99F53J + name: Tea Break + expected_duration: PT10M + is_paid: true + - id: BQFEZSHFZSC51 + start_at: '2019-01-22T12:30:00-05:00' + end_at: '2019-01-22T12:44:00-05:00' + break_type_id: P6Q468ZFRN1AC + name: Coffee Break + expected_duration: PT15M + is_paid: false + status: CLOSED + version: 16 + created_at: '2019-01-23T23:32:45Z' + updated_at: '2019-01-24T00:56:25Z' + team_member_id: 33fJchumvVdJwxV0H6L9 + declared_cash_tip_money: + amount: 0 + currency: USD + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + RetrieveTimecard: + path: /v2/labor/timecards/{id} + method: GET + auth: + - oauth2: + - TIMECARDS_READ + docs: Returns a single `Timecard` specified by `id`. + source: + openapi: openapi/openapi.json + display-name: RetrieveTimecard + request: + name: RetrieveTimecardRequest + path-parameters: + id: + type: string + docs: The UUID for the `Timecard` being retrieved. + response: + docs: Success + type: root.RetrieveTimecardResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + timecard: + id: T35HMQSN89SV4 + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-02-23T18:00:00-05:00' + end_at: '2019-02-23T21:00:00-05:00' + wage: + title: Cashier + hourly_rate: + amount: 1457 + currency: USD + job_id: N4YKVLzFj3oGtNocqoYHYpW3 + tip_eligible: true + breaks: + - id: M9BBKEPQAQD2T + start_at: '2019-02-23T19:00:00-05:00' + end_at: '2019-02-23T20:00:00-05:00' + break_type_id: 92EPDRQKJ5088 + name: Lunch Break + expected_duration: PT1H + is_paid: true + status: CLOSED + version: 1 + created_at: '2019-02-27T00:12:12Z' + updated_at: '2019-02-27T00:12:12Z' + team_member_id: D71KRMQof6cXGUW0aAv7 + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + UpdateTimecard: + path: /v2/labor/timecards/{id} + method: PUT + auth: + - oauth2: + - TIMECARDS_WRITE + - TIMECARDS_READ + docs: >- + Updates an existing `Timecard`. + + + When adding a `Break` to a `Timecard`, any earlier `Break` instances in + the `Timecard` have + + the `end_at` property set to a valid RFC-3339 datetime string. + + + When closing a `Timecard`, all `Break` instances in the `Timecard` must + be complete with `end_at` + + set on each `Break`. + source: + openapi: openapi/openapi.json + display-name: UpdateTimecard + request: + name: UpdateTimecardRequest + path-parameters: + id: + type: string + docs: The ID of the object being updated. + body: + properties: + timecard: + type: root.Timecard + docs: The updated `Timecard` object. + content-type: application/json + response: + docs: Success + type: root.UpdateTimecardResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + request: + timecard: + location_id: PAA1RJZZKXBFG + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Bartender + hourly_rate: + amount: 1500 + currency: USD + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + status: CLOSED + version: 1 + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + response: + body: + timecard: + id: K0YH4CV5462JB + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Bartender + hourly_rate: + amount: 1500 + currency: USD + job_id: dZtrPh5GSDGugyXGByesVp51 + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + status: CLOSED + version: 2 + created_at: '2019-02-28T00:39:02Z' + updated_at: '2019-02-28T00:42:41Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + DeleteTimecard: + path: /v2/labor/timecards/{id} + method: DELETE + auth: + - oauth2: + - TIMECARDS_WRITE + docs: Deletes a `Timecard`. + source: + openapi: openapi/openapi.json + display-name: DeleteTimecard + request: + name: DeleteTimecardRequest + path-parameters: + id: + type: string + docs: The UUID for the `Timecard` being deleted. + response: + docs: Success + type: root.DeleteTimecardResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor/breakTypes.yml b/.mock/definition/labor/breakTypes.yml new file mode 100644 index 000000000..58e6c272f --- /dev/null +++ b/.mock/definition/labor/breakTypes.yml @@ -0,0 +1,290 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/labor/break-types + method: GET + auth: + - oauth2: + - TIMECARDS_SETTINGS_READ + docs: Returns a paginated list of `BreakType` instances for a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.break_types + source: + openapi: openapi/openapi.json + display-name: ListBreakTypes + request: + name: ListBreakTypesRequest + query-parameters: + location_id: + type: optional> + docs: >- + Filter the returned `BreakType` results to only those that are + associated with the + + specified location. + limit: + type: optional> + docs: >- + The maximum number of `BreakType` results to return per page. The + number can range between 1 + + and 200. The default is 200. + cursor: + type: optional> + docs: A pointer to the next page of `BreakType` results to fetch. + response: + docs: Success + type: root.ListBreakTypesResponse + status-code: 200 + examples: + - query-parameters: + location_id: location_id + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + break_types: + - id: REGS1EQR1TPZ5 + location_id: PAA1RJZZKXBFG + break_name: Coffee Break + expected_duration: PT5M + is_paid: false + version: 1 + created_at: '2019-01-22T20:47:37Z' + updated_at: '2019-01-22T20:47:37Z' + - id: 92EPDRQKJ5088 + location_id: PAA1RJZZKXBFG + break_name: Lunch Break + expected_duration: PT1H + is_paid: true + version: 3 + created_at: '2019-01-25T19:26:30Z' + updated_at: '2019-01-25T19:26:30Z' + cursor: 2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/labor/break-types + method: POST + auth: + - oauth2: + - TIMECARDS_SETTINGS_WRITE + docs: >- + Creates a new `BreakType`. + + + A `BreakType` is a template for creating `Break` objects. + + You must provide the following values in your request to this + + endpoint: + + + - `location_id` + + - `break_name` + + - `expected_duration` + + - `is_paid` + + + You can only have three `BreakType` instances per location. If you + attempt to add a fourth + + `BreakType` for a location, an `INVALID_REQUEST_ERROR` "Exceeded limit + of 3 breaks per location." + + is returned. + source: + openapi: openapi/openapi.json + display-name: CreateBreakType + request: + name: CreateBreakTypeRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string value to ensure the idempotency of the + operation. + validation: + maxLength: 128 + break_type: + type: root.BreakType + docs: The `BreakType` to be created. + content-type: application/json + response: + docs: Success + type: root.CreateBreakTypeResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: PAD3NG5KSN2GL + break_type: + location_id: CGJN03P1D08GF + break_name: Lunch Break + expected_duration: PT30M + is_paid: true + response: + body: + break_type: + id: 49SSVDJG76WF3 + location_id: CGJN03P1D08GF + break_name: Lunch Break + expected_duration: PT30M + is_paid: true + version: 1 + created_at: '2019-02-26T22:42:54Z' + updated_at: '2019-02-26T22:42:54Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/labor/break-types/{id} + method: GET + auth: + - oauth2: + - TIMECARDS_SETTINGS_READ + docs: Returns a single `BreakType` specified by `id`. + source: + openapi: openapi/openapi.json + display-name: GetBreakType + request: + name: GetBreakTypesRequest + path-parameters: + id: + type: string + docs: The UUID for the `BreakType` being retrieved. + response: + docs: Success + type: root.GetBreakTypeResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + break_type: + id: lA0mj_RSOprNPwMUXdYp + location_id: 059SB0E0WCNWS + break_name: Lunch Break + expected_duration: PT30M + is_paid: true + version: 1 + created_at: '2019-02-21T17:50:00Z' + updated_at: '2019-02-21T17:50:00Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/labor/break-types/{id} + method: PUT + auth: + - oauth2: + - TIMECARDS_SETTINGS_WRITE + - TIMECARDS_SETTINGS_READ + docs: Updates an existing `BreakType`. + source: + openapi: openapi/openapi.json + display-name: UpdateBreakType + request: + name: UpdateBreakTypeRequest + path-parameters: + id: + type: string + docs: ' The UUID for the `BreakType` being updated.' + body: + properties: + break_type: + type: root.BreakType + docs: The updated `BreakType`. + content-type: application/json + response: + docs: Success + type: root.UpdateBreakTypeResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + request: + break_type: + location_id: 26M7H24AZ9N6R + break_name: Lunch + expected_duration: PT50M + is_paid: true + version: 1 + response: + body: + break_type: + id: Q6JSJS6D4DBCH + location_id: 26M7H24AZ9N6R + break_name: Lunch + expected_duration: PT50M + is_paid: true + version: 2 + created_at: '2018-06-12T20:19:12Z' + updated_at: '2019-02-26T23:12:59Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/labor/break-types/{id} + method: DELETE + auth: + - oauth2: + - TIMECARDS_SETTINGS_WRITE + docs: |- + Deletes an existing `BreakType`. + + A `BreakType` can be deleted even if it is referenced from a `Shift`. + source: + openapi: openapi/openapi.json + display-name: DeleteBreakType + request: + name: DeleteBreakTypesRequest + path-parameters: + id: + type: string + docs: The UUID for the `BreakType` being deleted. + response: + docs: Success + type: root.DeleteBreakTypeResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor/employeeWages.yml b/.mock/definition/labor/employeeWages.yml new file mode 100644 index 000000000..a907e8167 --- /dev/null +++ b/.mock/definition/labor/employeeWages.yml @@ -0,0 +1,125 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/labor/employee-wages + method: GET + auth: + - oauth2: + - EMPLOYEES_READ + docs: Returns a paginated list of `EmployeeWage` instances for a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.employee_wages + source: + openapi: openapi/openapi.json + display-name: ListEmployeeWages + request: + name: ListEmployeeWagesRequest + query-parameters: + employee_id: + type: optional> + docs: >- + Filter the returned wages to only those that are associated with + the specified employee. + limit: + type: optional> + docs: >- + The maximum number of `EmployeeWage` results to return per page. + The number can range between + + 1 and 200. The default is 200. + cursor: + type: optional> + docs: A pointer to the next page of `EmployeeWage` results to fetch. + response: + docs: Success + type: root.ListEmployeeWagesResponse + status-code: 200 + availability: deprecated + examples: + - query-parameters: + employee_id: employee_id + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + employee_wages: + - id: pXS3qCv7BERPnEGedM4S8mhm + employee_id: 33fJchumvVdJwxV0H6L9 + title: Manager + hourly_rate: + amount: 3250 + currency: USD + - id: rZduCkzYDUVL3ovh1sQgbue6 + employee_id: 33fJchumvVdJwxV0H6L9 + title: Cook + hourly_rate: + amount: 2600 + currency: USD + - id: FxLbs5KpPUHa8wyt5ctjubDX + employee_id: 33fJchumvVdJwxV0H6L9 + title: Barista + hourly_rate: + amount: 1600 + currency: USD + - id: vD1wCgijMDR3cX5TPnu7VXto + employee_id: 33fJchumvVdJwxV0H6L9 + title: Cashier + hourly_rate: + amount: 1700 + currency: USD + cursor: 2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/labor/employee-wages/{id} + method: GET + auth: + - oauth2: + - EMPLOYEES_READ + docs: Returns a single `EmployeeWage` specified by `id`. + source: + openapi: openapi/openapi.json + display-name: GetEmployeeWage + request: + name: GetEmployeeWagesRequest + path-parameters: + id: + type: string + docs: The UUID for the `EmployeeWage` being retrieved. + response: + docs: Success + type: root.GetEmployeeWageResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + employee_wage: + id: pXS3qCv7BERPnEGedM4S8mhm + employee_id: 33fJchumvVdJwxV0H6L9 + title: Manager + hourly_rate: + amount: 2000 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor/shifts.yml b/.mock/definition/labor/shifts.yml new file mode 100644 index 000000000..5ab84b7f8 --- /dev/null +++ b/.mock/definition/labor/shifts.yml @@ -0,0 +1,472 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/labor/shifts + method: POST + auth: + - oauth2: + - TIMECARDS_WRITE + docs: >- + Creates a new `Shift`. + + + A `Shift` represents a complete workday for a single team member. + + You must provide the following values in your request to this + + endpoint: + + + - `location_id` + + - `team_member_id` + + - `start_at` + + + An attempt to create a new `Shift` can result in a `BAD_REQUEST` error + when: + + - The `status` of the new `Shift` is `OPEN` and the team member has + another + + shift with an `OPEN` status. + + - The `start_at` date is in the future. + + - The `start_at` or `end_at` date overlaps another shift for the same + team member. + + - The `Break` instances are set in the request and a break `start_at` + + is before the `Shift.start_at`, a break `end_at` is after + + the `Shift.end_at`, or both. + source: + openapi: openapi/openapi.json + display-name: CreateShift + request: + name: CreateShiftRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string value to ensure the idempotency of the + operation. + validation: + maxLength: 128 + shift: + type: root.Shift + docs: The `Shift` to be created. + content-type: application/json + response: + docs: Success + type: root.CreateShiftResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: HIDSNG5KS478L + shift: + location_id: PAA1RJZZKXBFG + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + tip_eligible: true + breaks: + - start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + response: + body: + shift: + id: K0YH4CV5462JB + employee_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + status: CLOSED + version: 1 + created_at: '2019-02-28T00:39:02Z' + updated_at: '2019-02-28T00:39:02Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/labor/shifts/search + method: POST + auth: + - oauth2: + - TIMECARDS_READ + docs: |- + Returns a paginated list of `Shift` records for a business. + The list to be returned can be filtered by: + - Location IDs + - Team member IDs + - Shift status (`OPEN` or `CLOSED`) + - Shift start + - Shift end + - Workday details + + The list can be sorted by: + - `START_AT` + - `END_AT` + - `CREATED_AT` + - `UPDATED_AT` + source: + openapi: openapi/openapi.json + display-name: SearchShifts + request: + name: SearchShiftsRequest + body: + properties: + query: + type: optional + docs: Query filters. + limit: + type: optional + docs: The number of resources in a page (200 by default). + validation: + min: 1 + max: 200 + cursor: + type: optional + docs: An opaque cursor for fetching the next page. + content-type: application/json + response: + docs: Success + type: root.SearchShiftsResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + workday: + date_range: + start_date: '2019-01-20' + end_date: '2019-02-03' + match_shifts_by: START_AT + default_timezone: America/Los_Angeles + limit: 100 + response: + body: + shifts: + - id: X714F3HA6D1PT + employee_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-21T03:11:00-05:00' + end_at: '2019-01-21T13:11:00-05:00' + wage: + title: Barista + hourly_rate: + amount: 1100 + currency: USD + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + tip_eligible: true + breaks: + - id: SJW7X6AKEJQ65 + start_at: '2019-01-21T06:11:00-05:00' + end_at: '2019-01-21T06:11:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT10M + is_paid: true + status: CLOSED + version: 6 + created_at: '2019-01-24T01:12:03Z' + updated_at: '2019-02-07T22:21:08Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + - id: GDHYBZYWK0P2V + employee_id: 33fJchumvVdJwxV0H6L9 + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-22T12:02:00-05:00' + end_at: '2019-01-22T13:02:00-05:00' + wage: + title: Cook + hourly_rate: + amount: 1600 + currency: USD + job_id: gcbz15vKGnMKmaWJJ152kjim + tip_eligible: true + breaks: + - id: BKS6VR7WR748A + start_at: '2019-01-23T14:30:00-05:00' + end_at: '2019-01-23T14:40:00-05:00' + break_type_id: WQX00VR99F53J + name: Tea Break + expected_duration: PT10M + is_paid: true + - id: BQFEZSHFZSC51 + start_at: '2019-01-22T12:30:00-05:00' + end_at: '2019-01-22T12:44:00-05:00' + break_type_id: P6Q468ZFRN1AC + name: Coffee Break + expected_duration: PT15M + is_paid: false + status: CLOSED + version: 16 + created_at: '2019-01-23T23:32:45Z' + updated_at: '2019-01-24T00:56:25Z' + team_member_id: 33fJchumvVdJwxV0H6L9 + declared_cash_tip_money: + amount: 0 + currency: USD + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/labor/shifts/{id} + method: GET + auth: + - oauth2: + - TIMECARDS_READ + docs: Returns a single `Shift` specified by `id`. + source: + openapi: openapi/openapi.json + display-name: GetShift + request: + name: GetShiftsRequest + path-parameters: + id: + type: string + docs: The UUID for the `Shift` being retrieved. + response: + docs: Success + type: root.GetShiftResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + shift: + id: T35HMQSN89SV4 + employee_id: D71KRMQof6cXGUW0aAv7 + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-02-23T18:00:00-05:00' + end_at: '2019-02-23T21:00:00-05:00' + wage: + title: Cashier + hourly_rate: + amount: 1457 + currency: USD + job_id: N4YKVLzFj3oGtNocqoYHYpW3 + tip_eligible: true + breaks: + - id: M9BBKEPQAQD2T + start_at: '2019-02-23T19:00:00-05:00' + end_at: '2019-02-23T20:00:00-05:00' + break_type_id: 92EPDRQKJ5088 + name: Lunch Break + expected_duration: PT1H + is_paid: true + status: CLOSED + version: 1 + created_at: '2019-02-27T00:12:12Z' + updated_at: '2019-02-27T00:12:12Z' + team_member_id: D71KRMQof6cXGUW0aAv7 + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/labor/shifts/{id} + method: PUT + auth: + - oauth2: + - TIMECARDS_WRITE + - TIMECARDS_READ + docs: >- + Updates an existing `Shift`. + + + When adding a `Break` to a `Shift`, any earlier `Break` instances in the + `Shift` have + + the `end_at` property set to a valid RFC-3339 datetime string. + + + When closing a `Shift`, all `Break` instances in the `Shift` must be + complete with `end_at` + + set on each `Break`. + source: + openapi: openapi/openapi.json + display-name: UpdateShift + request: + name: UpdateShiftRequest + path-parameters: + id: + type: string + docs: The ID of the object being updated. + body: + properties: + shift: + type: root.Shift + docs: The updated `Shift` object. + content-type: application/json + response: + docs: Success + type: root.UpdateShiftResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + request: + shift: + location_id: PAA1RJZZKXBFG + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Bartender + hourly_rate: + amount: 1500 + currency: USD + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + version: 1 + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + response: + body: + shift: + id: K0YH4CV5462JB + employee_id: ormj0jJJZ5OZIzxrZYJI + location_id: PAA1RJZZKXBFG + timezone: America/New_York + start_at: '2019-01-25T03:11:00-05:00' + end_at: '2019-01-25T13:11:00-05:00' + wage: + title: Bartender + hourly_rate: + amount: 1500 + currency: USD + job_id: dZtrPh5GSDGugyXGByesVp51 + tip_eligible: true + breaks: + - id: X7GAQYVVRRG6P + start_at: '2019-01-25T06:11:00-05:00' + end_at: '2019-01-25T06:16:00-05:00' + break_type_id: REGS1EQR1TPZ5 + name: Tea Break + expected_duration: PT5M + is_paid: true + status: CLOSED + version: 2 + created_at: '2019-02-28T00:39:02Z' + updated_at: '2019-02-28T00:42:41Z' + team_member_id: ormj0jJJZ5OZIzxrZYJI + declared_cash_tip_money: + amount: 500 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/labor/shifts/{id} + method: DELETE + auth: + - oauth2: + - TIMECARDS_WRITE + docs: Deletes a `Shift`. + source: + openapi: openapi/openapi.json + display-name: DeleteShift + request: + name: DeleteShiftsRequest + path-parameters: + id: + type: string + docs: The UUID for the `Shift` being deleted. + response: + docs: Success + type: root.DeleteShiftResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor/teamMemberWages.yml b/.mock/definition/labor/teamMemberWages.yml new file mode 100644 index 000000000..65d84efd5 --- /dev/null +++ b/.mock/definition/labor/teamMemberWages.yml @@ -0,0 +1,135 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/labor/team-member-wages + method: GET + auth: + - oauth2: + - EMPLOYEES_READ + docs: Returns a paginated list of `TeamMemberWage` instances for a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.team_member_wages + source: + openapi: openapi/openapi.json + display-name: ListTeamMemberWages + request: + name: ListTeamMemberWagesRequest + query-parameters: + team_member_id: + type: optional> + docs: >- + Filter the returned wages to only those that are associated with + the + + specified team member. + limit: + type: optional> + docs: >- + The maximum number of `TeamMemberWage` results to return per page. + The number can range between + + 1 and 200. The default is 200. + cursor: + type: optional> + docs: A pointer to the next page of `EmployeeWage` results to fetch. + response: + docs: Success + type: root.ListTeamMemberWagesResponse + status-code: 200 + examples: + - query-parameters: + team_member_id: team_member_id + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + team_member_wages: + - id: pXS3qCv7BERPnEGedM4S8mhm + team_member_id: 33fJchumvVdJwxV0H6L9 + title: Manager + hourly_rate: + amount: 3250 + currency: USD + job_id: jxJNN6eCJsLrhg5UFJrDWDGE + tip_eligible: false + - id: rZduCkzYDUVL3ovh1sQgbue6 + team_member_id: 33fJchumvVdJwxV0H6L9 + title: Cook + hourly_rate: + amount: 2600 + currency: USD + job_id: gcbz15vKGnMKmaWJJ152kjim + tip_eligible: true + - id: FxLbs5KpPUHa8wyt5ctjubDX + team_member_id: 33fJchumvVdJwxV0H6L9 + title: Barista + hourly_rate: + amount: 1600 + currency: USD + job_id: FzbJAtt9qEWncK1BWgVCxQ6M + tip_eligible: true + - id: vD1wCgijMDR3cX5TPnu7VXto + team_member_id: 33fJchumvVdJwxV0H6L9 + title: Cashier + hourly_rate: + amount: 1700 + currency: USD + job_id: N4YKVLzFj3oGtNocqoYHYpW3 + tip_eligible: true + cursor: 2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/labor/team-member-wages/{id} + method: GET + auth: + - oauth2: + - EMPLOYEES_READ + docs: Returns a single `TeamMemberWage` specified by `id`. + source: + openapi: openapi/openapi.json + display-name: GetTeamMemberWage + request: + name: GetTeamMemberWagesRequest + path-parameters: + id: + type: string + docs: The UUID for the `TeamMemberWage` being retrieved. + response: + docs: Success + type: root.GetTeamMemberWageResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + response: + body: + team_member_wage: + id: pXS3qCv7BERPnEGedM4S8mhm + team_member_id: 33fJchumvVdJwxV0H6L9 + title: Manager + hourly_rate: + amount: 2000 + currency: USD + job_id: jxJNN6eCJsLrhg5UFJrDWDGE + tip_eligible: false + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/labor/workweekConfigs.yml b/.mock/definition/labor/workweekConfigs.yml new file mode 100644 index 000000000..20a4550d8 --- /dev/null +++ b/.mock/definition/labor/workweekConfigs.yml @@ -0,0 +1,109 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/labor/workweek-configs + method: GET + auth: + - oauth2: + - TIMECARDS_SETTINGS_READ + docs: Returns a list of `WorkweekConfig` instances for a business. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.workweek_configs + source: + openapi: openapi/openapi.json + display-name: ListWorkweekConfigs + request: + name: ListWorkweekConfigsRequest + query-parameters: + limit: + type: optional> + docs: >- + The maximum number of `WorkweekConfigs` results to return per + page. + cursor: + type: optional> + docs: A pointer to the next page of `WorkweekConfig` results to fetch. + response: + docs: Success + type: root.ListWorkweekConfigsResponse + status-code: 200 + examples: + - query-parameters: + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + workweek_configs: + - id: FY4VCAQN700GM + start_of_week: MON + start_of_day_local_time: '10:00' + version: 11 + created_at: '2016-02-04T00:58:24Z' + updated_at: '2019-02-28T01:04:35Z' + cursor: 2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/labor/workweek-configs/{id} + method: PUT + auth: + - oauth2: + - TIMECARDS_SETTINGS_WRITE + - TIMECARDS_SETTINGS_READ + docs: Updates a `WorkweekConfig`. + source: + openapi: openapi/openapi.json + display-name: UpdateWorkweekConfig + request: + name: UpdateWorkweekConfigRequest + path-parameters: + id: + type: string + docs: The UUID for the `WorkweekConfig` object being updated. + body: + properties: + workweek_config: + type: root.WorkweekConfig + docs: The updated `WorkweekConfig` object. + content-type: application/json + response: + docs: Success + type: root.UpdateWorkweekConfigResponse + status-code: 200 + examples: + - path-parameters: + id: id + headers: + Square-Version: '2025-10-16' + request: + workweek_config: + start_of_week: MON + start_of_day_local_time: '10:00' + version: 10 + response: + body: + workweek_config: + id: FY4VCAQN700GM + start_of_week: MON + start_of_day_local_time: '10:00' + version: 11 + created_at: '2016-02-04T00:58:24Z' + updated_at: '2019-02-28T01:04:35Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/locations.yml b/.mock/definition/locations.yml new file mode 100644 index 000000000..eb05b1ba3 --- /dev/null +++ b/.mock/definition/locations.yml @@ -0,0 +1,807 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/locations + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Provides details about all of the seller's + [locations](https://developer.squareup.com/docs/locations-api), + + including those with an inactive status. Locations are listed + alphabetically by `name`. + source: + openapi: openapi/openapi.json + display-name: ListLocations + response: + docs: Success + type: root.ListLocationsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + locations: + - id: 18YC4JDH91E1H + name: Grant Park + address: + address_line_1: 123 Main St + locality: San Francisco + administrative_district_level_1: CA + postal_code: '94114' + country: US + timezone: America/Los_Angeles + capabilities: + - CREDIT_CARD_PROCESSING + status: ACTIVE + created_at: '2016-09-19T17:33:12Z' + merchant_id: 3MYCJG5GVYQ8Q + country: US + language_code: en-US + currency: USD + phone_number: +1 650-354-7217 + business_name: Jet Fuel Coffee + type: PHYSICAL + website_url: website_url + business_email: business_email + description: description + twitter_username: twitter_username + instagram_username: instagram_username + facebook_url: facebook_url + logo_url: logo_url + pos_background_url: pos_background_url + mcc: mcc + full_format_logo_url: full_format_logo_url + - id: 3Z4V4WHQK64X9 + name: Midtown + address: + address_line_1: 1234 Peachtree St. NE + locality: Atlanta + administrative_district_level_1: GA + postal_code: '30309' + timezone: America/New_York + capabilities: + - CREDIT_CARD_PROCESSING + status: ACTIVE + created_at: '2022-02-19T17:58:25Z' + merchant_id: 3MYCJG5GVYQ8Q + country: US + language_code: en-US + currency: USD + phone_number: phone_number + business_name: Jet Fuel Coffee + type: PHYSICAL + website_url: website_url + business_email: business_email + description: Midtown Atlanta store + twitter_username: twitter_username + instagram_username: instagram_username + facebook_url: facebook_url + coordinates: + latitude: 33.7889 + longitude: -84.3841 + logo_url: logo_url + pos_background_url: pos_background_url + mcc: '7299' + full_format_logo_url: full_format_logo_url + create: + path: /v2/locations + method: POST + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Creates a [location](https://developer.squareup.com/docs/locations-api). + + Creating new locations allows for separate configuration of receipt + layouts, item prices, + + and sales reports. Developers can use locations to separate sales + activity through applications + + that integrate with Square from sales activity elsewhere in a seller's + account. + + Locations created programmatically with the Locations API last forever + and + + are visible to the seller for their own management. Therefore, ensure + that + + each location has a sensible and unique name. + source: + openapi: openapi/openapi.json + display-name: CreateLocation + request: + name: CreateLocationRequest + body: + properties: + location: + type: optional + docs: >- + The initial values of the location being created. The `name` + field is required and must be unique within a seller account. + + All other fields are optional, but any information you care + about for the location should be included. + + The remaining fields are automatically added based on the data + from the [main + location](https://developer.squareup.com/docs/locations-api#about-the-main-location). + content-type: application/json + response: + docs: Success + type: root.CreateLocationResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + location: + name: Midtown + address: + address_line_1: 1234 Peachtree St. NE + locality: Atlanta + administrative_district_level_1: GA + postal_code: '30309' + description: Midtown Atlanta store + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + location: + id: 3Z4V4WHQK64X9 + name: Midtown + address: + address_line_1: 1234 Peachtree St. NE + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: Atlanta + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: GA + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '30309' + country: ZZ + first_name: first_name + last_name: last_name + timezone: America/New_York + capabilities: + - CREDIT_CARD_PROCESSING + status: ACTIVE + created_at: '2022-02-19T17:58:25Z' + merchant_id: 3MYCJG5GVYQ8Q + country: US + language_code: en-US + currency: USD + phone_number: phone_number + business_name: Jet Fuel Coffee + type: PHYSICAL + website_url: website_url + business_hours: + periods: + - {} + business_email: business_email + description: Midtown Atlanta store + twitter_username: twitter_username + instagram_username: instagram_username + facebook_url: facebook_url + coordinates: + latitude: 33.7889 + longitude: -84.3841 + logo_url: logo_url + pos_background_url: pos_background_url + mcc: '7299' + full_format_logo_url: full_format_logo_url + tax_ids: + eu_vat: eu_vat + fr_siret: fr_siret + fr_naf: fr_naf + es_nif: es_nif + jp_qii: jp_qii + get: + path: /v2/locations/{location_id} + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Retrieves details of a single location. Specify "main" + + as the location ID to retrieve details of the [main + location](https://developer.squareup.com/docs/locations-api#about-the-main-location). + source: + openapi: openapi/openapi.json + display-name: RetrieveLocation + request: + name: GetLocationsRequest + path-parameters: + location_id: + type: string + docs: |- + The ID of the location to retrieve. Specify the string + "main" to return the main location. + response: + docs: Success + type: root.GetLocationResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + location: + id: 18YC4JDH91E1H + name: Grant Park + address: + address_line_1: 123 Main St + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: San Francisco + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: CA + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '94114' + country: US + first_name: first_name + last_name: last_name + timezone: America/Los_Angeles + capabilities: + - CREDIT_CARD_PROCESSING + status: ACTIVE + created_at: '2016-09-19T17:33:12Z' + merchant_id: 3MYCJG5GVYQ8Q + country: US + language_code: en-US + currency: USD + phone_number: +1 650-354-7217 + business_name: Jet Fuel Coffee + type: PHYSICAL + website_url: website_url + business_hours: + periods: + - {} + business_email: business_email + description: description + twitter_username: twitter_username + instagram_username: instagram_username + facebook_url: facebook_url + coordinates: + latitude: 1.1 + longitude: 1.1 + logo_url: logo_url + pos_background_url: pos_background_url + mcc: mcc + full_format_logo_url: full_format_logo_url + tax_ids: + eu_vat: eu_vat + fr_siret: fr_siret + fr_naf: fr_naf + es_nif: es_nif + jp_qii: jp_qii + update: + path: /v2/locations/{location_id} + method: PUT + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: Updates a [location](https://developer.squareup.com/docs/locations-api). + source: + openapi: openapi/openapi.json + display-name: UpdateLocation + request: + name: UpdateLocationRequest + path-parameters: + location_id: + type: string + docs: The ID of the location to update. + body: + properties: + location: + type: optional + docs: The `Location` object with only the fields to update. + content-type: application/json + response: + docs: Success + type: root.UpdateLocationResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-10-16' + request: + location: + business_hours: + periods: + - day_of_week: FRI + start_local_time: '07:00' + end_local_time: '18:00' + - day_of_week: SAT + start_local_time: '07:00' + end_local_time: '18:00' + - day_of_week: SUN + start_local_time: '09:00' + end_local_time: '15:00' + description: Midtown Atlanta store - Open weekends + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + location: + id: 3Z4V4WHQK64X9 + name: Midtown + address: + address_line_1: 1234 Peachtree St. NE + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: Atlanta + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: GA + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '30309' + country: ZZ + first_name: first_name + last_name: last_name + timezone: America/New_York + capabilities: + - CREDIT_CARD_PROCESSING + status: ACTIVE + created_at: '2022-02-19T17:58:25Z' + merchant_id: 3MYCJG5GVYQ8Q + country: US + language_code: en-US + currency: USD + phone_number: phone_number + business_name: Jet Fuel Coffee + type: PHYSICAL + website_url: website_url + business_hours: + periods: + - day_of_week: FRI + start_local_time: '07:00' + end_local_time: '18:00' + - day_of_week: SAT + start_local_time: '07:00' + end_local_time: '18:00' + - day_of_week: SUN + start_local_time: '09:00' + end_local_time: '15:00' + business_email: business_email + description: Midtown Atlanta store - Open weekends + twitter_username: twitter_username + instagram_username: instagram_username + facebook_url: facebook_url + coordinates: + latitude: 33.7889 + longitude: -84.3841 + logo_url: logo_url + pos_background_url: pos_background_url + mcc: '7299' + full_format_logo_url: full_format_logo_url + tax_ids: + eu_vat: eu_vat + fr_siret: fr_siret + fr_naf: fr_naf + es_nif: es_nif + jp_qii: jp_qii + checkouts: + path: /v2/locations/{location_id}/checkouts + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + - ORDERS_WRITE + docs: >- + Links a `checkoutId` to a `checkout_page_url` that customers are + + directed to in order to provide their payment information using a + + payment processing workflow hosted on connect.squareup.com. + + + + NOTE: The Checkout API has been updated with new features. + + For more information, see [Checkout API + highlights](https://developer.squareup.com/docs/checkout-api#checkout-api-highlights). + source: + openapi: openapi/openapi.json + display-name: CreateCheckout + request: + name: CreateCheckoutRequest + path-parameters: + location_id: + type: string + docs: The ID of the business location to associate the checkout with. + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this checkout among others you + have created. It can be + + any valid string but must be unique for every order sent to + Square Checkout for a given location ID. + + + The idempotency key is used to avoid processing the same order + more than once. If you are + + unsure whether a particular checkout was created successfully, + you can attempt it again with + + the same idempotency key and all the same other parameters + without worrying about creating duplicates. + + + You should use a random number/string generator native to the + language + + you are working in to generate strings for your idempotency + keys. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + maxLength: 192 + order: + type: root.CreateOrderRequest + docs: The order including line items to be checked out. + ask_for_shipping_address: + type: optional + docs: >- + If `true`, Square Checkout collects shipping information on your + behalf and stores + + that information with the transaction information in the Square + Seller Dashboard. + + + Default: `false`. + merchant_support_email: + type: optional + docs: >- + The email address to display on the Square Checkout confirmation + page + + and confirmation email that the buyer can use to contact the + seller. + + + If this value is not set, the confirmation page and email + display the + + primary email address associated with the seller's Square + account. + + + Default: none; only exists if explicitly set. + validation: + maxLength: 254 + pre_populate_buyer_email: + type: optional + docs: >- + If provided, the buyer's email is prepopulated on the checkout + page + + as an editable text field. + + + Default: none; only exists if explicitly set. + validation: + maxLength: 254 + pre_populate_shipping_address: + type: optional + docs: >- + If provided, the buyer's shipping information is prepopulated on + the + + checkout page as editable text fields. + + + Default: none; only exists if explicitly set. + redirect_url: + type: optional + docs: >- + The URL to redirect to after the checkout is completed with + `checkoutId`, + + `transactionId`, and `referenceId` appended as URL parameters. + For example, + + if the provided redirect URL is + `http://www.example.com/order-complete`, a + + successful transaction redirects the customer to: + + + `http://www.example.com/order-complete?checkoutId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx` + + + If you do not provide a redirect URL, Square Checkout displays + an order + + confirmation page on your behalf; however, it is strongly + recommended that + + you provide a redirect URL so you can verify the transaction + results and + + finalize the order through your existing/normal confirmation + workflow. + + + Default: none; only exists if explicitly set. + validation: + maxLength: 800 + additional_recipients: + type: optional> + docs: >- + The basic primitive of a multi-party transaction. The value is + optional. + + The transaction facilitated by you can be split from here. + + + If you provide this value, the `amount_money` value in your + `additional_recipients` field + + cannot be more than 90% of the `total_money` calculated by + Square for your order. + + The `location_id` must be a valid seller location where the + checkout is occurring. + + + This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth + permission. + + + This field is currently not supported in the Square Sandbox. + note: + type: optional + docs: |- + An optional note to associate with the `checkout` object. + + This value cannot exceed 60 characters. + validation: + maxLength: 60 + content-type: application/json + response: + docs: Success + type: root.CreateCheckoutResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 86ae1696-b1e3-4328-af6d-f1e04d947ad6 + order: + order: + location_id: location_id + reference_id: reference_id + customer_id: customer_id + line_items: + - name: Printed T Shirt + quantity: '2' + applied_taxes: + - tax_uid: 38ze1696-z1e3-5628-af6d-f1e04d947fg3 + applied_discounts: + - discount_uid: 56ae1696-z1e3-9328-af6d-f1e04d947gd4 + base_price_money: + amount: 1500 + currency: USD + - name: Slim Jeans + quantity: '1' + base_price_money: + amount: 2500 + currency: USD + - name: Woven Sweater + quantity: '3' + base_price_money: + amount: 3500 + currency: USD + taxes: + - uid: 38ze1696-z1e3-5628-af6d-f1e04d947fg3 + type: INCLUSIVE + percentage: '7.75' + scope: LINE_ITEM + discounts: + - uid: 56ae1696-z1e3-9328-af6d-f1e04d947gd4 + type: FIXED_AMOUNT + amount_money: + amount: 100 + currency: USD + scope: LINE_ITEM + idempotency_key: 12ae1696-z1e3-4328-af6d-f1e04d947gd4 + ask_for_shipping_address: true + merchant_support_email: merchant+support@website.com + pre_populate_buyer_email: example@email.com + pre_populate_shipping_address: + address_line_1: 1455 Market St. + address_line_2: Suite 600 + locality: San Francisco + administrative_district_level_1: CA + postal_code: '94103' + country: US + first_name: Jane + last_name: Doe + redirect_url: https://merchant.website.com/order-confirm + additional_recipients: + - location_id: 057P5VYJ4A5X1 + description: Application fees + amount_money: + amount: 60 + currency: USD + response: + body: + checkout: + id: CAISEHGimXh-C3RIT4og1a6u1qw + checkout_page_url: >- + https://connect.squareup.com/v2/checkout?c=CAISEHGimXh-C3RIT4og1a6u1qw&l=CYTKRM7R7JMV8 + ask_for_shipping_address: true + merchant_support_email: merchant+support@website.com + pre_populate_buyer_email: example@email.com + pre_populate_shipping_address: + address_line_1: 1455 Market St. + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: San Francisco + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: CA + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '94103' + country: US + first_name: Jane + last_name: Doe + redirect_url: https://merchant.website.com/order-confirm + order: + id: id + location_id: location_id + reference_id: reference_id + customer_id: customer_id + line_items: + - name: Printed T Shirt + quantity: '2' + applied_taxes: + - tax_uid: 38ze1696-z1e3-5628-af6d-f1e04d947fg3 + applied_money: + amount: 103 + currency: USD + applied_discounts: + - discount_uid: 56ae1696-z1e3-9328-af6d-f1e04d947gd4 + applied_money: + amount: 100 + currency: USD + base_price_money: + amount: 1500 + currency: USD + total_tax_money: + amount: 103 + currency: USD + total_discount_money: + amount: 100 + currency: USD + total_money: + amount: 1503 + currency: USD + - name: Slim Jeans + quantity: '1' + base_price_money: + amount: 2500 + currency: USD + total_money: + amount: 2500 + currency: USD + - name: Woven Sweater + quantity: '3' + base_price_money: + amount: 3500 + currency: USD + total_money: + amount: 10500 + currency: USD + taxes: + - uid: 38ze1696-z1e3-5628-af6d-f1e04d947fg3 + type: INCLUSIVE + percentage: '7.75' + scope: LINE_ITEM + discounts: + - uid: 56ae1696-z1e3-9328-af6d-f1e04d947gd4 + type: FIXED_AMOUNT + amount_money: + amount: 100 + currency: USD + applied_money: + amount: 100 + currency: USD + scope: LINE_ITEM + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + created_at: created_at + updated_at: updated_at + closed_at: closed_at + state: OPEN + version: 1 + total_money: + amount: 14503 + currency: USD + total_tax_money: + amount: 103 + currency: USD + total_discount_money: + amount: 100 + currency: USD + ticket_name: ticket_name + rewards: + - id: id + reward_tier_id: reward_tier_id + created_at: '2017-06-16T22:25:35Z' + additional_recipients: + - location_id: 057P5VYJ4A5X1 + description: Application fees + amount_money: + amount: 60 + currency: USD + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/locations/customAttributeDefinitions.yml b/.mock/definition/locations/customAttributeDefinitions.yml new file mode 100644 index 000000000..9ab3accbd --- /dev/null +++ b/.mock/definition/locations/customAttributeDefinitions.yml @@ -0,0 +1,419 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/locations/custom-attribute-definitions + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Lists the location-related [custom attribute + definitions](entity:CustomAttributeDefinition) that belong to a Square + seller account. + + When all response pages are retrieved, the results include all custom + attribute definitions + + that are visible to the requesting application, including those that are + created by other + + applications and set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attribute_definitions + source: + openapi: openapi/openapi.json + display-name: ListLocationCustomAttributeDefinitions + request: + name: ListCustomAttributeDefinitionsRequest + query-parameters: + visibility_filter: + type: optional> + docs: >- + Filters the `CustomAttributeDefinition` results by their + `visibility` values. + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListLocationCustomAttributeDefinitionsResponse + status-code: 200 + examples: + - query-parameters: + visibility_filter: ALL + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute_definitions: + - key: phone-number + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.PhoneNumber + name: phone number + description: Location's phone number + visibility: VISIBILITY_READ_ONLY + version: 1 + updated_at: '2022-12-02T19:50:21.832Z' + created_at: '2022-12-02T19:50:21.832Z' + - key: bestseller + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Bestseller + description: Bestselling item at location + visibility: VISIBILITY_READ_WRITE_VALUES + version: 4 + updated_at: '2022-12-03T10:17:52.341Z' + created_at: '2022-12-02T19:06:36.559Z' + cursor: >- + ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/locations/custom-attribute-definitions + method: POST + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Creates a location-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + Use this endpoint to define a custom attribute that can be associated + with locations. + + A custom attribute definition specifies the `key`, `visibility`, + `schema`, and other properties + + for a custom attribute. After the definition is created, you can call + + [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) + or + + [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) + + to set the custom attribute for locations. + source: + openapi: openapi/openapi.json + display-name: CreateLocationCustomAttributeDefinition + request: + name: CreateLocationCustomAttributeDefinitionRequest + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition to create. Note the following: + + - With the exception of the `Selection` data type, the `schema` + is specified as a simple URL to the JSON schema + + definition hosted on the Square CDN. For more information, + including supported values and constraints, see + + [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). + + - `name` is required unless `visibility` is set to + `VISIBILITY_HIDDEN`. + idempotency_key: + type: optional + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateLocationCustomAttributeDefinitionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + custom_attribute_definition: + key: bestseller + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Bestseller + description: Bestselling item at location + visibility: VISIBILITY_READ_WRITE_VALUES + response: + body: + custom_attribute_definition: + key: bestseller + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Bestseller + description: Bestselling item at location + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-12-02T19:06:36.559Z' + created_at: '2022-12-02T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/locations/custom-attribute-definitions/{key} + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Retrieves a location-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + To retrieve a custom attribute definition created by another + application, the `visibility` + + setting must be `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveLocationCustomAttributeDefinition + request: + name: GetCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: >- + The key of the custom attribute definition to retrieve. If the + requesting application + + is not the definition owner, you must use the qualified key. + query-parameters: + version: + type: optional> + docs: >- + The current version of the custom attribute definition, which is + used for strongly consistent + + reads to guarantee that you receive the most up-to-date data. When + included in the request, + + Square returns the specified version or a higher version if one + exists. If the specified version + + is higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveLocationCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + query-parameters: + version: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute_definition: + key: bestseller + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Bestseller + description: Bestselling item at location + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-12-02T19:06:36.559Z' + created_at: '2022-12-02T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/locations/custom-attribute-definitions/{key} + method: PUT + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Updates a location-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + Use this endpoint to update the following fields: `name`, `description`, + `visibility`, or the + + `schema` for a `Selection` data type. + + Only the definition owner can update a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: UpdateLocationCustomAttributeDefinition + request: + name: UpdateLocationCustomAttributeDefinitionRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to update. + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition that contains the fields to + update. This endpoint + + supports sparse updates, so only new or changed fields need to + be included in the request. + + Only the following fields can be updated: + + - `name` + + - `description` + + - `visibility` + + - `schema` for a `Selection` data type. Only changes to the + named options or the maximum number of allowed + + selections are supported. + + + For more information, see + + [Update a location custom attribute + definition](https://developer.squareup.com/docs/location-custom-attributes-api/custom-attribute-definitions#update-custom-attribute-definition). + + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, specify the current version of the custom attribute + definition. + + If this is not important for your application, `version` can be + set to -1. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateLocationCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-10-16' + request: + custom_attribute_definition: + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + response: + body: + custom_attribute_definition: + key: bestseller + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Bestseller + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 2 + updated_at: '2022-12-02T19:34:10.181Z' + created_at: '2022-12-02T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/locations/custom-attribute-definitions/{key} + method: DELETE + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Deletes a location-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + Deleting a custom attribute definition also deletes the corresponding + custom attribute from + + all locations. + + Only the definition owner can delete a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: DeleteLocationCustomAttributeDefinition + request: + name: DeleteCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to delete. + response: + docs: Success + type: root.DeleteLocationCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/locations/customAttributes.yml b/.mock/definition/locations/customAttributes.yml new file mode 100644 index 000000000..49104aff9 --- /dev/null +++ b/.mock/definition/locations/customAttributes.yml @@ -0,0 +1,577 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + batchDelete: + path: /v2/locations/custom-attributes/bulk-delete + method: POST + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Deletes [custom attributes](entity:CustomAttribute) for locations as a + bulk operation. + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkDeleteLocationCustomAttributes + request: + name: BulkDeleteLocationCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + The data used to update the `CustomAttribute` objects. + + The keys must be unique and are used to map to the corresponding + response. + content-type: application/json + response: + docs: Success + type: root.BulkDeleteLocationCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + values: + id1: + key: bestseller + id2: + key: bestseller + id3: + key: phone-number + response: + body: + values: + id1: + location_id: L0TBCBTB7P8RQ + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + location_id: L9XMD04V3STJX + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id3: + location_id: L0TBCBTB7P8RQ + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchUpsert: + path: /v2/locations/custom-attributes/bulk-upsert + method: POST + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Creates or updates [custom attributes](entity:CustomAttribute) for + locations as a bulk operation. + + Use this endpoint to set the value of one or more custom attributes for + one or more locations. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which is + + created using the + [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) + endpoint. + + This `BulkUpsertLocationCustomAttributes` endpoint accepts a map of 1 to + 25 individual upsert + + requests and returns a map of individual upsert responses. Each upsert + request has a unique ID + + and provides a location ID and custom attribute. Each upsert response is + returned with the ID + + of the corresponding request. + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkUpsertLocationCustomAttributes + request: + name: BulkUpsertLocationCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + A map containing 1 to 25 individual upsert requests. For each + request, provide an + + arbitrary ID that is unique for this + `BulkUpsertLocationCustomAttributes` request and the + + information needed to create or update a custom attribute. + content-type: application/json + response: + docs: Success + type: root.BulkUpsertLocationCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + values: + id1: + location_id: L0TBCBTB7P8RQ + custom_attribute: + key: bestseller + value: hot cocoa + id2: + location_id: L9XMD04V3STJX + custom_attribute: + key: bestseller + value: berry smoothie + id3: + location_id: L0TBCBTB7P8RQ + custom_attribute: + key: phone-number + value: '+12223334444' + response: + body: + values: + id1: + location_id: L0TBCBTB7P8RQ + custom_attribute: + key: bestseller + value: hot cocoa + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2023-01-09T19:21:04.551Z' + created_at: '2023-01-09T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + location_id: L9XMD04V3STJX + custom_attribute: + key: bestseller + value: berry smoothie + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2023-01-09T19:21:04.551Z' + created_at: '2023-01-09T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id3: + location_id: L0TBCBTB7P8RQ + custom_attribute: + key: phone-number + value: '+12239903892' + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2023-01-09T19:21:04.563Z' + created_at: '2023-01-09T19:04:57.985Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + list: + path: /v2/locations/{location_id}/custom-attributes + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Lists the [custom attributes](entity:CustomAttribute) associated with a + location. + + You can use the `with_definitions` query parameter to also retrieve + custom attribute definitions + + in the same call. + + When all response pages are retrieved, the results include all custom + attributes that are + + visible to the requesting application, including those that are owned by + other applications + + and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attributes + source: + openapi: openapi/openapi.json + display-name: ListLocationCustomAttributes + request: + name: ListCustomAttributesRequest + path-parameters: + location_id: + type: string + docs: The ID of the target [location](entity:Location). + query-parameters: + visibility_filter: + type: optional> + docs: >- + Filters the `CustomAttributeDefinition` results by their + `visibility` values. + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. For more + + information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + with_definitions: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + response: + docs: Success + type: root.ListLocationCustomAttributesResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + query-parameters: + visibility_filter: ALL + limit: 1 + cursor: cursor + with_definitions: true + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attributes: + - key: phone-number + value: '+12223334444' + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-12-12T18:13:03.745Z' + created_at: '2022-12-12T18:13:03.745Z' + - key: bestseller + value: hot cocoa + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-12-12T19:27:57.975Z' + created_at: '2022-12-12T19:27:57.975Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/locations/{location_id}/custom-attributes/{key} + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Retrieves a [custom attribute](entity:CustomAttribute) associated with a + location. + + You can use the `with_definition` query parameter to also retrieve the + custom attribute definition + + in the same call. + + To retrieve a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveLocationCustomAttribute + request: + name: GetCustomAttributesRequest + path-parameters: + location_id: + type: string + docs: The ID of the target [location](entity:Location). + key: + type: string + docs: >- + The key of the custom attribute to retrieve. This key must match + the `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + query-parameters: + with_definition: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of + + the custom attribute. Set this parameter to `true` to get the name + and description of the custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + version: + type: optional> + docs: >- + The current version of the custom attribute, which is used for + strongly consistent reads to + + guarantee that you receive the most up-to-date data. When included + in the request, Square + + returns the specified version or a higher version if one exists. + If the specified version is + + higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveLocationCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + key: key + query-parameters: + with_definition: true + version: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute: + key: bestseller + value: hot cocoa + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2023-01-09T19:21:04.551Z' + created_at: '2023-01-09T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + upsert: + path: /v2/locations/{location_id}/custom-attributes/{key} + method: POST + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Creates or updates a [custom attribute](entity:CustomAttribute) for a + location. + + Use this endpoint to set the value of a custom attribute for a specified + location. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which + + is created using the + [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) + endpoint. + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: UpsertLocationCustomAttribute + request: + name: UpsertLocationCustomAttributeRequest + path-parameters: + location_id: + type: string + docs: The ID of the target [location](entity:Location). + key: + type: string + docs: >- + The key of the custom attribute to create or update. This key must + match the `key` of a + + custom attribute definition in the Square seller account. If the + requesting application is not + + the definition owner, you must use the qualified key. + body: + properties: + custom_attribute: + type: root.CustomAttribute + docs: >- + The custom attribute to create or update, with the following + fields: + + - `value`. This value must conform to the `schema` specified by + the definition. + + For more information, see [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control for an update operation, include the current version of + the custom attribute. + + If this is not important for your application, version can be + set to -1. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpsertLocationCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + key: key + headers: + Square-Version: '2025-10-16' + request: + custom_attribute: + value: hot cocoa + response: + body: + custom_attribute: + key: bestseller + value: hot cocoa + version: 2 + visibility: VISIBILITY_READ_WRITE_VALUES + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2023-01-09T19:21:04.551Z' + created_at: '2023-01-09T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/locations/{location_id}/custom-attributes/{key} + method: DELETE + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Deletes a [custom attribute](entity:CustomAttribute) associated with a + location. + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: DeleteLocationCustomAttribute + request: + name: DeleteCustomAttributesRequest + path-parameters: + location_id: + type: string + docs: The ID of the target [location](entity:Location). + key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match the + `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + response: + docs: Success + type: root.DeleteLocationCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + location_id: location_id + key: key + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/locations/transactions.yml b/.mock/definition/locations/transactions.yml new file mode 100644 index 000000000..9be50cc61 --- /dev/null +++ b/.mock/definition/locations/transactions.yml @@ -0,0 +1,344 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/locations/{location_id}/transactions + method: GET + auth: + - oauth2: + - PAYMENTS_READ + docs: >- + Lists transactions for a particular location. + + + Transactions include payment information from sales and exchanges and + refund + + information from returns and exchanges. + + + Max results per + [page](https://developer.squareup.com/docs/working-with-apis/pagination): + 50 + source: + openapi: openapi/openapi.json + display-name: ListTransactions + request: + name: ListTransactionsRequest + path-parameters: + location_id: + type: string + docs: The ID of the location to list transactions for. + query-parameters: + begin_time: + type: optional> + docs: >- + The beginning of the requested reporting period, in RFC 3339 + format. + + + See [Date + ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) + for details on date inclusivity/exclusivity. + + + Default value: The current time minus one year. + end_time: + type: optional> + docs: >- + The end of the requested reporting period, in RFC 3339 format. + + + See [Date + ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) + for details on date inclusivity/exclusivity. + + + Default value: The current time. + sort_order: + type: optional> + docs: |- + The order in which results are listed in the response (`ASC` for + oldest first, `DESC` for newest first). + + Default value: `DESC` + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for your original + query. + + + See [Paginating + results](https://developer.squareup.com/docs/working-with-apis/pagination) + for more information. + response: + docs: Success + type: root.ListTransactionsResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + query-parameters: + begin_time: begin_time + end_time: end_time + sort_order: DESC + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + transactions: + - id: KnL67ZIwXCPtzOrqj0HrkxMF + location_id: 18YC4JDH91E1H + created_at: '2016-01-20T22:57:56Z' + tenders: + - id: MtZRYYdDrYNQbOvV7nbuBvMF + location_id: 18YC4JDH91E1H + transaction_id: KnL67ZIwXCPtzOrqj0HrkxMF + created_at: '2016-01-20T22:57:56Z' + note: some optional note + amount_money: + amount: 5000 + currency: USD + processing_fee_money: + amount: 138 + currency: USD + type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + entry_method: KEYED + additional_recipients: + - location_id: 057P5VYJ4A5X1 + description: Application fees + amount_money: + amount: 20 + currency: USD + refunds: + - id: 7a5RcVI0CxbOcJ2wMOkE + location_id: 18YC4JDH91E1H + transaction_id: KnL67ZIwXCPtzOrqj0HrkxMF + tender_id: MtZRYYdDrYNQbOvV7nbuBvMF + created_at: '2016-01-20T22:59:20Z' + reason: some reason why + amount_money: + amount: 5000 + currency: USD + status: APPROVED + processing_fee_money: + amount: 138 + currency: USD + additional_recipients: + - location_id: 057P5VYJ4A5X1 + description: Application fees + amount_money: + amount: 100 + currency: USD + reference_id: some optional reference id + product: EXTERNAL_API + client_id: client_id + order_id: order_id + cursor: cursor + get: + path: /v2/locations/{location_id}/transactions/{transaction_id} + method: GET + auth: + - oauth2: + - PAYMENTS_READ + docs: Retrieves details for a single transaction. + source: + openapi: openapi/openapi.json + display-name: RetrieveTransaction + request: + name: GetTransactionsRequest + path-parameters: + location_id: + type: string + docs: The ID of the transaction's associated location. + transaction_id: + type: string + docs: The ID of the transaction to retrieve. + response: + docs: Success + type: root.GetTransactionResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + transaction_id: transaction_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + transaction: + id: KnL67ZIwXCPtzOrqj0HrkxMF + location_id: 18YC4JDH91E1H + created_at: '2016-03-10T22:57:56Z' + tenders: + - id: MtZRYYdDrYNQbOvV7nbuBvMF + location_id: 18YC4JDH91E1H + transaction_id: KnL67ZIwXCPtzOrqj0HrkxMF + created_at: '2016-03-10T22:57:56Z' + note: some optional note + amount_money: + amount: 5000 + currency: USD + processing_fee_money: + amount: 138 + currency: USD + type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + entry_method: KEYED + additional_recipients: + - location_id: 057P5VYJ4A5X1 + description: Application fees + amount_money: + amount: 20 + currency: USD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + reference_id: some optional reference id + product: EXTERNAL_API + client_id: client_id + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + order_id: order_id + capture: + path: /v2/locations/{location_id}/transactions/{transaction_id}/capture + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Captures a transaction that was created with the + [Charge](api-endpoint:Transactions-Charge) + + endpoint with a `delay_capture` value of `true`. + + + + See [Delayed capture + transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) + + for more information. + source: + openapi: openapi/openapi.json + display-name: CaptureTransaction + request: + name: CaptureTransactionsRequest + path-parameters: + location_id: + type: string + docs: '' + transaction_id: + type: string + docs: '' + response: + docs: Success + type: root.CaptureTransactionResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + transaction_id: transaction_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + void: + path: /v2/locations/{location_id}/transactions/{transaction_id}/void + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Cancels a transaction that was created with the + [Charge](api-endpoint:Transactions-Charge) + + endpoint with a `delay_capture` value of `true`. + + + + See [Delayed capture + transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) + + for more information. + source: + openapi: openapi/openapi.json + display-name: VoidTransaction + request: + name: VoidTransactionsRequest + path-parameters: + location_id: + type: string + docs: '' + transaction_id: + type: string + docs: '' + response: + docs: Success + type: root.VoidTransactionResponse + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + transaction_id: transaction_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/loyalty.yml b/.mock/definition/loyalty.yml new file mode 100644 index 000000000..426eb29ad --- /dev/null +++ b/.mock/definition/loyalty.yml @@ -0,0 +1,139 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + searchEvents: + path: /v2/loyalty/events/search + method: POST + auth: + - oauth2: + - LOYALTY_READ + docs: >- + Searches for loyalty events. + + + A Square loyalty program maintains a ledger of events that occur during + the lifetime of a + + buyer's loyalty account. Each change in the point balance + + (for example, points earned, points redeemed, and points expired) is + + recorded in the ledger. Using this endpoint, you can search the ledger + for events. + + + Search results are sorted by `created_at` in descending order. + source: + openapi: openapi/openapi.json + display-name: SearchLoyaltyEvents + request: + name: SearchLoyaltyEventsRequest + body: + properties: + query: + type: optional + docs: >- + A set of one or more predefined query filters to apply when + + searching for loyalty events. The endpoint performs a logical + AND to + + evaluate multiple filters and performs a logical OR on arrays + + that specifies multiple field values. + limit: + type: optional + docs: |- + The maximum number of results to include in the response. + The last page might contain fewer events. + The default is 30 events. + validation: + min: 1 + max: 30 + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this to retrieve the next set of results for your + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchLoyaltyEventsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + order_filter: + order_id: PyATxhYLfsMqpVkcKJITPydgEYfZY + limit: 30 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + events: + - id: c27c8465-806e-36f2-b4b3-71f5887b5ba8 + type: ACCUMULATE_POINTS + created_at: '2020-05-08T22:01:30Z' + accumulate_points: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + points: 5 + order_id: PyATxhYLfsMqpVkcKJITPydgEYfZY + adjust_points: + points: 1 + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: P034NEENMD09F + source: LOYALTY_API + expire_points: + points: 1 + other_event: + points: 1 + - id: e4a5cbc3-a4d0-3779-98e9-e578885d9430 + type: REDEEM_REWARD + created_at: '2020-05-08T22:01:15Z' + redeem_reward: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + reward_id: d03f79f4-815f-3500-b851-cc1e68a457f9 + order_id: PyATxhYLfsMqpVkcKJITPydgEYfZY + adjust_points: + points: 1 + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: P034NEENMD09F + source: LOYALTY_API + expire_points: + points: 1 + other_event: + points: 1 + - id: 5e127479-0b03-3671-ab1e-15faea8b7188 + type: CREATE_REWARD + created_at: '2020-05-08T22:00:44Z' + create_reward: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + reward_id: d03f79f4-815f-3500-b851-cc1e68a457f9 + points: -10 + adjust_points: + points: 1 + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: location_id + source: LOYALTY_API + expire_points: + points: 1 + other_event: + points: 1 + cursor: cursor + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/loyalty/accounts.yml b/.mock/definition/loyalty/accounts.yml new file mode 100644 index 000000000..1abf87ed4 --- /dev/null +++ b/.mock/definition/loyalty/accounts.yml @@ -0,0 +1,482 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/loyalty/accounts + method: POST + auth: + - oauth2: + - LOYALTY_WRITE + docs: >- + Creates a loyalty account. To create a loyalty account, you must provide + the `program_id` and a `mapping` with the `phone_number` of the buyer. + source: + openapi: openapi/openapi.json + display-name: CreateLoyaltyAccount + request: + name: CreateLoyaltyAccountRequest + body: + properties: + loyalty_account: + type: root.LoyaltyAccount + docs: The loyalty account to create. + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreateLoyaltyAccount` + request. + + Keys can be any valid string, but must be unique for every + request. + validation: + minLength: 1 + maxLength: 128 + content-type: application/json + response: + docs: Success + type: root.CreateLoyaltyAccountResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + loyalty_account: + program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + mapping: + phone_number: '+14155551234' + idempotency_key: ec78c477-b1c3-4899-a209-a4e71337c996 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_account: + id: 79b807d2-d786-46a9-933b-918028d7a8c5 + program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + balance: 0 + lifetime_points: 0 + customer_id: QPTXM8PQNX3Q726ZYHPMNP46XC + enrolled_at: enrolled_at + created_at: '2020-05-08T21:44:32Z' + updated_at: '2020-05-08T21:44:32Z' + mapping: + id: 66aaab3f-da99-49ed-8b19-b87f851c844f + created_at: '2020-05-08T21:44:32Z' + phone_number: '+14155551234' + expiring_point_deadlines: + - points: 1 + expires_at: expires_at + search: + path: /v2/loyalty/accounts/search + method: POST + auth: + - oauth2: + - LOYALTY_READ + docs: >- + Searches for loyalty accounts in a loyalty program. + + + You can search for a loyalty account using the phone number or customer + ID associated with the account. To return all loyalty accounts, specify + an empty `query` object or omit it entirely. + + + Search results are sorted by `created_at` in ascending order. + source: + openapi: openapi/openapi.json + display-name: SearchLoyaltyAccounts + request: + name: SearchLoyaltyAccountsRequest + body: + properties: + query: + type: optional + docs: The search criteria for the request. + limit: + type: optional + docs: >- + The maximum number of results to include in the response. The + default value is 30. + validation: + min: 1 + max: 200 + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to + + this endpoint. Provide this to retrieve the next set of + + results for the original query. + + + For more information, + + see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchLoyaltyAccountsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + mappings: + - phone_number: '+14155551234' + limit: 10 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_accounts: + - id: 79b807d2-d786-46a9-933b-918028d7a8c5 + program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + balance: 10 + lifetime_points: 20 + customer_id: Q8002FAM9V1EZ0ADB2T5609X6NET1H0 + enrolled_at: enrolled_at + created_at: '2020-05-08T21:44:32Z' + updated_at: '2020-05-08T21:44:32Z' + mapping: + id: 66aaab3f-da99-49ed-8b19-b87f851c844f + created_at: '2020-05-08T21:44:32Z' + phone_number: '+14155551234' + expiring_point_deadlines: + - points: 1 + expires_at: expires_at + cursor: cursor + get: + path: /v2/loyalty/accounts/{account_id} + method: GET + auth: + - oauth2: + - LOYALTY_READ + docs: Retrieves a loyalty account. + source: + openapi: openapi/openapi.json + display-name: RetrieveLoyaltyAccount + request: + name: GetAccountsRequest + path-parameters: + account_id: + type: string + docs: >- + The ID of the [loyalty account](entity:LoyaltyAccount) to + retrieve. + response: + docs: Success + type: root.GetLoyaltyAccountResponse + status-code: 200 + examples: + - path-parameters: + account_id: account_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_account: + id: 79b807d2-d786-46a9-933b-918028d7a8c5 + program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + balance: 10 + lifetime_points: 20 + customer_id: Q8002FAM9V1EZ0ADB2T5609X6NET1H0 + enrolled_at: enrolled_at + created_at: '2020-05-08T21:44:32Z' + updated_at: '2020-05-08T21:44:32Z' + mapping: + id: 66aaab3f-da99-49ed-8b19-b87f851c844f + created_at: '2020-05-08T21:44:32Z' + phone_number: '+14155551234' + expiring_point_deadlines: + - points: 1 + expires_at: expires_at + accumulatePoints: + path: /v2/loyalty/accounts/{account_id}/accumulate + method: POST + auth: + - oauth2: + - LOYALTY_WRITE + docs: >- + Adds points earned from a purchase to a [loyalty + account](entity:LoyaltyAccount). + + + - If you are using the Orders API to manage orders, provide the + `order_id`. Square reads the order + + to compute the points earned from both the base loyalty program and an + associated + + [loyalty promotion](entity:LoyaltyPromotion). For purchases that qualify + for multiple accrual + + rules, Square computes points based on the accrual rule that grants the + most points. + + For purchases that qualify for multiple promotions, Square computes + points based on the most + + recently created promotion. A purchase must first qualify for program + points to be eligible for promotion points. + + + - If you are not using the Orders API to manage orders, provide `points` + with the number of points to add. + + You must first perform a client-side computation of the points earned + from the loyalty program and + + loyalty promotion. For spend-based and visit-based programs, you can + call + [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) + + to compute the points earned from the base loyalty program. For + information about computing points earned from a loyalty promotion, see + + [Calculating promotion + points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). + source: + openapi: openapi/openapi.json + display-name: AccumulateLoyaltyPoints + request: + name: AccumulateLoyaltyPointsRequest + path-parameters: + account_id: + type: string + docs: The ID of the target [loyalty account](entity:LoyaltyAccount). + body: + properties: + accumulate_points: + type: root.LoyaltyEventAccumulatePoints + docs: >- + The points to add to the account. + + If you are using the Orders API to manage orders, specify the + order ID. + + Otherwise, specify the points to add. + idempotency_key: + type: string + docs: >- + A unique string that identifies the `AccumulateLoyaltyPoints` + request. + + Keys can be any valid string but must be unique for every + request. + validation: + minLength: 1 + maxLength: 128 + location_id: + type: string + docs: The [location](entity:Location) where the purchase was made. + content-type: application/json + response: + docs: Success + type: root.AccumulateLoyaltyPointsResponse + status-code: 200 + examples: + - path-parameters: + account_id: account_id + headers: + Square-Version: '2025-10-16' + request: + accumulate_points: + order_id: RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY + idempotency_key: 58b90739-c3e8-4b11-85f7-e636d48d72cb + location_id: P034NEENMD09F + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + event: + id: id + type: ACCUMULATE_POINTS + created_at: created_at + accumulate_points: + loyalty_program_id: loyalty_program_id + points: 1 + order_id: order_id + create_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + redeem_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + order_id: order_id + delete_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + adjust_points: + loyalty_program_id: loyalty_program_id + points: 1 + reason: reason + loyalty_account_id: loyalty_account_id + location_id: location_id + source: SQUARE + expire_points: + loyalty_program_id: loyalty_program_id + points: 1 + other_event: + loyalty_program_id: loyalty_program_id + points: 1 + accumulate_promotion_points: + loyalty_program_id: loyalty_program_id + loyalty_promotion_id: loyalty_promotion_id + points: 1 + order_id: order_id + events: + - id: ee46aafd-1af6-3695-a385-276e2ef0be26 + type: ACCUMULATE_POINTS + created_at: '2020-05-08T21:41:12Z' + accumulate_points: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + points: 6 + order_id: RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY + adjust_points: + points: 1 + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: P034NEENMD09F + source: LOYALTY_API + expire_points: + points: 1 + other_event: + points: 1 + adjust: + path: /v2/loyalty/accounts/{account_id}/adjust + method: POST + auth: + - oauth2: + - LOYALTY_WRITE + docs: >- + Adds points to or subtracts points from a buyer's account. + + + Use this endpoint only when you need to manually adjust points. + Otherwise, in your application flow, you call + + [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) + + to add points when a buyer pays for the purchase. + source: + openapi: openapi/openapi.json + display-name: AdjustLoyaltyPoints + request: + name: AdjustLoyaltyPointsRequest + path-parameters: + account_id: + type: string + docs: The ID of the target [loyalty account](entity:LoyaltyAccount). + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this `AdjustLoyaltyPoints` + request. + + Keys can be any valid string, but must be unique for every + request. + validation: + minLength: 1 + maxLength: 128 + adjust_points: + type: root.LoyaltyEventAdjustPoints + docs: >- + The points to add or subtract and the reason for the adjustment. + To add points, specify a positive integer. + + To subtract points, specify a negative integer. + allow_negative_balance: + type: optional> + docs: >- + Indicates whether to allow a negative adjustment to result in a + negative balance. If `true`, a negative + + balance is allowed when subtracting points. If `false`, Square + returns a `BAD_REQUEST` error when subtracting + + the specified number of points would result in a negative + balance. The default value is `false`. + content-type: application/json + response: + docs: Success + type: root.AdjustLoyaltyPointsResponse + status-code: 200 + examples: + - path-parameters: + account_id: account_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: bc29a517-3dc9-450e-aa76-fae39ee849d1 + adjust_points: + points: 10 + reason: Complimentary points + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + event: + id: 613a6fca-8d67-39d0-bad2-3b4bc45c8637 + type: ADJUST_POINTS + created_at: '2020-05-08T21:42:32Z' + accumulate_points: + loyalty_program_id: loyalty_program_id + points: 1 + order_id: order_id + create_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + redeem_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + order_id: order_id + delete_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + adjust_points: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + points: 10 + reason: Complimentary points + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: location_id + source: LOYALTY_API + expire_points: + loyalty_program_id: loyalty_program_id + points: 1 + other_event: + loyalty_program_id: loyalty_program_id + points: 1 + accumulate_promotion_points: + loyalty_program_id: loyalty_program_id + loyalty_promotion_id: loyalty_promotion_id + points: 1 + order_id: order_id + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/loyalty/programs.yml b/.mock/definition/loyalty/programs.yml new file mode 100644 index 000000000..74a59a2e1 --- /dev/null +++ b/.mock/definition/loyalty/programs.yml @@ -0,0 +1,280 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/loyalty/programs + method: GET + auth: + - oauth2: + - LOYALTY_READ + docs: >- + Returns a list of loyalty programs in the seller's account. + + Loyalty programs define how buyers can earn points and redeem points for + rewards. Square sellers can have only one loyalty program, which is + created and managed from the Seller Dashboard. For more information, see + [Loyalty Program + Overview](https://developer.squareup.com/docs/loyalty/overview). + + + + Replaced with + [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) + when used with the keyword `main`. + source: + openapi: openapi/openapi.json + display-name: ListLoyaltyPrograms + response: + docs: Success + type: root.ListLoyaltyProgramsResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + programs: + - id: d619f755-2d17-41f3-990d-c04ecedd64dd + status: ACTIVE + reward_tiers: + - id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + name: 10% off entire sale + created_at: '2020-04-20T16:55:11Z' + pricing_rule_reference: + object_id: 74C4JSHESNLTB2A7ITO5HO6F + catalog_version: 1000000 + expiration_policy: + expiration_duration: expiration_duration + terminology: + one: Point + other: Points + location_ids: + - P034NEENMD09F + created_at: '2020-04-20T16:55:11Z' + updated_at: '2020-05-01T02:00:02Z' + accrual_rules: + - accrual_type: SPEND + points: 1 + spend_data: + amount_money: + amount: 100 + currency: USD + excluded_category_ids: + - 7ZERJKO5PVYXCVUHV2JCZ2UG + - FQKAOJE5C4FIMF5A2URMLW6V + excluded_item_variation_ids: + - CBZXBUVVTYUBZGQO44RHMR6B + - EDILT24Z2NISEXDKGY6HP7XV + tax_mode: BEFORE_TAX + get: + path: /v2/loyalty/programs/{program_id} + method: GET + auth: + - oauth2: + - LOYALTY_READ + docs: >- + Retrieves the loyalty program in a seller's account, specified by the + program ID or the keyword `main`. + + + Loyalty programs define how buyers can earn points and redeem points for + rewards. Square sellers can have only one loyalty program, which is + created and managed from the Seller Dashboard. For more information, see + [Loyalty Program + Overview](https://developer.squareup.com/docs/loyalty/overview). + source: + openapi: openapi/openapi.json + display-name: RetrieveLoyaltyProgram + request: + name: GetProgramsRequest + path-parameters: + program_id: + type: string + docs: >- + The ID of the loyalty program or the keyword `main`. Either value + can be used to retrieve the single loyalty program that belongs to + the seller. + response: + docs: Success + type: root.GetLoyaltyProgramResponse + status-code: 200 + examples: + - path-parameters: + program_id: program_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + program: + id: d619f755-2d17-41f3-990d-c04ecedd64dd + status: ACTIVE + reward_tiers: + - id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + name: 10% off entire sale + created_at: '2020-04-20T16:55:11Z' + pricing_rule_reference: + object_id: 74C4JSHESNLTB2A7ITO5HO6F + catalog_version: 1000000 + expiration_policy: + expiration_duration: expiration_duration + terminology: + one: Point + other: Points + location_ids: + - P034NEENMD09F + created_at: '2020-04-20T16:55:11Z' + updated_at: '2020-05-01T02:00:02Z' + accrual_rules: + - accrual_type: SPEND + points: 1 + spend_data: + amount_money: + amount: 100 + currency: USD + excluded_category_ids: + - 7ZERJKO5PVYXCVUHV2JCZ2UG + - FQKAOJE5C4FIMF5A2URMLW6V + excluded_item_variation_ids: + - CBZXBUVVTYUBZGQO44RHMR6B + - EDILT24Z2NISEXDKGY6HP7XV + tax_mode: BEFORE_TAX + calculate: + path: /v2/loyalty/programs/{program_id}/calculate + method: POST + auth: + - oauth2: + - LOYALTY_READ + docs: >- + Calculates the number of points a buyer can earn from a purchase. + Applications might call this endpoint + + to display the points to the buyer. + + + - If you are using the Orders API to manage orders, provide the + `order_id` and (optional) `loyalty_account_id`. + + Square reads the order to compute the points earned from the base + loyalty program and an associated + + [loyalty promotion](entity:LoyaltyPromotion). + + + - If you are not using the Orders API to manage orders, provide + `transaction_amount_money` with the + + purchase amount. Square uses this amount to calculate the points earned + from the base loyalty program, + + but not points earned from a loyalty promotion. For spend-based and + visit-based programs, the `tax_mode` + + setting of the accrual rule indicates how taxes should be treated for + loyalty points accrual. + + If the purchase qualifies for program points, call + + [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) and + perform a client-side computation + + to calculate whether the purchase also qualifies for promotion points. + For more information, see + + [Calculating promotion + points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). + source: + openapi: openapi/openapi.json + display-name: CalculateLoyaltyPoints + request: + name: CalculateLoyaltyPointsRequest + path-parameters: + program_id: + type: string + docs: >- + The ID of the [loyalty program](entity:LoyaltyProgram), which + defines the rules for accruing points. + body: + properties: + order_id: + type: optional> + docs: >- + The [order](entity:Order) ID for which to calculate the points. + + Specify this field if your application uses the Orders API to + process orders. + + Otherwise, specify the `transaction_amount_money`. + transaction_amount_money: + type: optional + docs: >- + The purchase amount for which to calculate the points. + + Specify this field if your application does not use the Orders + API to process orders. + + Otherwise, specify the `order_id`. + loyalty_account_id: + type: optional> + docs: >- + The ID of the target [loyalty account](entity:LoyaltyAccount). + Optionally specify this field + + if your application uses the Orders API to process orders. + + + If specified, the `promotion_points` field in the response shows + the number of points the buyer would + + earn from the purchase. In this case, Square uses the account ID + to determine whether the promotion's + + `trigger_limit` (the maximum number of times that a buyer can + trigger the promotion) has been reached. + + If not specified, the `promotion_points` field shows the number + of points the purchase qualifies + + for regardless of the trigger limit. + validation: + minLength: 1 + maxLength: 36 + content-type: application/json + response: + docs: Success + type: root.CalculateLoyaltyPointsResponse + status-code: 200 + examples: + - path-parameters: + program_id: program_id + headers: + Square-Version: '2025-10-16' + request: + order_id: RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY + loyalty_account_id: 79b807d2-d786-46a9-933b-918028d7a8c5 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + points: 6 + promotion_points: 12 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/loyalty/programs/promotions.yml b/.mock/definition/loyalty/programs/promotions.yml new file mode 100644 index 000000000..c90dcd940 --- /dev/null +++ b/.mock/definition/loyalty/programs/promotions.yml @@ -0,0 +1,476 @@ +imports: + root: ../../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/loyalty/programs/{program_id}/promotions + method: GET + auth: + - oauth2: + - LOYALTY_READ + docs: >- + Lists the loyalty promotions associated with a [loyalty + program](entity:LoyaltyProgram). + + Results are sorted by the `created_at` date in descending order (newest + to oldest). + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.loyalty_promotions + source: + openapi: openapi/openapi.json + display-name: ListLoyaltyPromotions + request: + name: ListPromotionsRequest + path-parameters: + program_id: + type: string + docs: >- + The ID of the base [loyalty program](entity:LoyaltyProgram). To + get the program ID, + + call + [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) + using the `main` keyword. + query-parameters: + status: + type: optional> + docs: >- + The status to filter the results by. If a status is provided, only + loyalty promotions + + with the specified status are returned. Otherwise, all loyalty + promotions associated with + + the loyalty program are returned. + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. + + The minimum value is 1 and the maximum value is 30. The default + value is 30. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListLoyaltyPromotionsResponse + status-code: 200 + examples: + - path-parameters: + program_id: program_id + query-parameters: + status: ACTIVE + cursor: cursor + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_promotions: + - id: loypromo_f0f9b849-725e-378d-b810-511237e07b67 + name: Tuesday Happy Hour Promo + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + points_multiplier: 3 + multiplier: '3.000' + available_time: + start_date: '2022-08-16' + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220816T160000 + DURATION:PT2H + RRULE:FREQ=WEEKLY;BYDAY=TU + END:VEVENT + trigger_limit: + times: 1 + interval: DAY + status: ACTIVE + created_at: '2022-08-16T08:38:54Z' + canceled_at: canceled_at + updated_at: '2022-08-16T08:38:54Z' + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + qualifying_item_variation_ids: + - CJ3RYL56ITAKMD4VRCM7XERS + - AT3RYLR3TUA9C34VRCB7X5RR + qualifying_category_ids: + - qualifying_category_ids + - id: loypromo_e696f057-2286-35ff-8108-132241328106 + name: July Special + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + points_multiplier: 2 + multiplier: '2.000' + available_time: + start_date: '2022-07-01' + end_date: '2022-08-01' + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220704T090000 + DURATION:PT8H + RRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=MO + END:VEVENT + - |- + BEGIN:VEVENT + DTSTART:20220705T090000 + DURATION:PT8H + RRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TU + END:VEVENT + - |- + BEGIN:VEVENT + DTSTART:20220706T090000 + DURATION:PT8H + RRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=WE + END:VEVENT + - |- + BEGIN:VEVENT + DTSTART:20220707T090000 + DURATION:PT8H + RRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TH + END:VEVENT + - |- + BEGIN:VEVENT + DTSTART:20220701T090000 + DURATION:PT8H + RRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=FR + END:VEVENT + trigger_limit: + times: 5 + interval: ALL_TIME + status: ENDED + created_at: '2022-06-27T15:37:38Z' + canceled_at: canceled_at + updated_at: '2022-06-27T15:37:38Z' + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + minimum_spend_amount_money: + amount: 2000 + currency: USD + qualifying_item_variation_ids: + - qualifying_item_variation_ids + qualifying_category_ids: + - XTQPYLR3IIU9C44VRCB3XD12 + cursor: cursor + create: + path: /v2/loyalty/programs/{program_id}/promotions + method: POST + auth: + - oauth2: + - LOYALTY_WRITE + docs: >- + Creates a loyalty promotion for a [loyalty + program](entity:LoyaltyProgram). A loyalty promotion + + enables buyers to earn points in addition to those earned from the base + loyalty program. + + + This endpoint sets the loyalty promotion to the `ACTIVE` or `SCHEDULED` + status, depending on the + + `available_time` setting. A loyalty program can have a maximum of 10 + loyalty promotions with an + + `ACTIVE` or `SCHEDULED` status. + source: + openapi: openapi/openapi.json + display-name: CreateLoyaltyPromotion + request: + name: CreateLoyaltyPromotionRequest + path-parameters: + program_id: + type: string + docs: >- + The ID of the [loyalty program](entity:LoyaltyProgram) to + associate with the promotion. + + To get the program ID, call + [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) + + using the `main` keyword. + body: + properties: + loyalty_promotion: + type: root.LoyaltyPromotion + docs: The loyalty promotion to create. + idempotency_key: + type: string + docs: >- + A unique identifier for this request, which is used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 128 + content-type: application/json + response: + docs: Success + type: root.CreateLoyaltyPromotionResponse + status-code: 200 + examples: + - path-parameters: + program_id: program_id + headers: + Square-Version: '2025-10-16' + request: + loyalty_promotion: + name: Tuesday Happy Hour Promo + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + multiplier: '3.0' + available_time: + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220816T160000 + DURATION:PT2H + RRULE:FREQ=WEEKLY;BYDAY=TU + END:VEVENT + trigger_limit: + times: 1 + interval: DAY + minimum_spend_amount_money: + amount: 2000 + currency: USD + qualifying_category_ids: + - XTQPYLR3IIU9C44VRCB3XD12 + idempotency_key: ec78c477-b1c3-4899-a209-a4e71337c996 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_promotion: + id: loypromo_f0f9b849-725e-378d-b810-511237e07b67 + name: Tuesday Happy Hour Promo + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + points_multiplier: 3 + multiplier: '3.000' + points_addition_data: + points_addition: 1 + available_time: + start_date: '2022-08-16' + end_date: end_date + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220816T160000 + DURATION:PT2H + RRULE:FREQ=WEEKLY;BYDAY=TU + END:VEVENT + trigger_limit: + times: 1 + interval: DAY + status: ACTIVE + created_at: '2022-08-16T08:38:54Z' + canceled_at: canceled_at + updated_at: '2022-08-16T08:38:54Z' + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + minimum_spend_amount_money: + amount: 2000 + currency: USD + qualifying_item_variation_ids: + - qualifying_item_variation_ids + qualifying_category_ids: + - XTQPYLR3IIU9C44VRCB3XD12 + get: + path: /v2/loyalty/programs/{program_id}/promotions/{promotion_id} + method: GET + auth: + - oauth2: + - LOYALTY_READ + docs: Retrieves a loyalty promotion. + source: + openapi: openapi/openapi.json + display-name: RetrieveLoyaltyPromotion + request: + name: GetPromotionsRequest + path-parameters: + program_id: + type: string + docs: >- + The ID of the base [loyalty program](entity:LoyaltyProgram). To + get the program ID, + + call + [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) + using the `main` keyword. + promotion_id: + type: string + docs: >- + The ID of the [loyalty promotion](entity:LoyaltyPromotion) to + retrieve. + response: + docs: Success + type: root.GetLoyaltyPromotionResponse + status-code: 200 + examples: + - path-parameters: + program_id: program_id + promotion_id: promotion_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_promotion: + id: loypromo_f0f9b849-725e-378d-b810-511237e07b67 + name: Tuesday Happy Hour Promo + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + points_multiplier: 3 + multiplier: '3.000' + points_addition_data: + points_addition: 1 + available_time: + start_date: '2022-08-16' + end_date: end_date + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220816T160000 + DURATION:PT2H + RRULE:FREQ=WEEKLY;BYDAY=TU + END:VEVENT + trigger_limit: + times: 1 + interval: DAY + status: ACTIVE + created_at: '2022-08-16T08:38:54Z' + canceled_at: canceled_at + updated_at: '2022-08-16T08:38:54Z' + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + minimum_spend_amount_money: + amount: 2000 + currency: USD + qualifying_item_variation_ids: + - CJ3RYL56ITAKMD4VRCM7XERS + - AT3RYLR3TUA9C34VRCB7X5RR + qualifying_category_ids: + - qualifying_category_ids + cancel: + path: /v2/loyalty/programs/{program_id}/promotions/{promotion_id}/cancel + method: POST + auth: + - oauth2: + - LOYALTY_WRITE + docs: >- + Cancels a loyalty promotion. Use this endpoint to cancel an `ACTIVE` + promotion earlier than the + + end date, cancel an `ACTIVE` promotion when an end date is not + specified, or cancel a `SCHEDULED` promotion. + + Because updating a promotion is not supported, you can also use this + endpoint to cancel a promotion before + + you create a new one. + + + This endpoint sets the loyalty promotion to the `CANCELED` state + source: + openapi: openapi/openapi.json + display-name: CancelLoyaltyPromotion + request: + name: CancelPromotionsRequest + path-parameters: + program_id: + type: string + docs: The ID of the base [loyalty program](entity:LoyaltyProgram). + promotion_id: + type: string + docs: >- + The ID of the [loyalty promotion](entity:LoyaltyPromotion) to + cancel. You can cancel a + + promotion that has an `ACTIVE` or `SCHEDULED` status. + response: + docs: Success + type: root.CancelLoyaltyPromotionResponse + status-code: 200 + examples: + - path-parameters: + program_id: program_id + promotion_id: promotion_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + loyalty_promotion: + id: loypromo_f0f9b849-725e-378d-b810-511237e07b67 + name: Tuesday Happy Hour Promo + incentive: + type: POINTS_MULTIPLIER + points_multiplier_data: + points_multiplier: 3 + multiplier: '3.000' + points_addition_data: + points_addition: 1 + available_time: + start_date: '2022-08-16' + end_date: end_date + time_periods: + - |- + BEGIN:VEVENT + DTSTART:20220816T160000 + DURATION:PT2H + RRULE:FREQ=WEEKLY;BYDAY=TU + END:VEVENT + trigger_limit: + times: 1 + interval: DAY + status: CANCELED + created_at: '2022-08-16T08:38:54Z' + canceled_at: '2022-08-17T12:42:49Z' + updated_at: '2022-08-17T12:42:49Z' + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + minimum_spend_amount_money: + amount: 2000 + currency: USD + qualifying_item_variation_ids: + - qualifying_item_variation_ids + qualifying_category_ids: + - XTQPYLR3IIU9C44VRCB3XD12 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/loyalty/rewards.yml b/.mock/definition/loyalty/rewards.yml new file mode 100644 index 000000000..912d790e0 --- /dev/null +++ b/.mock/definition/loyalty/rewards.yml @@ -0,0 +1,390 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/loyalty/rewards + method: POST + auth: + - oauth2: + - LOYALTY_WRITE + docs: >- + Creates a loyalty reward. In the process, the endpoint does following: + + + - Uses the `reward_tier_id` in the request to determine the number of + points + + to lock for this reward. + + - If the request includes `order_id`, it adds the reward and related + discount to the order. + + + After a reward is created, the points are locked and + + not available for the buyer to redeem another reward. + source: + openapi: openapi/openapi.json + display-name: CreateLoyaltyReward + request: + name: CreateLoyaltyRewardRequest + body: + properties: + reward: + type: root.LoyaltyReward + docs: The reward to create. + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreateLoyaltyReward` + request. + + Keys can be any valid string, but must be unique for every + request. + validation: + minLength: 1 + maxLength: 128 + content-type: application/json + response: + docs: Success + type: root.CreateLoyaltyRewardResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + reward: + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + order_id: RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY + idempotency_key: 18c2e5ea-a620-4b1f-ad60-7b167285e451 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + reward: + id: a8f43ebe-2ad6-3001-bdd5-7d7c2da08943 + status: ISSUED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY + created_at: '2020-05-01T21:49:54Z' + updated_at: '2020-05-01T21:49:54Z' + redeemed_at: redeemed_at + search: + path: /v2/loyalty/rewards/search + method: POST + auth: + - oauth2: + - LOYALTY_READ + docs: >- + Searches for loyalty rewards. This endpoint accepts a request with no + query filters and returns results for all loyalty accounts. + + If you include a `query` object, `loyalty_account_id` is required and + `status` is optional. + + + If you know a reward ID, use the + + [RetrieveLoyaltyReward](api-endpoint:Loyalty-RetrieveLoyaltyReward) + endpoint. + + + Search results are sorted by `updated_at` in descending order. + source: + openapi: openapi/openapi.json + display-name: SearchLoyaltyRewards + request: + name: SearchLoyaltyRewardsRequest + body: + properties: + query: + type: optional + docs: >- + The search criteria for the request. + + If empty, the endpoint retrieves all loyalty rewards in the + loyalty program. + limit: + type: optional + docs: >- + The maximum number of results to return in the response. The + default value is 30. + validation: + min: 1 + max: 30 + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to + + this endpoint. Provide this to retrieve the next set of + + results for the original query. + + For more information, + + see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchLoyaltyRewardsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + limit: 10 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + rewards: + - id: d03f79f4-815f-3500-b851-cc1e68a457f9 + status: REDEEMED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: PyATxhYLfsMqpVkcKJITPydgEYfZY + created_at: '2020-05-08T22:00:44Z' + updated_at: '2020-05-08T22:01:17Z' + redeemed_at: '2020-05-08T22:01:17Z' + - id: 9f18ac21-233a-31c3-be77-b45840f5a810 + status: REDEEMED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: order_id + created_at: '2020-05-08T21:55:42Z' + updated_at: '2020-05-08T21:56:00Z' + redeemed_at: '2020-05-08T21:56:00Z' + - id: a8f43ebe-2ad6-3001-bdd5-7d7c2da08943 + status: DELETED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: 5NB69ZNh3FbsOs1ox43bh1xrli6YY + created_at: '2020-05-01T21:49:54Z' + updated_at: '2020-05-08T21:55:10Z' + redeemed_at: redeemed_at + - id: a051254c-f840-3b45-8cf1-50bcd38ff92a + status: ISSUED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: LQQ16znvi2VIUKPVhUfJefzr1eEZY + created_at: '2020-05-01T20:20:37Z' + updated_at: '2020-05-01T20:20:40Z' + redeemed_at: redeemed_at + cursor: cursor + get: + path: /v2/loyalty/rewards/{reward_id} + method: GET + auth: + - oauth2: + - LOYALTY_READ + docs: Retrieves a loyalty reward. + source: + openapi: openapi/openapi.json + display-name: RetrieveLoyaltyReward + request: + name: GetRewardsRequest + path-parameters: + reward_id: + type: string + docs: The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve. + response: + docs: Success + type: root.GetLoyaltyRewardResponse + status-code: 200 + examples: + - path-parameters: + reward_id: reward_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + reward: + id: 9f18ac21-233a-31c3-be77-b45840f5a810 + status: REDEEMED + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + reward_tier_id: e1b39225-9da5-43d1-a5db-782cdd8ad94f + points: 10 + order_id: order_id + created_at: '2020-05-08T21:55:42Z' + updated_at: '2020-05-08T21:56:00Z' + redeemed_at: '2020-05-08T21:56:00Z' + delete: + path: /v2/loyalty/rewards/{reward_id} + method: DELETE + auth: + - oauth2: + - LOYALTY_WRITE + docs: >- + Deletes a loyalty reward by doing the following: + + + - Returns the loyalty points back to the loyalty account. + + - If an order ID was specified when the reward was created + + (see [CreateLoyaltyReward](api-endpoint:Loyalty-CreateLoyaltyReward)), + + it updates the order by removing the reward and related + + discounts. + + + You cannot delete a reward that has reached the terminal state + (REDEEMED). + source: + openapi: openapi/openapi.json + display-name: DeleteLoyaltyReward + request: + name: DeleteRewardsRequest + path-parameters: + reward_id: + type: string + docs: The ID of the [loyalty reward](entity:LoyaltyReward) to delete. + response: + docs: Success + type: root.DeleteLoyaltyRewardResponse + status-code: 200 + examples: + - path-parameters: + reward_id: reward_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + redeem: + path: /v2/loyalty/rewards/{reward_id}/redeem + method: POST + auth: + - oauth2: + - LOYALTY_WRITE + docs: |- + Redeems a loyalty reward. + + The endpoint sets the reward to the `REDEEMED` terminal state. + + If you are using your own order processing system (not using the + Orders API), you call this endpoint after the buyer paid for the + purchase. + + After the reward reaches the terminal state, it cannot be deleted. + In other words, points used for the reward cannot be returned + to the account. + source: + openapi: openapi/openapi.json + display-name: RedeemLoyaltyReward + request: + name: RedeemLoyaltyRewardRequest + path-parameters: + reward_id: + type: string + docs: The ID of the [loyalty reward](entity:LoyaltyReward) to redeem. + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this `RedeemLoyaltyReward` + request. + + Keys can be any valid string, but must be unique for every + request. + validation: + minLength: 1 + maxLength: 128 + location_id: + type: string + docs: >- + The ID of the [location](entity:Location) where the reward is + redeemed. + validation: + minLength: 1 + content-type: application/json + response: + docs: Success + type: root.RedeemLoyaltyRewardResponse + status-code: 200 + examples: + - path-parameters: + reward_id: reward_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 98adc7f7-6963-473b-b29c-f3c9cdd7d994 + location_id: P034NEENMD09F + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + event: + id: 67377a6e-dbdc-369d-aa16-2e7ed422e71f + type: REDEEM_REWARD + created_at: '2020-05-08T21:56:00Z' + accumulate_points: + loyalty_program_id: loyalty_program_id + points: 1 + order_id: order_id + create_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + redeem_reward: + loyalty_program_id: d619f755-2d17-41f3-990d-c04ecedd64dd + reward_id: 9f18ac21-233a-31c3-be77-b45840f5a810 + order_id: order_id + delete_reward: + loyalty_program_id: loyalty_program_id + reward_id: reward_id + points: 1 + adjust_points: + loyalty_program_id: loyalty_program_id + points: 1 + reason: reason + loyalty_account_id: 5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd + location_id: P034NEENMD09F + source: LOYALTY_API + expire_points: + loyalty_program_id: loyalty_program_id + points: 1 + other_event: + loyalty_program_id: loyalty_program_id + points: 1 + accumulate_promotion_points: + loyalty_program_id: loyalty_program_id + loyalty_promotion_id: loyalty_promotion_id + points: 1 + order_id: order_id + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/merchants.yml b/.mock/definition/merchants.yml new file mode 100644 index 000000000..f204b0ea3 --- /dev/null +++ b/.mock/definition/merchants.yml @@ -0,0 +1,122 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/merchants + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Provides details about the merchant associated with a given access + token. + + + The access token used to connect your application to a Square seller is + associated + + with a single merchant. That means that `ListMerchants` returns a list + + with a single `Merchant` object. You can specify your personal access + token + + to get your own merchant information or specify an OAuth token to get + the + + information for the merchant that granted your application access. + + + If you know the merchant ID, you can also use the + [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) + + endpoint to retrieve the merchant information. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.merchant + source: + openapi: openapi/openapi.json + display-name: ListMerchants + request: + name: ListMerchantsRequest + query-parameters: + cursor: + type: optional> + docs: The cursor generated by the previous response. + response: + docs: Success + type: root.ListMerchantsResponse + status-code: 200 + examples: + - query-parameters: + cursor: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + merchant: + - id: DM7VKY8Q63GNP + business_name: Apple A Day + country: US + language_code: en-US + currency: USD + status: ACTIVE + main_location_id: 9A65CGC72ZQG1 + created_at: '2021-12-10T19:25:52.484Z' + cursor: 1 + get: + path: /v2/merchants/{merchant_id} + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: Retrieves the `Merchant` object for the given `merchant_id`. + source: + openapi: openapi/openapi.json + display-name: RetrieveMerchant + request: + name: GetMerchantsRequest + path-parameters: + merchant_id: + type: string + docs: >- + The ID of the merchant to retrieve. If the string "me" is supplied + as the ID, + + then retrieve the merchant that is currently accessible to this + call. + response: + docs: Success + type: root.GetMerchantResponse + status-code: 200 + examples: + - path-parameters: + merchant_id: merchant_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + merchant: + id: DM7VKY8Q63GNP + business_name: Apple A Day + country: US + language_code: en-US + currency: USD + status: ACTIVE + main_location_id: 9A65CGC72ZQG1 + created_at: '2021-12-10T19:25:52.484Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/merchants/customAttributeDefinitions.yml b/.mock/definition/merchants/customAttributeDefinitions.yml new file mode 100644 index 000000000..45d538fc5 --- /dev/null +++ b/.mock/definition/merchants/customAttributeDefinitions.yml @@ -0,0 +1,421 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/merchants/custom-attribute-definitions + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Lists the merchant-related [custom attribute + definitions](entity:CustomAttributeDefinition) that belong to a Square + seller account. + + When all response pages are retrieved, the results include all custom + attribute definitions + + that are visible to the requesting application, including those that are + created by other + + applications and set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attribute_definitions + source: + openapi: openapi/openapi.json + display-name: ListMerchantCustomAttributeDefinitions + request: + name: ListCustomAttributeDefinitionsRequest + query-parameters: + visibility_filter: + type: optional> + docs: >- + Filters the `CustomAttributeDefinition` results by their + `visibility` values. + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListMerchantCustomAttributeDefinitionsResponse + status-code: 200 + examples: + - query-parameters: + visibility_filter: ALL + limit: 1 + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute_definitions: + - key: has_seen_tutorial + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean + name: NAME + description: >- + Whether the merchant has seen the tutorial screen for using + the app. + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2023-05-05T16:50:21.832Z' + created_at: '2023-05-05T16:50:21.832Z' + - key: alternative_seller_name + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Alternative Merchant Name + description: This is the other name this merchant goes by. + visibility: VISIBILITY_READ_ONLY + version: 4 + updated_at: '2023-05-05T10:17:52.341Z' + created_at: '2023-05-05T19:06:36.559Z' + cursor: >- + ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/merchants/custom-attribute-definitions + method: POST + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Creates a merchant-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + Use this endpoint to define a custom attribute that can be associated + with a merchant connecting to your application. + + A custom attribute definition specifies the `key`, `visibility`, + `schema`, and other properties + + for a custom attribute. After the definition is created, you can call + + [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) + or + + [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) + + to set the custom attribute for a merchant. + source: + openapi: openapi/openapi.json + display-name: CreateMerchantCustomAttributeDefinition + request: + name: CreateMerchantCustomAttributeDefinitionRequest + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition to create. Note the following: + + - With the exception of the `Selection` data type, the `schema` + is specified as a simple URL to the JSON schema + + definition hosted on the Square CDN. For more information, + including supported values and constraints, see + + [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). + + - `name` is required unless `visibility` is set to + `VISIBILITY_HIDDEN`. + idempotency_key: + type: optional + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateMerchantCustomAttributeDefinitionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + custom_attribute_definition: + key: alternative_seller_name + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Alternative Merchant Name + description: This is the other name this merchant goes by. + visibility: VISIBILITY_READ_ONLY + response: + body: + custom_attribute_definition: + key: alternative_seller_name + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Alternative Merchant Name + description: This is the other name this merchant goes by. + visibility: VISIBILITY_READ_ONLY + version: 1 + updated_at: '2023-05-05T19:06:36.559Z' + created_at: '2023-05-05T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/merchants/custom-attribute-definitions/{key} + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Retrieves a merchant-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + To retrieve a custom attribute definition created by another + application, the `visibility` + + setting must be `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveMerchantCustomAttributeDefinition + request: + name: GetCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: >- + The key of the custom attribute definition to retrieve. If the + requesting application + + is not the definition owner, you must use the qualified key. + query-parameters: + version: + type: optional> + docs: >- + The current version of the custom attribute definition, which is + used for strongly consistent + + reads to guarantee that you receive the most up-to-date data. When + included in the request, + + Square returns the specified version or a higher version if one + exists. If the specified version + + is higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveMerchantCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + query-parameters: + version: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute_definition: + key: alternative_seller_name + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Alternative Merchant Name + description: This is the other name this merchant goes by. + visibility: VISIBILITY_READ_ONLY + version: 1 + updated_at: '2023-05-05T19:06:36.559Z' + created_at: '2023-05-05T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/merchants/custom-attribute-definitions/{key} + method: PUT + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Updates a merchant-related [custom attribute + definition](entity:CustomAttributeDefinition) for a Square seller + account. + + Use this endpoint to update the following fields: `name`, `description`, + `visibility`, or the + + `schema` for a `Selection` data type. + + Only the definition owner can update a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: UpdateMerchantCustomAttributeDefinition + request: + name: UpdateMerchantCustomAttributeDefinitionRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to update. + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition that contains the fields to + update. This endpoint + + supports sparse updates, so only new or changed fields need to + be included in the request. + + Only the following fields can be updated: + + - `name` + + - `description` + + - `visibility` + + - `schema` for a `Selection` data type. Only changes to the + named options or the maximum number of allowed + + selections are supported. + + For more information, see + + [Update a merchant custom attribute + definition](https://developer.squareup.com/docs/merchant-custom-attributes-api/custom-attribute-definitions#update-custom-attribute-definition). + + The version field must match the current version of the custom + attribute definition to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + If this is not important for your application, version can be + set to -1. For any other values, the request fails with a + BAD_REQUEST error. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateMerchantCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-10-16' + request: + custom_attribute_definition: + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + response: + body: + custom_attribute_definition: + key: alternative_seller_name + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String + name: Alternative Merchant Name + description: Update the description as desired. + visibility: VISIBILITY_READ_ONLY + version: 2 + updated_at: '2023-05-05T19:34:10.181Z' + created_at: '2023-05-05T19:06:36.559Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/merchants/custom-attribute-definitions/{key} + method: DELETE + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Deletes a merchant-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + Deleting a custom attribute definition also deletes the corresponding + custom attribute from + + the merchant. + + Only the definition owner can delete a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: DeleteMerchantCustomAttributeDefinition + request: + name: DeleteCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to delete. + response: + docs: Success + type: root.DeleteMerchantCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/merchants/customAttributes.yml b/.mock/definition/merchants/customAttributes.yml new file mode 100644 index 000000000..6a81db37e --- /dev/null +++ b/.mock/definition/merchants/customAttributes.yml @@ -0,0 +1,552 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + batchDelete: + path: /v2/merchants/custom-attributes/bulk-delete + method: POST + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Deletes [custom attributes](entity:CustomAttribute) for a merchant as a + bulk operation. + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkDeleteMerchantCustomAttributes + request: + name: BulkDeleteMerchantCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + The data used to update the `CustomAttribute` objects. + + The keys must be unique and are used to map to the corresponding + response. + content-type: application/json + response: + docs: Success + type: root.BulkDeleteMerchantCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + values: + id1: + key: alternative_seller_name + id2: + key: has_seen_tutorial + response: + body: + values: + id1: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchUpsert: + path: /v2/merchants/custom-attributes/bulk-upsert + method: POST + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Creates or updates [custom attributes](entity:CustomAttribute) for a + merchant as a bulk operation. + + Use this endpoint to set the value of one or more custom attributes for + a merchant. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which is + + created using the + [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) + endpoint. + + This `BulkUpsertMerchantCustomAttributes` endpoint accepts a map of 1 to + 25 individual upsert + + requests and returns a map of individual upsert responses. Each upsert + request has a unique ID + + and provides a merchant ID and custom attribute. Each upsert response is + returned with the ID + + of the corresponding request. + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkUpsertMerchantCustomAttributes + request: + name: BulkUpsertMerchantCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + A map containing 1 to 25 individual upsert requests. For each + request, provide an + + arbitrary ID that is unique for this + `BulkUpsertMerchantCustomAttributes` request and the + + information needed to create or update a custom attribute. + content-type: application/json + response: + docs: Success + type: root.BulkUpsertMerchantCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + values: + id1: + merchant_id: DM7VKY8Q63GNP + custom_attribute: + key: alternative_seller_name + value: Ultimate Sneaker Store + id2: + merchant_id: DM7VKY8Q63GNP + custom_attribute: + key: has_seen_tutorial + value: true + response: + body: + values: + id1: + merchant_id: DM7VKY8Q63GNP + custom_attribute: + key: alternative_seller_name + value: Ultimate Sneaker Store + version: 2 + visibility: VISIBILITY_READ_ONLY + updated_at: '2023-05-06T19:21:04.551Z' + created_at: '2023-05-06T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id2: + merchant_id: DM7VKY8Q63GNP + custom_attribute: + key: has_seen_tutorial + value: true + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2023-05-06T19:21:04.551Z' + created_at: '2023-05-06T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + list: + path: /v2/merchants/{merchant_id}/custom-attributes + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Lists the [custom attributes](entity:CustomAttribute) associated with a + merchant. + + You can use the `with_definitions` query parameter to also retrieve + custom attribute definitions + + in the same call. + + When all response pages are retrieved, the results include all custom + attributes that are + + visible to the requesting application, including those that are owned by + other applications + + and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attributes + source: + openapi: openapi/openapi.json + display-name: ListMerchantCustomAttributes + request: + name: ListCustomAttributesRequest + path-parameters: + merchant_id: + type: string + docs: The ID of the target [merchant](entity:Merchant). + query-parameters: + visibility_filter: + type: optional> + docs: >- + Filters the `CustomAttributeDefinition` results by their + `visibility` values. + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. For more + + information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + with_definitions: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + response: + docs: Success + type: root.ListMerchantCustomAttributesResponse + status-code: 200 + examples: + - path-parameters: + merchant_id: merchant_id + query-parameters: + visibility_filter: ALL + limit: 1 + cursor: cursor + with_definitions: true + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attributes: + - key: has_seen_tutorial + value: true + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2023-05-05T18:13:03.745Z' + created_at: '2023-05-05T18:13:03.745Z' + - key: alternative_seller_name + value: Ultimate Sneaker Store + version: 1 + visibility: VISIBILITY_READ_ONLY + updated_at: '2023-05-05T19:27:57.975Z' + created_at: '2023-05-05T19:27:57.975Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/merchants/{merchant_id}/custom-attributes/{key} + method: GET + auth: + - oauth2: + - MERCHANT_PROFILE_READ + docs: >- + Retrieves a [custom attribute](entity:CustomAttribute) associated with a + merchant. + + You can use the `with_definition` query parameter to also retrieve the + custom attribute definition + + in the same call. + + To retrieve a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveMerchantCustomAttribute + request: + name: GetCustomAttributesRequest + path-parameters: + merchant_id: + type: string + docs: The ID of the target [merchant](entity:Merchant). + key: + type: string + docs: >- + The key of the custom attribute to retrieve. This key must match + the `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + query-parameters: + with_definition: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of + + the custom attribute. Set this parameter to `true` to get the name + and description of the custom + + attribute, information about the data type, or other definition + details. The default value is `false`. + version: + type: optional> + docs: >- + The current version of the custom attribute, which is used for + strongly consistent reads to + + guarantee that you receive the most up-to-date data. When included + in the request, Square + + returns the specified version or a higher version if one exists. + If the specified version is + + higher than the current version, Square returns a `BAD_REQUEST` + error. + response: + docs: Success + type: root.RetrieveMerchantCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + merchant_id: merchant_id + key: key + query-parameters: + with_definition: true + version: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute: + key: alternative_seller_name + value: Ultimate Sneaker Store + version: 2 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2023-05-06T19:21:04.551Z' + created_at: '2023-05-06T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + upsert: + path: /v2/merchants/{merchant_id}/custom-attributes/{key} + method: POST + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Creates or updates a [custom attribute](entity:CustomAttribute) for a + merchant. + + Use this endpoint to set the value of a custom attribute for a specified + merchant. + + A custom attribute is based on a custom attribute definition in a Square + seller account, which + + is created using the + [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) + endpoint. + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: UpsertMerchantCustomAttribute + request: + name: UpsertMerchantCustomAttributeRequest + path-parameters: + merchant_id: + type: string + docs: The ID of the target [merchant](entity:Merchant). + key: + type: string + docs: >- + The key of the custom attribute to create or update. This key must + match the `key` of a + + custom attribute definition in the Square seller account. If the + requesting application is not + + the definition owner, you must use the qualified key. + body: + properties: + custom_attribute: + type: root.CustomAttribute + docs: >- + The custom attribute to create or update, with the following + fields: + + - `value`. This value must conform to the `schema` specified by + the definition. + + For more information, see [Supported data + types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). + + - The version field must match the current version of the custom + attribute definition to enable + + [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + If this is not important for your application, version can be + set to -1. For any other values, the request fails with a + BAD_REQUEST error. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. For more information, + + see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpsertMerchantCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + merchant_id: merchant_id + key: key + headers: + Square-Version: '2025-10-16' + request: + custom_attribute: + value: Ultimate Sneaker Store + response: + body: + custom_attribute: + key: alternative_seller_name + value: Ultimate Sneaker Store + version: 2 + visibility: VISIBILITY_READ_ONLY + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2023-05-06T19:21:04.551Z' + created_at: '2023-05-06T19:02:58.647Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/merchants/{merchant_id}/custom-attributes/{key} + method: DELETE + auth: + - oauth2: + - MERCHANT_PROFILE_WRITE + docs: >- + Deletes a [custom attribute](entity:CustomAttribute) associated with a + merchant. + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: DeleteMerchantCustomAttribute + request: + name: DeleteCustomAttributesRequest + path-parameters: + merchant_id: + type: string + docs: The ID of the target [merchant](entity:Merchant). + key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match the + `key` of a custom + + attribute definition in the Square seller account. If the + requesting application is not the + + definition owner, you must use the qualified key. + response: + docs: Success + type: root.DeleteMerchantCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + merchant_id: merchant_id + key: key + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/mobile.yml b/.mock/definition/mobile.yml new file mode 100644 index 000000000..8e4d5ab72 --- /dev/null +++ b/.mock/definition/mobile.yml @@ -0,0 +1,80 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + authorizationCode: + path: /mobile/authorization-code + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE_IN_PERSON + docs: >- + __Note:__ This endpoint is used by the deprecated Reader SDK. + + Developers should update their integration to use the [Mobile Payments + SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which + includes its own authorization methods. + + + Generates code to authorize a mobile application to connect to a Square + card reader. + + + Authorization codes are one-time-use codes and expire 60 minutes after + being issued. + + + The `Authorization` header you provide to this endpoint must have the + following format: + + + ``` + + Authorization: Bearer ACCESS_TOKEN + + ``` + + + Replace `ACCESS_TOKEN` with a + + [valid production authorization + credential](https://developer.squareup.com/docs/build-basics/access-tokens). + source: + openapi: openapi/openapi.json + display-name: CreateMobileAuthorizationCode + request: + name: CreateMobileAuthorizationCodeRequest + body: + properties: + location_id: + type: optional + docs: >- + The Square location ID that the authorization code should be + tied to. + validation: + minLength: 1 + maxLength: 191 + content-type: application/json + response: + docs: Success + type: root.CreateMobileAuthorizationCodeResponse + status-code: 200 + availability: deprecated + examples: + - headers: + Square-Version: '2025-10-16' + request: + location_id: YOUR_LOCATION_ID + response: + body: + authorization_code: YOUR_MOBILE_AUTHORIZATION_CODE + expires_at: '2019-01-10T19:42:08Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/oAuth.yml b/.mock/definition/oAuth.yml new file mode 100644 index 000000000..c9d4325a8 --- /dev/null +++ b/.mock/definition/oAuth.yml @@ -0,0 +1,376 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + revokeToken: + path: /oauth2/revoke + method: POST + auth: + - {} + docs: >- + Revokes an access token generated with the OAuth flow. + + + If an account has more than one OAuth access token for your application, + this + + endpoint revokes all of them, regardless of which token you specify. + + + __Important:__ The `Authorization` header for this endpoint must have + the + + following format: + + + ``` + + Authorization: Client APPLICATION_SECRET + + ``` + + + Replace `APPLICATION_SECRET` with the application secret on the + **OAuth** + + page for your application in the Developer Dashboard. + source: + openapi: openapi/openapi.json + display-name: RevokeToken + request: + name: RevokeTokenRequest + body: + properties: + client_id: + type: optional> + docs: >- + The Square-issued ID for your application, which is available on + the **OAuth** page in the + + [Developer Dashboard](https://developer.squareup.com/apps). + validation: + maxLength: 191 + access_token: + type: optional> + docs: >- + The access token of the merchant whose token you want to revoke. + + Do not provide a value for `merchant_id` if you provide this + parameter. + validation: + minLength: 2 + maxLength: 1024 + merchant_id: + type: optional> + docs: >- + The ID of the merchant whose token you want to revoke. + + Do not provide a value for `access_token` if you provide this + parameter. + revoke_only_access_token: + type: optional> + docs: |- + If `true`, terminate the given single access token, but do not + terminate the entire authorization. + Default: `false` + content-type: application/json + response: + docs: Success + type: root.RevokeTokenResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + client_id: CLIENT_ID + access_token: ACCESS_TOKEN + response: + body: + success: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + obtainToken: + path: /oauth2/token + method: POST + docs: >- + Returns an OAuth access token and refresh token using the + `authorization_code` + + or `refresh_token` grant type. + + + When `grant_type` is `authorization_code`: + + - With the [code + flow](https://developer.squareup.com/docs/oauth-api/overview#code-flow), + + provide `code`, `client_id`, and `client_secret`. + + - With the [PKCE + flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow), + + provide `code`, `client_id`, and `code_verifier`. + + + When `grant_type` is `refresh_token`: + + - With the code flow, provide `refresh_token`, `client_id`, and + `client_secret`. + + The response returns the same refresh token provided in the request. + + - With the PKCE flow, provide `refresh_token` and `client_id`. The + response returns + + a new refresh token. + + + You can use the `scopes` parameter to limit the set of permissions + authorized by the + + access token. You can use the `short_lived` parameter to create an + access token that + + expires in 24 hours. + + + __Important:__ OAuth tokens should be encrypted and stored on a secure + server. + + Application clients should never interact directly with OAuth tokens. + source: + openapi: openapi/openapi.json + display-name: ObtainToken + request: + name: ObtainTokenRequest + body: + properties: + client_id: + type: string + docs: >- + The Square-issued ID of your application, which is available as + the **Application ID** + + on the **OAuth** page in the [Developer + Console](https://developer.squareup.com/apps). + + + Required for the code flow and PKCE flow for any grant type. + validation: + maxLength: 191 + client_secret: + type: optional> + docs: >- + The secret key for your application, which is available as the + **Application secret** + + on the **OAuth** page in the [Developer + Console](https://developer.squareup.com/apps). + + + Required for the code flow for any grant type. Don't confuse + your client secret with your + + personal access token. + validation: + minLength: 2 + maxLength: 1024 + code: + type: optional> + docs: >- + The authorization code to exchange for an OAuth access token. + This is the `code` + + value that Square sent to your redirect URL in the authorization + response. + + + Required for the code flow and PKCE flow if `grant_type` is + `authorization_code`. + validation: + maxLength: 191 + redirect_uri: + type: optional> + docs: >- + The redirect URL for your application, which you registered as + the **Redirect URL** + + on the **OAuth** page in the [Developer + Console](https://developer.squareup.com/apps). + + + Required for the code flow and PKCE flow if `grant_type` is + `authorization_code` and + + you provided the `redirect_uri` parameter in your authorization + URL. + validation: + maxLength: 2048 + grant_type: + type: string + docs: >- + The method used to obtain an OAuth access token. The request + must include the + + credential that corresponds to the specified grant type. Valid + values are: + + - `authorization_code` - Requires the `code` field. + + - `refresh_token` - Requires the `refresh_token` field. + + - `migration_token` - LEGACY for access tokens obtained using a + Square API version prior + + to 2019-03-13. Requires the `migration_token` field. + validation: + minLength: 10 + maxLength: 20 + refresh_token: + type: optional> + docs: >- + A valid refresh token used to generate a new OAuth access token. + This is a + + refresh token that was returned in a previous `ObtainToken` + response. + + + Required for the code flow and PKCE flow if `grant_type` is + `refresh_token`. + validation: + minLength: 2 + maxLength: 1024 + migration_token: + type: optional> + docs: >- + __LEGACY__ A valid access token (obtained using a Square API + version prior to 2019-03-13) + + used to generate a new OAuth access token. + + + Required if `grant_type` is `migration_token`. For more + information, see + + [Migrate to Using Refresh + Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens). + validation: + minLength: 2 + maxLength: 1024 + scopes: + type: optional>> + docs: >- + The list of permissions that are explicitly requested for the + access token. + + For example, + ["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]. + + + The returned access token is limited to the permissions that are + the intersection + + of these requested permissions and those authorized by the + provided `refresh_token`. + + + Optional for the code flow and PKCE flow if `grant_type` is + `refresh_token`. + short_lived: + type: optional> + docs: >- + Indicates whether the returned access token should expire in 24 + hours. + + + Optional for the code flow and PKCE flow for any grant type. The + default value is `false`. + code_verifier: + type: optional> + docs: >- + The secret your application generated for the authorization + request used to + + obtain the authorization code. This is the source of the + `code_challenge` hash you + + provided in your authorization URL. + + + Required for the PKCE flow if `grant_type` is + `authorization_code`. + content-type: application/json + response: + docs: Success + type: root.ObtainTokenResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + client_id: sq0idp-uaPHILoPzWZk3tlJqlML0g + client_secret: sq0csp-30a-4C_tVOnTh14Piza2BfTPBXyLafLPWSzY1qAjeBfM + code: sq0cgb-l0SBqxs4uwxErTVyYOdemg + grant_type: authorization_code + response: + body: + access_token: EAAl3ikZIe18J-2-cHlV2bL4-EaZHGoJUhtEBT7QA6-7AgwIHw8Xe1IoUvGsNxA + token_type: bearer + expires_at: '2025-04-03T18:31:06Z' + merchant_id: MLQW2MYBY81PZ + subscription_id: subscription_id + plan_id: plan_id + id_token: id_token + refresh_token: EQAAl0OcByu3IYJYScGGg-8E5YNf0r0b6jCTCMy5nOcRZ4ok0wbWAL8vY3tZWNcc + short_lived: false + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refresh_token_expires_at: refresh_token_expires_at + RetrieveTokenStatus: + path: /oauth2/token/status + method: POST + auth: + - oauth2: [] + docs: "Returns information about an [OAuth access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-an-oauth-access-token)\_or an application’s [personal access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-a-personal-access-token).\n\nAdd the access token to the Authorization header of the request.\n\n__Important:__ The `Authorization` header you provide to this endpoint must have the following format:\n\n```\nAuthorization: Bearer ACCESS_TOKEN\n```\n\nwhere `ACCESS_TOKEN` is a\n[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens).\n\nIf the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error." + source: + openapi: openapi/openapi.json + display-name: RetrieveTokenStatus + response: + docs: Success + type: root.RetrieveTokenStatusResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + response: + body: + scopes: + - PAYMENTS_READ + - PAYMENTS_WRITE + expires_at: '2022-10-14T14:44:00Z' + client_id: CLIENT_ID + merchant_id: MERCHANT_ID + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + authorize: + path: /oauth2/authorize + method: GET + source: + openapi: openapi/openapi.json + examples: + - headers: + Square-Version: '2025-10-16' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/orders.yml b/.mock/definition/orders.yml new file mode 100644 index 000000000..380f1a34e --- /dev/null +++ b/.mock/definition/orders.yml @@ -0,0 +1,1734 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/orders + method: POST + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Creates a new [order](entity:Order) that can include information about + products for + + purchase and settings to apply to the purchase. + + + To pay for a created order, see + + [Pay for + Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). + + + You can modify open orders using the + [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. + source: + openapi: openapi/openapi.json + display-name: CreateOrder + request: + body: root.CreateOrderRequest + content-type: application/json + response: + docs: Success + type: root.CreateOrderResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + order: + location_id: 057P5VYJ4A5X1 + reference_id: my-order-001 + line_items: + - name: New York Strip Steak + quantity: '1' + base_price_money: + amount: 1599 + currency: USD + - quantity: '2' + catalog_object_id: BEMYCSMIJL46OCDV4KYIKXIB + modifiers: + - catalog_object_id: CHQX7Y4KY6N5KINJKZCFURPZ + applied_discounts: + - discount_uid: one-dollar-off + taxes: + - uid: state-sales-tax + name: State Sales Tax + percentage: '9' + scope: ORDER + discounts: + - uid: labor-day-sale + name: Labor Day Sale + percentage: '5' + scope: ORDER + - uid: membership-discount + catalog_object_id: DB7L55ZH2BGWI4H23ULIWOQ7 + scope: ORDER + - uid: one-dollar-off + name: Sale - $1.00 off + amount_money: + amount: 100 + currency: USD + scope: LINE_ITEM + idempotency_key: 8193148c-9586-11e6-99f9-28cfe92138cf + response: + body: + order: + id: CAISENgvlJ6jLWAzERDzjyHVybY + location_id: 057P5VYJ4A5X1 + reference_id: my-order-001 + source: + name: My App + customer_id: customer_id + line_items: + - uid: 8uSwfzvUImn3IRrvciqlXC + name: New York Strip Steak + quantity: '1' + applied_taxes: + - uid: aKG87ArnDpvMLSZJHxWUl + tax_uid: state-sales-tax + applied_money: + amount: 136 + currency: USD + applied_discounts: + - uid: jWdgP1TpHPFBuVrz81mXVC + discount_uid: membership-discount + applied_money: + amount: 8 + currency: USD + - uid: jnZOjjVY57eRcQAVgEwFuC + discount_uid: labor-day-sale + applied_money: + amount: 79 + currency: USD + base_price_money: + amount: 1599 + currency: USD + variation_total_price_money: + amount: 1599 + currency: USD + gross_sales_money: + amount: 1599 + currency: USD + total_tax_money: + amount: 136 + currency: USD + total_discount_money: + amount: 87 + currency: USD + total_money: + amount: 1648 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: v8ZuEXpOJpb0bazLuvrLDB + name: New York Steak + quantity: '2' + catalog_object_id: BEMYCSMIJL46OCDV4KYIKXIB + variation_name: Larger + modifiers: + - uid: Lo3qMMckDluu9Qsb58d4CC + catalog_object_id: CHQX7Y4KY6N5KINJKZCFURPZ + name: Well + base_price_money: + amount: 50 + currency: USD + total_price_money: + amount: 100 + currency: USD + applied_taxes: + - uid: v1dAgrfUVUPTnVTf9sRPz + tax_uid: state-sales-tax + applied_money: + amount: 374 + currency: USD + applied_discounts: + - uid: nUXvdsIItfKko0dbYtY58C + discount_uid: membership-discount + applied_money: + amount: 22 + currency: USD + - uid: qSdkOOOernlVQqsJ94SPjB + discount_uid: labor-day-sale + applied_money: + amount: 224 + currency: USD + - uid: y7bVl4njrWAnfDwmz19izB + discount_uid: one-dollar-off + applied_money: + amount: 100 + currency: USD + base_price_money: + amount: 2200 + currency: USD + variation_total_price_money: + amount: 4400 + currency: USD + gross_sales_money: + amount: 4500 + currency: USD + total_tax_money: + amount: 374 + currency: USD + total_discount_money: + amount: 346 + currency: USD + total_money: + amount: 4528 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - uid: state-sales-tax + name: State Sales Tax + type: ADDITIVE + percentage: '9' + applied_money: + amount: 510 + currency: USD + scope: ORDER + discounts: + - uid: membership-discount + catalog_object_id: DB7L55ZH2BGWI4H23ULIWOQ7 + name: Membership Discount + type: FIXED_PERCENTAGE + percentage: '0.5' + applied_money: + amount: 30 + currency: USD + scope: ORDER + - uid: labor-day-sale + name: Labor Day Sale + type: FIXED_PERCENTAGE + percentage: '5' + applied_money: + amount: 303 + currency: USD + scope: ORDER + - uid: one-dollar-off + name: Sale - $1.00 off + type: FIXED_AMOUNT + amount_money: + amount: 100 + currency: USD + applied_money: + amount: 100 + currency: USD + scope: LINE_ITEM + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 6176 + currency: USD + tax_money: + amount: 510 + currency: USD + discount_money: + amount: 433 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2020-01-17T20:47:53.293Z' + updated_at: '2020-01-17T20:47:53.293Z' + closed_at: closed_at + state: OPEN + version: 1 + total_money: + amount: 6176 + currency: USD + total_tax_money: + amount: 510 + currency: USD + total_discount_money: + amount: 433 + currency: USD + total_tip_money: + amount: 0 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchGet: + path: /v2/orders/batch-retrieve + method: POST + auth: + - oauth2: + - ORDERS_READ + docs: >- + Retrieves a set of [orders](entity:Order) by their IDs. + + + If a given order ID does not exist, the ID is ignored instead of + generating an error. + source: + openapi: openapi/openapi.json + display-name: BatchRetrieveOrders + request: + name: BatchGetOrdersRequest + body: + properties: + location_id: + type: optional> + docs: >- + The ID of the location for these orders. This field is optional: + omit it to retrieve + + orders within the scope of the current authorization's merchant + ID. + order_ids: + docs: >- + The IDs of the orders to retrieve. A maximum of 100 orders can + be retrieved per request. + type: list + content-type: application/json + response: + docs: Success + type: root.BatchGetOrdersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + location_id: 057P5VYJ4A5X1 + order_ids: + - CAISEM82RcpmcFBM0TfOyiHV3es + - CAISENgvlJ6jLWAzERDzjyHVybY + response: + body: + orders: + - id: CAISEM82RcpmcFBM0TfOyiHV3es + location_id: 057P5VYJ4A5X1 + reference_id: my-order-001 + customer_id: customer_id + line_items: + - uid: 945986d1-9586-11e6-ad5a-28cfe92138cf + name: Awesome product + quantity: '1' + base_price_money: + amount: 1599 + currency: USD + total_money: + amount: 1599 + currency: USD + - uid: a8f4168c-9586-11e6-bdf0-28cfe92138cf + name: Another awesome product + quantity: '3' + base_price_money: + amount: 2000 + currency: USD + total_money: + amount: 6000 + currency: USD + taxes: + - {} + discounts: + - {} + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + created_at: created_at + updated_at: updated_at + closed_at: closed_at + state: OPEN + version: 1 + total_money: + amount: 7599 + currency: USD + ticket_name: ticket_name + rewards: + - id: id + reward_tier_id: reward_tier_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + calculate: + path: /v2/orders/calculate + method: POST + auth: + - oauth2: [] + docs: Enables applications to preview order pricing without creating an order. + source: + openapi: openapi/openapi.json + display-name: CalculateOrder + request: + name: CalculateOrderRequest + body: + properties: + order: + type: root.Order + docs: >- + The order to be calculated. Expects the entire order, not a + sparse update. + proposed_rewards: + type: optional>> + docs: >- + Identifies one or more loyalty reward tiers to apply during the + order calculation. + + The discounts defined by the reward tiers are added to the order + only to preview the + + effect of applying the specified rewards. The rewards do not + correspond to actual + + redemptions; that is, no `reward`s are created. Therefore, the + reward `id`s are + + random strings used only to reference the reward tier. + content-type: application/json + response: + docs: Success + type: root.CalculateOrderResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + order: + location_id: D7AVYMEAPJ3A3 + line_items: + - name: Item 1 + quantity: '1' + base_price_money: + amount: 500 + currency: USD + - name: Item 2 + quantity: '2' + base_price_money: + amount: 300 + currency: USD + discounts: + - name: 50% Off + percentage: '50' + scope: ORDER + response: + body: + order: + id: id + location_id: D7AVYMEAPJ3A3 + reference_id: reference_id + source: + name: name + customer_id: customer_id + line_items: + - uid: ULkg0tQTRK2bkU9fNv3IJD + name: Item 1 + quantity: '1' + applied_discounts: + - uid: 9zr9S4dxvPAixvn0lpa1VC + discount_uid: zGsRZP69aqSSR9lq9euSPB + applied_money: + amount: 250 + currency: USD + base_price_money: + amount: 500 + currency: USD + variation_total_price_money: + amount: 500 + currency: USD + gross_sales_money: + amount: 500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 250 + currency: USD + total_money: + amount: 250 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: mumY8Nun4BC5aKe2yyx5a + name: Item 2 + quantity: '2' + applied_discounts: + - uid: qa8LwwZK82FgSEkQc2HYVC + discount_uid: zGsRZP69aqSSR9lq9euSPB + applied_money: + amount: 300 + currency: USD + base_price_money: + amount: 300 + currency: USD + variation_total_price_money: + amount: 600 + currency: USD + gross_sales_money: + amount: 600 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 300 + currency: USD + total_money: + amount: 300 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - {} + discounts: + - uid: zGsRZP69aqSSR9lq9euSPB + name: 50% Off + type: FIXED_PERCENTAGE + percentage: '50' + applied_money: + amount: 550 + currency: USD + scope: ORDER + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 550 + currency: USD + tax_money: + amount: 0 + currency: USD + discount_money: + amount: 550 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2020-05-18T16:30:49.614Z' + updated_at: '2020-05-18T16:30:49.614Z' + closed_at: closed_at + state: OPEN + version: 1 + total_money: + amount: 550 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 550 + currency: USD + total_tip_money: + amount: 0 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + clone: + path: /v2/orders/clone + method: POST + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Creates a new order, in the `DRAFT` state, by duplicating an existing + order. The newly created order has + + only the core fields (such as line items, taxes, and discounts) copied + from the original order. + source: + openapi: openapi/openapi.json + display-name: CloneOrder + request: + name: CloneOrderRequest + body: + properties: + order_id: + type: string + docs: The ID of the order to clone. + version: + type: optional + docs: >- + An optional order version for concurrency protection. + + + If a version is provided, it must match the latest stored + version of the order to clone. + + If a version is not provided, the API clones the latest version. + idempotency_key: + type: optional> + docs: >- + A value you specify that uniquely identifies this clone request. + + + If you are unsure whether a particular order was cloned + successfully, + + you can reattempt the call with the same idempotency key without + + worrying about creating duplicate cloned orders. + + The originally cloned order is returned. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + content-type: application/json + response: + docs: Success + type: root.CloneOrderResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + order_id: ZAISEM52YcpmcWAzERDOyiWS123 + version: 3 + idempotency_key: UNIQUE_STRING + response: + body: + order: + id: CAISENgvlJ6jLWAzERDzjyHVybY + location_id: 057P5VYJ4A5X1 + reference_id: my-order-001 + source: + name: My App + customer_id: customer_id + line_items: + - uid: 8uSwfzvUImn3IRrvciqlXC + name: New York Strip Steak + quantity: '1' + applied_taxes: + - uid: aKG87ArnDpvMLSZJHxWUl + tax_uid: state-sales-tax + applied_money: + amount: 136 + currency: USD + applied_discounts: + - uid: jWdgP1TpHPFBuVrz81mXVC + discount_uid: membership-discount + applied_money: + amount: 8 + currency: USD + - uid: jnZOjjVY57eRcQAVgEwFuC + discount_uid: labor-day-sale + applied_money: + amount: 79 + currency: USD + base_price_money: + amount: 1599 + currency: USD + variation_total_price_money: + amount: 1599 + currency: USD + gross_sales_money: + amount: 1599 + currency: USD + total_tax_money: + amount: 136 + currency: USD + total_discount_money: + amount: 87 + currency: USD + total_money: + amount: 1648 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: v8ZuEXpOJpb0bazLuvrLDB + name: New York Steak + quantity: '2' + catalog_object_id: BEMYCSMIJL46OCDV4KYIKXIB + variation_name: Larger + modifiers: + - uid: Lo3qMMckDluu9Qsb58d4CC + catalog_object_id: CHQX7Y4KY6N5KINJKZCFURPZ + name: Well + base_price_money: + amount: 50 + currency: USD + total_price_money: + amount: 100 + currency: USD + applied_taxes: + - uid: v1dAgrfUVUPTnVTf9sRPz + tax_uid: state-sales-tax + applied_money: + amount: 374 + currency: USD + applied_discounts: + - uid: nUXvdsIItfKko0dbYtY58C + discount_uid: membership-discount + applied_money: + amount: 22 + currency: USD + - uid: qSdkOOOernlVQqsJ94SPjB + discount_uid: labor-day-sale + applied_money: + amount: 224 + currency: USD + - uid: y7bVl4njrWAnfDwmz19izB + discount_uid: one-dollar-off + applied_money: + amount: 100 + currency: USD + base_price_money: + amount: 2200 + currency: USD + variation_total_price_money: + amount: 4400 + currency: USD + gross_sales_money: + amount: 4500 + currency: USD + total_tax_money: + amount: 374 + currency: USD + total_discount_money: + amount: 346 + currency: USD + total_money: + amount: 4528 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - uid: state-sales-tax + name: State Sales Tax + type: ADDITIVE + percentage: '9' + applied_money: + amount: 510 + currency: USD + scope: ORDER + discounts: + - uid: membership-discount + catalog_object_id: DB7L55ZH2BGWI4H23ULIWOQ7 + name: Membership Discount + type: FIXED_PERCENTAGE + percentage: '0.5' + applied_money: + amount: 30 + currency: USD + scope: ORDER + - uid: labor-day-sale + name: Labor Day Sale + type: FIXED_PERCENTAGE + percentage: '5' + applied_money: + amount: 303 + currency: USD + scope: ORDER + - uid: one-dollar-off + name: Sale - $1.00 off + type: FIXED_AMOUNT + amount_money: + amount: 100 + currency: USD + applied_money: + amount: 100 + currency: USD + scope: LINE_ITEM + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 6176 + currency: USD + tax_money: + amount: 510 + currency: USD + discount_money: + amount: 433 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2020-01-17T20:47:53.293Z' + updated_at: '2020-01-17T20:47:53.293Z' + closed_at: closed_at + state: DRAFT + version: 1 + total_money: + amount: 6176 + currency: USD + total_tax_money: + amount: 510 + currency: USD + total_discount_money: + amount: 433 + currency: USD + total_tip_money: + amount: 0 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/orders/search + method: POST + auth: + - oauth2: + - ORDERS_READ + docs: >- + Search all orders for one or more locations. Orders include all sales, + + returns, and exchanges regardless of how or when they entered the Square + + ecosystem (such as Point of Sale, Invoices, and Connect APIs). + + + `SearchOrders` requests need to specify which locations to search and + define a + + [SearchOrdersQuery](entity:SearchOrdersQuery) object that controls + + how to sort or filter the results. Your `SearchOrdersQuery` can: + + Set filter criteria. + Set the sort order. + Determine whether to return results as complete `Order` objects or as + [OrderEntry](entity:OrderEntry) objects. + + + Note that details for orders processed with Square Point of Sale while + in + + offline mode might not be transmitted to Square for up to 72 hours. + Offline + + orders have a `created_at` value that reflects the time the order was + created, + + not the time it was subsequently transmitted to Square. + source: + openapi: openapi/openapi.json + display-name: SearchOrders + request: + name: SearchOrdersRequest + body: + properties: + location_ids: + type: optional> + docs: >- + The location IDs for the orders to query. All locations must + belong to + + the same merchant. + + + Max: 10 location IDs. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this cursor to retrieve the next set of results for your + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + query: + type: optional + docs: >- + Query conditions used to filter or sort the results. Note that + when + + retrieving additional pages using a cursor, you must use the + original query. + limit: + type: optional + docs: |- + The maximum number of results to be returned in a single page. + + Default: `500` + Max: `1000` + return_entries: + type: optional + docs: >- + A Boolean that controls the format of the search results. If + `true`, + + `SearchOrders` returns [OrderEntry](entity:OrderEntry) objects. + If `false`, `SearchOrders` + + returns complete order objects. + + + Default: `false`. + content-type: application/json + response: + docs: Success + type: root.SearchOrdersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + location_ids: + - 057P5VYJ4A5X1 + - 18YC4JDH91E1H + query: + filter: + state_filter: + states: + - COMPLETED + date_time_filter: + closed_at: + start_at: '2018-03-03T20:00:00+00:00' + end_at: '2019-03-04T21:54:45+00:00' + sort: + sort_field: CLOSED_AT + sort_order: DESC + limit: 3 + return_entries: true + response: + body: + order_entries: + - order_id: CAISEM82RcpmcFBM0TfOyiHV3es + version: 1 + location_id: 057P5VYJ4A5X1 + - order_id: CAISENgvlJ6jLWAzERDzjyHVybY + version: 1 + location_id: 18YC4JDH91E1H + - order_id: CAISEM52YcpmcWAzERDOyiWS3ty + version: 1 + location_id: 057P5VYJ4A5X1 + orders: + - id: id + location_id: location_id + reference_id: reference_id + customer_id: customer_id + line_items: + - quantity: quantity + taxes: + - {} + discounts: + - {} + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + created_at: created_at + updated_at: updated_at + closed_at: closed_at + state: OPEN + version: 1 + ticket_name: ticket_name + rewards: + - id: id + reward_tier_id: reward_tier_id + cursor: '123' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/orders/{order_id} + method: GET + auth: + - oauth2: + - ORDERS_READ + docs: Retrieves an [Order](entity:Order) by ID. + source: + openapi: openapi/openapi.json + display-name: RetrieveOrder + request: + name: GetOrdersRequest + path-parameters: + order_id: + type: string + docs: The ID of the order to retrieve. + response: + docs: Success + type: root.GetOrderResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + headers: + Square-Version: '2025-10-16' + response: + body: + order: + id: CAISENgvlJ6jLWAzERDzjyHVybY + location_id: D7AVYMEAPJ3A3 + reference_id: reference_id + source: + name: name + customer_id: customer_id + line_items: + - uid: ULkg0tQTRK2bkU9fNv3IJD + name: Item 1 + quantity: '1' + applied_discounts: + - uid: 9zr9S4dxvPAixvn0lpa1VC + discount_uid: zGsRZP69aqSSR9lq9euSPB + applied_money: + amount: 250 + currency: USD + base_price_money: + amount: 500 + currency: USD + variation_total_price_money: + amount: 500 + currency: USD + gross_sales_money: + amount: 500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 250 + currency: USD + total_money: + amount: 250 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: mumY8Nun4BC5aKe2yyx5a + name: Item 2 + quantity: '2' + applied_discounts: + - uid: qa8LwwZK82FgSEkQc2HYVC + discount_uid: zGsRZP69aqSSR9lq9euSPB + applied_money: + amount: 300 + currency: USD + base_price_money: + amount: 300 + currency: USD + variation_total_price_money: + amount: 600 + currency: USD + gross_sales_money: + amount: 600 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 300 + currency: USD + total_money: + amount: 300 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - {} + discounts: + - uid: zGsRZP69aqSSR9lq9euSPB + name: 50% Off + type: FIXED_PERCENTAGE + percentage: '50' + applied_money: + amount: 550 + currency: USD + scope: ORDER + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 550 + currency: USD + tax_money: + amount: 0 + currency: USD + discount_money: + amount: 550 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2020-05-18T16:30:49.614Z' + updated_at: '2020-05-18T16:30:49.614Z' + closed_at: closed_at + state: OPEN + version: 1 + total_money: + amount: 550 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 550 + currency: USD + total_tip_money: + amount: 0 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/orders/{order_id} + method: PUT + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Updates an open [order](entity:Order) by adding, replacing, or deleting + + fields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated. + + + An `UpdateOrder` request requires the following: + + + - The `order_id` in the endpoint path, identifying the order to update. + + - The latest `version` of the order to update. + + - The [sparse + order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) + + containing only the fields to update and the version to which the update + is + + being applied. + + - If deleting fields, the [dot notation + paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete) + + identifying the fields to clear. + + + To pay for an order, see + + [Pay for + Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). + source: + openapi: openapi/openapi.json + display-name: UpdateOrder + request: + name: UpdateOrderRequest + path-parameters: + order_id: + type: string + docs: The ID of the order to update. + body: + properties: + order: + type: optional + docs: >- + The [sparse + order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) + + containing only the fields to update and the version to which + the update is + + being applied. + fields_to_clear: + type: optional>> + docs: >- + The [dot notation + paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete) + + fields to clear. For example, `line_items[uid].note`. + + For more information, see [Deleting + fields](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#deleting-fields). + idempotency_key: + type: optional> + docs: >- + A value you specify that uniquely identifies this update + request. + + + If you are unsure whether a particular update was applied to an + order successfully, + + you can reattempt it with the same idempotency key without + + worrying about creating duplicate updates to the order. + + The latest order version is returned. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + maxLength: 192 + content-type: application/json + response: + docs: Success + type: root.UpdateOrderResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + headers: + Square-Version: '2025-10-16' + request: + order: + location_id: location_id + line_items: + - uid: cookie_uid + name: COOKIE + quantity: '2' + base_price_money: + amount: 200 + currency: USD + version: 1 + fields_to_clear: + - discounts + idempotency_key: UNIQUE_STRING + response: + body: + order: + id: DREk7wJcyXNHqULq8JJ2iPAsluJZY + location_id: MXVQSVNDGN3C8 + reference_id: reference_id + source: + name: Cookies + customer_id: customer_id + line_items: + - uid: EuYkakhmu3ksHIds5Hiot + name: Small Coffee + quantity: '1' + base_price_money: + amount: 500 + currency: USD + variation_total_price_money: + amount: 500 + currency: USD + gross_sales_money: + amount: 500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_money: + amount: 500 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: cookie_uid + name: COOKIE + quantity: '2' + base_price_money: + amount: 200 + currency: USD + variation_total_price_money: + amount: 400 + currency: USD + gross_sales_money: + amount: 400 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_money: + amount: 400 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - {} + discounts: + - {} + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 900 + currency: USD + tax_money: + amount: 0 + currency: USD + discount_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - type: CARD + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2019-08-23T18:26:18.243Z' + updated_at: '2019-08-23T18:33:47.523Z' + closed_at: closed_at + state: OPEN + version: 2 + total_money: + amount: 900 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + pay: + path: /v2/orders/{order_id}/pay + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + - ORDERS_WRITE + docs: >- + Pay for an [order](entity:Order) using one or more approved + [payments](entity:Payment) + + or settle an order with a total of `0`. + + + The total of the `payment_ids` listed in the request must be equal to + the order + + total. Orders with a total amount of `0` can be marked as paid by + specifying an empty + + array of `payment_ids` in the request. + + + To be used with `PayOrder`, a payment must: + + + - Reference the order by specifying the `order_id` when [creating the + payment](api-endpoint:Payments-CreatePayment). + + Any approved payments that reference the same `order_id` not specified + in the + + `payment_ids` is canceled. + + - Be approved with [delayed + capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture). + + Using a delayed capture payment with `PayOrder` completes the approved + payment. + source: + openapi: openapi/openapi.json + display-name: PayOrder + request: + name: PayOrderRequest + path-parameters: + order_id: + type: string + docs: The ID of the order being paid. + body: + properties: + idempotency_key: + type: string + docs: >- + A value you specify that uniquely identifies this request among + requests you have sent. If + + you are unsure whether a particular payment request was + completed successfully, you can reattempt + + it with the same idempotency key without worrying about + duplicate payments. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + maxLength: 192 + order_version: + type: optional> + docs: >- + The version of the order being paid. If not supplied, the latest + version will be paid. + payment_ids: + type: optional>> + docs: |- + The IDs of the [payments](entity:Payment) to collect. + The payment total must match the order total. + content-type: application/json + response: + docs: Success + type: root.PayOrderResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: c043a359-7ad9-4136-82a9-c3f1d66dcbff + payment_ids: + - EnZdNAlWCmfh6Mt5FMNST1o7taB + - 0LRiVlbXVwe8ozu4KbZxd12mvaB + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + order: + id: lgwOlEityYPJtcuvKTVKT1pA986YY + location_id: P3CCK6HSNDAS7 + reference_id: reference_id + source: + name: Source Name + customer_id: customer_id + line_items: + - uid: QW6kofLHJK7JEKMjlSVP5C + name: Item 1 + quantity: '1' + base_price_money: + amount: 500 + currency: USD + gross_sales_money: + amount: 500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_money: + amount: 500 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + - uid: zhw8MNfRGdFQMI2WE1UBJD + name: Item 2 + quantity: '2' + base_price_money: + amount: 750 + currency: USD + gross_sales_money: + amount: 1500 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_money: + amount: 1500 + currency: USD + total_service_charge_money: + amount: 0 + currency: USD + taxes: + - {} + discounts: + - {} + service_charges: + - {} + fulfillments: + - {} + returns: + - {} + net_amounts: + total_money: + amount: 2000 + currency: USD + tax_money: + amount: 0 + currency: USD + discount_money: + amount: 0 + currency: USD + tip_money: + amount: 0 + currency: USD + service_charge_money: + amount: 0 + currency: USD + rounding_adjustment: + uid: uid + name: name + tenders: + - id: EnZdNAlWCmfh6Mt5FMNST1o7taB + location_id: P3CCK6HSNDAS7 + transaction_id: lgwOlEityYPJtcuvKTVKT1pA986YY + created_at: '2019-08-06T02:47:36.293Z' + amount_money: + amount: 1000 + currency: USD + type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 2 + exp_year: 2022 + fingerprint: >- + sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ + entry_method: KEYED + payment_id: EnZdNAlWCmfh6Mt5FMNST1o7taB + - id: 0LRiVlbXVwe8ozu4KbZxd12mvaB + location_id: P3CCK6HSNDAS7 + transaction_id: lgwOlEityYPJtcuvKTVKT1pA986YY + created_at: '2019-08-06T02:47:36.809Z' + amount_money: + amount: 1000 + currency: USD + type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 2 + exp_year: 2022 + fingerprint: >- + sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ + entry_method: KEYED + payment_id: 0LRiVlbXVwe8ozu4KbZxd12mvaB + refunds: + - id: id + location_id: location_id + reason: reason + amount_money: {} + status: PENDING + metadata: + key: value + created_at: '2019-08-06T02:47:35.693Z' + updated_at: '2019-08-06T02:47:37.140Z' + closed_at: '2019-08-06T02:47:37.140Z' + state: COMPLETED + version: 4 + total_money: + amount: 2000 + currency: USD + total_tax_money: + amount: 0 + currency: USD + total_discount_money: + amount: 0 + currency: USD + total_tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + total_service_charge_money: + amount: 0 + currency: USD + ticket_name: ticket_name + pricing_options: + auto_apply_discounts: true + auto_apply_taxes: true + rewards: + - id: id + reward_tier_id: reward_tier_id + net_amount_due_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/orders/customAttributeDefinitions.yml b/.mock/definition/orders/customAttributeDefinitions.yml new file mode 100644 index 000000000..d82344d11 --- /dev/null +++ b/.mock/definition/orders/customAttributeDefinitions.yml @@ -0,0 +1,404 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/orders/custom-attribute-definitions + method: GET + auth: + - oauth2: + - ORDERS_READ + docs: >- + Lists the order-related [custom attribute + definitions](entity:CustomAttributeDefinition) that belong to a Square + seller account. + + + When all response pages are retrieved, the results include all custom + attribute definitions + + that are visible to the requesting application, including those that are + created by other + + applications and set to `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. Note that + + seller-defined custom attributes (also known as custom fields) are + always set to `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attribute_definitions + source: + openapi: openapi/openapi.json + display-name: ListOrderCustomAttributeDefinitions + request: + name: ListCustomAttributeDefinitionsRequest + query-parameters: + visibility_filter: + type: optional> + docs: >- + Requests that all of the custom attributes be returned, or only + those that are read-only or read-write. + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + response: + docs: Success + type: root.ListOrderCustomAttributeDefinitionsResponse + status-code: 200 + examples: + - query-parameters: + visibility_filter: ALL + cursor: cursor + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute_definitions: + - key: cover-count + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Cover count + description: The number of people seated at a table + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-11-16T18:03:44.051Z' + created_at: '2022-11-16T18:03:44.051Z' + - key: seat-number + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Seat number + description: The identifier for a particular seat + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-11-16T18:04:32.059Z' + created_at: '2022-11-16T18:04:32.059Z' + - key: table-number + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Table number + description: The identifier for a particular table + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-11-16T18:04:21.912Z' + created_at: '2022-11-16T18:04:21.912Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + create: + path: /v2/orders/custom-attribute-definitions + method: POST + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Creates an order-related custom attribute definition. Use this endpoint + to + + define a custom attribute that can be associated with orders. + + + After creating a custom attribute definition, you can set the custom + attribute for orders + + in the Square seller account. + source: + openapi: openapi/openapi.json + display-name: CreateOrderCustomAttributeDefinition + request: + name: CreateOrderCustomAttributeDefinitionRequest + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition to create. Note the following: + + - With the exception of the `Selection` data type, the `schema` + is specified as a simple URL to the JSON schema + + definition hosted on the Square CDN. For more information, + including supported values and constraints, see + + [Specifying the + schema](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#specify-schema). + + - If provided, `name` must be unique (case-sensitive) across all + visible customer-related custom attribute definitions for the + seller. + + - All custom attributes are visible in exported customer data, + including those set to `VISIBILITY_HIDDEN`. + idempotency_key: + type: optional + docs: >- + A unique identifier for this request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateOrderCustomAttributeDefinitionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + custom_attribute_definition: + key: cover-count + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Cover count + description: The number of people seated at a table + visibility: VISIBILITY_READ_WRITE_VALUES + idempotency_key: IDEMPOTENCY_KEY + response: + body: + custom_attribute_definition: + key: cover-count + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Cover count + description: The number of people seated at a table + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-10-06T16:53:23.141Z' + created_at: '2022-10-06T16:53:23.141Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/orders/custom-attribute-definitions/{key} + method: GET + auth: + - oauth2: + - ORDERS_READ + docs: >- + Retrieves an order-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + + To retrieve a custom attribute definition created by another + application, the `visibility` + + setting must be `VISIBILITY_READ_ONLY` or + `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveOrderCustomAttributeDefinition + request: + name: GetCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to retrieve. + query-parameters: + version: + type: optional> + docs: >- + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include this optional field and specify the current + version of the custom attribute. + response: + docs: Success + type: root.RetrieveOrderCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + query-parameters: + version: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute_definition: + key: cover-count + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Cover count + description: The number of people seated at a table + visibility: VISIBILITY_READ_WRITE_VALUES + version: 1 + updated_at: '2022-10-06T16:53:23.141Z' + created_at: '2022-10-06T16:53:23.141Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/orders/custom-attribute-definitions/{key} + method: PUT + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Updates an order-related custom attribute definition for a Square seller + account. + + + Only the definition owner can update a custom attribute definition. Note + that sellers can view all custom attributes in exported customer data, + including those set to `VISIBILITY_HIDDEN`. + source: + openapi: openapi/openapi.json + display-name: UpdateOrderCustomAttributeDefinition + request: + name: UpdateOrderCustomAttributeDefinitionRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to update. + body: + properties: + custom_attribute_definition: + type: root.CustomAttributeDefinition + docs: >- + The custom attribute definition that contains the fields to + update. This endpoint supports sparse updates, + + so only new or changed fields need to be included in the + request. For more information, see + + [Updatable definition + fields](https://developer.squareup.com/docs/orders-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields). + + + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + control, include the optional `version` field and specify the + current version of the custom attribute definition. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateOrderCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-10-16' + request: + custom_attribute_definition: + key: cover-count + visibility: VISIBILITY_READ_ONLY + version: 1 + idempotency_key: IDEMPOTENCY_KEY + response: + body: + custom_attribute_definition: + key: cover-count + schema: + \$ref: >- + https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number + name: Cover count + description: The number of people seated at a table + visibility: VISIBILITY_READ_ONLY + version: 2 + updated_at: '2022-11-16T17:44:11.436Z' + created_at: '2022-11-16T16:53:23.141Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/orders/custom-attribute-definitions/{key} + method: DELETE + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Deletes an order-related [custom attribute + definition](entity:CustomAttributeDefinition) from a Square seller + account. + + + Only the definition owner can delete a custom attribute definition. + source: + openapi: openapi/openapi.json + display-name: DeleteOrderCustomAttributeDefinition + request: + name: DeleteCustomAttributeDefinitionsRequest + path-parameters: + key: + type: string + docs: The key of the custom attribute definition to delete. + response: + docs: Success + type: root.DeleteOrderCustomAttributeDefinitionResponse + status-code: 200 + examples: + - path-parameters: + key: key + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/orders/customAttributes.yml b/.mock/definition/orders/customAttributes.yml new file mode 100644 index 000000000..8611d434f --- /dev/null +++ b/.mock/definition/orders/customAttributes.yml @@ -0,0 +1,581 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + batchDelete: + path: /v2/orders/custom-attributes/bulk-delete + method: POST + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Deletes order [custom attributes](entity:CustomAttribute) as a bulk + operation. + + + Use this endpoint to delete one or more custom attributes from one or + more orders. + + A custom attribute is based on a custom attribute definition in a Square + seller account. (To create a + + custom attribute definition, use the + [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) + endpoint.) + + + This `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 + individual delete + + requests and returns a map of individual delete responses. Each delete + request has a unique ID + + and provides an order ID and custom attribute. Each delete response is + returned with the ID + + of the corresponding request. + + + To delete a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkDeleteOrderCustomAttributes + request: + name: BulkDeleteOrderCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + A map of requests that correspond to individual delete + operations for custom attributes. + content-type: application/json + response: + docs: Success + type: root.BulkDeleteOrderCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + values: + cover-count: + key: cover-count + order_id: 7BbXGEIWNldxAzrtGf9GPVZTwZ4F + table-number: + key: table-number + order_id: 7BbXGEIWNldxAzrtGf9GPVZTwZ4F + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + values: + cover-count: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + table-number: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + batchUpsert: + path: /v2/orders/custom-attributes/bulk-upsert + method: POST + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Creates or updates order [custom attributes](entity:CustomAttribute) as + a bulk operation. + + + Use this endpoint to delete one or more custom attributes from one or + more orders. + + A custom attribute is based on a custom attribute definition in a Square + seller account. (To create a + + custom attribute definition, use the + [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) + endpoint.) + + + This `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 + individual upsert + + requests and returns a map of individual upsert responses. Each upsert + request has a unique ID + + and provides an order ID and custom attribute. Each upsert response is + returned with the ID + + of the corresponding request. + + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: BulkUpsertOrderCustomAttributes + request: + name: BulkUpsertOrderCustomAttributesRequest + body: + properties: + values: + type: >- + map + docs: >- + A map of requests that correspond to individual upsert + operations for custom attributes. + content-type: application/json + response: + docs: Success + type: root.BulkUpsertOrderCustomAttributesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + values: + cover-count: + custom_attribute: + key: cover-count + value: '6' + version: 2 + order_id: 7BbXGEIWNldxAzrtGf9GPVZTwZ4F + table-number: + custom_attribute: + key: table-number + value: '11' + version: 4 + order_id: 7BbXGEIWNldxAzrtGf9GPVZTwZ4F + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + values: + cover-count: + custom_attribute: + key: cover-count + value: '6' + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-22T21:28:35.721Z' + created_at: '2022-11-22T21:27:33.429Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + table-number: + custom_attribute: + key: table-number + value: '11' + visibility: VISIBILITY_HIDDEN + updated_at: '2022-11-22T21:28:35.726Z' + created_at: '2022-11-22T21:24:57.823Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + list: + path: /v2/orders/{order_id}/custom-attributes + method: GET + auth: + - oauth2: + - ORDERS_READ + docs: >- + Lists the [custom attributes](entity:CustomAttribute) associated with an + order. + + + You can use the `with_definitions` query parameter to also retrieve + custom attribute definitions + + in the same call. + + + When all response pages are retrieved, the results include all custom + attributes that are + + visible to the requesting application, including those that are owned by + other applications + + and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.custom_attributes + source: + openapi: openapi/openapi.json + display-name: ListOrderCustomAttributes + request: + name: ListCustomAttributesRequest + path-parameters: + order_id: + type: string + docs: The ID of the target [order](entity:Order). + query-parameters: + visibility_filter: + type: optional> + docs: >- + Requests that all of the custom attributes be returned, or only + those that are read-only or read-write. + cursor: + type: optional> + docs: >- + The cursor returned in the paged response from the previous call + to this endpoint. + + Provide this cursor to retrieve the next page of results for your + original request. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + limit: + type: optional> + docs: >- + The maximum number of results to return in a single paged + response. This limit is advisory. + + The response might contain more or fewer results. The minimum + value is 1 and the maximum value is 100. + + The default value is 20. + + For more information, see + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + with_definitions: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom attribute, + + information about the data type, or other definition details. The + default value is `false`. + response: + docs: Success + type: root.ListOrderCustomAttributesResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + query-parameters: + visibility_filter: ALL + cursor: cursor + limit: 1 + with_definitions: true + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attributes: + - key: wayne-test-15 + value: TEST + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + updated_at: '2022-11-10T17:31:36.111Z' + created_at: '2022-11-10T17:31:36.111Z' + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/orders/{order_id}/custom-attributes/{custom_attribute_key} + method: GET + auth: + - oauth2: + - ORDERS_READ + docs: >- + Retrieves a [custom attribute](entity:CustomAttribute) associated with + an order. + + + You can use the `with_definition` query parameter to also retrieve the + custom attribute definition + + in the same call. + + + To retrieve a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that + seller-defined custom attributes + + also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: RetrieveOrderCustomAttribute + request: + name: GetCustomAttributesRequest + path-parameters: + order_id: + type: string + docs: The ID of the target [order](entity:Order). + custom_attribute_key: + type: string + docs: >- + The key of the custom attribute to retrieve. This key must match + the key of an + + existing custom attribute definition. + query-parameters: + version: + type: optional> + docs: >- + To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include this optional field and specify the current + version of the custom attribute. + with_definition: + type: optional> + default: false + docs: >- + Indicates whether to return the [custom attribute + definition](entity:CustomAttributeDefinition) in the `definition` + field of each + + custom attribute. Set this parameter to `true` to get the name and + description of each custom attribute, + + information about the data type, or other definition details. The + default value is `false`. + response: + docs: Success + type: root.RetrieveOrderCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + custom_attribute_key: custom_attribute_key + query-parameters: + version: 1 + with_definition: true + headers: + Square-Version: '2025-10-16' + response: + body: + custom_attribute: + key: cover-count + value: '6' + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-11-22T21:28:35.721Z' + created_at: '2022-11-22T21:27:33.429Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + upsert: + path: /v2/orders/{order_id}/custom-attributes/{custom_attribute_key} + method: POST + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Creates or updates a [custom attribute](entity:CustomAttribute) for an + order. + + + Use this endpoint to set the value of a custom attribute for a specific + order. + + A custom attribute is based on a custom attribute definition in a Square + seller account. (To create a + + custom attribute definition, use the + [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) + endpoint.) + + + To create or update a custom attribute owned by another application, the + `visibility` setting + + must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: UpsertOrderCustomAttribute + request: + name: UpsertOrderCustomAttributeRequest + path-parameters: + order_id: + type: string + docs: The ID of the target [order](entity:Order). + custom_attribute_key: + type: string + docs: >- + The key of the custom attribute to create or update. This key + must match the key + + of an existing custom attribute definition. + body: + properties: + custom_attribute: + type: root.CustomAttribute + docs: >- + The custom attribute to create or update, with the following + fields: + + + - `value`. This value must conform to the `schema` specified by + the definition. + + For more information, see [Value data + types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types). + + + - `version`. To enable [optimistic + concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) + + control, include this optional field and specify the current + version of the custom attribute. + idempotency_key: + type: optional> + docs: >- + A unique identifier for this request, used to ensure + idempotency. + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpsertOrderCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + custom_attribute_key: custom_attribute_key + headers: + Square-Version: '2025-10-16' + request: + custom_attribute: + key: table-number + value: '42' + version: 1 + response: + body: + custom_attribute: + key: table-number + value: '42' + version: 1 + visibility: VISIBILITY_READ_WRITE_VALUES + definition: + key: key + schema: + key: value + name: name + description: description + visibility: VISIBILITY_HIDDEN + version: 1 + updated_at: updated_at + created_at: created_at + updated_at: '2022-10-06T20:41:22.673Z' + created_at: '2022-10-06T20:41:22.673Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/orders/{order_id}/custom-attributes/{custom_attribute_key} + method: DELETE + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Deletes a [custom attribute](entity:CustomAttribute) associated with a + customer profile. + + + To delete a custom attribute owned by another application, the + `visibility` setting must be + + `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom + attributes + + (also known as custom fields) are always set to + `VISIBILITY_READ_WRITE_VALUES`. + source: + openapi: openapi/openapi.json + display-name: DeleteOrderCustomAttribute + request: + name: DeleteCustomAttributesRequest + path-parameters: + order_id: + type: string + docs: The ID of the target [order](entity:Order). + custom_attribute_key: + type: string + docs: >- + The key of the custom attribute to delete. This key must match + the key of an + + existing custom attribute definition. + response: + docs: Success + type: root.DeleteOrderCustomAttributeResponse + status-code: 200 + examples: + - path-parameters: + order_id: order_id + custom_attribute_key: custom_attribute_key + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/payments.yml b/.mock/definition/payments.yml new file mode 100644 index 000000000..4b8b27b34 --- /dev/null +++ b/.mock/definition/payments.yml @@ -0,0 +1,1646 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/payments + method: GET + auth: + - oauth2: + - PAYMENTS_READ + docs: >- + Retrieves a list of payments taken by the account making the request. + + + Results are eventually consistent, and new payments or changes to + payments might take several + + seconds to appear. + + + The maximum results per page is 100. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.payments + source: + openapi: openapi/openapi.json + display-name: ListPayments + request: + name: ListPaymentsRequest + query-parameters: + begin_time: + type: optional> + docs: >- + Indicates the start of the time range to retrieve payments for, in + RFC 3339 format. + + The range is determined using the `created_at` field for each + Payment. + + Inclusive. Default: The current time minus one year. + end_time: + type: optional> + docs: >- + Indicates the end of the time range to retrieve payments for, in + RFC 3339 format. The + + range is determined using the `created_at` field for each Payment. + + + Default: The current time. + sort_order: + type: optional> + docs: >- + The order in which results are listed by + `ListPaymentsRequest.sort_field`: + + - `ASC` - Oldest to newest. + + - `DESC` - Newest to oldest (default). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + location_id: + type: optional> + docs: >- + Limit results to the location supplied. By default, results are + returned + + for the default (main) location associated with the seller. + total: + type: optional> + docs: The exact amount in the `total_money` for a payment. + last_4: + type: optional> + docs: The last four digits of a payment card. + card_brand: + type: optional> + docs: The brand of the payment card (for example, VISA). + limit: + type: optional> + docs: >- + The maximum number of results to be returned in a single page. + + It is possible to receive fewer results than the specified limit + on a given page. + + + The default value of 100 is also the maximum allowed value. If the + provided value is + + greater than 100, it is ignored and the default value is used + instead. + + + Default: `100` + is_offline_payment: + type: optional> + default: false + docs: Whether the payment was taken offline or not. + offline_begin_time: + type: optional> + docs: >- + Indicates the start of the time range for which to retrieve + offline payments, in RFC 3339 + + format for timestamps. The range is determined using the + + `offline_payment_details.client_created_at` field for each + Payment. If set, payments without a + + value set in `offline_payment_details.client_created_at` will not + be returned. + + + Default: The current time. + offline_end_time: + type: optional> + docs: >- + Indicates the end of the time range for which to retrieve offline + payments, in RFC 3339 + + format for timestamps. The range is determined using the + + `offline_payment_details.client_created_at` field for each + Payment. If set, payments without a + + value set in `offline_payment_details.client_created_at` will not + be returned. + + + Default: The current time. + updated_at_begin_time: + type: optional> + docs: >- + Indicates the start of the time range to retrieve payments for, in + RFC 3339 format. The + + range is determined using the `updated_at` field for each Payment. + updated_at_end_time: + type: optional> + docs: >- + Indicates the end of the time range to retrieve payments for, in + RFC 3339 format. The + + range is determined using the `updated_at` field for each Payment. + sort_field: + type: optional> + docs: The field used to sort results by. The default is `CREATED_AT`. + response: + docs: Success + type: root.ListPaymentsResponse + status-code: 200 + examples: + - query-parameters: + begin_time: begin_time + end_time: end_time + sort_order: sort_order + cursor: cursor + location_id: location_id + total: 1000000 + last_4: last_4 + card_brand: card_brand + limit: 1 + is_offline_payment: true + offline_begin_time: offline_begin_time + offline_end_time: offline_end_time + updated_at_begin_time: updated_at_begin_time + updated_at_end_time: updated_at_end_time + sort_field: CREATED_AT + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payments: + - id: bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + created_at: '2021-10-13T19:34:33.524Z' + updated_at: '2021-10-13T19:34:37.261Z' + amount_money: + amount: 555 + currency: USD + total_money: + amount: 555 + currency: USD + approved_money: + amount: 555 + currency: USD + processing_fee: + - effective_at: '2021-10-13T21:34:35.000Z' + type: INITIAL + amount_money: + amount: 34 + currency: USD + status: COMPLETED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T19:34:33.524Z' + source_type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: KEYED + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: 2Nkw7q + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T19:34:33.680Z' + captured_at: '2021-10-13T19:34:34.340Z' + cash_details: + buyer_supplied_money: {} + external_details: + type: type + source: source + location_id: L88917AVBK2S5 + order_id: d7eKah653Z579f3gVtjlxpSlmUcZY + reference_id: reference_id + customer_id: customer_id + employee_id: TMoK_ogh6rH1o4dV + team_member_id: TMoK_ogh6rH1o4dV + refund_ids: + - refund_ids + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + note: Test Note + statement_description_identifier: statement_description_identifier + capabilities: + - capabilities + receipt_number: bP9m + receipt_url: >- + https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + application_details: + square_product: VIRTUAL_TERMINAL + application_id: sq0ids-Pw67AZAlLVB7hsRmwlJPuA + is_offline_payment: true + version_token: vguW2km0KpVCdAXZcNTZ438qg5LlVPTP4HO5OpiHNfa6o + cursor: cursor + create: + path: /v2/payments + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Creates a payment using the provided source. You can use this endpoint + + to charge a card (credit/debit card or + + Square gift card) or record a payment that the seller received outside + of Square + + (cash payment from a buyer or a payment that an external entity + + processed on behalf of the seller). + + + The endpoint creates a + + `Payment` object and returns it in the response. + source: + openapi: openapi/openapi.json + display-name: CreatePayment + request: + name: CreatePaymentRequest + body: + properties: + source_id: + type: string + docs: >- + The ID for the source of funds for this payment. + + This could be a payment token generated by the Web Payments SDK + for any of its + + [supported + methods](https://developer.squareup.com/docs/web-payments/overview#explore-payment-methods), + + including cards, bank transfers, Afterpay or Cash App Pay. If + recording a payment + + that the seller received outside of Square, specify either + "CASH" or "EXTERNAL". + + For more information, see + + [Take + Payments](https://developer.squareup.com/docs/payments-api/take-payments). + validation: + minLength: 1 + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreatePayment` request. + Keys can be any valid string + + but must be unique for every `CreatePayment` request. + + + Note: The number of allowed characters might be less than the + stated maximum, if multi-byte + + characters are used. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + maxLength: 45 + amount_money: + type: optional + docs: >- + The amount of money to accept for this payment, not including + `tip_money`. + + + The amount must be specified in the smallest denomination of the + applicable currency + + (for example, US dollar amounts are specified in cents). For + more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + + + The currency code must match the currency associated with the + business + + that is accepting the payment. + tip_money: + type: optional + docs: >- + The amount designated as a tip, in addition to `amount_money`. + + + The amount must be specified in the smallest denomination of the + applicable currency + + (for example, US dollar amounts are specified in cents). For + more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + + + The currency code must match the currency associated with the + business + + that is accepting the payment. + app_fee_money: + type: optional + docs: >- + The amount of money that the developer is taking as a fee + + for facilitating the payment on behalf of the seller. + + + The amount cannot be more than 90% of the total amount of the + payment. + + + The amount must be specified in the smallest denomination of the + applicable currency + + (for example, US dollar amounts are specified in cents). For + more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + + + The fee currency code must match the currency associated with + the seller + + that is accepting the payment. The application must be from a + developer + + account in the same country and using the same currency code as + the seller. + + + For more information about the application fee scenario, see + + [Take Payments and Collect + Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + + + To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth + permission is required. + + For more information, see + [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions). + delay_duration: + type: optional + docs: >- + The duration of time after the payment's creation when Square + automatically + + either completes or cancels the payment depending on the + `delay_action` field value. + + For more information, see + + [Time + threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). + + + This parameter should be specified as a time duration, in RFC + 3339 format. + + + Note: This feature is only supported for card payments. This + parameter can only be set for a delayed + + capture payment (`autocomplete=false`). + + + Default: + + + - Card-present payments: "PT36H" (36 hours) from the creation + time. + + - Card-not-present payments: "P7D" (7 days) from the creation + time. + delay_action: + type: optional + docs: >- + The action to be applied to the payment when the + `delay_duration` has elapsed. The action must be + + CANCEL or COMPLETE. For more information, see + + [Time + Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold). + + + Default: CANCEL + autocomplete: + type: optional + docs: >- + If set to `true`, this payment will be completed when possible. + If + + set to `false`, this payment is held in an approved state until + either + + explicitly completed (captured) or canceled (voided). For more + information, see + + [Delayed + capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment). + + + Default: true + order_id: + type: optional + docs: Associates a previously created order with this payment. + customer_id: + type: optional + docs: >- + The [Customer](entity:Customer) ID of the customer associated + with the payment. + + + This is required if the `source_id` refers to a card on file + created using the Cards API. + location_id: + type: optional + docs: >- + The location ID to associate with the payment. If not specified, + the [main + location](https://developer.squareup.com/docs/locations-api#about-the-main-location) + is + + used. + team_member_id: + type: optional + docs: |- + An optional [TeamMember](entity:TeamMember) ID to associate with + this payment. + reference_id: + type: optional + docs: >- + A user-defined ID to associate with the payment. + + + You can use this field to associate the payment to an entity in + an external system + + (for example, you might specify an order ID that is generated by + a third-party shopping cart). + validation: + maxLength: 40 + verification_token: + type: optional + docs: >- + An identifying token generated by + [payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). + + Verification tokens encapsulate customer device information and + 3-D Secure + + challenge results to indicate that Square has verified the buyer + identity. + + + For more information, see [SCA + Overview](https://developer.squareup.com/docs/sca-overview). + accept_partial_authorization: + type: optional + docs: >- + If set to `true` and charging a Square Gift Card, a payment + might be returned with + + `amount_money` equal to less than what was requested. For + example, a request for $20 when charging + + a Square Gift Card with a balance of $5 results in an APPROVED + payment of $5. You might choose + + to prompt the buyer for an additional payment to cover the + remainder or cancel the Gift Card + + payment. This field cannot be `true` when `autocomplete = true`. + + + For more information, see + + [Partial amount with Square Gift + Cards](https://developer.squareup.com/docs/payments-api/take-payments#partial-payment-gift-card). + + + Default: false + buyer_email_address: + type: optional + docs: The buyer's email address. + validation: + maxLength: 255 + buyer_phone_number: + type: optional + docs: >- + The buyer's phone number. + + Must follow the following format: + + 1. A leading + symbol (followed by a country code) + + 2. The phone number can contain spaces and the special + characters `(` , `)` , `-` , and `.`. + + Alphabetical characters aren't allowed. + + 3. The phone number must contain between 9 and 16 digits. + billing_address: + type: optional + docs: The buyer's billing address. + shipping_address: + type: optional + docs: The buyer's shipping address. + note: + type: optional + docs: >- + An optional note to be entered by the developer when creating a + payment. + validation: + maxLength: 500 + statement_description_identifier: + type: optional + docs: >- + Optional additional payment information to include on the + customer's card statement + + as part of the statement description. This can be, for example, + an invoice number, ticket number, + + or short description that uniquely identifies the purchase. + + + Note that the `statement_description_identifier` might get + truncated on the statement description + + to fit the required information including the Square identifier + (SQ *) and name of the + + seller taking the payment. + validation: + maxLength: 20 + cash_details: + type: optional + docs: >- + Additional details required when recording a cash payment + (`source_id` is CASH). + external_details: + type: optional + docs: >- + Additional details required when recording an external payment + (`source_id` is EXTERNAL). + customer_details: + type: optional + docs: Details about the customer making the payment. + offline_payment_details: + type: optional + docs: >- + An optional field for specifying the offline payment details. + This is intended for + + internal 1st-party callers only. + content-type: application/json + response: + docs: Success + type: root.CreatePaymentResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + source_id: ccof:GaJGNaZa8x4OgDJn4GB + idempotency_key: 7b0f3ec5-086a-4871-8f13-3c81b3875218 + amount_money: + amount: 1000 + currency: USD + app_fee_money: + amount: 10 + currency: USD + autocomplete: true + customer_id: W92WH6P11H4Z77CTET0RNTGFW8 + location_id: L88917AVBK2S5 + reference_id: '123456' + note: Brief description + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment: + id: R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY + created_at: '2021-10-13T21:14:29.577Z' + updated_at: '2021-10-13T21:14:30.504Z' + amount_money: + amount: 1000 + currency: USD + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + total_money: + amount: 1000 + currency: USD + app_fee_money: + amount: 10 + currency: USD + approved_money: + amount: 1000 + currency: USD + processing_fee: + - {} + refunded_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: COMPLETED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T21:14:29.577Z' + source_type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: ON_FILE + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: vNEn2f + application_identifier: application_identifier + application_name: application_name + application_cryptogram: application_cryptogram + verification_method: verification_method + verification_results: verification_results + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T21:14:29.732Z' + captured_at: '2021-10-13T21:14:30.504Z' + refund_requires_card_presence: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + cash_details: + buyer_supplied_money: {} + bank_account_details: + bank_name: bank_name + transfer_type: transfer_type + account_ownership_type: account_ownership_type + fingerprint: fingerprint + country: country + statement_description: statement_description + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + external_details: + type: type + source: source + source_id: source_id + wallet_details: + status: status + brand: brand + buy_now_pay_later_details: + brand: brand + square_account_details: + payment_source_token: payment_source_token + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + location_id: L88917AVBK2S5 + order_id: pRsjRTgFWATl7so6DxdKBJa7ssbZY + reference_id: '123456' + customer_id: W92WH6P11H4Z77CTET0RNTGFW8 + employee_id: employee_id + team_member_id: team_member_id + refund_ids: + - refund_ids + risk_evaluation: + created_at: '2021-10-13T21:14:30.423Z' + risk_level: NORMAL + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + billing_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + note: Brief Description + statement_description_identifier: statement_description_identifier + capabilities: + - capabilities + receipt_number: R2B3 + receipt_url: https://squareup.com/receipt/preview/EXAMPLE_RECEIPT_ID + device_details: + device_id: device_id + device_installation_id: device_installation_id + device_name: device_name + application_details: + square_product: ECOMMERCE_API + application_id: sq0ids-TcgftTEtKxJTRF1lCFJ9TA + is_offline_payment: true + offline_payment_details: + client_created_at: client_created_at + version_token: TPtNEOBOa6Qq6E3C3IjckSVOM6b3hMbfhjvTxHBQUsB6o + cancelByIdempotencyKey: + path: /v2/payments/cancel + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Cancels (voids) a payment identified by the idempotency key that is + specified in the + + request. + + + Use this method when the status of a `CreatePayment` request is unknown + (for example, after you send a + + `CreatePayment` request, a network error occurs and you do not get a + response). In this case, you can + + direct Square to cancel the payment using this endpoint. In the request, + you provide the same + + idempotency key that you provided in your `CreatePayment` request that + you want to cancel. After + + canceling the payment, you can submit your `CreatePayment` request + again. + + + Note that if no payment with the specified idempotency key is found, no + action is taken and the endpoint + + returns successfully. + source: + openapi: openapi/openapi.json + display-name: CancelPaymentByIdempotencyKey + request: + name: CancelPaymentByIdempotencyKeyRequest + body: + properties: + idempotency_key: + type: string + docs: The `idempotency_key` identifying the payment to be canceled. + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CancelPaymentByIdempotencyKeyResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: a7e36d40-d24b-11e8-b568-0800200c9a66 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/payments/{payment_id} + method: GET + auth: + - oauth2: + - PAYMENTS_READ + docs: Retrieves details for a specific payment. + source: + openapi: openapi/openapi.json + display-name: GetPayment + request: + name: GetPaymentsRequest + path-parameters: + payment_id: + type: string + docs: A unique ID for the desired payment. + response: + docs: Success + type: root.GetPaymentResponse + status-code: 200 + examples: + - path-parameters: + payment_id: payment_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment: + id: bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + created_at: '2021-10-13T19:34:33.524Z' + updated_at: '2021-10-13T19:34:34.339Z' + amount_money: + amount: 555 + currency: USD + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + total_money: + amount: 555 + currency: USD + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + approved_money: + amount: 555 + currency: USD + processing_fee: + - effective_at: '2021-10-13T21:34:35.000Z' + type: INITIAL + amount_money: + amount: 34 + currency: USD + refunded_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: COMPLETED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T19:34:33.524Z' + source_type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: KEYED + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: 2Nkw7q + application_identifier: application_identifier + application_name: application_name + application_cryptogram: application_cryptogram + verification_method: verification_method + verification_results: verification_results + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T19:34:33.680Z' + captured_at: '2021-10-13T19:34:34.340Z' + refund_requires_card_presence: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + cash_details: + buyer_supplied_money: {} + bank_account_details: + bank_name: bank_name + transfer_type: transfer_type + account_ownership_type: account_ownership_type + fingerprint: fingerprint + country: country + statement_description: statement_description + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + external_details: + type: type + source: source + source_id: source_id + wallet_details: + status: status + brand: brand + buy_now_pay_later_details: + brand: brand + square_account_details: + payment_source_token: payment_source_token + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + location_id: L88917AVBK2S5 + order_id: d7eKah653Z579f3gVtjlxpSlmUcZY + reference_id: reference_id + customer_id: customer_id + employee_id: TMoK_ogh6rH1o4dV + team_member_id: TMoK_ogh6rH1o4dV + refund_ids: + - refund_ids + risk_evaluation: + created_at: created_at + risk_level: PENDING + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + billing_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + note: Test Note + statement_description_identifier: statement_description_identifier + capabilities: + - capabilities + receipt_number: bP9m + receipt_url: >- + https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + device_details: + device_id: device_id + device_installation_id: device_installation_id + device_name: device_name + application_details: + square_product: VIRTUAL_TERMINAL + application_id: sq0ids-Pw67AZAlLVB7hsRmwlJPuA + is_offline_payment: true + offline_payment_details: + client_created_at: client_created_at + version_token: 56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o + update: + path: /v2/payments/{payment_id} + method: PUT + auth: + - oauth2: + - PAYMENTS_WRITE + docs: |- + Updates a payment with the APPROVED status. + You can update the `amount_money` and `tip_money` using this endpoint. + source: + openapi: openapi/openapi.json + display-name: UpdatePayment + request: + name: UpdatePaymentRequest + path-parameters: + payment_id: + type: string + docs: The ID of the payment to update. + body: + properties: + payment: + type: optional + docs: The updated `Payment` object. + idempotency_key: + type: string + docs: >- + A unique string that identifies this `UpdatePayment` request. + Keys can be any valid string + + but must be unique for every `UpdatePayment` request. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdatePaymentResponse + status-code: 200 + examples: + - path-parameters: + payment_id: payment_id + headers: + Square-Version: '2025-10-16' + request: + payment: + amount_money: + amount: 1000 + currency: USD + tip_money: + amount: 100 + currency: USD + version_token: ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o + idempotency_key: 956f8b13-e4ec-45d6-85e8-d1d95ef0c5de + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment: + id: 1QjqpBVyrI9S4H9sTGDWU9JeiWdZY + created_at: '2021-10-13T20:26:44.191Z' + updated_at: '2021-10-13T20:26:44.364Z' + amount_money: + amount: 1000 + currency: USD + tip_money: + amount: 100 + currency: USD + total_money: + amount: 1100 + currency: USD + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + approved_money: + amount: 1000 + currency: USD + processing_fee: + - {} + refunded_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: APPROVED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T20:26:44.191Z' + source_type: CARD + card_details: + status: AUTHORIZED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: ON_FILE + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: 68aLBM + application_identifier: application_identifier + application_name: application_name + application_cryptogram: application_cryptogram + verification_method: verification_method + verification_results: verification_results + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T20:26:44.364Z' + refund_requires_card_presence: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + cash_details: + buyer_supplied_money: {} + bank_account_details: + bank_name: bank_name + transfer_type: transfer_type + account_ownership_type: account_ownership_type + fingerprint: fingerprint + country: country + statement_description: statement_description + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + external_details: + type: type + source: source + source_id: source_id + wallet_details: + status: status + brand: brand + buy_now_pay_later_details: + brand: brand + square_account_details: + payment_source_token: payment_source_token + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + location_id: L88917AVBK2S5 + order_id: nUSN9TdxpiK3SrQg3wzmf6r8LP9YY + reference_id: reference_id + customer_id: W92WH6P11H4Z77CTET0RNTGFW8 + employee_id: employee_id + team_member_id: team_member_id + refund_ids: + - refund_ids + risk_evaluation: + created_at: '2021-10-13T20:26:45.271Z' + risk_level: NORMAL + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + billing_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + note: Example Note + statement_description_identifier: statement_description_identifier + capabilities: + - EDIT_AMOUNT_UP + - EDIT_AMOUNT_DOWN + - EDIT_TIP_AMOUNT_UP + - EDIT_TIP_AMOUNT_DOWN + receipt_number: 1Qjq + receipt_url: receipt_url + device_details: + device_id: device_id + device_installation_id: device_installation_id + device_name: device_name + application_details: + square_product: ECOMMERCE_API + application_id: sq0ids-TcgftTEtKxJTRF1lCFJ9TA + is_offline_payment: true + offline_payment_details: + client_created_at: client_created_at + version_token: rDrXnqiS7fJgexccgdpzmwqTiXui1aIKCp9EchZ7trE6o + cancel: + path: /v2/payments/{payment_id}/cancel + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Cancels (voids) a payment. You can use this endpoint to cancel a payment + with + + the APPROVED `status`. + source: + openapi: openapi/openapi.json + display-name: CancelPayment + request: + name: CancelPaymentsRequest + path-parameters: + payment_id: + type: string + docs: The ID of the payment to cancel. + response: + docs: Success + type: root.CancelPaymentResponse + status-code: 200 + examples: + - path-parameters: + payment_id: payment_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment: + id: 1QjqpBVyrI9S4H9sTGDWU9JeiWdZY + created_at: '2021-10-13T20:26:44.191Z' + updated_at: '2021-10-13T20:31:21.597Z' + amount_money: + amount: 1000 + currency: USD + tip_money: + amount: 100 + currency: USD + total_money: + amount: 1100 + currency: USD + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + approved_money: + amount: 1000 + currency: USD + processing_fee: + - {} + refunded_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: CANCELED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T20:26:44.191Z' + source_type: CARD + card_details: + status: VOIDED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: ON_FILE + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: 68aLBM + application_identifier: application_identifier + application_name: application_name + application_cryptogram: application_cryptogram + verification_method: verification_method + verification_results: verification_results + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T20:26:44.364Z' + voided_at: '2021-10-13T20:31:21.597Z' + refund_requires_card_presence: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + cash_details: + buyer_supplied_money: {} + bank_account_details: + bank_name: bank_name + transfer_type: transfer_type + account_ownership_type: account_ownership_type + fingerprint: fingerprint + country: country + statement_description: statement_description + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + external_details: + type: type + source: source + source_id: source_id + wallet_details: + status: status + brand: brand + buy_now_pay_later_details: + brand: brand + square_account_details: + payment_source_token: payment_source_token + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + location_id: L88917AVBK2S5 + order_id: nUSN9TdxpiK3SrQg3wzmf6r8LP9YY + reference_id: reference_id + customer_id: W92WH6P11H4Z77CTET0RNTGFW8 + employee_id: employee_id + team_member_id: team_member_id + refund_ids: + - refund_ids + risk_evaluation: + created_at: '2021-10-13T20:26:45.271Z' + risk_level: NORMAL + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + billing_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + note: Example Note + statement_description_identifier: statement_description_identifier + capabilities: + - capabilities + receipt_number: receipt_number + receipt_url: receipt_url + device_details: + device_id: device_id + device_installation_id: device_installation_id + device_name: device_name + application_details: + square_product: ECOMMERCE_API + application_id: sq0ids-TcgftTEtKxJTRF1lCFJ9TA + is_offline_payment: true + offline_payment_details: + client_created_at: client_created_at + version_token: N8AGYgEjCiY9Q57Jw7aVHEpBq8bzGCDCQMRX8Vs56N06o + complete: + path: /v2/payments/{payment_id}/complete + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Completes (captures) a payment. + + By default, payments are set to complete immediately after they are + created. + + + You can use this endpoint to complete a payment with the APPROVED + `status`. + source: + openapi: openapi/openapi.json + display-name: CompletePayment + request: + name: CompletePaymentRequest + path-parameters: + payment_id: + type: string + docs: The unique ID identifying the payment to be completed. + body: + properties: + version_token: + type: optional> + docs: >- + Used for optimistic concurrency. This opaque token identifies + the current `Payment` + + version that the caller expects. If the server has a different + version of the Payment, + + the update fails and a response with a VERSION_MISMATCH error is + returned. + content-type: application/json + response: + docs: Success + type: root.CompletePaymentResponse + status-code: 200 + examples: + - path-parameters: + payment_id: payment_id + headers: + Square-Version: '2025-10-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + payment: + id: bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + created_at: '2021-10-13T19:34:33.524Z' + updated_at: '2021-10-13T19:34:34.339Z' + amount_money: + amount: 555 + currency: USD + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + total_money: + amount: 555 + currency: USD + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + approved_money: + amount: 555 + currency: USD + processing_fee: + - effective_at: '2021-10-13T21:34:35.000Z' + type: INITIAL + amount_money: + amount: 34 + currency: USD + refunded_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + status: COMPLETED + delay_duration: PT168H + delay_action: CANCEL + delayed_until: '2021-10-20T19:34:33.524Z' + source_type: CARD + card_details: + status: CAPTURED + card: + card_brand: VISA + last_4: '1111' + exp_month: 11 + exp_year: 2022 + fingerprint: >- + sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ + card_type: DEBIT + prepaid_type: NOT_PREPAID + bin: '411111' + entry_method: KEYED + cvv_status: CVV_ACCEPTED + avs_status: AVS_ACCEPTED + auth_result_code: 2Nkw7q + application_identifier: application_identifier + application_name: application_name + application_cryptogram: application_cryptogram + verification_method: verification_method + verification_results: verification_results + statement_description: SQ *EXAMPLE TEST GOSQ.C + card_payment_timeline: + authorized_at: '2021-10-13T19:34:33.680Z' + captured_at: '2021-10-13T19:34:34.340Z' + refund_requires_card_presence: true + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + cash_details: + buyer_supplied_money: {} + bank_account_details: + bank_name: bank_name + transfer_type: transfer_type + account_ownership_type: account_ownership_type + fingerprint: fingerprint + country: country + statement_description: statement_description + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + external_details: + type: type + source: source + source_id: source_id + wallet_details: + status: status + brand: brand + buy_now_pay_later_details: + brand: brand + square_account_details: + payment_source_token: payment_source_token + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + location_id: L88917AVBK2S5 + order_id: d7eKah653Z579f3gVtjlxpSlmUcZY + reference_id: reference_id + customer_id: customer_id + employee_id: TMoK_ogh6rH1o4dV + team_member_id: TMoK_ogh6rH1o4dV + refund_ids: + - refund_ids + risk_evaluation: + created_at: created_at + risk_level: PENDING + terminal_checkout_id: terminal_checkout_id + buyer_email_address: buyer_email_address + billing_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + note: Test Note + statement_description_identifier: statement_description_identifier + capabilities: + - capabilities + receipt_number: bP9m + receipt_url: >- + https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + device_details: + device_id: device_id + device_installation_id: device_installation_id + device_name: device_name + application_details: + square_product: VIRTUAL_TERMINAL + application_id: sq0ids-Pw67AZAlLVB7hsRmwlJPuA + is_offline_payment: true + offline_payment_details: + client_created_at: client_created_at + version_token: 56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/payouts.yml b/.mock/definition/payouts.yml new file mode 100644 index 000000000..0cce7f8f5 --- /dev/null +++ b/.mock/definition/payouts.yml @@ -0,0 +1,297 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/payouts + method: GET + auth: + - oauth2: [] + docs: >- + Retrieves a list of all payouts for the default location. + + You can filter payouts by location ID, status, time range, and order + them in ascending or descending order. + + To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.payouts + source: + openapi: openapi/openapi.json + display-name: ListPayouts + request: + name: ListPayoutsRequest + query-parameters: + location_id: + type: optional> + docs: >- + The ID of the location for which to list the payouts. + + By default, payouts are returned for the default (main) location + associated with the seller. + status: + type: optional> + docs: If provided, only payouts with the given status are returned. + begin_time: + type: optional> + docs: >- + The timestamp for the beginning of the payout creation time, in + RFC 3339 format. + + Inclusive. Default: The current time minus one year. + end_time: + type: optional> + docs: >- + The timestamp for the end of the payout creation time, in RFC 3339 + format. + + Default: The current time. + sort_order: + type: optional> + docs: The order in which payouts are listed. + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + + If request parameters change between requests, subsequent results + may contain duplicates or missing records. + limit: + type: optional> + docs: >- + The maximum number of results to be returned in a single page. + + It is possible to receive fewer results than the specified limit + on a given page. + + The default value of 100 is also the maximum allowed value. If the + provided value is + + greater than 100, it is ignored and the default value is used + instead. + + Default: `100` + response: + docs: Success + type: root.ListPayoutsResponse + status-code: 200 + examples: + - query-parameters: + location_id: location_id + status: SENT + begin_time: begin_time + end_time: end_time + sort_order: DESC + cursor: cursor + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + payouts: + - id: po_b345d2c7-90b3-4f0b-a2aa-df1def7f8afc + status: PAID + location_id: L88917AVBK2S5 + created_at: '2022-03-29T16:12:31Z' + updated_at: '2022-03-30T01:07:22.875Z' + amount_money: + amount: 6259 + destination: + type: CARD + id: ccof:ZPp3oedR3AeEUNd3z7 + version: 2 + type: BATCH + payout_fee: + - amount_money: + amount: 95 + effective_at: '2022-03-29T16:12:31Z' + type: TRANSFER_FEE + arrival_date: '2022-03-29' + end_to_end_id: L2100000005 + - id: po_f3c0fb38-a5ce-427d-b858-52b925b72e45 + status: PAID + location_id: L88917AVBK2S5 + created_at: '2022-03-24T03:07:09Z' + updated_at: '2022-03-24T03:07:09Z' + amount_money: + amount: -103 + destination: + type: BANK_ACCOUNT + id: bact:ZPp3oedR3AeEUNd3z7 + version: 1 + type: BATCH + payout_fee: + - {} + arrival_date: '2022-03-24' + end_to_end_id: L2100000006 + cursor: >- + EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/payouts/{payout_id} + method: GET + auth: + - oauth2: [] + docs: |- + Retrieves details of a specific payout identified by a payout ID. + To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + source: + openapi: openapi/openapi.json + display-name: GetPayout + request: + name: GetPayoutsRequest + path-parameters: + payout_id: + type: string + docs: The ID of the payout to retrieve the information for. + response: + docs: Success + type: root.GetPayoutResponse + status-code: 200 + examples: + - path-parameters: + payout_id: payout_id + headers: + Square-Version: '2025-10-16' + response: + body: + payout: + id: po_f3c0fb38-a5ce-427d-b858-52b925b72e45 + status: PAID + location_id: L88917AVBK2S5 + created_at: '2022-03-24T03:07:09Z' + updated_at: '2022-03-24T03:07:09Z' + amount_money: + amount: -103 + currency: UNKNOWN_CURRENCY + destination: + type: BANK_ACCOUNT + id: bact:ZPp3oedR3AeEUNd3z7 + version: 1 + type: BATCH + payout_fee: + - {} + arrival_date: '2022-03-24' + end_to_end_id: end_to_end_id + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + ListEntries: + path: /v2/payouts/{payout_id}/payout-entries + method: GET + auth: + - oauth2: [] + docs: |- + Retrieves a list of all payout entries for a specific payout. + To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.payout_entries + source: + openapi: openapi/openapi.json + display-name: ListPayoutEntries + request: + name: ListEntriesPayoutsRequest + path-parameters: + payout_id: + type: string + docs: The ID of the payout to retrieve the information for. + query-parameters: + sort_order: + type: optional> + docs: The order in which payout entries are listed. + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + + If request parameters change between requests, subsequent results + may contain duplicates or missing records. + limit: + type: optional> + docs: >- + The maximum number of results to be returned in a single page. + + It is possible to receive fewer results than the specified limit + on a given page. + + The default value of 100 is also the maximum allowed value. If the + provided value is + + greater than 100, it is ignored and the default value is used + instead. + + Default: `100` + response: + docs: Success + type: root.ListPayoutEntriesResponse + status-code: 200 + examples: + - path-parameters: + payout_id: payout_id + query-parameters: + sort_order: DESC + cursor: cursor + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + payout_entries: + - id: poe_ZQWcw41d0SGJS6IWd4cSi8mKHk + payout_id: po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6 + effective_at: '2021-12-14T23:31:49Z' + type: REFUND + gross_amount_money: + amount: -50 + fee_amount_money: + amount: -2 + net_amount_money: + amount: -48 + type_refund_details: + payment_id: HVdG62HeMlti8YYf94oxrN + refund_id: HVdG62HeMlti8YYf94oxrN_dR8Nztxg7umf94oxrN12Ji5r2KW14FAY + - id: poe_EibbY9Ob1d0SGJS6IWd4cSiSi6wkaPk + payout_id: po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6 + effective_at: '2021-12-14T23:31:49Z' + type: CHARGE + gross_amount_money: + amount: 100 + fee_amount_money: + amount: 19 + net_amount_money: + amount: 81 + type_charge_details: + payment_id: HVdG62H5K3291d0SGJS6IWd4cSi8YY + cursor: >- + TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/refunds.yml b/.mock/definition/refunds.yml new file mode 100644 index 000000000..a329e35cf --- /dev/null +++ b/.mock/definition/refunds.yml @@ -0,0 +1,507 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/refunds + method: GET + auth: + - oauth2: + - PAYMENTS_READ + docs: >- + Retrieves a list of refunds for the account making the request. + + + Results are eventually consistent, and new refunds or changes to refunds + might take several + + seconds to appear. + + + The maximum results per page is 100. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.refunds + source: + openapi: openapi/openapi.json + display-name: ListPaymentRefunds + request: + name: ListRefundsRequest + query-parameters: + begin_time: + type: optional> + docs: >- + Indicates the start of the time range to retrieve each + `PaymentRefund` for, in RFC 3339 + + format. The range is determined using the `created_at` field for + each `PaymentRefund`. + + + Default: The current time minus one year. + end_time: + type: optional> + docs: >- + Indicates the end of the time range to retrieve each + `PaymentRefund` for, in RFC 3339 + + format. The range is determined using the `created_at` field for + each `PaymentRefund`. + + + Default: The current time. + sort_order: + type: optional> + docs: >- + The order in which results are listed by + `PaymentRefund.created_at`: + + - `ASC` - Oldest to newest. + + - `DESC` - Newest to oldest (default). + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + location_id: + type: optional> + docs: >- + Limit results to the location supplied. By default, results are + returned + + for all locations associated with the seller. + status: + type: optional> + docs: >- + If provided, only refunds with the given status are returned. + + For a list of refund status values, see + [PaymentRefund](entity:PaymentRefund). + + + Default: If omitted, refunds are returned regardless of their + status. + source_type: + type: optional> + docs: >- + If provided, only returns refunds whose payments have the + indicated source type. + + Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, + and `EXTERNAL`. + + For information about these payment source types, see + + [Take + Payments](https://developer.squareup.com/docs/payments-api/take-payments). + + + Default: If omitted, refunds are returned regardless of the source + type. + limit: + type: optional> + docs: >- + The maximum number of results to be returned in a single page. + + + It is possible to receive fewer results than the specified limit + on a given page. + + + If the supplied value is greater than 100, no more than 100 + results are returned. + + + Default: 100 + updated_at_begin_time: + type: optional> + docs: >- + Indicates the start of the time range to retrieve each + `PaymentRefund` for, in RFC 3339 + + format. The range is determined using the `updated_at` field for + each `PaymentRefund`. + + + Default: If omitted, the time range starts at `begin_time`. + updated_at_end_time: + type: optional> + docs: >- + Indicates the end of the time range to retrieve each + `PaymentRefund` for, in RFC 3339 + + format. The range is determined using the `updated_at` field for + each `PaymentRefund`. + + + Default: The current time. + sort_field: + type: optional> + docs: The field used to sort results by. The default is `CREATED_AT`. + response: + docs: Success + type: root.ListPaymentRefundsResponse + status-code: 200 + examples: + - query-parameters: + begin_time: begin_time + end_time: end_time + sort_order: sort_order + cursor: cursor + location_id: location_id + status: status + source_type: source_type + limit: 1 + updated_at_begin_time: updated_at_begin_time + updated_at_end_time: updated_at_end_time + sort_field: CREATED_AT + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refunds: + - id: >- + bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd + status: COMPLETED + location_id: L88917AVBK2S5 + unlinked: true + destination_type: destination_type + amount_money: + amount: 555 + currency: USD + processing_fee: + - effective_at: '2021-10-13T21:34:35.000Z' + type: INITIAL + amount_money: + amount: -34 + currency: USD + payment_id: bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + order_id: 9ltv0bx5PuvGXUYHYHxYSKEqC3IZY + reason: Example Refund + created_at: '2021-10-13T19:59:05.342Z' + updated_at: '2021-10-13T20:00:03.497Z' + team_member_id: team_member_id + terminal_refund_id: terminal_refund_id + cursor: >- + 5evquW1YswHoT4EoyUhzMmTsCnsSXBU9U0WJ4FU4623nrMQcocH0RGU6Up1YkwfiMcF59ood58EBTEGgzMTGHQJpocic7ExOL0NtrTXCeWcv0UJIJNk8eXb + RefundPayment: + path: /v2/refunds + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Refunds a payment. You can refund the entire payment amount or a + + portion of it. You can use this endpoint to refund a card payment or + record a + + refund of a cash or external payment. For more information, see + + [Refund + Payment](https://developer.squareup.com/docs/payments-api/refund-payments). + source: + openapi: openapi/openapi.json + display-name: RefundPayment + request: + name: RefundPaymentRequest + body: + properties: + idempotency_key: + type: string + docs: >2- + A unique string that identifies this `RefundPayment` request. The key can be any valid string + but must be unique for every `RefundPayment` request. + + + Keys are limited to a max of 45 characters - however, the number + of allowed characters might be + + less than 45, if multi-byte characters are used. + + + For more information, see + [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + validation: + minLength: 1 + amount_money: + type: root.Money + docs: >- + The amount of money to refund. + + + This amount cannot be more than the `total_money` value of the + payment minus the total + + amount of all previously completed refunds for this payment. + + + This amount must be specified in the smallest denomination of + the applicable currency + + (for example, US dollar amounts are specified in cents). For + more information, see + + [Working with Monetary + Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). + + + The currency code must match the currency associated with the + business + + that is charging the card. + app_fee_money: + type: optional + docs: >- + The amount of money the developer contributes to help cover the + refunded amount. + + This amount is specified in the smallest denomination of the + applicable currency (for example, + + US dollar amounts are specified in cents). + + + The value cannot be more than the `amount_money`. + + + You can specify this parameter in a refund request only if the + same parameter was also included + + when taking the payment. This is part of the application fee + scenario the API supports. For more + + information, see [Take Payments and Collect + Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). + + + To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth + permission is required. + + For more information, see + [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions). + payment_id: + type: optional> + docs: |- + The unique ID of the payment being refunded. + Required when unlinked=false, otherwise must not be set. + destination_id: + type: optional> + docs: >- + The ID indicating where funds will be refunded to. Required for + unlinked refunds. For more + + information, see [Process an Unlinked + Refund](https://developer.squareup.com/docs/refunds-api/unlinked-refunds). + + + For refunds linked to Square payments, `destination_id` is + usually omitted; in this case, funds + + will be returned to the original payment source. The field may + be specified in order to request + + a cross-method refund to a gift card. For more information, + + see [Cross-method refunds to gift + cards](https://developer.squareup.com/docs/payments-api/refund-payments#cross-method-refunds-to-gift-cards). + unlinked: + type: optional> + docs: >- + Indicates that the refund is not linked to a Square payment. + + If set to true, `destination_id` and `location_id` must be + supplied while `payment_id` must not + + be provided. + location_id: + type: optional> + docs: >- + The location ID associated with the unlinked refund. + + Required for requests specifying `unlinked=true`. + + Otherwise, if included when `unlinked=false`, will throw an + error. + validation: + maxLength: 50 + customer_id: + type: optional> + docs: >- + The [Customer](entity:Customer) ID of the customer associated + with the refund. + + This is required if the `destination_id` refers to a card on + file created using the Cards + + API. Only allowed when `unlinked=true`. + reason: + type: optional> + docs: A description of the reason for the refund. + validation: + maxLength: 192 + payment_version_token: + type: optional> + docs: >2- + Used for optimistic concurrency. This opaque token identifies the current `Payment` + version that the caller expects. If the server has a different + version of the Payment, + + the update fails and a response with a VERSION_MISMATCH error is + returned. + + If the versions match, or the field is not provided, the refund + proceeds as normal. + team_member_id: + type: optional> + docs: >- + An optional [TeamMember](entity:TeamMember) ID to associate with + this refund. + validation: + maxLength: 192 + cash_details: + type: optional + docs: >- + Additional details required when recording an unlinked cash + refund (`destination_id` is CASH). + external_details: + type: optional + docs: >- + Additional details required when recording an unlinked external + refund + + (`destination_id` is EXTERNAL). + content-type: application/json + response: + docs: Success + type: root.RefundPaymentResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 9b7f2dcf-49da-4411-b23e-a2d6af21333a + amount_money: + amount: 1000 + currency: USD + app_fee_money: + amount: 10 + currency: USD + payment_id: R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY + reason: Example + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: >- + R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY_KlWP8IC1557ddwc9QWTKrCVU6m0JXDz15R2Qym5eQfR + status: PENDING + location_id: L88917AVBK2S5 + unlinked: true + destination_type: destination_type + destination_details: + cash_details: + seller_supplied_money: {} + external_details: + type: type + source: source + amount_money: + amount: 1000 + currency: USD + app_fee_money: + amount: 10 + currency: USD + processing_fee: + - {} + payment_id: R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY + order_id: 1JLEUZeEooAIX8HMqm9kvWd69aQZY + reason: Example + created_at: '2021-10-13T21:23:19.116Z' + updated_at: '2021-10-13T21:23:19.508Z' + team_member_id: team_member_id + terminal_refund_id: terminal_refund_id + get: + path: /v2/refunds/{refund_id} + method: GET + auth: + - oauth2: + - PAYMENTS_READ + docs: Retrieves a specific refund using the `refund_id`. + source: + openapi: openapi/openapi.json + display-name: GetPaymentRefund + request: + name: GetRefundsRequest + path-parameters: + refund_id: + type: string + docs: The unique ID for the desired `PaymentRefund`. + response: + docs: Success + type: root.GetPaymentRefundResponse + status-code: 200 + examples: + - path-parameters: + refund_id: refund_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: >- + bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd + status: COMPLETED + location_id: L88917AVBK2S5 + unlinked: true + destination_type: destination_type + destination_details: + cash_details: + seller_supplied_money: {} + external_details: + type: type + source: source + amount_money: + amount: 555 + currency: USD + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + processing_fee: + - effective_at: '2021-10-13T21:34:35.000Z' + type: INITIAL + amount_money: + amount: -34 + currency: USD + payment_id: bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY + order_id: 9ltv0bx5PuvGXUYHYHxYSKEqC3IZY + reason: Example Refund + created_at: '2021-10-13T19:59:05.073Z' + updated_at: '2021-10-13T20:00:02.442Z' + team_member_id: team_member_id + terminal_refund_id: terminal_refund_id + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/sites.yml b/.mock/definition/sites.yml new file mode 100644 index 000000000..0ac717c12 --- /dev/null +++ b/.mock/definition/sites.yml @@ -0,0 +1,54 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/sites + method: GET + auth: + - oauth2: + - ONLINE_STORE_SITE_READ + docs: >- + Lists the Square Online sites that belong to a seller. Sites are listed + in descending order by the `created_at` date. + + + + __Note:__ Square Online APIs are publicly available as part of an early + access program. For more information, see [Early access program for + Square Online + APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + source: + openapi: openapi/openapi.json + display-name: ListSites + response: + docs: Success + type: root.ListSitesResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + sites: + - id: site_278075276488921835 + site_title: My Second Site + domain: mysite2.square.site + is_published: false + created_at: '2020-10-28T13:22:51.000000Z' + updated_at: '2020-10-28T13:22:51.000000Z' + - id: site_102725345836253849 + site_title: My First Site + domain: mysite1.square.site + is_published: true + created_at: '2020-06-18T17:45:13.000000Z' + updated_at: '2020-11-23T02:19:10.000000Z' + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/snippets.yml b/.mock/definition/snippets.yml new file mode 100644 index 000000000..b02dfe03c --- /dev/null +++ b/.mock/definition/snippets.yml @@ -0,0 +1,168 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + get: + path: /v2/sites/{site_id}/snippet + method: GET + auth: + - oauth2: + - ONLINE_STORE_SNIPPETS_READ + docs: >- + Retrieves your snippet from a Square Online site. A site can contain + snippets from multiple snippet applications, but you can retrieve only + the snippet that was added by your application. + + + You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of + the sites that belong to a seller. + + + + __Note:__ Square Online APIs are publicly available as part of an early + access program. For more information, see [Early access program for + Square Online + APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + source: + openapi: openapi/openapi.json + display-name: RetrieveSnippet + request: + name: GetSnippetsRequest + path-parameters: + site_id: + type: string + docs: The ID of the site that contains the snippet. + response: + docs: Success + type: root.GetSnippetResponse + status-code: 200 + examples: + - path-parameters: + site_id: site_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + snippet: + id: snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7 + site_id: site_278075276488921835 + content: + created_at: '2021-03-11T25:40:09.000000Z' + updated_at: '2021-03-11T25:40:09.000000Z' + upsert: + path: /v2/sites/{site_id}/snippet + method: POST + auth: + - oauth2: + - ONLINE_STORE_SNIPPETS_WRITE + docs: >- + Adds a snippet to a Square Online site or updates the existing snippet + on the site. + + The snippet code is appended to the end of the `head` element on every + page of the site, except checkout pages. A snippet application can add + one snippet to a given site. + + + You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of + the sites that belong to a seller. + + + + __Note:__ Square Online APIs are publicly available as part of an early + access program. For more information, see [Early access program for + Square Online + APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + source: + openapi: openapi/openapi.json + display-name: UpsertSnippet + request: + name: UpsertSnippetRequest + path-parameters: + site_id: + type: string + docs: The ID of the site where you want to add or update the snippet. + body: + properties: + snippet: + type: root.Snippet + docs: The snippet for the site. + content-type: application/json + response: + docs: Success + type: root.UpsertSnippetResponse + status-code: 200 + examples: + - path-parameters: + site_id: site_id + headers: + Square-Version: '2025-10-16' + request: + snippet: + content: + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + snippet: + id: snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7 + site_id: site_278075276488921835 + content: + created_at: '2021-03-11T25:40:09.000000Z' + updated_at: '2021-03-11T25:40:09.000000Z' + delete: + path: /v2/sites/{site_id}/snippet + method: DELETE + auth: + - oauth2: + - ONLINE_STORE_SNIPPETS_WRITE + docs: >- + Removes your snippet from a Square Online site. + + + You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of + the sites that belong to a seller. + + + + __Note:__ Square Online APIs are publicly available as part of an early + access program. For more information, see [Early access program for + Square Online + APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + source: + openapi: openapi/openapi.json + display-name: DeleteSnippet + request: + name: DeleteSnippetsRequest + path-parameters: + site_id: + type: string + docs: The ID of the site that contains the snippet. + response: + docs: Success + type: root.DeleteSnippetResponse + status-code: 200 + examples: + - path-parameters: + site_id: site_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/subscriptions.yml b/.mock/definition/subscriptions.yml new file mode 100644 index 000000000..0d2ca2664 --- /dev/null +++ b/.mock/definition/subscriptions.yml @@ -0,0 +1,1309 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/subscriptions + method: POST + auth: + - oauth2: + - CUSTOMERS_READ + - PAYMENTS_WRITE + - SUBSCRIPTIONS_WRITE + - ITEMS_READ + - ORDERS_WRITE + - INVOICES_WRITE + docs: >- + Enrolls a customer in a subscription. + + + If you provide a card on file in the request, Square charges the card + for + + the subscription. Otherwise, Square sends an invoice to the customer's + email + + address. The subscription starts immediately, unless the request + includes + + the optional `start_date`. Each individual subscription is associated + with a particular location. + + + For more information, see [Create a + subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription). + source: + openapi: openapi/openapi.json + display-name: CreateSubscription + request: + name: CreateSubscriptionRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies this `CreateSubscription` + request. + + If you do not provide a unique string (or provide an empty + string as the value), + + the endpoint treats each request as independent. + + + For more information, see [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + location_id: + type: string + docs: The ID of the location the subscription is associated with. + validation: + minLength: 1 + plan_variation_id: + type: optional + docs: >- + The ID of the [subscription plan + variation](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations#plan-variations) + created using the Catalog API. + customer_id: + type: string + docs: >- + The ID of the [customer](entity:Customer) subscribing to the + subscription plan variation. + validation: + minLength: 1 + start_date: + type: optional + docs: |- + The `YYYY-MM-DD`-formatted date to start the subscription. + If it is unspecified, the subscription starts immediately. + canceled_date: + type: optional + docs: >- + The `YYYY-MM-DD`-formatted date when the newly created + subscription is scheduled for cancellation. + + + This date overrides the cancellation date set in the plan + variation configuration. + + If the cancellation date is earlier than the end date of a + subscription cycle, the subscription stops + + at the canceled date and the subscriber is sent a prorated + invoice at the beginning of the canceled cycle. + + + When the subscription plan of the newly created subscription has + a fixed number of cycles and the `canceled_date` + + occurs before the subscription plan completes, the specified + `canceled_date` sets the date when the subscription + + stops through the end of the last cycle. + tax_percentage: + type: optional + docs: >- + The tax to add when billing the subscription. + + The percentage is expressed in decimal form, using a `'.'` as + the decimal + + separator and without a `'%'` sign. For example, a value of 7.5 + + corresponds to 7.5%. + validation: + maxLength: 10 + price_override_money: + type: optional + docs: >- + A custom price which overrides the cost of a subscription plan + variation with `STATIC` pricing. + + This field does not affect itemized subscriptions with + `RELATIVE` pricing. Instead, + + you should edit the Subscription's [order + template](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#phases-and-order-templates). + card_id: + type: optional + docs: >- + The ID of the [subscriber's](entity:Customer) + [card](entity:Card) to charge. + + If it is not specified, the subscriber receives an invoice via + email with a link to pay for their subscription. + timezone: + type: optional + docs: >- + The timezone that is used in date calculations for the + subscription. If unset, defaults to + + the location timezone. If a timezone is not configured for the + location, defaults to "America/New_York". + + Format: the IANA Timezone Database identifier for the location + timezone. For + + a list of time zones, see [List of tz database time + zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + source: + type: optional + docs: The origination details of the subscription. + monthly_billing_anchor_date: + type: optional + docs: The day-of-the-month to change the billing date to. + validation: + min: 1 + max: 31 + phases: + type: optional> + docs: array of phases for this subscription + content-type: application/json + response: + docs: Success + type: root.CreateSubscriptionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 8193148c-9586-11e6-99f9-28cfe92138cf + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2023-06-20' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + phases: + - ordinal: 0 + order_template_id: U2NaowWxzXwpsZU697x7ZHOAnCNZY + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 56214fb2-cc85-47a1-93bc-44f3766bb56f + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2023-06-20' + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + price_override_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + version: 1 + created_at: '2023-06-20T21:53:10Z' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - uid: 873451e0-745b-4e87-ab0b-c574933fe616 + ordinal: 0 + order_template_id: U2NaowWxzXwpsZU697x7ZHOAnCNZY + plan_phase_uid: X2Q2AONPB3RB64Y27S25QCZP + completed_date: completed_date + BulkSwapPlan: + path: /v2/subscriptions/bulk-swap-plan + method: POST + auth: + - oauth2: + - SUBSCRIPTIONS_WRITE + - SUBSCRIPTIONS_READ + - ITEMS_READ + docs: >- + Schedules a plan variation change for all active subscriptions under a + given plan + + variation. For more information, see [Swap Subscription Plan + Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). + source: + openapi: openapi/openapi.json + display-name: BulkSwapPlan + request: + name: BulkSwapPlanRequest + body: + properties: + new_plan_variation_id: + type: string + docs: |- + The ID of the new subscription plan variation. + + This field is required. + validation: + minLength: 1 + old_plan_variation_id: + type: string + docs: >- + The ID of the plan variation whose subscriptions should be + swapped. Active subscriptions + + using this plan variation will be subscribed to the new plan + variation on their next billing + + day. + validation: + minLength: 1 + location_id: + type: string + docs: >- + The ID of the location to associate with the swapped + subscriptions. + validation: + minLength: 1 + content-type: application/json + response: + docs: Success + type: root.BulkSwapPlanResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + new_plan_variation_id: FQ7CDXXWSLUJRPM3GFJSJGZ7 + old_plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + location_id: S8GWD5R9QB376 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + affected_subscriptions: 12 + search: + path: /v2/subscriptions/search + method: POST + auth: + - oauth2: + - SUBSCRIPTIONS_READ + docs: >- + Searches for subscriptions. + + + Results are ordered chronologically by subscription creation date. If + + the request specifies more than one location ID, + + the endpoint orders the result + + by location ID, and then by creation date within each location. If no + locations are given + + in the query, all locations are searched. + + + You can also optionally specify `customer_ids` to search by customer. + + If left unset, all customers + + associated with the specified locations are returned. + + If the request specifies customer IDs, the endpoint orders results + + first by location, within location by customer ID, and within + + customer by subscription creation date. + source: + openapi: openapi/openapi.json + display-name: SearchSubscriptions + request: + name: SearchSubscriptionsRequest + body: + properties: + cursor: + type: optional + docs: >- + When the total number of resulting subscriptions exceeds the + limit of a paged response, + + specify the cursor returned from a preceding response here to + fetch the next set of results. + + If the cursor is unset, the response contains the last page of + the results. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional + docs: |- + The upper limit on the number of subscriptions to return + in a paged response. + validation: + min: 1 + query: + type: optional + docs: >- + A subscription query consisting of specified filtering + conditions. + + + If this `query` field is unspecified, the `SearchSubscriptions` + call will return all subscriptions. + include: + type: optional> + docs: >- + An option to include related information in the response. + + + The supported values are: + + + - `actions`: to include scheduled actions on the targeted + subscriptions. + content-type: application/json + response: + docs: Success + type: root.SearchSubscriptionsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + customer_ids: + - CHFGVKYY8RSV93M5KCYTG4PN0G + location_ids: + - S8GWD5R9QB376 + source_names: + - My App + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscriptions: + - id: de86fc96-8664-474b-af1a-abbe59cacf0e + location_id: S8GWD5R9QB376 + plan_variation_id: L3TJVDHVBEQEGQDEZL2JJM7R + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2021-10-20' + canceled_date: '2021-10-30' + charged_through_date: '2021-11-20' + status: CANCELED + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + version: 1000000 + created_at: '2021-10-20T21:53:10Z' + card_id: ccof:mueUsvgajChmjEbp4GB + timezone: UTC + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + completed_date: completed_date + - id: 56214fb2-cc85-47a1-93bc-44f3766bb56f + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2022-01-19' + canceled_date: canceled_date + charged_through_date: '2022-08-19' + status: PAUSED + tax_percentage: '5' + invoice_ids: + - grebK0Q_l8H4fqoMMVvt-Q + - rcX_i3sNmHTGKhI4W2mceA + price_override_money: + amount: 1000 + currency: USD + version: 2 + created_at: '2022-01-19T21:53:10Z' + card_id: card_id + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + completed_date: completed_date + - id: 56214fb2-cc85-47a1-93bc-44f3766bb56f + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2023-06-20' + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + version: 1 + created_at: '2023-06-20T21:53:10Z' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - uid: 873451e0-745b-4e87-ab0b-c574933fe616 + ordinal: 0 + order_template_id: U2NaowWxzXwpsZU697x7ZHOAnCNZY + plan_phase_uid: X2Q2AONPB3RB64Y27S25QCZP + completed_date: completed_date + cursor: cursor + get: + path: /v2/subscriptions/{subscription_id} + method: GET + auth: + - oauth2: + - SUBSCRIPTIONS_READ + docs: Retrieves a specific subscription. + source: + openapi: openapi/openapi.json + display-name: RetrieveSubscription + request: + name: GetSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to retrieve. + query-parameters: + include: + type: optional> + docs: >- + A query parameter to specify related information to be included in + the response. + + + The supported query parameter values are: + + + - `actions`: to include scheduled actions on the targeted + subscription. + response: + docs: Success + type: root.GetSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + query-parameters: + include: include + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 8151fc89-da15-4eb9-a685-1a70883cebfc + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + start_date: '2022-07-27' + canceled_date: canceled_date + charged_through_date: '2023-11-20' + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + - inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA + price_override_money: + amount: 25000 + currency: USD + version: 1000000 + created_at: '2022-07-27T21:53:10Z' + card_id: ccof:IkWfpLj4tNHMyFii3GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + completed_date: completed_date + update: + path: /v2/subscriptions/{subscription_id} + method: PUT + auth: + - oauth2: + - CUSTOMERS_READ + - PAYMENTS_WRITE + - SUBSCRIPTIONS_WRITE + - ITEMS_READ + - ORDERS_WRITE + - INVOICES_WRITE + docs: >- + Updates a subscription by modifying or clearing `subscription` field + values. + + To clear a field, set its value to `null`. + source: + openapi: openapi/openapi.json + display-name: UpdateSubscription + request: + name: UpdateSubscriptionRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to update. + body: + properties: + subscription: + type: optional + docs: >- + The subscription object containing the current version, and + fields to update. + + Unset fields will be left at their current server values, and + JSON `null` values will + + be treated as a request to clear the relevant data. + content-type: application/json + response: + docs: Success + type: root.UpdateSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + request: + subscription: + card_id: '{NEW CARD ID}' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 7217d8ca-1fee-4446-a9e5-8540b5d8c9bb + location_id: LPJKHYR7WFDKN + plan_variation_id: XOUNEKCE6NSXQW5NTSQ73MMX + customer_id: AM69AB81FT4479YH9HGWS1HZY8 + start_date: '2023-01-30' + canceled_date: canceled_date + charged_through_date: '2023-03-13' + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - inv:0-ChAPSfVYvNewckgf3x4iigN_ENMM + - inv:0-ChBQaCCLfjcm9WEUBGxvuydJENMM + price_override_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + version: 3 + created_at: '2023-01-30T19:27:32Z' + card_id: '{NEW CARD ID}' + timezone: UTC + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + completed_date: completed_date + DeleteAction: + path: /v2/subscriptions/{subscription_id}/actions/{action_id} + method: DELETE + auth: + - oauth2: + - SUBSCRIPTIONS_WRITE + docs: Deletes a scheduled action for a subscription. + source: + openapi: openapi/openapi.json + display-name: DeleteSubscriptionAction + request: + name: DeleteActionSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription the targeted action is to act upon. + action_id: + type: string + docs: The ID of the targeted action to be deleted. + response: + docs: Success + type: root.DeleteSubscriptionActionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + action_id: action_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 8151fc89-da15-4eb9-a685-1a70883cebfc + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: JDKYHBWT1D4F8MFH63DBMEN8Y4 + start_date: '2022-07-27' + canceled_date: canceled_date + charged_through_date: '2023-11-20' + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + - inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA + price_override_money: + amount: 25000 + currency: USD + version: 1000000 + created_at: '2022-07-27T21:53:10Z' + card_id: ccof:IkWfpLj4tNHMyFii3GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + completed_date: completed_date + ChangeBillingAnchorDate: + path: /v2/subscriptions/{subscription_id}/billing-anchor + method: POST + auth: + - oauth2: + - SUBSCRIPTIONS_WRITE + - SUBSCRIPTIONS_READ + - ITEMS_READ + docs: >- + Changes the [billing anchor + date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates) + + for a subscription. + source: + openapi: openapi/openapi.json + display-name: ChangeBillingAnchorDate + request: + name: ChangeBillingAnchorDateRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to update the billing anchor date. + body: + properties: + monthly_billing_anchor_date: + type: optional> + docs: The anchor day for the billing cycle. + validation: + min: 1 + max: 31 + effective_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date when the scheduled + `BILLING_ANCHOR_CHANGE` action takes + + place on the subscription. + + + When this date is unspecified or falls within the current + billing cycle, the billing anchor date + + is changed immediately. + content-type: application/json + response: + docs: Success + type: root.ChangeBillingAnchorDateResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + request: + monthly_billing_anchor_date: 1 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 9ba40961-995a-4a3d-8c53-048c40cafc13 + location_id: S8GWD5R9QB376 + plan_variation_id: FQ7CDXXWSLUJRPM3GFJSJGZ7 + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: start_date + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + price_override_money: + amount: 2000 + currency: USD + version: 3 + created_at: '2023-06-20T21:53:10Z' + card_id: card_id + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 20 + phases: + - uid: 98d6f53b-40e1-4714-8827-032fd923be25 + ordinal: 0 + order_template_id: E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY + plan_phase_uid: C66BKH3ASTDYGJJCEZXQQSS7 + completed_date: completed_date + actions: + - id: f0a1dfdc-675b-3a14-a640-99f7ac1cee83 + type: CHANGE_BILLING_ANCHOR_DATE + effective_date: '2023-11-01' + monthly_billing_anchor_date: 1 + phases: + - {} + new_plan_variation_id: new_plan_variation_id + cancel: + path: /v2/subscriptions/{subscription_id}/cancel + method: POST + auth: + - oauth2: + - SUBSCRIPTIONS_WRITE + docs: >- + Schedules a `CANCEL` action to cancel an active subscription. This + + sets the `canceled_date` field to the end of the active billing period. + After this date, + + the subscription status changes from ACTIVE to CANCELED. + source: + openapi: openapi/openapi.json + display-name: CancelSubscription + request: + name: CancelSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to cancel. + response: + docs: Success + type: root.CancelSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 910afd30-464a-4e00-a8d8-2296e + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2022-01-19' + canceled_date: '2023-06-05' + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - inv:0-ChCHu2mZEabLeeHahQnXDjZQECY + - inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA + price_override_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + version: 3 + created_at: '2022-01-19T21:53:10Z' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - {} + completed_date: completed_date + actions: + - id: id + type: CANCEL + effective_date: effective_date + monthly_billing_anchor_date: 1 + phases: + - {} + new_plan_variation_id: new_plan_variation_id + listEvents: + path: /v2/subscriptions/{subscription_id}/events + method: GET + auth: + - oauth2: + - SUBSCRIPTIONS_READ + docs: >- + Lists all + [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) + for a specific subscription. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.subscription_events + source: + openapi: openapi/openapi.json + display-name: ListSubscriptionEvents + request: + name: ListEventsSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to retrieve the events for. + query-parameters: + cursor: + type: optional> + docs: >- + When the total number of resulting subscription events exceeds the + limit of a paged response, + + specify the cursor returned from a preceding response here to + fetch the next set of results. + + If the cursor is unset, the response contains the last page of the + results. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + limit: + type: optional> + docs: |- + The upper limit on the number of subscription events to return + in a paged response. + response: + docs: Success + type: root.ListSubscriptionEventsResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + query-parameters: + cursor: cursor + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription_events: + - id: 06809161-3867-4598-8269-8aea5be4f9de + subscription_event_type: START_SUBSCRIPTION + effective_date: '2020-04-24' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + - id: f2736603-cd2e-47ec-8675-f815fff54f88 + subscription_event_type: DEACTIVATE_SUBSCRIPTION + effective_date: '2020-05-01' + monthly_billing_anchor_date: 1 + info: + detail: >- + The customer with ID `V74BMG0GPS2KNCWJE1BTYJ37Y0` does not + have a name on record. + code: CUSTOMER_NO_NAME + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + - id: b426fc85-6859-450b-b0d0-fe3a5d1b565f + subscription_event_type: RESUME_SUBSCRIPTION + effective_date: '2022-05-01' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + - id: 09f14de1-2f53-4dae-9091-49aa53f83d01 + subscription_event_type: PAUSE_SUBSCRIPTION + effective_date: '2022-09-01' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + - id: f28a73ac-1a1b-4b0f-8eeb-709a72945776 + subscription_event_type: RESUME_SUBSCRIPTION + effective_date: '2022-12-01' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + - id: 1eee8790-472d-4efe-8c69-8ad84e9cefe0 + subscription_event_type: PLAN_CHANGE + effective_date: '2023-04-01' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 02CD53CFA4d1498AFAD42 + - id: a0c08083-5db0-4800-85c7-d398de4fbb6e + subscription_event_type: STOP_SUBSCRIPTION + effective_date: '2023-06-21' + monthly_billing_anchor_date: 1 + phases: + - {} + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + cursor: cursor + pause: + path: /v2/subscriptions/{subscription_id}/pause + method: POST + auth: + - oauth2: + - CUSTOMERS_READ + - PAYMENTS_WRITE + - SUBSCRIPTIONS_WRITE + - ITEMS_READ + - ORDERS_WRITE + - INVOICES_WRITE + docs: Schedules a `PAUSE` action to pause an active subscription. + source: + openapi: openapi/openapi.json + display-name: PauseSubscription + request: + name: PauseSubscriptionRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to pause. + body: + properties: + pause_effective_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date when the scheduled `PAUSE` + action takes place on the subscription. + + + When this date is unspecified or falls within the current + billing cycle, the subscription is paused + + on the starting date of the next billing cycle. + pause_cycle_duration: + type: optional> + docs: >- + The number of billing cycles the subscription will be paused + before it is reactivated. + + + When this is set, a `RESUME` action is also scheduled to take + place on the subscription at + + the end of the specified pause cycle duration. In this case, + neither `resume_effective_date` + + nor `resume_change_timing` may be specified. + resume_effective_date: + type: optional> + docs: >- + The date when the subscription is reactivated by a scheduled + `RESUME` action. + + This date must be at least one billing cycle ahead of + `pause_effective_date`. + resume_change_timing: + type: optional + docs: >- + The timing whether the subscription is reactivated immediately + or at the end of the billing cycle, relative to + + `resume_effective_date`. + + See [ChangeTiming](#type-changetiming) for possible values + pause_reason: + type: optional> + docs: The user-provided reason to pause the subscription. + validation: + maxLength: 255 + content-type: application/json + response: + docs: Success + type: root.PauseSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 56214fb2-cc85-47a1-93bc-44f3766bb56f + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2023-06-20' + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + price_override_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + version: 1 + created_at: '2023-06-20T21:53:10Z' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - uid: 873451e0-745b-4e87-ab0b-c574933fe616 + ordinal: 0 + order_template_id: U2NaowWxzXwpsZU697x7ZHOAnCNZY + plan_phase_uid: X2Q2AONPB3RB64Y27S25QCZP + completed_date: completed_date + actions: + - id: 99b2439e-63f7-3ad5-95f7-ab2447a80673 + type: PAUSE + effective_date: '2023-11-17' + monthly_billing_anchor_date: 1 + phases: + - {} + new_plan_variation_id: new_plan_variation_id + resume: + path: /v2/subscriptions/{subscription_id}/resume + method: POST + auth: + - oauth2: + - CUSTOMERS_READ + - PAYMENTS_WRITE + - SUBSCRIPTIONS_WRITE + - ITEMS_READ + - ORDERS_WRITE + - INVOICES_WRITE + docs: >- + Schedules a `RESUME` action to resume a paused or a deactivated + subscription. + source: + openapi: openapi/openapi.json + display-name: ResumeSubscription + request: + name: ResumeSubscriptionRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to resume. + body: + properties: + resume_effective_date: + type: optional> + docs: >- + The `YYYY-MM-DD`-formatted date when the subscription + reactivated. + resume_change_timing: + type: optional + docs: |- + The timing to resume a subscription, relative to the specified + `resume_effective_date` attribute value. + See [ChangeTiming](#type-changetiming) for possible values + content-type: application/json + response: + docs: Success + type: root.ResumeSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 56214fb2-cc85-47a1-93bc-44f3766bb56f + location_id: S8GWD5R9QB376 + plan_variation_id: 6JHXF3B2CW3YKHDV4XEM674H + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: '2023-06-20' + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + price_override_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + version: 1 + created_at: '2023-06-20T21:53:10Z' + card_id: ccof:qy5x8hHGYsgLrp4Q4GB + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - uid: 873451e0-745b-4e87-ab0b-c574933fe616 + ordinal: 0 + order_template_id: U2NaowWxzXwpsZU697x7ZHOAnCNZY + plan_phase_uid: X2Q2AONPB3RB64Y27S25QCZP + completed_date: completed_date + actions: + - id: 18ff74f4-3da4-30c5-929f-7d6fca84f115 + type: RESUME + effective_date: '2023-09-01' + monthly_billing_anchor_date: 1 + phases: + - {} + new_plan_variation_id: new_plan_variation_id + SwapPlan: + path: /v2/subscriptions/{subscription_id}/swap-plan + method: POST + auth: + - oauth2: + - CUSTOMERS_READ + - PAYMENTS_WRITE + - SUBSCRIPTIONS_WRITE + - ITEMS_READ + - ORDERS_WRITE + - INVOICES_WRITE + docs: >- + Schedules a `SWAP_PLAN` action to swap a subscription plan variation in + an existing subscription. + + For more information, see [Swap Subscription Plan + Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). + source: + openapi: openapi/openapi.json + display-name: SwapPlan + request: + name: SwapPlanRequest + path-parameters: + subscription_id: + type: string + docs: The ID of the subscription to swap the subscription plan for. + body: + properties: + new_plan_variation_id: + type: optional> + docs: |- + The ID of the new subscription plan variation. + + This field is required. + phases: + type: optional>> + docs: >- + A list of PhaseInputs, to pass phase-specific information used + in the swap. + content-type: application/json + response: + docs: Success + type: root.SwapPlanResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + request: + new_plan_variation_id: FQ7CDXXWSLUJRPM3GFJSJGZ7 + phases: + - ordinal: 0 + order_template_id: uhhnjH9osVv3shUADwaC0b3hNxQZY + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: 9ba40961-995a-4a3d-8c53-048c40cafc13 + location_id: S8GWD5R9QB376 + plan_variation_id: FQ7CDXXWSLUJRPM3GFJSJGZ7 + customer_id: CHFGVKYY8RSV93M5KCYTG4PN0G + start_date: start_date + canceled_date: canceled_date + charged_through_date: charged_through_date + status: ACTIVE + tax_percentage: tax_percentage + invoice_ids: + - invoice_ids + price_override_money: + amount: 2000 + currency: USD + version: 3 + created_at: '2023-06-20T21:53:10Z' + card_id: card_id + timezone: America/Los_Angeles + source: + name: My Application + actions: + - {} + monthly_billing_anchor_date: 1 + phases: + - uid: 98d6f53b-40e1-4714-8827-032fd923be25 + ordinal: 0 + order_template_id: E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY + plan_phase_uid: C66BKH3ASTDYGJJCEZXQQSS7 + completed_date: completed_date + actions: + - id: f0a1dfdc-675b-3a14-a640-99f7ac1cee83 + type: SWAP_PLAN + effective_date: '2023-11-17' + monthly_billing_anchor_date: 1 + phases: + - ordinal: 0 + order_template_id: uhhnjH9osVv3shUADwaC0b3hNxQZY + new_plan_variation_id: FQ7CDXXWSLUJRPM3GFJSJGZ7 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/team.yml b/.mock/definition/team.yml new file mode 100644 index 000000000..f09d0b699 --- /dev/null +++ b/.mock/definition/team.yml @@ -0,0 +1,228 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + ListJobs: + path: /v2/team-members/jobs + method: GET + auth: + - oauth2: + - EMPLOYEES_READ + docs: >- + Lists jobs in a seller account. Results are sorted by title in ascending + order. + source: + openapi: openapi/openapi.json + display-name: ListJobs + request: + name: ListJobsRequest + query-parameters: + cursor: + type: optional> + docs: >- + The pagination cursor returned by the previous call to this + endpoint. Provide this + + cursor to retrieve the next page of results for your original + request. For more information, + + see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + response: + docs: Success + type: root.ListJobsResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + headers: + Square-Version: '2025-10-16' + response: + body: + jobs: + - id: VDNpRv8da51NU8qZFC5zDWpF + title: Cashier + is_tip_eligible: true + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + version: 2 + - id: FjS8x95cqHiMenw4f1NAUH4P + title: Chef + is_tip_eligible: false + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + version: 1 + cursor: cursor + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + CreateJob: + path: /v2/team-members/jobs + method: POST + auth: + - oauth2: + - EMPLOYEES_WRITE + docs: >- + Creates a job in a seller account. A job defines a title and tip + eligibility. Note that + + compensation is defined in a [job assignment](entity:JobAssignment) in a + team member's wage setting. + source: + openapi: openapi/openapi.json + display-name: CreateJob + request: + name: CreateJobRequest + body: + properties: + job: + type: root.Job + docs: >- + The job to create. The `title` field is required and + `is_tip_eligible` defaults to true. + idempotency_key: + type: string + docs: >- + A unique identifier for the `CreateJob` request. Keys can be any + valid string, + + but must be unique for each request. For more information, see + + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). + validation: + minLength: 1 + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.CreateJobResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + job: + title: Cashier + is_tip_eligible: true + idempotency_key: idempotency-key-0 + response: + body: + job: + id: 1yJlHapkseYnNPETIU1B + title: Cashier + is_tip_eligible: true + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + version: 1 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + RetrieveJob: + path: /v2/team-members/jobs/{job_id} + method: GET + auth: + - oauth2: + - EMPLOYEES_READ + docs: Retrieves a specified job. + source: + openapi: openapi/openapi.json + display-name: RetrieveJob + request: + name: RetrieveJobRequest + path-parameters: + job_id: + type: string + docs: The ID of the job to retrieve. + response: + docs: Success + type: root.RetrieveJobResponse + status-code: 200 + examples: + - path-parameters: + job_id: job_id + headers: + Square-Version: '2025-10-16' + response: + body: + job: + id: 1yJlHapkseYnNPETIU1B + title: Cashier 1 + is_tip_eligible: true + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + version: 2 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + UpdateJob: + path: /v2/team-members/jobs/{job_id} + method: PUT + auth: + - oauth2: + - EMPLOYEES_WRITE + docs: >- + Updates the title or tip eligibility of a job. Changes to the title + propagate to all + + `JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference + the job ID. Changes to + + tip eligibility propagate to all `TeamMemberWage` objects that reference + the job ID. + source: + openapi: openapi/openapi.json + display-name: UpdateJob + request: + name: UpdateJobRequest + path-parameters: + job_id: + type: string + docs: The ID of the job to update. + body: + properties: + job: + type: root.Job + docs: >- + The job with the updated fields, either `title`, + `is_tip_eligible`, or both. Only changed fields need + + to be included in the request. Optionally include `version` to + enable optimistic concurrency control. + content-type: application/json + response: + docs: Success + type: root.UpdateJobResponse + status-code: 200 + examples: + - path-parameters: + job_id: job_id + headers: + Square-Version: '2025-10-16' + request: + job: + title: Cashier 1 + is_tip_eligible: true + response: + body: + job: + id: 1yJlHapkseYnNPETIU1B + title: Cashier 1 + is_tip_eligible: true + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-13T12:55:45Z' + version: 2 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/teamMembers.yml b/.mock/definition/teamMembers.yml new file mode 100644 index 000000000..b2c6a0d8b --- /dev/null +++ b/.mock/definition/teamMembers.yml @@ -0,0 +1,789 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/team-members + method: POST + auth: + - oauth2: + - EMPLOYEES_WRITE + docs: >- + Creates a single `TeamMember` object. The `TeamMember` object is + returned on successful creates. + + You must provide the following values in your request to this endpoint: + + - `given_name` + + - `family_name` + + + Learn about [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#createteammember). + source: + openapi: openapi/openapi.json + display-name: CreateTeamMember + request: + body: root.CreateTeamMemberRequest + content-type: application/json + response: + docs: Success + type: root.CreateTeamMemberResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: idempotency-key-0 + team_member: + reference_id: reference_id_1 + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@gmail.com + phone_number: '+14159283333' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - YSGH2WBKG94QZ + - GA2Y9HSJ8KRYT + wage_setting: + job_assignments: + - pay_type: SALARY + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + response: + body: + team_member: + id: 1yJlHapkseYnNPETIU1B + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@example.com + phone_number: '+14159283333' + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - GA2Y9HSJ8KRYT + - YSGH2WBKG94QZ + wage_setting: + team_member_id: 1yJlHapkseYnNPETIU1B + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 1443 + currency: USD + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchCreate: + path: /v2/team-members/bulk-create + method: POST + auth: + - oauth2: + - EMPLOYEES_WRITE + docs: >- + Creates multiple `TeamMember` objects. The created `TeamMember` objects + are returned on successful creates. + + This process is non-transactional and processes as much of the request + as possible. If one of the creates in + + the request cannot be successfully processed, the request is not marked + as failed, but the body of the response + + contains explicit error information for the failed create. + + + Learn about [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members). + source: + openapi: openapi/openapi.json + display-name: BulkCreateTeamMembers + request: + name: BatchCreateTeamMembersRequest + body: + properties: + team_members: + type: map + docs: >- + The data used to create the `TeamMember` objects. Each key is + the `idempotency_key` that maps to the + `CreateTeamMemberRequest`. + + The maximum number of create objects is 25. + + + If you include a team member's `wage_setting`, you must provide + `job_id` for each job assignment. To get job IDs, + + call [ListJobs](api-endpoint:Team-ListJobs). + content-type: application/json + response: + docs: Success + type: root.BatchCreateTeamMembersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + team_members: + idempotency-key-1: + team_member: + reference_id: reference_id_1 + given_name: Joe + family_name: Doe + email_address: joe_doe@gmail.com + phone_number: '+14159283333' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - YSGH2WBKG94QZ + - GA2Y9HSJ8KRYT + idempotency-key-2: + team_member: + reference_id: reference_id_2 + given_name: Jane + family_name: Smith + email_address: jane_smith@gmail.com + phone_number: '+14159223334' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + response: + body: + team_members: + idempotency-key-1: + team_member: + id: ywhG1qfIOoqsHfVRubFV + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@gmail.com + phone_number: '+14159283333' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - GA2Y9HSJ8KRYT + - YSGH2WBKG94QZ + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + idempotency-key-2: + team_member: + id: IF_Ncrg7fHhCqxVI9T6R + reference_id: reference_id_2 + is_owner: false + status: ACTIVE + given_name: Jane + family_name: Smith + email_address: jane_smith@gmail.com + phone_number: '+14159223334' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + batchUpdate: + path: /v2/team-members/bulk-update + method: POST + auth: + - oauth2: + - EMPLOYEES_WRITE + docs: >- + Updates multiple `TeamMember` objects. The updated `TeamMember` objects + are returned on successful updates. + + This process is non-transactional and processes as much of the request + as possible. If one of the updates in + + the request cannot be successfully processed, the request is not marked + as failed, but the body of the response + + contains explicit error information for the failed update. + + Learn about [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members). + source: + openapi: openapi/openapi.json + display-name: BulkUpdateTeamMembers + request: + name: BatchUpdateTeamMembersRequest + body: + properties: + team_members: + type: map + docs: >- + The data used to update the `TeamMember` objects. Each key is + the `team_member_id` that maps to the `UpdateTeamMemberRequest`. + + The maximum number of update objects is 25. + + + For each team member, include the fields to add, change, or + clear. Fields can be cleared using a null value. + + To update `wage_setting.job_assignments`, you must provide the + complete list of job assignments. If needed, + + call [ListJobs](api-endpoint:Team-ListJobs) to get the required + `job_id` values. + content-type: application/json + response: + docs: Success + type: root.BatchUpdateTeamMembersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + team_members: + AFMwA08kR-MIF-3Vs0OE: + team_member: + reference_id: reference_id_2 + is_owner: false + status: ACTIVE + given_name: Jane + family_name: Smith + email_address: jane_smith@gmail.com + phone_number: '+14159223334' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + fpgteZNMaf0qOK-a4t6P: + team_member: + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@gmail.com + phone_number: '+14159283333' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - YSGH2WBKG94QZ + - GA2Y9HSJ8KRYT + response: + body: + team_members: + AFMwA08kR-MIF-3Vs0OE: + team_member: + id: AFMwA08kR-MIF-3Vs0OE + reference_id: reference_id_2 + is_owner: false + status: ACTIVE + given_name: Jane + family_name: Smith + email_address: jane_smith@example.com + phone_number: '+14159223334' + created_at: '2020-03-24T18:14:00Z' + updated_at: '2020-03-24T18:18:00Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + fpgteZNMaf0qOK-a4t6P: + team_member: + id: fpgteZNMaf0qOK-a4t6P + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@example.com + phone_number: '+14159283333' + created_at: '2020-03-24T18:14:00Z' + updated_at: '2020-03-24T18:18:00Z' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - GA2Y9HSJ8KRYT + - YSGH2WBKG94QZ + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/team-members/search + method: POST + auth: + - oauth2: + - EMPLOYEES_READ + docs: >- + Returns a paginated list of `TeamMember` objects for a business. + + The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, + or whether + + the team member is the Square account owner. + source: + openapi: openapi/openapi.json + display-name: SearchTeamMembers + request: + name: SearchTeamMembersRequest + body: + properties: + query: + type: optional + docs: The query parameters. + limit: + type: optional + docs: >- + The maximum number of `TeamMember` objects in a page (100 by + default). + validation: + min: 1 + max: 200 + cursor: + type: optional + docs: >- + The opaque cursor for fetching the next page. For more + information, see + + [pagination](https://developer.squareup.com/docs/working-with-apis/pagination). + content-type: application/json + response: + docs: Success + type: root.SearchTeamMembersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + location_ids: + - 0G5P3VGACMMQZ + status: ACTIVE + limit: 10 + response: + body: + team_members: + - id: '-3oZQKPKVk6gUXU_V5Qa' + reference_id: '12345678' + is_owner: false + status: ACTIVE + given_name: Johnny + family_name: Cash + email_address: johnny_cash@squareup.com + phone_number: phone_number + created_at: '2019-07-10T17:26:48Z' + updated_at: '2020-04-28T21:49:28Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + wage_setting: + team_member_id: '-3oZQKPKVk6gUXU_V5Qa' + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 1443 + currency: USD + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + - id: 1AVJj0DjkzbmbJw5r4KK + reference_id: abcded + is_owner: false + status: ACTIVE + given_name: Lombard + family_name: Smith + email_address: email_address + phone_number: '+14155552671' + created_at: '2020-03-24T18:14:01Z' + updated_at: '2020-06-09T17:38:05Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + wage_setting: + team_member_id: 1AVJj0DjkzbmbJw5r4KK + job_assignments: + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2400 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 2 + created_at: '2020-03-24T18:14:01Z' + updated_at: '2020-06-09T17:38:05Z' + - id: 2JCmiJol_KKFs9z2Evim + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Monica + family_name: Sway + email_address: email_address + phone_number: phone_number + created_at: '2020-03-24T01:09:25Z' + updated_at: '2020-03-24T01:11:25Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + wage_setting: + team_member_id: 2JCmiJol_KKFs9z2Evim + job_assignments: + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2400 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2020-03-24T01:09:25Z' + updated_at: '2020-03-24T01:09:25Z' + - id: 4uXcJQSLtbk3F0UQHFNQ + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Elton + family_name: Ipsum + email_address: email_address + phone_number: phone_number + created_at: '2020-03-24T01:09:23Z' + updated_at: '2020-03-24T01:15:23Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + - id: 5CoUpyrw1YwGWcRd-eDL + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Steven + family_name: Lo + email_address: email_address + phone_number: phone_number + created_at: '2020-03-24T01:09:23Z' + updated_at: '2020-03-24T01:19:23Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + - id: 5MRPTTp8MMBLVSmzrGha + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Patrick + family_name: Steward + email_address: email_address + phone_number: '+14155552671' + created_at: '2020-03-24T18:14:03Z' + updated_at: '2020-03-24T18:18:03Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + wage_setting: + team_member_id: 5MRPTTp8MMBLVSmzrGha + job_assignments: + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2020-03-24T18:14:03Z' + updated_at: '2020-03-24T18:14:03Z' + - id: 7F5ZxsfRnkexhu1PTbfh + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Ivy + family_name: Manny + email_address: email_address + phone_number: phone_number + created_at: '2020-03-24T01:09:25Z' + updated_at: '2020-03-24T01:09:25Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + - id: 808X9HR72yKvVaigQXf4 + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: John + family_name: Smith + email_address: john_smith@example.com + phone_number: '+14155552671' + created_at: '2020-03-24T18:14:02Z' + updated_at: '2020-03-24T18:14:02Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + - id: 9MVDVoY4hazkWKGo_OuZ + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Robert + family_name: Wen + email_address: r_wen@example.com + phone_number: '+14155552671' + created_at: '2020-03-24T18:14:00Z' + updated_at: '2020-03-24T18:14:00Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + - id: 9UglUjOXQ13-hMFypCft + reference_id: reference_id + is_owner: false + status: ACTIVE + given_name: Ashley + family_name: Simpson + email_address: asimpson@example.com + phone_number: '+14155552671' + created_at: '2020-03-24T18:14:00Z' + updated_at: '2020-03-24T18:18:00Z' + assigned_locations: + assignment_type: ALL_CURRENT_AND_FUTURE_LOCATIONS + wage_setting: + team_member_id: 9UglUjOXQ13-hMFypCft + job_assignments: + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2020-03-24T18:14:00Z' + updated_at: '2020-03-24T18:14:03Z' + cursor: N:9UglUjOXQ13-hMFypCft + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/team-members/{team_member_id} + method: GET + auth: + - oauth2: + - EMPLOYEES_READ + docs: >- + Retrieves a `TeamMember` object for the given `TeamMember.id`. + + Learn about [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member). + source: + openapi: openapi/openapi.json + display-name: RetrieveTeamMember + request: + name: GetTeamMembersRequest + path-parameters: + team_member_id: + type: string + docs: The ID of the team member to retrieve. + response: + docs: Success + type: root.GetTeamMemberResponse + status-code: 200 + examples: + - path-parameters: + team_member_id: team_member_id + headers: + Square-Version: '2025-10-16' + response: + body: + team_member: + id: 1yJlHapkseYnNPETIU1B + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@example.com + phone_number: '+14159283333' + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-15T17:38:05Z' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - GA2Y9HSJ8KRYT + - YSGH2WBKG94QZ + wage_setting: + team_member_id: 1yJlHapkseYnNPETIU1B + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 1443 + currency: USD + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/team-members/{team_member_id} + method: PUT + auth: + - oauth2: + - EMPLOYEES_WRITE + docs: >- + Updates a single `TeamMember` object. The `TeamMember` object is + returned on successful updates. + + Learn about [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member). + source: + openapi: openapi/openapi.json + display-name: UpdateTeamMember + request: + body: root.UpdateTeamMemberRequest + path-parameters: + team_member_id: + type: string + docs: The ID of the team member to update. + name: UpdateTeamMembersRequest + content-type: application/json + response: + docs: Success + type: root.UpdateTeamMemberResponse + status-code: 200 + examples: + - path-parameters: + team_member_id: team_member_id + headers: + Square-Version: '2025-10-16' + request: + team_member: + reference_id: reference_id_1 + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@gmail.com + phone_number: '+14159283333' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - YSGH2WBKG94QZ + - GA2Y9HSJ8KRYT + wage_setting: + job_assignments: + - pay_type: SALARY + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - pay_type: HOURLY + hourly_rate: + amount: 1200 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + response: + body: + team_member: + id: 1yJlHapkseYnNPETIU1B + reference_id: reference_id_1 + is_owner: false + status: ACTIVE + given_name: Joe + family_name: Doe + email_address: joe_doe@example.com + phone_number: '+14159283333' + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-15T17:38:05Z' + assigned_locations: + assignment_type: EXPLICIT_LOCATIONS + location_ids: + - GA2Y9HSJ8KRYT + - YSGH2WBKG94QZ + wage_setting: + team_member_id: 1yJlHapkseYnNPETIU1B + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 1443 + currency: USD + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + job_id: FjS8x95cqHiMenw4f1NAUH4P + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 1200 + currency: USD + job_id: VDNpRv8da51NU8qZFC5zDWpF + is_overtime_exempt: true + version: 1 + created_at: '2021-06-11T22:55:45Z' + updated_at: '2021-06-11T22:55:45Z' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/teamMembers/wageSetting.yml b/.mock/definition/teamMembers/wageSetting.yml new file mode 100644 index 000000000..1b7471c42 --- /dev/null +++ b/.mock/definition/teamMembers/wageSetting.yml @@ -0,0 +1,178 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + get: + path: /v2/team-members/{team_member_id}/wage-setting + method: GET + auth: + - oauth2: + - EMPLOYEES_READ + docs: >- + Retrieves a `WageSetting` object for a team member specified + + by `TeamMember.id`. For more information, see + + [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting). + + + Square recommends using + [RetrieveTeamMember](api-endpoint:Team-RetrieveTeamMember) or + [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) + + to get this information directly from the `TeamMember.wage_setting` + field. + source: + openapi: openapi/openapi.json + display-name: RetrieveWageSetting + request: + name: GetWageSettingRequest + path-parameters: + team_member_id: + type: string + docs: The ID of the team member for which to retrieve the wage setting. + response: + docs: Success + type: root.GetWageSettingResponse + status-code: 200 + examples: + - path-parameters: + team_member_id: team_member_id + headers: + Square-Version: '2025-10-16' + response: + body: + wage_setting: + team_member_id: 1yJlHapkseYnNPETIU1B + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 2164 + currency: USD + annual_rate: + amount: 4500000 + currency: USD + weekly_hours: 40 + is_overtime_exempt: false + version: 1 + created_at: '2020-06-11T23:01:21+00:00' + updated_at: '2020-06-11T23:01:21+00:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/team-members/{team_member_id}/wage-setting + method: PUT + auth: + - oauth2: + - EMPLOYEES_WRITE + docs: >- + Creates or updates a `WageSetting` object. The object is created if a + + `WageSetting` with the specified `team_member_id` doesn't exist. + Otherwise, + + it fully replaces the `WageSetting` object for the team member. + + The `WageSetting` is returned on a successful update. For more + information, see + + [Troubleshooting the Team + API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting). + + + Square recommends using + [CreateTeamMember](api-endpoint:Team-CreateTeamMember) or + [UpdateTeamMember](api-endpoint:Team-UpdateTeamMember) + + to manage the `TeamMember.wage_setting` field directly. + source: + openapi: openapi/openapi.json + display-name: UpdateWageSetting + request: + name: UpdateWageSettingRequest + path-parameters: + team_member_id: + type: string + docs: >- + The ID of the team member for which to update the `WageSetting` + object. + body: + properties: + wage_setting: + type: root.WageSetting + docs: >- + The complete `WageSetting` object. For all job assignments, + specify one of the following: + + - `job_id` (recommended) - If needed, call + [ListJobs](api-endpoint:Team-ListJobs) to get a list of all + jobs. + + Requires Square API version 2024-12-18 or later. + + - `job_title` - Use the exact, case-sensitive spelling of an + existing title unless you want to create a new job. + + This value is ignored if `job_id` is also provided. + content-type: application/json + response: + docs: Success + type: root.UpdateWageSettingResponse + status-code: 200 + examples: + - path-parameters: + team_member_id: team_member_id + headers: + Square-Version: '2025-10-16' + request: + wage_setting: + job_assignments: + - job_title: Manager + pay_type: SALARY + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + is_overtime_exempt: true + response: + body: + wage_setting: + team_member_id: '-3oZQKPKVk6gUXU_V5Qa' + job_assignments: + - job_title: Manager + pay_type: SALARY + hourly_rate: + amount: 1443 + currency: USD + annual_rate: + amount: 3000000 + currency: USD + weekly_hours: 40 + - job_title: Cashier + pay_type: HOURLY + hourly_rate: + amount: 2000 + currency: USD + is_overtime_exempt: true + version: 1 + created_at: '2019-07-10T17:26:48+00:00' + updated_at: '2020-06-11T23:12:04+00:00' + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/terminal.yml b/.mock/definition/terminal.yml new file mode 100644 index 000000000..0793a9e6d --- /dev/null +++ b/.mock/definition/terminal.yml @@ -0,0 +1,241 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + DismissTerminalAction: + path: /v2/terminals/actions/{action_id}/dismiss + method: POST + auth: + - oauth2: [] + docs: >- + Dismisses a Terminal action request if the status and type of the + request permits it. + + + See [Link and Dismiss + Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) + for more details. + source: + openapi: openapi/openapi.json + display-name: DismissTerminalAction + request: + name: DismissTerminalActionRequest + path-parameters: + action_id: + type: string + docs: >- + Unique ID for the `TerminalAction` associated with the action to + be dismissed. + response: + docs: Success + type: root.DismissTerminalActionResponse + status-code: 200 + examples: + - path-parameters: + action_id: action_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + action: + id: termapia:abcdefg1234567 + device_id: DEVICE_ID + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + created_at: '2021-07-28T23:22:07.476Z' + updated_at: '2021-07-28T23:22:29.511Z' + app_id: APP_ID + location_id: location_id + type: CONFIRMATION + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: customer_id + card_id: card_id + reference_id: reference_id + signature_options: + title: title + body: body + signature: + - {} + confirmation_options: + title: Marketing communications + body: >- + I agree to receive promotional emails about future events + and activities. + agree_button_text: Agree + disagree_button_text: Decline + decision: + has_agreed: true + receipt_options: + payment_id: payment_id + print_only: true + is_duplicate: true + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + selected_option: + reference_id: reference_id + title: title + device_metadata: + battery_percentage: battery_percentage + charging_state: charging_state + location_id: location_id + merchant_id: merchant_id + network_connection_type: network_connection_type + payment_region: payment_region + serial_number: serial_number + os_version: os_version + app_version: app_version + wifi_network_name: wifi_network_name + wifi_network_strength: wifi_network_strength + ip_address: ip_address + await_next_action: true + await_next_action_duration: PT5M + DismissTerminalCheckout: + path: /v2/terminals/checkouts/{checkout_id}/dismiss + method: POST + auth: + - oauth2: [] + docs: >- + Dismisses a Terminal checkout request if the status and type of the + request permits it. + source: + openapi: openapi/openapi.json + display-name: DismissTerminalCheckout + request: + name: DismissTerminalCheckoutRequest + path-parameters: + checkout_id: + type: string + docs: >- + Unique ID for the `TerminalCheckout` associated with the checkout + to be dismissed. + response: + docs: Success + type: root.DismissTerminalCheckoutResponse + status-code: 200 + examples: + - path-parameters: + checkout_id: checkout_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + checkout: + id: LmZEKbo3SBfqO + amount_money: + amount: 2610 + currency: USD + reference_id: reference_id + note: note + order_id: order_id + payment_options: + autocomplete: true + delay_duration: delay_duration + accept_partial_authorization: true + delay_action: CANCEL + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: false + collect_signature: true + tip_settings: + allow_tipping: true + separate_tip_screen: true + custom_tip_field: false + show_itemized_cart: true + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + payment_ids: + - D7vLJqMkvSoAlX4yyFzUitOy4EPZY + created_at: '2023-11-29T14:59:50.682Z' + updated_at: '2023-11-29T15:00:18.936Z' + app_id: APP_ID + location_id: LOCATION_ID + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + statement_description_identifier: statement_description_identifier + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + DismissTerminalRefund: + path: /v2/terminals/refunds/{terminal_refund_id}/dismiss + method: POST + auth: + - oauth2: [] + docs: >- + Dismisses a Terminal refund request if the status and type of the + request permits it. + source: + openapi: openapi/openapi.json + display-name: DismissTerminalRefund + request: + name: DismissTerminalRefundRequest + path-parameters: + terminal_refund_id: + type: string + docs: >- + Unique ID for the `TerminalRefund` associated with the refund to + be dismissed. + response: + docs: Success + type: root.DismissTerminalRefundResponse + status-code: 200 + examples: + - path-parameters: + terminal_refund_id: terminal_refund_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: vjkNb2HD-xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY + refund_id: refund_id + payment_id: xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY + order_id: s8OMhQcpEp1b61YywlccSHWqUaQZY + amount_money: + amount: 111 + currency: CAD + reason: Returning item + device_id: 47776348fd8b32b9 + deadline_duration: PT5M + status: IN_PROGRESS + cancel_reason: BUYER_CANCELED + created_at: '2023-11-30T16:16:39.299Z' + updated_at: '2023-11-30T16:16:57.863Z' + app_id: APP_ID + location_id: location_id + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/terminal/actions.yml b/.mock/definition/terminal/actions.yml new file mode 100644 index 000000000..e7c8d16ca --- /dev/null +++ b/.mock/definition/terminal/actions.yml @@ -0,0 +1,464 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/terminals/actions + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: Creates a Terminal action request and sends it to the specified device. + source: + openapi: openapi/openapi.json + display-name: CreateTerminalAction + request: + name: CreateTerminalActionRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreateAction` request. + Keys can be any valid string + + but must be unique for every `CreateAction` request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more + + information. + validation: + minLength: 1 + maxLength: 64 + action: + type: root.TerminalAction + docs: The Action to create. + content-type: application/json + response: + docs: Success + type: root.CreateTerminalActionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e + action: + device_id: '{{DEVICE_ID}}' + deadline_duration: PT5M + type: SAVE_CARD + save_card_options: + customer_id: '{{CUSTOMER_ID}}' + reference_id: user-id-1 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + action: + id: termapia:jveJIAkkAjILHkdCE + device_id: DEVICE_ID + deadline_duration: PT5M + status: PENDING + cancel_reason: BUYER_CANCELED + created_at: '2021-07-28T23:22:07.476Z' + updated_at: '2021-07-28T23:22:07.476Z' + app_id: APP_ID + location_id: LOCATION_ID + type: SAVE_CARD + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: CUSTOMER_ID + card_id: card_id + reference_id: user-id-1 + signature_options: + title: title + body: body + signature: + - {} + confirmation_options: + title: title + body: body + agree_button_text: agree_button_text + disagree_button_text: disagree_button_text + receipt_options: + payment_id: payment_id + print_only: true + is_duplicate: true + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + selected_option: + reference_id: reference_id + title: title + device_metadata: + battery_percentage: battery_percentage + charging_state: charging_state + location_id: location_id + merchant_id: merchant_id + network_connection_type: network_connection_type + payment_region: payment_region + serial_number: serial_number + os_version: os_version + app_version: app_version + wifi_network_name: wifi_network_name + wifi_network_strength: wifi_network_strength + ip_address: ip_address + await_next_action: true + await_next_action_duration: await_next_action_duration + search: + path: /v2/terminals/actions/search + method: POST + auth: + - oauth2: + - PAYMENTS_READ + docs: >- + Retrieves a filtered list of Terminal action requests created by the + account making the request. Terminal action requests are available for + 30 days. + source: + openapi: openapi/openapi.json + display-name: SearchTerminalActions + request: + name: SearchTerminalActionsRequest + body: + properties: + query: + type: optional + docs: >- + Queries terminal actions based on given conditions and sort + order. + + Leaving this unset will return all actions with the default sort + order. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this to retrieve the next set of results for the + original query. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more + + information. + limit: + type: optional + docs: Limit the number of results returned for a single request. + validation: + min: 1 + max: 100 + content-type: application/json + response: + docs: Success + type: root.SearchTerminalActionsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + created_at: + start_at: '2022-04-01T00:00:00.000Z' + sort: + sort_order: DESC + limit: 2 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + action: + - id: termapia:oBGWlAats8xWCiCE + device_id: DEVICE_ID + deadline_duration: PT5M + status: IN_PROGRESS + cancel_reason: BUYER_CANCELED + created_at: '2022-04-08T15:14:04.895Z' + updated_at: '2022-04-08T15:14:05.446Z' + app_id: APP_ID + location_id: LOCATION_ID + type: SAVE_CARD + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: CUSTOMER_ID + reference_id: user-id-1 + signature_options: + title: title + body: body + confirmation_options: + title: title + body: body + agree_button_text: agree_button_text + receipt_options: + payment_id: payment_id + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + await_next_action: true + await_next_action_duration: await_next_action_duration + - id: termapia:K2NY2YSSml3lTiCE + device_id: DEVICE_ID + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + created_at: '2022-04-08T15:14:01.210Z' + updated_at: '2022-04-08T15:14:09.861Z' + app_id: APP_ID + location_id: LOCATION_ID + type: SAVE_CARD + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: CUSTOMER_ID + card_id: ccof:CARD_ID + reference_id: user-id-1 + signature_options: + title: title + body: body + confirmation_options: + title: title + body: body + agree_button_text: agree_button_text + receipt_options: + payment_id: payment_id + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + await_next_action: true + await_next_action_duration: await_next_action_duration + cursor: CURSOR + get: + path: /v2/terminals/actions/{action_id} + method: GET + auth: + - oauth2: + - PAYMENTS_READ + docs: >- + Retrieves a Terminal action request by `action_id`. Terminal action + requests are available for 30 days. + source: + openapi: openapi/openapi.json + display-name: GetTerminalAction + request: + name: GetActionsRequest + path-parameters: + action_id: + type: string + docs: Unique ID for the desired `TerminalAction`. + response: + docs: Success + type: root.GetTerminalActionResponse + status-code: 200 + examples: + - path-parameters: + action_id: action_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + action: + id: termapia:jveJIAkkAjILHkdCE + device_id: DEVICE_ID + deadline_duration: PT5M + status: IN_PROGRESS + cancel_reason: BUYER_CANCELED + created_at: '2021-07-28T23:22:07.476Z' + updated_at: '2021-07-28T23:22:08.301Z' + app_id: APP_ID + location_id: LOCATION_ID + type: SAVE_CARD + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: CUSTOMER_ID + card_id: card_id + reference_id: user-id-1 + signature_options: + title: title + body: body + signature: + - {} + confirmation_options: + title: title + body: body + agree_button_text: agree_button_text + disagree_button_text: disagree_button_text + receipt_options: + payment_id: payment_id + print_only: true + is_duplicate: true + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + selected_option: + reference_id: reference_id + title: title + device_metadata: + battery_percentage: battery_percentage + charging_state: charging_state + location_id: location_id + merchant_id: merchant_id + network_connection_type: network_connection_type + payment_region: payment_region + serial_number: serial_number + os_version: os_version + app_version: app_version + wifi_network_name: wifi_network_name + wifi_network_strength: wifi_network_strength + ip_address: ip_address + await_next_action: true + await_next_action_duration: await_next_action_duration + cancel: + path: /v2/terminals/actions/{action_id}/cancel + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Cancels a Terminal action request if the status of the request permits + it. + source: + openapi: openapi/openapi.json + display-name: CancelTerminalAction + request: + name: CancelActionsRequest + path-parameters: + action_id: + type: string + docs: Unique ID for the desired `TerminalAction`. + response: + docs: Success + type: root.CancelTerminalActionResponse + status-code: 200 + examples: + - path-parameters: + action_id: action_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + action: + id: termapia:jveJIAkkAjILHkdCE + device_id: DEVICE_ID + deadline_duration: PT5M + status: CANCELED + cancel_reason: SELLER_CANCELED + created_at: '2021-07-28T23:22:07.476Z' + updated_at: '2021-07-28T23:22:29.511Z' + app_id: APP_ID + location_id: LOCATION_ID + type: SAVE_CARD + qr_code_options: + title: title + body: body + barcode_contents: barcode_contents + save_card_options: + customer_id: CUSTOMER_ID + card_id: card_id + reference_id: user-id-1 + signature_options: + title: title + body: body + signature: + - {} + confirmation_options: + title: title + body: body + agree_button_text: agree_button_text + disagree_button_text: disagree_button_text + receipt_options: + payment_id: payment_id + print_only: true + is_duplicate: true + data_collection_options: + title: title + body: body + input_type: EMAIL + select_options: + title: title + body: body + options: + - reference_id: reference_id + title: title + selected_option: + reference_id: reference_id + title: title + device_metadata: + battery_percentage: battery_percentage + charging_state: charging_state + location_id: location_id + merchant_id: merchant_id + network_connection_type: network_connection_type + payment_region: payment_region + serial_number: serial_number + os_version: os_version + app_version: app_version + wifi_network_name: wifi_network_name + wifi_network_strength: wifi_network_strength + ip_address: ip_address + await_next_action: true + await_next_action_duration: await_next_action_duration + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/terminal/checkouts.yml b/.mock/definition/terminal/checkouts.yml new file mode 100644 index 000000000..cfa737848 --- /dev/null +++ b/.mock/definition/terminal/checkouts.yml @@ -0,0 +1,370 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/terminals/checkouts + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Creates a Terminal checkout request and sends it to the specified device + to take a payment + + for the requested amount. + source: + openapi: openapi/openapi.json + display-name: CreateTerminalCheckout + request: + name: CreateTerminalCheckoutRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreateCheckout` request. + Keys can be any valid string but + + must be unique for every `CreateCheckout` request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 64 + checkout: + type: root.TerminalCheckout + docs: The checkout to create. + content-type: application/json + response: + docs: Success + type: root.CreateTerminalCheckoutResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 28a0c3bc-7839-11ea-bc55-0242ac130003 + checkout: + amount_money: + amount: 2610 + currency: USD + reference_id: id11572 + note: A brief note + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + checkout: + id: 08YceKh7B3ZqO + amount_money: + amount: 2610 + currency: USD + reference_id: id11572 + note: A brief note + order_id: order_id + payment_options: + autocomplete: true + delay_duration: delay_duration + accept_partial_authorization: true + delay_action: CANCEL + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: false + collect_signature: true + tip_settings: + allow_tipping: false + show_itemized_cart: true + deadline_duration: PT5M + status: PENDING + cancel_reason: BUYER_CANCELED + payment_ids: + - payment_ids + created_at: '2020-04-06T16:39:32.545Z' + updated_at: '2020-04-06T16:39:32.545Z' + app_id: APP_ID + location_id: LOCATION_ID + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + statement_description_identifier: statement_description_identifier + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + search: + path: /v2/terminals/checkouts/search + method: POST + auth: + - oauth2: + - PAYMENTS_READ + docs: >- + Returns a filtered list of Terminal checkout requests created by the + application making the request. Only Terminal checkout requests created + for the merchant scoped to the OAuth token are returned. Terminal + checkout requests are available for 30 days. + source: + openapi: openapi/openapi.json + display-name: SearchTerminalCheckouts + request: + name: SearchTerminalCheckoutsRequest + body: + properties: + query: + type: optional + docs: >- + Queries Terminal checkouts based on given conditions and the + sort order. + + Leaving these unset returns all checkouts with the default sort + order. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + + See + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) + for more information. + limit: + type: optional + docs: Limits the number of results returned for a single request. + validation: + min: 1 + max: 100 + content-type: application/json + response: + docs: Success + type: root.SearchTerminalCheckoutsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + status: COMPLETED + limit: 2 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + checkouts: + - id: tsQPvzwBpMqqO + amount_money: + amount: 2610 + currency: USD + reference_id: id14467 + note: A brief note + order_id: order_id + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: false + tip_settings: + allow_tipping: false + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + payment_ids: + - rXnhZzywrEk4vR6pw76fPZfgvaB + created_at: '2020-03-31T18:13:15.921Z' + updated_at: '2020-03-31T18:13:52.725Z' + app_id: APP_ID + location_id: location_id + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + statement_description_identifier: statement_description_identifier + - id: XlOPTgcEhrbqO + amount_money: + amount: 2610 + currency: USD + reference_id: id41623 + note: A brief note + order_id: order_id + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: true + tip_settings: + allow_tipping: false + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + payment_ids: + - VYBF861PaoKPP7Pih0TlbZiNvaB + created_at: '2020-03-31T18:08:31.882Z' + updated_at: '2020-03-31T18:08:41.635Z' + app_id: APP_ID + location_id: location_id + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + statement_description_identifier: statement_description_identifier + cursor: RiTJqBoTuXlbLmmrPvEkX9iG7XnQ4W4RjGnH + get: + path: /v2/terminals/checkouts/{checkout_id} + method: GET + auth: + - oauth2: + - PAYMENTS_READ + docs: >- + Retrieves a Terminal checkout request by `checkout_id`. Terminal + checkout requests are available for 30 days. + source: + openapi: openapi/openapi.json + display-name: GetTerminalCheckout + request: + name: GetCheckoutsRequest + path-parameters: + checkout_id: + type: string + docs: The unique ID for the desired `TerminalCheckout`. + response: + docs: Success + type: root.GetTerminalCheckoutResponse + status-code: 200 + examples: + - path-parameters: + checkout_id: checkout_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + checkout: + id: 08YceKh7B3ZqO + amount_money: + amount: 2610 + currency: USD + reference_id: id11572 + note: A brief note + order_id: order_id + payment_options: + autocomplete: true + delay_duration: delay_duration + accept_partial_authorization: true + delay_action: CANCEL + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: false + collect_signature: true + tip_settings: + allow_tipping: false + show_itemized_cart: true + deadline_duration: PT5M + status: IN_PROGRESS + cancel_reason: BUYER_CANCELED + payment_ids: + - payment_ids + created_at: '2020-04-06T16:39:32.545Z' + updated_at: 2020-04-06T16:39:323.001Z + app_id: APP_ID + location_id: LOCATION_ID + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + statement_description_identifier: statement_description_identifier + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + cancel: + path: /v2/terminals/checkouts/{checkout_id}/cancel + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Cancels a Terminal checkout request if the status of the request permits + it. + source: + openapi: openapi/openapi.json + display-name: CancelTerminalCheckout + request: + name: CancelCheckoutsRequest + path-parameters: + checkout_id: + type: string + docs: The unique ID for the desired `TerminalCheckout`. + response: + docs: Success + type: root.CancelTerminalCheckoutResponse + status-code: 200 + examples: + - path-parameters: + checkout_id: checkout_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + checkout: + id: S1yDlPQx7slqO + amount_money: + amount: 123 + currency: USD + reference_id: id36815 + note: note + order_id: order_id + payment_options: + autocomplete: true + delay_duration: delay_duration + accept_partial_authorization: true + delay_action: CANCEL + device_options: + device_id: dbb5d83a-7838-11ea-bc55-0242ac130003 + skip_receipt_screen: true + collect_signature: true + tip_settings: + allow_tipping: true + show_itemized_cart: true + deadline_duration: PT5M + status: CANCELED + cancel_reason: SELLER_CANCELED + payment_ids: + - payment_ids + created_at: '2020-03-16T15:31:19.934Z' + updated_at: '2020-03-16T15:31:45.787Z' + app_id: APP_ID + location_id: LOCATION_ID + payment_type: CARD_PRESENT + team_member_id: team_member_id + customer_id: customer_id + app_fee_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + statement_description_identifier: statement_description_identifier + tip_money: + amount: 1000000 + currency: UNKNOWN_CURRENCY + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/terminal/refunds.yml b/.mock/definition/terminal/refunds.yml new file mode 100644 index 000000000..0429189a2 --- /dev/null +++ b/.mock/definition/terminal/refunds.yml @@ -0,0 +1,269 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/terminals/refunds + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Creates a request to refund an Interac payment completed on a Square + Terminal. Refunds for Interac payments on a Square Terminal are + supported only for Interac debit cards in Canada. Other refunds for + Terminal payments should use the Refunds API. For more information, see + [Refunds API](api:Refunds). + source: + openapi: openapi/openapi.json + display-name: CreateTerminalRefund + request: + name: CreateTerminalRefundRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this `CreateRefund` request. + Keys can be any valid string but + + must be unique for every `CreateRefund` request. + + + See [Idempotency + keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + for more information. + validation: + minLength: 1 + maxLength: 64 + refund: + type: optional + docs: The refund to create. + content-type: application/json + response: + docs: Success + type: root.CreateTerminalRefundResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 402a640b-b26f-401f-b406-46f839590c04 + refund: + payment_id: 5O5OvgkcNUhl7JBuINflcjKqUzXZY + amount_money: + amount: 111 + currency: CAD + reason: Returning items + device_id: f72dfb8e-4d65-4e56-aade-ec3fb8d33291 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: 009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY + refund_id: refund_id + payment_id: 5O5OvgkcNUhl7JBuINflcjKqUzXZY + order_id: kcuKDKreRaI4gF4TjmEgZjHk8Z7YY + amount_money: + amount: 111 + currency: CAD + reason: Returning items + device_id: f72dfb8e-4d65-4e56-aade-ec3fb8d33291 + deadline_duration: PT5M + status: PENDING + cancel_reason: BUYER_CANCELED + created_at: '2020-09-29T15:21:46.771Z' + updated_at: '2020-09-29T15:21:46.771Z' + app_id: sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ + location_id: 76C9W6K8CNNQ5 + search: + path: /v2/terminals/refunds/search + method: POST + auth: + - oauth2: + - PAYMENTS_READ + docs: >- + Retrieves a filtered list of Interac Terminal refund requests created by + the seller making the request. Terminal refund requests are available + for 30 days. + source: + openapi: openapi/openapi.json + display-name: SearchTerminalRefunds + request: + name: SearchTerminalRefundsRequest + body: + properties: + query: + type: optional + docs: >- + Queries the Terminal refunds based on given conditions and the + sort order. Calling + + `SearchTerminalRefunds` without an explicit query parameter + returns all available + + refunds with the default sort order. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this cursor to retrieve the next set of results for the + original query. + limit: + type: optional + docs: Limits the number of results returned for a single request. + validation: + min: 1 + max: 100 + content-type: application/json + response: + docs: Success + type: root.SearchTerminalRefundsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + status: COMPLETED + limit: 1 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refunds: + - id: 009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY + refund_id: >- + 5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb + payment_id: 5O5OvgkcNUhl7JBuINflcjKqUzXZY + order_id: kcuKDKreRaI4gF4TjmEgZjHk8Z7YY + amount_money: + amount: 111 + currency: CAD + reason: Returning item + device_id: f72dfb8e-4d65-4e56-aade-ec3fb8d33291 + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + created_at: '2020-09-29T15:21:46.771Z' + updated_at: '2020-09-29T15:21:48.675Z' + app_id: sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ + location_id: 76C9W6K8CNNQ5 + cursor: cursor + get: + path: /v2/terminals/refunds/{terminal_refund_id} + method: GET + auth: + - oauth2: + - PAYMENTS_READ + docs: >- + Retrieves an Interac Terminal refund object by ID. Terminal refund + objects are available for 30 days. + source: + openapi: openapi/openapi.json + display-name: GetTerminalRefund + request: + name: GetRefundsRequest + path-parameters: + terminal_refund_id: + type: string + docs: The unique ID for the desired `TerminalRefund`. + response: + docs: Success + type: root.GetTerminalRefundResponse + status-code: 200 + examples: + - path-parameters: + terminal_refund_id: terminal_refund_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: 009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY + refund_id: >- + 5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb + payment_id: 5O5OvgkcNUhl7JBuINflcjKqUzXZY + order_id: kcuKDKreRaI4gF4TjmEgZjHk8Z7YY + amount_money: + amount: 111 + currency: CAD + reason: Returning item + device_id: f72dfb8e-4d65-4e56-aade-ec3fb8d33291 + deadline_duration: PT5M + status: COMPLETED + cancel_reason: BUYER_CANCELED + created_at: '2020-09-29T15:21:46.771Z' + updated_at: '2020-09-29T15:21:48.675Z' + app_id: sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ + location_id: 76C9W6K8CNNQ5 + cancel: + path: /v2/terminals/refunds/{terminal_refund_id}/cancel + method: POST + auth: + - oauth2: + - PAYMENTS_WRITE + docs: >- + Cancels an Interac Terminal refund request by refund request ID if the + status of the request permits it. + source: + openapi: openapi/openapi.json + display-name: CancelTerminalRefund + request: + name: CancelRefundsRequest + path-parameters: + terminal_refund_id: + type: string + docs: The unique ID for the desired `TerminalRefund`. + response: + docs: Success + type: root.CancelTerminalRefundResponse + status-code: 200 + examples: + - path-parameters: + terminal_refund_id: terminal_refund_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + refund: + id: g6ycb6HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY + refund_id: refund_id + payment_id: 5O5OvgkcNUhl7JBuINflcjKqUzXZY + order_id: kcuKDKreRaI4gF4TjmEgZjHk8Z7YY + amount_money: + amount: 100 + currency: CAD + reason: reason + device_id: 42690809-faa2-4701-a24b-19d3d34c9aaa + deadline_duration: PT5M + status: CANCELED + cancel_reason: SELLER_CANCELED + created_at: '2020-10-21T22:47:23.241Z' + updated_at: '2020-10-21T22:47:30.096Z' + app_id: sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ + location_id: 76C9W6K8CNNQ5 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/transferOrders.yml b/.mock/definition/transferOrders.yml new file mode 100644 index 000000000..fcb8338e3 --- /dev/null +++ b/.mock/definition/transferOrders.yml @@ -0,0 +1,807 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v2/transfer-orders + method: POST + auth: + - oauth2: + - INVENTORY_READ + - INVENTORY_WRITE + docs: >- + Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) + status. A transfer order represents the intent + + to move [CatalogItemVariation](entity:CatalogItemVariation)s from one + [Location](entity:Location) to another. + + The source and destination locations must be different and must belong + to your Square account. + + + In [DRAFT](entity:TransferOrderStatus) status, you can: + + - Add or remove items + + - Modify quantities + + - Update shipping information + + - Delete the entire order via + [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) + + + The request requires source_location_id and destination_location_id. + + Inventory levels are not affected until the order is started via + + [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). + + + Common integration points: + + - Sync with warehouse management systems + + - Automate regular stock transfers + + - Initialize transfers from inventory optimization systems + + + Creates a [transfer_order.created](webhook:transfer_order.created) + webhook event. + source: + openapi: openapi/openapi.json + display-name: CreateTransferOrder + request: + name: CreateTransferOrderRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this CreateTransferOrder + request. Keys can be + + any valid string but must be unique for every + CreateTransferOrder request. + validation: + minLength: 1 + transfer_order: + type: root.CreateTransferOrderData + docs: The transfer order to create + content-type: application/json + response: + docs: Success + type: root.CreateTransferOrderResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 65cc0586-3e82-384s-b524-3885cffd52 + transfer_order: + source_location_id: EXAMPLE_SOURCE_LOCATION_ID_123 + destination_location_id: EXAMPLE_DEST_LOCATION_ID_456 + expected_at: '2025-11-09T05:00:00Z' + notes: >- + Example transfer order for inventory redistribution between + locations + tracking_number: TRACK123456789 + created_by_team_member_id: EXAMPLE_TEAM_MEMBER_ID_789 + line_items: + - item_variation_id: EXAMPLE_ITEM_VARIATION_ID_001 + quantity_ordered: '5' + - item_variation_id: EXAMPLE_ITEM_VARIATION_ID_002 + quantity_ordered: '3' + response: + body: + transfer_order: + id: EXAMPLE_TRANSFER_ORDER_ID_123 + source_location_id: EXAMPLE_SOURCE_LOCATION_ID_123 + destination_location_id: EXAMPLE_DEST_LOCATION_ID_456 + status: DRAFT + created_at: '2025-01-15T10:30:00Z' + updated_at: '2025-01-15T10:30:00Z' + expected_at: '2025-11-09T05:00:00Z' + completed_at: completed_at + notes: >- + Example transfer order for inventory redistribution between + locations + tracking_number: TRACK123456789 + created_by_team_member_id: EXAMPLE_TEAM_MEMBER_ID_789 + line_items: + - uid: '1' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_001 + quantity_ordered: '5' + quantity_pending: '5' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '0' + - uid: '2' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_002 + quantity_ordered: '3' + quantity_pending: '3' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '0' + version: 1753109537351 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + search: + path: /v2/transfer-orders/search + method: POST + auth: + - oauth2: + - INVENTORY_READ + docs: >- + Searches for transfer orders using filters. Returns a paginated list of + matching + + [TransferOrder](entity:TransferOrder)s sorted by creation date. + + + Common search scenarios: + + - Find orders for a source [Location](entity:Location) + + - Find orders for a destination [Location](entity:Location) + + - Find orders in a particular + [TransferOrderStatus](entity:TransferOrderStatus) + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.transfer_orders + source: + openapi: openapi/openapi.json + display-name: SearchTransferOrders + request: + name: SearchTransferOrdersRequest + body: + properties: + query: + type: optional + docs: The search query + cursor: + type: optional + docs: Pagination cursor from a previous search response + limit: + type: optional + docs: Maximum number of results to return (1-100) + validation: + min: 1 + max: 100 + content-type: application/json + response: + docs: Success + type: root.SearchTransferOrdersResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + query: + filter: + source_location_ids: + - EXAMPLE_SOURCE_LOCATION_ID_123 + destination_location_ids: + - EXAMPLE_DEST_LOCATION_ID_456 + statuses: + - STARTED + - PARTIALLY_RECEIVED + sort: + field: UPDATED_AT + order: DESC + cursor: eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9 + limit: 10 + response: + body: + transfer_orders: + - id: EXAMPLE_TRANSFER_ORDER_ID_123 + source_location_id: EXAMPLE_SOURCE_LOCATION_ID_123 + destination_location_id: EXAMPLE_DEST_LOCATION_ID_456 + status: STARTED + created_at: '2025-01-15T10:30:00Z' + updated_at: '2025-01-15T10:32:00Z' + expected_at: '2025-11-09T05:00:00Z' + completed_at: completed_at + notes: Inventory rebalance between stores + tracking_number: TRACK123456789 + created_by_team_member_id: EXAMPLE_TEAM_MEMBER_ID_789 + line_items: + - uid: '1' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_001 + quantity_ordered: '5' + quantity_pending: '5' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '0' + version: 1753118664873 + - id: EXAMPLE_TRANSFER_ORDER_ID_456 + source_location_id: EXAMPLE_SOURCE_LOCATION_ID_123 + destination_location_id: EXAMPLE_DEST_LOCATION_ID_456 + status: PARTIALLY_RECEIVED + created_at: '2025-01-14T14:20:00Z' + updated_at: '2025-01-15T09:45:00Z' + expected_at: '2025-11-08T12:00:00Z' + completed_at: completed_at + notes: Seasonal stock transfer + tracking_number: tracking_number + created_by_team_member_id: created_by_team_member_id + line_items: + - uid: '1' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_002 + quantity_ordered: '10' + quantity_pending: '3' + quantity_received: '7' + quantity_damaged: '0' + quantity_canceled: '0' + version: 1753115540123 + cursor: eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTU1NDBfMTIzfQ== + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + get: + path: /v2/transfer-orders/{transfer_order_id} + method: GET + auth: + - oauth2: + - INVENTORY_READ + docs: >- + Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. + Returns the complete + + order details including: + + + - Basic information (status, dates, notes) + + - Line items with ordered and received quantities + + - Source and destination [Location](entity:Location)s + + - Tracking information (if available) + source: + openapi: openapi/openapi.json + display-name: RetrieveTransferOrder + request: + name: GetTransferOrdersRequest + path-parameters: + transfer_order_id: + type: string + docs: The ID of the transfer order to retrieve + response: + docs: Success + type: root.RetrieveTransferOrderResponse + status-code: 200 + examples: + - path-parameters: + transfer_order_id: transfer_order_id + headers: + Square-Version: '2025-10-16' + response: + body: + transfer_order: + id: EXAMPLE_TRANSFER_ORDER_ID_123 + source_location_id: EXAMPLE_SOURCE_LOCATION_ID_123 + destination_location_id: EXAMPLE_DEST_LOCATION_ID_456 + status: STARTED + created_at: '2025-01-15T10:30:00Z' + updated_at: '2025-01-15T10:35:00Z' + expected_at: '2025-11-09T05:00:00Z' + completed_at: completed_at + notes: >- + Example transfer order for inventory redistribution between + locations + tracking_number: TRACK123456789 + created_by_team_member_id: EXAMPLE_TEAM_MEMBER_ID_789 + line_items: + - uid: '1' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_001 + quantity_ordered: '5' + quantity_pending: '5' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '0' + - uid: '2' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_002 + quantity_ordered: '3' + quantity_pending: '3' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '0' + version: 1753117449752 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + update: + path: /v2/transfer-orders/{transfer_order_id} + method: PUT + auth: + - oauth2: + - INVENTORY_READ + - INVENTORY_WRITE + docs: >- + Updates an existing transfer order. This endpoint supports sparse + updates, + + allowing you to modify specific fields without affecting others. + + + Creates a [transfer_order.updated](webhook:transfer_order.updated) + webhook event. + source: + openapi: openapi/openapi.json + display-name: UpdateTransferOrder + request: + name: UpdateTransferOrderRequest + path-parameters: + transfer_order_id: + type: string + docs: The ID of the transfer order to update + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this UpdateTransferOrder + request. Keys must contain only alphanumeric characters, dashes + and underscores + validation: + minLength: 1 + transfer_order: + type: root.UpdateTransferOrderData + docs: The transfer order updates to apply + version: + type: optional + docs: Version for optimistic concurrency + content-type: application/json + response: + docs: Success + type: root.UpdateTransferOrderResponse + status-code: 200 + examples: + - path-parameters: + transfer_order_id: transfer_order_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: f47ac10b-58cc-4372-a567-0e02b2c3d479 + transfer_order: + source_location_id: EXAMPLE_SOURCE_LOCATION_ID_789 + destination_location_id: EXAMPLE_DEST_LOCATION_ID_101 + expected_at: '2025-11-10T08:00:00Z' + notes: 'Updated: Priority transfer due to low stock at destination' + tracking_number: TRACK987654321 + line_items: + - uid: '1' + quantity_ordered: '7' + - item_variation_id: EXAMPLE_NEW_ITEM_VARIATION_ID_003 + quantity_ordered: '2' + - uid: '2' + remove: true + version: 1753109537351 + response: + body: + transfer_order: + id: EXAMPLE_TRANSFER_ORDER_ID_123 + source_location_id: EXAMPLE_SOURCE_LOCATION_ID_789 + destination_location_id: EXAMPLE_DEST_LOCATION_ID_101 + status: DRAFT + created_at: '2025-01-15T10:30:00Z' + updated_at: '2025-01-15T11:15:00Z' + expected_at: '2025-11-10T08:00:00Z' + completed_at: completed_at + notes: 'Updated: Priority transfer due to low stock at destination' + tracking_number: TRACK987654321 + created_by_team_member_id: EXAMPLE_TEAM_MEMBER_ID_789 + line_items: + - uid: '1' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_001 + quantity_ordered: '7' + quantity_pending: '7' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '0' + - uid: '3' + item_variation_id: EXAMPLE_NEW_ITEM_VARIATION_ID_003 + quantity_ordered: '2' + quantity_pending: '2' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '0' + version: 1753122900456 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + delete: + path: /v2/transfer-orders/{transfer_order_id} + method: DELETE + auth: + - oauth2: + - INVENTORY_WRITE + docs: >- + Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. + + Only draft orders can be deleted. Once an order is started via + + [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it + can no longer be deleted. + + + Creates a [transfer_order.deleted](webhook:transfer_order.deleted) + webhook event. + source: + openapi: openapi/openapi.json + display-name: DeleteTransferOrder + request: + name: DeleteTransferOrdersRequest + path-parameters: + transfer_order_id: + type: string + docs: The ID of the transfer order to delete + query-parameters: + version: + type: optional> + docs: Version for optimistic concurrency + response: + docs: Success + type: root.DeleteTransferOrderResponse + status-code: 200 + examples: + - path-parameters: + transfer_order_id: transfer_order_id + query-parameters: + version: 1000000 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + cancel: + path: /v2/transfer-orders/{transfer_order_id}/cancel + method: POST + auth: + - oauth2: + - INVENTORY_READ + - INVENTORY_WRITE + docs: >- + Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or + + [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived + quantities will no + + longer be receivable and will be immediately returned to the source + [Location](entity:Location)'s inventory. + + + Common reasons for cancellation: + + - Items no longer needed at destination + + - Source location needs the inventory + + - Order created in error + + + Creates a [transfer_order.updated](webhook:transfer_order.updated) + webhook event. + source: + openapi: openapi/openapi.json + display-name: CancelTransferOrder + request: + name: CancelTransferOrderRequest + path-parameters: + transfer_order_id: + type: string + docs: >- + The ID of the transfer order to cancel. Must be in STARTED or + PARTIALLY_RECEIVED status. + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this UpdateTransferOrder + request. Keys can be + + any valid string but must be unique for every + UpdateTransferOrder request. + validation: + minLength: 1 + version: + type: optional + docs: Version for optimistic concurrency + content-type: application/json + response: + docs: Success + type: root.CancelTransferOrderResponse + status-code: 200 + examples: + - path-parameters: + transfer_order_id: transfer_order_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 65cc0586-3e82-4d08-b524-3885cffd52 + version: 1753117449752 + response: + body: + transfer_order: + id: EXAMPLE_TRANSFER_ORDER_ID_123 + source_location_id: EXAMPLE_SOURCE_LOCATION_ID_123 + destination_location_id: EXAMPLE_DEST_LOCATION_ID_456 + status: CANCELED + created_at: '2025-01-15T10:30:00Z' + updated_at: '2025-01-15T10:45:00Z' + expected_at: '2025-11-09T05:00:00Z' + completed_at: '2025-01-15T10:45:00Z' + notes: >- + Example transfer order for inventory redistribution between + locations + tracking_number: TRACK123456789 + created_by_team_member_id: EXAMPLE_TEAM_MEMBER_ID_789 + line_items: + - uid: '1' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_001 + quantity_ordered: '5' + quantity_pending: '0' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '5' + - uid: '2' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_002 + quantity_ordered: '3' + quantity_pending: '0' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '3' + version: 1753117461842 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + receive: + path: /v2/transfer-orders/{transfer_order_id}/receive + method: POST + auth: + - oauth2: + - INVENTORY_READ + - INVENTORY_WRITE + docs: >- + Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s + for a transfer order. + + This endpoint supports partial receiving - you can receive items in + multiple batches. + + + For each line item, you can specify: + + - Quantity received in good condition (added to destination inventory + with [InventoryState](entity:InventoryState) of IN_STOCK) + + - Quantity damaged during transit/handling (added to destination + inventory with [InventoryState](entity:InventoryState) of WASTE) + + - Quantity canceled (returned to source location's inventory) + + + The order must be in [STARTED](entity:TransferOrderStatus) or + [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. + + Received quantities are added to the destination + [Location](entity:Location)'s inventory according to their condition. + + Canceled quantities are immediately returned to the source + [Location](entity:Location)'s inventory. + + + When all items are either received, damaged, or canceled, the order + moves to + + [COMPLETED](entity:TransferOrderStatus) status. + + + Creates a [transfer_order.updated](webhook:transfer_order.updated) + webhook event. + source: + openapi: openapi/openapi.json + display-name: ReceiveTransferOrder + request: + name: ReceiveTransferOrderRequest + path-parameters: + transfer_order_id: + type: string + docs: The ID of the transfer order to receive items for + body: + properties: + idempotency_key: + type: string + docs: A unique key to make this request idempotent + validation: + minLength: 1 + receipt: + type: root.TransferOrderGoodsReceipt + docs: The receipt details + version: + type: optional + docs: Version for optimistic concurrency + content-type: application/json + response: + docs: Success + type: root.ReceiveTransferOrderResponse + status-code: 200 + examples: + - path-parameters: + transfer_order_id: transfer_order_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: EXAMPLE_IDEMPOTENCY_KEY_101 + receipt: + line_items: + - transfer_order_line_uid: transfer_order_line_uid + quantity_received: '3' + quantity_damaged: '1' + quantity_canceled: '1' + - transfer_order_line_uid: transfer_order_line_uid + quantity_received: '2' + quantity_canceled: '1' + version: 1753118664873 + response: + body: + transfer_order: + id: EXAMPLE_TRANSFER_ORDER_ID_123 + source_location_id: EXAMPLE_SOURCE_LOCATION_ID_123 + destination_location_id: EXAMPLE_DEST_LOCATION_ID_456 + status: COMPLETED + created_at: '2025-01-15T10:30:00Z' + updated_at: '2025-01-15T10:55:00Z' + expected_at: '2025-11-09T05:00:00Z' + completed_at: '2025-01-15T10:55:00Z' + notes: >- + Example transfer order for inventory redistribution between + locations + tracking_number: TRACK123456789 + created_by_team_member_id: EXAMPLE_TEAM_MEMBER_ID_789 + line_items: + - uid: '1' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_001 + quantity_ordered: '5' + quantity_pending: '0' + quantity_received: '3' + quantity_damaged: '1' + quantity_canceled: '1' + - uid: '2' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_002 + quantity_ordered: '3' + quantity_pending: '0' + quantity_received: '2' + quantity_damaged: '0' + quantity_canceled: '1' + version: 1753118667248 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + start: + path: /v2/transfer-orders/{transfer_order_id}/start + method: POST + auth: + - oauth2: + - INVENTORY_READ + - INVENTORY_WRITE + docs: >- + Changes a [DRAFT](entity:TransferOrderStatus) transfer order to + [STARTED](entity:TransferOrderStatus) status. + + This decrements inventory at the source [Location](entity:Location) and + marks it as in-transit. + + + The order must be in [DRAFT](entity:TransferOrderStatus) status and have + all required fields populated. + + Once started, the order can no longer be deleted, but it can be canceled + via + + [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). + + + Creates a [transfer_order.updated](webhook:transfer_order.updated) + webhook event. + source: + openapi: openapi/openapi.json + display-name: StartTransferOrder + request: + name: StartTransferOrderRequest + path-parameters: + transfer_order_id: + type: string + docs: The ID of the transfer order to start. Must be in DRAFT status. + body: + properties: + idempotency_key: + type: string + docs: >- + A unique string that identifies this UpdateTransferOrder + request. Keys can be + + any valid string but must be unique for every + UpdateTransferOrder request. + validation: + minLength: 1 + version: + type: optional + docs: Version for optimistic concurrency + content-type: application/json + response: + docs: Success + type: root.StartTransferOrderResponse + status-code: 200 + examples: + - path-parameters: + transfer_order_id: transfer_order_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: EXAMPLE_IDEMPOTENCY_KEY_789 + version: 1753109537351 + response: + body: + transfer_order: + id: EXAMPLE_TRANSFER_ORDER_ID_123 + source_location_id: EXAMPLE_SOURCE_LOCATION_ID_123 + destination_location_id: EXAMPLE_DEST_LOCATION_ID_456 + status: STARTED + created_at: '2025-01-15T10:30:00Z' + updated_at: '2025-01-15T10:32:00Z' + expected_at: '2025-11-09T05:00:00Z' + completed_at: completed_at + notes: >- + Example transfer order for inventory redistribution between + locations + tracking_number: TRACK123456789 + created_by_team_member_id: EXAMPLE_TEAM_MEMBER_ID_789 + line_items: + - uid: '1' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_001 + quantity_ordered: '5' + quantity_pending: '5' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '0' + - uid: '2' + item_variation_id: EXAMPLE_ITEM_VARIATION_ID_002 + quantity_ordered: '3' + quantity_pending: '3' + quantity_received: '0' + quantity_damaged: '0' + quantity_canceled: '0' + version: 1753118664873 + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/v1Transactions.yml b/.mock/definition/v1Transactions.yml new file mode 100644 index 000000000..252e79409 --- /dev/null +++ b/.mock/definition/v1Transactions.yml @@ -0,0 +1,382 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + V1ListOrders: + path: /v1/{location_id}/orders + method: GET + auth: + - oauth2: + - ORDERS_READ + docs: Provides summary information for a merchant's online store orders. + source: + openapi: openapi/openapi.json + display-name: V1ListOrders + request: + name: V1ListOrdersRequest + path-parameters: + location_id: + type: string + docs: The ID of the location to list online store orders for. + query-parameters: + order: + type: optional> + docs: The order in which payments are listed in the response. + limit: + type: optional> + docs: >- + The maximum number of payments to return in a single response. + This value cannot exceed 200. + batch_token: + type: optional> + docs: |- + A pagination cursor to retrieve the next set of results for your + original query to the endpoint. + response: + docs: Success + type: list + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + query-parameters: + order: DESC + limit: 1 + batch_token: batch_token + headers: + Square-Version: '2025-10-16' + response: + body: + - errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + id: id + buyer_email: buyer_email + recipient_name: recipient_name + recipient_phone_number: recipient_phone_number + state: PENDING + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + subtotal_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_shipping_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_tax_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_price_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_discount_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + created_at: created_at + updated_at: updated_at + expires_at: expires_at + payment_id: payment_id + buyer_note: buyer_note + completed_note: completed_note + refunded_note: refunded_note + canceled_note: canceled_note + tender: + id: id + type: CREDIT_CARD + name: name + employee_id: employee_id + receipt_url: receipt_url + card_brand: OTHER_BRAND + pan_suffix: pan_suffix + entry_method: MANUAL + payment_note: payment_note + tendered_at: tendered_at + settled_at: settled_at + is_exchange: true + order_history: + - {} + promo_code: promo_code + btc_receive_address: btc_receive_address + btc_price_satoshi: 1.1 + V1RetrieveOrder: + path: /v1/{location_id}/orders/{order_id} + method: GET + auth: + - oauth2: + - ORDERS_READ + docs: >- + Provides comprehensive information for a single online store order, + including the order's history. + source: + openapi: openapi/openapi.json + display-name: V1RetrieveOrder + request: + name: V1RetrieveOrderRequest + path-parameters: + location_id: + type: string + docs: The ID of the order's associated location. + order_id: + type: string + docs: >- + The order's Square-issued ID. You obtain this value from Order + objects returned by the List Orders endpoint + response: + docs: Success + type: root.V1Order + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + order_id: order_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + id: id + buyer_email: buyer_email + recipient_name: recipient_name + recipient_phone_number: recipient_phone_number + state: PENDING + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + subtotal_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_shipping_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_tax_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_price_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_discount_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + created_at: created_at + updated_at: updated_at + expires_at: expires_at + payment_id: payment_id + buyer_note: buyer_note + completed_note: completed_note + refunded_note: refunded_note + canceled_note: canceled_note + tender: + id: id + type: CREDIT_CARD + name: name + employee_id: employee_id + receipt_url: receipt_url + card_brand: OTHER_BRAND + pan_suffix: pan_suffix + entry_method: MANUAL + payment_note: payment_note + total_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + tendered_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + tendered_at: tendered_at + settled_at: settled_at + change_back_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + refunded_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + is_exchange: true + order_history: + - action: ORDER_PLACED + created_at: created_at + promo_code: promo_code + btc_receive_address: btc_receive_address + btc_price_satoshi: 1.1 + V1UpdateOrder: + path: /v1/{location_id}/orders/{order_id} + method: PUT + auth: + - oauth2: + - ORDERS_WRITE + docs: >- + Updates the details of an online store order. Every update you perform + on an order corresponds to one of three actions: + source: + openapi: openapi/openapi.json + display-name: V1UpdateOrder + request: + name: V1UpdateOrderRequest + path-parameters: + location_id: + type: string + docs: The ID of the order's associated location. + order_id: + type: string + docs: >- + The order's Square-issued ID. You obtain this value from Order + objects returned by the List Orders endpoint + body: + properties: + action: + type: root.V1UpdateOrderRequestAction + docs: >- + The action to perform on the order (COMPLETE, CANCEL, or + REFUND). + + See + [V1UpdateOrderRequestAction](#type-v1updateorderrequestaction) + for possible values + shipped_tracking_number: + type: optional> + docs: >- + The tracking number of the shipment associated with the order. + Only valid if action is COMPLETE. + completed_note: + type: optional> + docs: >- + A merchant-specified note about the completion of the order. + Only valid if action is COMPLETE. + refunded_note: + type: optional> + docs: >- + A merchant-specified note about the refunding of the order. Only + valid if action is REFUND. + canceled_note: + type: optional> + docs: >- + A merchant-specified note about the canceling of the order. Only + valid if action is CANCEL. + content-type: application/json + response: + docs: Success + type: root.V1Order + status-code: 200 + availability: deprecated + examples: + - path-parameters: + location_id: location_id + order_id: order_id + headers: + Square-Version: '2025-10-16' + request: + action: COMPLETE + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + id: id + buyer_email: buyer_email + recipient_name: recipient_name + recipient_phone_number: recipient_phone_number + state: PENDING + shipping_address: + address_line_1: address_line_1 + address_line_2: address_line_2 + address_line_3: address_line_3 + locality: locality + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: administrative_district_level_1 + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: postal_code + country: ZZ + first_name: first_name + last_name: last_name + subtotal_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_shipping_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_tax_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_price_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + total_discount_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + created_at: created_at + updated_at: updated_at + expires_at: expires_at + payment_id: payment_id + buyer_note: buyer_note + completed_note: completed_note + refunded_note: refunded_note + canceled_note: canceled_note + tender: + id: id + type: CREDIT_CARD + name: name + employee_id: employee_id + receipt_url: receipt_url + card_brand: OTHER_BRAND + pan_suffix: pan_suffix + entry_method: MANUAL + payment_note: payment_note + total_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + tendered_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + tendered_at: tendered_at + settled_at: settled_at + change_back_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + refunded_money: + amount: 1 + currency_code: UNKNOWN_CURRENCY + is_exchange: true + order_history: + - action: ORDER_PLACED + created_at: created_at + promo_code: promo_code + btc_receive_address: btc_receive_address + btc_price_satoshi: 1.1 + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/vendors.yml b/.mock/definition/vendors.yml new file mode 100644 index 000000000..5975c364f --- /dev/null +++ b/.mock/definition/vendors.yml @@ -0,0 +1,558 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + batchCreate: + path: /v2/vendors/bulk-create + method: POST + auth: + - oauth2: + - VENDOR_WRITE + docs: >- + Creates one or more [Vendor](entity:Vendor) objects to represent + suppliers to a seller. + source: + openapi: openapi/openapi.json + display-name: BulkCreateVendors + request: + name: BatchCreateVendorsRequest + body: + properties: + vendors: + type: map + docs: >- + Specifies a set of new [Vendor](entity:Vendor) objects as + represented by a collection of idempotency-key/`Vendor`-object + pairs. + content-type: application/json + response: + docs: Success + type: root.BatchCreateVendorsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + vendors: + 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe: + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + responses: + 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T10:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + version: 0 + status: ACTIVE + batchGet: + path: /v2/vendors/bulk-retrieve + method: POST + auth: + - oauth2: + - VENDOR_READ + docs: Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs. + source: + openapi: openapi/openapi.json + display-name: BulkRetrieveVendors + request: + name: BatchGetVendorsRequest + body: + properties: + vendor_ids: + type: optional>> + docs: IDs of the [Vendor](entity:Vendor) objects to retrieve. + content-type: application/json + response: + docs: Success + type: root.BatchGetVendorsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + vendor_ids: + - INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + responses: + INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T10:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + version: 1 + status: ACTIVE + batchUpdate: + path: /v2/vendors/bulk-update + method: PUT + auth: + - oauth2: + - VENDOR_WRITE + docs: >- + Updates one or more of existing [Vendor](entity:Vendor) objects as + suppliers to a seller. + source: + openapi: openapi/openapi.json + display-name: BulkUpdateVendors + request: + name: BatchUpdateVendorsRequest + body: + properties: + vendors: + type: map + docs: >- + A set of [UpdateVendorRequest](entity:UpdateVendorRequest) + objects encapsulating to-be-updated [Vendor](entity:Vendor) + + objects. The set is represented by a collection of + `Vendor`-ID/`UpdateVendorRequest`-object pairs. + content-type: application/json + response: + docs: Success + type: root.BatchUpdateVendorsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + vendors: + FMCYHBWT1TPL8MFH52PBMEN92A: + vendor: {} + INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4: + vendor: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + responses: + INV_V_FMCYHBWT1TPL8MFH52PBMEN92A: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + vendor: + id: INV_V_FMCYHBWT1TPL8MFH52PBMEN92A + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T20:21:54.859Z' + name: Annie’s Hot Sauce + address: + address_line_1: 202 Mill St + locality: Moorestown + administrative_district_level_1: NJ + postal_code: '08057' + country: US + contacts: + - id: INV_VC_ABYYHBWT1TPL8MFH52PBMENPJ4 + name: Annie Thomas + email_address: annie@annieshotsauce.com + phone_number: 1-212-555-4250 + ordinal: 0 + version: 11 + status: ACTIVE + INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:10:54.859Z' + updated_at: '2022-03-16T20:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 0 + account_number: '4025391' + note: favorite vendor + version: 31 + status: ACTIVE + create: + path: /v2/vendors/create + method: POST + auth: + - oauth2: + - VENDOR_WRITE + docs: >- + Creates a single [Vendor](entity:Vendor) object to represent a supplier + to a seller. + source: + openapi: openapi/openapi.json + display-name: CreateVendor + request: + name: CreateVendorRequest + body: + properties: + idempotency_key: + type: string + docs: >- + A client-supplied, universally unique identifier (UUID) to make + this [CreateVendor](api-endpoint:Vendors-CreateVendor) call + idempotent. + + + See + [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) + in the + + [API Development + 101](https://developer.squareup.com/docs/buildbasics) section + for more + + information. + validation: + minLength: 1 + maxLength: 128 + vendor: + type: optional + docs: The requested [Vendor](entity:Vendor) to be created. + content-type: application/json + response: + docs: Success + type: root.CreateVendorResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe + vendor: + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T10:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + version: 1 + status: ACTIVE + search: + path: /v2/vendors/search + method: POST + auth: + - oauth2: + - VENDOR_READ + docs: >- + Searches for vendors using a filter against supported + [Vendor](entity:Vendor) properties and a supported sorter. + source: + openapi: openapi/openapi.json + display-name: SearchVendors + request: + name: SearchVendorsRequest + body: + properties: + filter: + type: optional + docs: Specifies a filter used to search for vendors. + sort: + type: optional + docs: Specifies a sorter used to sort the returned vendors. + cursor: + type: optional + docs: >- + A pagination cursor returned by a previous call to this + endpoint. + + Provide this to retrieve the next set of results for the + original query. + + + See the + [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) + guide for more information. + content-type: application/json + response: + docs: Success + type: root.SearchVendorsResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: {} + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + vendors: + - id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T10:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + locality: New York + administrative_district_level_1: NY + postal_code: '10003' + country: US + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + version: 1 + status: ACTIVE + cursor: cursor + get: + path: /v2/vendors/{vendor_id} + method: GET + auth: + - oauth2: + - VENDOR_READ + docs: Retrieves the vendor of a specified [Vendor](entity:Vendor) ID. + source: + openapi: openapi/openapi.json + display-name: RetrieveVendor + request: + name: GetVendorsRequest + path-parameters: + vendor_id: + type: string + docs: ID of the [Vendor](entity:Vendor) to retrieve. + response: + docs: Success + type: root.GetVendorResponse + status-code: 200 + examples: + - path-parameters: + vendor_id: vendor_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T10:21:54.859Z' + name: Joe's Fresh Seafood + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 1 + account_number: '4025391' + note: a vendor + version: 1 + status: ACTIVE + update: + path: /v2/vendors/{vendor_id} + method: PUT + auth: + - oauth2: + - VENDOR_WRITE + docs: >- + Updates an existing [Vendor](entity:Vendor) object as a supplier to a + seller. + source: + openapi: openapi/openapi.json + display-name: UpdateVendor + request: + body: root.UpdateVendorRequest + path-parameters: + vendor_id: + type: string + docs: ID of the [Vendor](entity:Vendor) to retrieve. + name: UpdateVendorsRequest + content-type: application/json + response: + docs: Success + type: root.UpdateVendorResponse + status-code: 200 + examples: + - path-parameters: + vendor_id: vendor_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + name: Jack's Chicken Shack + version: 1 + status: ACTIVE + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + vendor: + id: INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4 + created_at: '2022-03-16T10:21:54.859Z' + updated_at: '2022-03-16T20:21:54.859Z' + name: Jack's Chicken Shack + address: + address_line_1: 505 Electric Ave + address_line_2: Suite 600 + address_line_3: address_line_3 + locality: New York + sublocality: sublocality + sublocality_2: sublocality_2 + sublocality_3: sublocality_3 + administrative_district_level_1: NY + administrative_district_level_2: administrative_district_level_2 + administrative_district_level_3: administrative_district_level_3 + postal_code: '10003' + country: US + first_name: first_name + last_name: last_name + contacts: + - id: INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A + name: Joe Burrow + email_address: joe@joesfreshseafood.com + phone_number: 1-212-555-4250 + ordinal: 0 + account_number: '4025391' + note: note + version: 2 + status: ACTIVE + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/webhooks/eventTypes.yml b/.mock/definition/webhooks/eventTypes.yml new file mode 100644 index 000000000..0047c851e --- /dev/null +++ b/.mock/definition/webhooks/eventTypes.yml @@ -0,0 +1,47 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/webhooks/event-types + method: GET + auth: + - oauth2: [] + docs: Lists all webhook event types that can be subscribed to. + source: + openapi: openapi/openapi.json + display-name: ListWebhookEventTypes + request: + name: ListEventTypesRequest + query-parameters: + api_version: + type: optional> + docs: >- + The API version for which to list event types. Setting this field + overrides the default version used by the application. + response: + docs: Success + type: root.ListWebhookEventTypesResponse + status-code: 200 + examples: + - query-parameters: + api_version: api_version + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + event_types: + - inventory.count.updated + metadata: + - event_type: inventory.count.updated + api_version_introduced: '2018-07-12' + release_status: PUBLIC + source: + openapi: openapi/openapi.json diff --git a/.mock/definition/webhooks/subscriptions.yml b/.mock/definition/webhooks/subscriptions.yml new file mode 100644 index 000000000..91f3c926d --- /dev/null +++ b/.mock/definition/webhooks/subscriptions.yml @@ -0,0 +1,395 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /v2/webhooks/subscriptions + method: GET + auth: + - oauth2: [] + docs: Lists all webhook subscriptions owned by your application. + pagination: + cursor: $request.cursor + next_cursor: $response.cursor + results: $response.subscriptions + source: + openapi: openapi/openapi.json + display-name: ListWebhookSubscriptions + request: + name: ListSubscriptionsRequest + query-parameters: + cursor: + type: optional> + docs: >- + A pagination cursor returned by a previous call to this endpoint. + + Provide this to retrieve the next set of results for your original + query. + + + For more information, see + [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). + include_disabled: + type: optional> + default: false + docs: >- + Includes disabled [Subscription](entity:WebhookSubscription)s. + + By default, all enabled + [Subscription](entity:WebhookSubscription)s are returned. + sort_order: + type: optional> + docs: >- + Sorts the returned list by when the + [Subscription](entity:WebhookSubscription) was created with the + specified order. + + This field defaults to ASC. + limit: + type: optional> + docs: >- + The maximum number of results to be returned in a single page. + + It is possible to receive fewer results than the specified limit + on a given page. + + The default value of 100 is also the maximum allowed value. + + + Default: 100 + response: + docs: Success + type: root.ListWebhookSubscriptionsResponse + status-code: 200 + examples: + - query-parameters: + cursor: cursor + include_disabled: true + sort_order: DESC + limit: 1 + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscriptions: + - id: wbhk_b35f6b3145074cf9ad513610786c19d5 + name: Example Webhook Subscription + enabled: true + event_types: + - payment.created + - payment.updated + notification_url: https://example-webhook-url.com + api_version: '2021-12-15' + signature_key: signature_key + created_at: 2022-01-10 23:29:48 +0000 UTC + updated_at: 2022-01-10 23:29:48 +0000 UTC + cursor: cursor + create: + path: /v2/webhooks/subscriptions + method: POST + auth: + - oauth2: [] + docs: Creates a webhook subscription. + source: + openapi: openapi/openapi.json + display-name: CreateWebhookSubscription + request: + name: CreateWebhookSubscriptionRequest + body: + properties: + idempotency_key: + type: optional + docs: >- + A unique string that identifies the + [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) + request. + validation: + maxLength: 45 + subscription: + type: root.WebhookSubscription + docs: The [Subscription](entity:WebhookSubscription) to create. + content-type: application/json + response: + docs: Success + type: root.CreateWebhookSubscriptionResponse + status-code: 200 + examples: + - headers: + Square-Version: '2025-10-16' + request: + idempotency_key: 63f84c6c-2200-4c99-846c-2670a1311fbf + subscription: + name: Example Webhook Subscription + event_types: + - payment.created + - payment.updated + notification_url: https://example-webhook-url.com + api_version: '2021-12-15' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: wbhk_b35f6b3145074cf9ad513610786c19d5 + name: Example Webhook Subscription + enabled: true + event_types: + - payment.created + - payment.updated + notification_url: https://example-webhook-url.com + api_version: '2021-12-15' + signature_key: 1k9bIJKCeTmSQwyagtNRLg + created_at: 2022-01-10 23:29:48 +0000 UTC + updated_at: 2022-01-10 23:29:48 +0000 UTC + get: + path: /v2/webhooks/subscriptions/{subscription_id} + method: GET + auth: + - oauth2: [] + docs: Retrieves a webhook subscription identified by its ID. + source: + openapi: openapi/openapi.json + display-name: RetrieveWebhookSubscription + request: + name: GetSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: >- + [REQUIRED] The ID of the + [Subscription](entity:WebhookSubscription) to retrieve. + response: + docs: Success + type: root.GetWebhookSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: wbhk_b35f6b3145074cf9ad513610786c19d5 + name: Example Webhook Subscription + enabled: true + event_types: + - payment.created + - payment.updated + notification_url: https://example-webhook-url.com + api_version: '2021-12-15' + signature_key: 1k9bIJKCeTmSQwyagtNRLg + created_at: 2022-01-10 23:29:48 +0000 UTC + updated_at: 2022-01-10 23:29:48 +0000 UTC + update: + path: /v2/webhooks/subscriptions/{subscription_id} + method: PUT + auth: + - oauth2: [] + docs: Updates a webhook subscription. + source: + openapi: openapi/openapi.json + display-name: UpdateWebhookSubscription + request: + name: UpdateWebhookSubscriptionRequest + path-parameters: + subscription_id: + type: string + docs: >- + [REQUIRED] The ID of the + [Subscription](entity:WebhookSubscription) to update. + body: + properties: + subscription: + type: optional + docs: The [Subscription](entity:WebhookSubscription) to update. + content-type: application/json + response: + docs: Success + type: root.UpdateWebhookSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + request: + subscription: + name: Updated Example Webhook Subscription + enabled: false + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription: + id: wbhk_b35f6b3145074cf9ad513610786c19d5 + name: Updated Example Webhook Subscription + enabled: false + event_types: + - payment.created + - payment.updated + notification_url: https://example-webhook-url.com + api_version: '2021-12-15' + signature_key: signature_key + created_at: 2022-01-10 23:29:48 +0000 UTC + updated_at: 2022-01-10 23:45:51 +0000 UTC + delete: + path: /v2/webhooks/subscriptions/{subscription_id} + method: DELETE + auth: + - oauth2: [] + docs: Deletes a webhook subscription. + source: + openapi: openapi/openapi.json + display-name: DeleteWebhookSubscription + request: + name: DeleteSubscriptionsRequest + path-parameters: + subscription_id: + type: string + docs: >- + [REQUIRED] The ID of the + [Subscription](entity:WebhookSubscription) to delete. + response: + docs: Success + type: root.DeleteWebhookSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + updateSignatureKey: + path: /v2/webhooks/subscriptions/{subscription_id}/signature-key + method: POST + auth: + - oauth2: [] + docs: >- + Updates a webhook subscription by replacing the existing signature key + with a new one. + source: + openapi: openapi/openapi.json + display-name: UpdateWebhookSubscriptionSignatureKey + request: + name: UpdateWebhookSubscriptionSignatureKeyRequest + path-parameters: + subscription_id: + type: string + docs: >- + [REQUIRED] The ID of the + [Subscription](entity:WebhookSubscription) to update. + body: + properties: + idempotency_key: + type: optional> + docs: >- + A unique string that identifies the + [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) + request. + validation: + maxLength: 45 + content-type: application/json + response: + docs: Success + type: root.UpdateWebhookSubscriptionSignatureKeyResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + request: + idempotency_key: ed80ae6b-0654-473b-bbab-a39aee89a60d + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + signature_key: 1k9bIJKCeTmSQwyagtNRLg + test: + path: /v2/webhooks/subscriptions/{subscription_id}/test + method: POST + auth: + - oauth2: [] + docs: >- + Tests a webhook subscription by sending a test event to the notification + URL. + source: + openapi: openapi/openapi.json + display-name: TestWebhookSubscription + request: + name: TestWebhookSubscriptionRequest + path-parameters: + subscription_id: + type: string + docs: >- + [REQUIRED] The ID of the + [Subscription](entity:WebhookSubscription) to test. + body: + properties: + event_type: + type: optional> + docs: >- + The event type that will be used to test the + [Subscription](entity:WebhookSubscription). The event type must + be + + contained in the list of event types in the + [Subscription](entity:WebhookSubscription). + content-type: application/json + response: + docs: Success + type: root.TestWebhookSubscriptionResponse + status-code: 200 + examples: + - path-parameters: + subscription_id: subscription_id + headers: + Square-Version: '2025-10-16' + request: + event_type: payment.created + response: + body: + errors: + - category: API_ERROR + code: INTERNAL_SERVER_ERROR + detail: detail + field: field + subscription_test_result: + id: 23eed5a9-2b12-403e-b212-7e2889aea0f6 + status_code: 404 + payload: >- + {"merchant_id":"1ZYMKZY1YFGBW","type":"payment.created","event_id":"23eed5a9-2b12-403e-b212-7e2889aea0f6","created_at":"2022-01-11T00:06:48.322945116Z","data":{"type":"payment","id":"KkAkhdMsgzn59SM8A89WgKwekxLZY","object":{"payment":{"amount_money":{"amount":100,"currency":"USD"},"approved_money":{"amount":100,"currency":"USD"},"capabilities":["EDIT_TIP_AMOUNT","EDIT_TIP_AMOUNT_UP","EDIT_TIP_AMOUNT_DOWN"],"card_details":{"avs_status":"AVS_ACCEPTED","card":{"bin":"540988","card_brand":"MASTERCARD","card_type":"CREDIT","exp_month":11,"exp_year":2022,"fingerprint":"sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg","last_4":"9029","prepaid_type":"NOT_PREPAID"},"card_payment_timeline":{"authorized_at":"2020-11-22T21:16:51.198Z"},"cvv_status":"CVV_ACCEPTED","entry_method":"KEYED","statement_description":"SQ + *DEFAULT TEST + ACCOUNT","status":"AUTHORIZED"},"created_at":"2020-11-22T21:16:51.086Z","delay_action":"CANCEL","delay_duration":"PT168H","delayed_until":"2020-11-29T21:16:51.086Z","id":"hYy9pRFVxpDsO1FB05SunFWUe9JZY","location_id":"S8GWD5R9QB376","order_id":"03O3USaPaAaFnI6kkwB1JxGgBsUZY","receipt_number":"hYy9","risk_evaluation":{"created_at":"2020-11-22T21:16:51.198Z","risk_level":"NORMAL"},"source_type":"CARD","status":"APPROVED","total_money":{"amount":100,"currency":"USD"},"updated_at":"2020-11-22T21:16:51.198Z","version_token":"FfQhQJf9r3VSQIgyWBk1oqhIwiznLwVwJbVVA0bdyEv6o"}}}} + created_at: 2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746 + updated_at: 2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746 + source: + openapi: openapi/openapi.json diff --git a/.mock/fern.config.json b/.mock/fern.config.json new file mode 100644 index 000000000..6bf92d1db --- /dev/null +++ b/.mock/fern.config.json @@ -0,0 +1,4 @@ +{ + "organization" : "square", + "version" : "0.92.0" +} \ No newline at end of file diff --git a/.mock/openapi/openapi.json b/.mock/openapi/openapi.json new file mode 100644 index 000000000..4e900f57a --- /dev/null +++ b/.mock/openapi/openapi.json @@ -0,0 +1,79245 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "2.0", + "title": "Square", + "description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.", + "termsOfService": "https://connect.squareup.com/tos", + "contact": { + "name": "Square Developer Platform", + "email": "developers@squareup.com", + "url": "https://squareup.com/developers" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Read the official documentation here:", + "url": "https://docs.connect.squareup.com/" + }, + "x-server-configuration": { + "default-environment": "production", + "default-server": "default", + "environments": [ + { + "name": "production", + "servers": [ + { + "name": "default", + "url": "https://connect.squareup.com" + } + ] + }, + { + "name": "sandbox", + "servers": [ + { + "name": "default", + "url": "https://connect.squareupsandbox.com" + } + ] + }, + { + "name": "custom", + "servers": [ + { + "name": "default", + "url": "{custom_url}" + } + ] + } + ], + "parameters": [ + { + "name": "custom_url", + "description": "Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`", + "type": "string", + "example": "https://connect.squareup.com" + } + ] + }, + "x-square-generic-error-codes": [ + "ACCESS_TOKEN_EXPIRED", + "ACCESS_TOKEN_REVOKED", + "API_VERSION_INCOMPATIBLE", + "APPLICATION_DISABLED", + "ARRAY_EMPTY", + "ARRAY_LENGTH_TOO_LONG", + "ARRAY_LENGTH_TOO_SHORT", + "BAD_CERTIFICATE", + "BAD_GATEWAY", + "BAD_REQUEST", + "CONFLICT", + "CONFLICTING_PARAMETERS", + "CURRENCY_MISMATCH", + "EXPECTED_ARRAY", + "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", + "EXPECTED_BOOLEAN", + "EXPECTED_FLOAT", + "EXPECTED_INTEGER", + "EXPECTED_JSON_BODY", + "EXPECTED_MAP", + "EXPECTED_OBJECT", + "EXPECTED_STRING", + "FORBIDDEN", + "GATEWAY_TIMEOUT", + "GONE", + "IDEMPOTENCY_KEY_REUSED", + "INCORRECT_TYPE", + "INSUFFICIENT_SCOPES", + "INTERNAL_SERVER_ERROR", + "INVALID_ARRAY_VALUE", + "INVALID_CONTENT_TYPE", + "INVALID_CURSOR", + "INVALID_ENUM_VALUE", + "INVALID_FORM_VALUE", + "INVALID_SORT_ORDER", + "INVALID_SQUARE_VERSION_FORMAT", + "INVALID_TIME", + "INVALID_TIME_RANGE", + "INVALID_VALUE", + "LOCATION_MISMATCH", + "MAP_KEY_LENGTH_TOO_LONG", + "MAP_KEY_LENGTH_TOO_SHORT", + "MERCHANT_SUBSCRIPTION_NOT_FOUND", + "METHOD_NOT_ALLOWED", + "MISSING_REQUIRED_PARAMETER", + "NOT_ACCEPTABLE", + "NOT_FOUND", + "NOT_IMPLEMENTED", + "NO_FIELDS_SET", + "RATE_LIMITED", + "REQUEST_ENTITY_TOO_LARGE", + "REQUEST_TIMEOUT", + "SANDBOX_NOT_SUPPORTED", + "SERVICE_UNAVAILABLE", + "TOO_MANY_MAP_ENTRIES", + "UNAUTHORIZED", + "UNEXPECTED_VALUE", + "UNKNOWN_BODY_PARAMETER", + "UNKNOWN_QUERY_PARAMETER", + "UNPROCESSABLE_ENTITY", + "UNSUPPORTED_MEDIA_TYPE", + "V1_ACCESS_TOKEN", + "V1_APPLICATION", + "VALUE_EMPTY", + "VALUE_REGEX_MISMATCH", + "VALUE_TOO_HIGH", + "VALUE_TOO_LONG", + "VALUE_TOO_LOW", + "VALUE_TOO_SHORT" + ] + }, + "servers": [ + { + "url": "https://connect.squareup.com", + "variables": {} + } + ], + "components": { + "securitySchemes": { + "oauth2": { + "type": "oauth2", + "x-additional-headers": [ + { + "name": "Square-Version", + "description": "Square Connect API versions", + "schema": { + "default": "2025-10-16" + } + } + ], + "flows": { + "authorizationCode": { + "authorizationUrl": "https://connect.squareup.com/oauth2/authorize", + "tokenUrl": "https://connect.squareup.com/oauth2/token", + "scopes": { + "ADDON_CONFIGURATIONS_READ": "__HTTP Method__: `GET`\n\nGrants write access for third-party Add-ons to read configurations of their Add-ons, for example, when calling `RetrieveConfiguration` endpoint.", + "ADDON_CONFIGURATIONS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access for third-party Add-ons to store configurations of their Add-ons, for example, when calling `CreateConfiguration` endpoint.", + "APPOINTMENTS_ALL_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to all of a seller's booking information, calendar, and business details.\nThis permission must be accompanied by the `APPOINTMENTS_READ` permission.", + "APPOINTMENTS_ALL_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to all booking details, including double-booking a seller.\nThis permission must be accompanied by the `APPOINTMENTS_WRITE` permission.", + "APPOINTMENTS_BUSINESS_SETTINGS_READ": "__HTTP Method__: `GET`\n\nGrants read access to booking business settings. For example, to call the\nListTeamMemberBookingProfiles endpoint.", + "APPOINTMENTS_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to booking information. For example, to call the\nRetrieveBooking endpoint.", + "APPOINTMENTS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to booking information. For example, to call the CreateBooking endpoint.", + "BANK_ACCOUNTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to bank account information associated with the targeted\nSquare account. For example, to call the Connect v1 ListBankAccounts endpoint.", + "CASH_DRAWER_READ": "__HTTP Method__: `GET`\n\nGrants read access to cash drawer shift information. For example, to call the\nListCashDrawerShifts endpoint.", + "CHANNELS_CREATE": "__HTTP Method__: `POST`\n\nGrants write access to create channels, for example, when calling the\n`CreateChannel` endpoint.", + "CHANNELS_READ": "__HTTP Method__: `GET`\n\nGrants read access to view channels, for example, when calling the\n`RetrieveChannel` endpoint.", + "CHANNELS_UPDATE": "__HTTP Method__: `PUT`\n\nGrants write access to update channels, for example, when calling the\n`UpdateChannel` endpoint.", + "CUSTOMERS_READ": "__HTTP Method__: `GET`\n\nGrants read access to customer information. For example, to call the\nListCustomers endpoint.", + "CUSTOMERS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to customer information. For example, to create and update\ncustomer profiles.", + "DEVICES_READ": "__HTTP Method__: `GET`\n\nGrants read access to device information. For example, to\ncall the `GetDevice` and `ListDevices` endpoints.", + "DEVICE_CREDENTIAL_MANAGEMENT": "__HTTP Method__: `POST`, `GET`\n\nGrants read/write access to device credentials information. For example, to\ncall the CreateDeviceCode endpoint.", + "DISCOUNT_CODES_READ": "__HTTP Method__: `GET`\n\nGrants read access to Discount Codes API. For example, to call the `RetrieveDiscountCode` and `RetrieveRedemption` endpoints.", + "DISCOUNT_CODES_WRITE": "__HTTP Method__: `POST`\n\nGrants write access to Discount Codes API.", + "DISPUTES_READ": "__HTTP Method__: `GET`\n\nGrants read access to dispute information. For example, to call the RetrieveDispute\nendpoint.", + "DISPUTES_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to dispute information. For example, to call the SubmitEvidence\nendpoint.", + "EMPLOYEES_READ": "__HTTP Method__: `GET`\n\nGrants read access to employee profile information. For example, to call the\nConnect v1 Employees API.", + "EMPLOYEES_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to employee profile information. For example, to create\nand modify employee profiles.", + "GIFTCARDS_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to gift card information. For example, to call the RetrieveGiftCard\nendpoint.", + "GIFTCARDS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to gift card information. For example, to call the CreateGiftCard\nendpoint.", + "INVENTORY_READ": "__HTTP Method__: `GET`\n\nGrants read access to inventory information. For example, to call the\nRetrieveInventoryCount endpoint.", + "INVENTORY_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to inventory information. For example, to call the\nBatchChangeInventory endpoint.", + "INVOICES_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to invoice information. For example, to call the ListInvoices endpoint.", + "INVOICES_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to invoice information. For example, to call the CreateInvoice endpoint.", + "ITEMS_READ": "__HTTP Method__: `GET`\n\nGrants read access to product catalog information. For example, to obtain objects in a product catalog.", + "ITEMS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to product catalog information. For example, to modify or\nadd to a product catalog.", + "LOYALTY_READ": "__HTTP Method__: `GET`\n\nGrants read access to loyalty information. For example, to call the\nListLoyaltyPrograms endpoint.", + "LOYALTY_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to loyalty information. For example, to call the\nCreateLoyaltyAccount endpoint.", + "MERCHANT_PROFILE_READ": "__HTTP Method__: `GET`\n\nGrants read access to business and location information. For example, to\nobtain a location ID for subsequent activity.", + "MERCHANT_PROFILE_WRITE": "__HTTP Method__: `POST`, `PUT`\n\nGrants write access to business and location information. For example, to create a new location or\nupdate the business hours at an existing location.", + "ONLINE_STORE_SITE_READ": "__HTTP Method__: `GET`, `POST`\n\nRead access to ECOM online store site details.", + "ONLINE_STORE_SNIPPETS_READ": "__HTTP Method__: `GET`, `POST`\n\nRead access to ECOM online store snippets on published websites.", + "ONLINE_STORE_SNIPPETS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nWrite access to ECOM online store snippets on published websites.", + "ORDERS_READ": "__HTTP Method__: `GET`\n\nGrants read access to order information. For example, to call the\nBatchRetrieveOrders endpoint.", + "ORDERS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to order information. For example, to call the\nCreateCheckout endpoint.", + "PAYMENTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to transaction and refund information. For example, to call\nthe RetrieveTransaction endpoint.", + "PAYMENTS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to transaction and refunds information. For example, to\nprocess payments with the Payments or Checkout API.", + "PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nAllow third party applications to deduct a portion of each transaction amount.\n__Required__ to use multiparty transaction functionality with the Payments\nAPI.", + "PAYMENTS_WRITE_IN_PERSON": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to payments and refunds information. For example, to\nprocess in-person payments.", + "PAYMENTS_WRITE_SHARED_ONFILE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nAllows the developer to process payments on behalf of a seller using a shared on file payment method.", + "PAYOUTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to payouts and payout entries information. For example,\nto call the Connect v2 `ListPayouts` endpoint.", + "PERMISSION_SETS_READ": "__HTTP Method__: `GET`\n\nGrants read access to Permission Sets. For example, to\ncall the `ListPermissionSets` and `RetrievePermissionSet` endpoints.", + "PERMISSION_SETS_WRITE": "__HTTP Method__: `PUT`\n\nGrants write access to Permission Sets.", + "RESERVATIONS_READ": "__HTTP Method__: `GET`\n\nGrants read access to reservation information, for example, when calling the\n`RetrieveReservation` endpoint.", + "RESERVATIONS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to reservation information, for example, when calling the\n`CreateReservation` endpoint.", + "RESTAURANT_CHECKS_READ": "__HTTP Method__: `GET`\n\nGrants read access to check information, for example, when calling the\n`RetrieveCheck` endpoint.", + "SETTLEMENTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to settlement (deposit) information. For example, to call\nthe Connect v1 ListSettlements endpoint.", + "SUBSCRIPTIONS_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to subscription information. For example, to call the RetrieveSubscription\nendpoint.", + "SUBSCRIPTIONS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to subscription information. For example, to call the CreateSubscription\nendpoint.", + "TIMECARDS_READ": "__HTTP Method__: `GET`\n\nGrants read access to employee timecard information. For example, to call the\nConnect v2 SearchShifts endpoint.", + "TIMECARDS_SETTINGS_READ": "__HTTP Method__: `GET`\n\nGrants read access to employee timecard settings information. For example, to\ncall the GetBreakType endpoint.", + "TIMECARDS_SETTINGS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to employee timecard settings information. For example, to\ncall the UpdateBreakType endpoint.", + "TIMECARDS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to employee shift information. For example, to create\nand modify employee shifts.", + "VENDOR_READ": "__HTTP Method__: `GET`, `POST`\n\nGrants read access to vendor information, for example, when calling the\n`RetrieveVendor` endpoint.", + "VENDOR_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to vendor information, for example, when calling the\n`BulkUpdateVendors` endpoint." + } + } + } + }, + "oauth2ClientSecret": { + "type": "apiKey", + "in": "header", + "name": "Authorization" + } + }, + "schemas": { + "ACHDetails": { + "type": "object", + "description": "ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`.", + "x-release-status": "PUBLIC", + "properties": { + "routing_number": { + "type": "string", + "description": "The routing number for the bank account.", + "maxLength": 50, + "nullable": true + }, + "account_number_suffix": { + "type": "string", + "description": "The last few digits of the bank account number.", + "minLength": 1, + "maxLength": 4, + "nullable": true + }, + "account_type": { + "type": "string", + "description": "The type of the bank account performing the transfer. The account type can be `CHECKING`,\n`SAVINGS`, or `UNKNOWN`.", + "maxLength": 50, + "nullable": true + } + } + }, + "AcceptDisputeResponse": { + "type": "object", + "description": "Defines the fields in an `AcceptDispute` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "dispute": { + "$ref": "#/components/schemas/Dispute", + "description": "Details about the accepted dispute." + } + }, + "example": { + "dispute": { + "amount_money": { + "amount": 2500, + "currency": "USD" + }, + "brand_dispute_id": "100000809947", + "card_brand": "VISA", + "created_at": "2022-06-29T18:45:22.265Z", + "disputed_payment": { + "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" + }, + "due_at": "2022-07-13T00:00:00.000Z", + "id": "XDgyFu7yo1E2S5lQGGpYn", + "location_id": "L1HN3ZMQK64X9", + "reason": "NO_KNOWLEDGE", + "reported_at": "2022-06-29T00:00:00.000Z", + "state": "ACCEPTED", + "updated_at": "2022-07-07T19:14:42.650Z", + "version": 2 + } + } + }, + "AcceptedPaymentMethods": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "apple_pay": { + "type": "boolean", + "description": "Whether Apple Pay is accepted at checkout.", + "nullable": true + }, + "google_pay": { + "type": "boolean", + "description": "Whether Google Pay is accepted at checkout.", + "nullable": true + }, + "cash_app_pay": { + "type": "boolean", + "description": "Whether Cash App Pay is accepted at checkout.", + "nullable": true + }, + "afterpay_clearpay": { + "type": "boolean", + "description": "Whether Afterpay/Clearpay is accepted at checkout.", + "nullable": true + } + } + }, + "AccumulateLoyaltyPointsRequest": { + "type": "object", + "description": "Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "required": [ + "accumulate_points", + "idempotency_key", + "location_id" + ], + "properties": { + "accumulate_points": { + "$ref": "#/components/schemas/LoyaltyEventAccumulatePoints", + "description": "The points to add to the account. \nIf you are using the Orders API to manage orders, specify the order ID.\nOtherwise, specify the points to add." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `AccumulateLoyaltyPoints` request. \nKeys can be any valid string but must be unique for every request.", + "minLength": 1, + "maxLength": 128 + }, + "location_id": { + "type": "string", + "description": "The [location](entity:Location) where the purchase was made." + } + }, + "example": { + "accumulate_points": { + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + }, + "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", + "location_id": "P034NEENMD09F" + } + }, + "AccumulateLoyaltyPointsResponse": { + "type": "object", + "description": "Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "event": { + "$ref": "#/components/schemas/LoyaltyEvent", + "description": "The resulting loyalty event. Starting in Square version 2022-08-17, this field is no longer returned.", + "x-release-status": "DEPRECATED" + }, + "events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyEvent" + }, + "description": "The resulting loyalty events. If the purchase qualifies for points, the `ACCUMULATE_POINTS` event\nis always included. When using the Orders API, the `ACCUMULATE_PROMOTION_POINTS` event is included\nif the purchase also qualifies for a loyalty promotion." + } + }, + "example": { + "events": [ + { + "accumulate_points": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", + "points": 6 + }, + "created_at": "2020-05-08T21:41:12Z", + "id": "ee46aafd-1af6-3695-a385-276e2ef0be26", + "location_id": "P034NEENMD09F", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "source": "LOYALTY_API", + "type": "ACCUMULATE_POINTS" + } + ] + } + }, + "ActionCancelReason": { + "type": "string", + "enum": [ + "BUYER_CANCELED", + "SELLER_CANCELED", + "TIMED_OUT" + ], + "x-enum-elements": [ + { + "name": "BUYER_CANCELED", + "description": "A person canceled the `TerminalCheckout` from a Square device." + }, + { + "name": "SELLER_CANCELED", + "description": "A client canceled the `TerminalCheckout` using the API." + }, + { + "name": "TIMED_OUT", + "description": "The `TerminalCheckout` timed out (see `deadline_duration` on the `TerminalCheckout`)." + } + ], + "x-release-status": "PUBLIC" + }, + "ActivityType": { + "type": "string", + "enum": [ + "ADJUSTMENT", + "APP_FEE_REFUND", + "APP_FEE_REVENUE", + "AUTOMATIC_SAVINGS", + "AUTOMATIC_SAVINGS_REVERSED", + "CHARGE", + "DEPOSIT_FEE", + "DEPOSIT_FEE_REVERSED", + "DISPUTE", + "ESCHEATMENT", + "FEE", + "FREE_PROCESSING", + "HOLD_ADJUSTMENT", + "INITIAL_BALANCE_CHANGE", + "MONEY_TRANSFER", + "MONEY_TRANSFER_REVERSAL", + "OPEN_DISPUTE", + "OTHER", + "OTHER_ADJUSTMENT", + "PAID_SERVICE_FEE", + "PAID_SERVICE_FEE_REFUND", + "REDEMPTION_CODE", + "REFUND", + "RELEASE_ADJUSTMENT", + "RESERVE_HOLD", + "RESERVE_RELEASE", + "RETURNED_PAYOUT", + "SQUARE_CAPITAL_PAYMENT", + "SQUARE_CAPITAL_REVERSED_PAYMENT", + "SUBSCRIPTION_FEE", + "SUBSCRIPTION_FEE_PAID_REFUND", + "SUBSCRIPTION_FEE_REFUND", + "TAX_ON_FEE", + "THIRD_PARTY_FEE", + "THIRD_PARTY_FEE_REFUND", + "PAYOUT", + "AUTOMATIC_BITCOIN_CONVERSIONS", + "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED", + "CREDIT_CARD_REPAYMENT", + "CREDIT_CARD_REPAYMENT_REVERSED", + "LOCAL_OFFERS_CASHBACK", + "LOCAL_OFFERS_FEE", + "PERCENTAGE_PROCESSING_ENROLLMENT", + "PERCENTAGE_PROCESSING_DEACTIVATION", + "PERCENTAGE_PROCESSING_REPAYMENT", + "PERCENTAGE_PROCESSING_REPAYMENT_REVERSED", + "PROCESSING_FEE", + "PROCESSING_FEE_REFUND", + "UNDO_PROCESSING_FEE_REFUND", + "GIFT_CARD_LOAD_FEE", + "GIFT_CARD_LOAD_FEE_REFUND", + "UNDO_GIFT_CARD_LOAD_FEE_REFUND", + "BALANCE_FOLDERS_TRANSFER", + "BALANCE_FOLDERS_TRANSFER_REVERSED", + "GIFT_CARD_POOL_TRANSFER", + "GIFT_CARD_POOL_TRANSFER_REVERSED", + "SQUARE_PAYROLL_TRANSFER", + "SQUARE_PAYROLL_TRANSFER_REVERSED" + ], + "x-enum-elements": [ + { + "name": "ADJUSTMENT", + "description": "A manual adjustment applied to the seller's account by Square." + }, + { + "name": "APP_FEE_REFUND", + "description": "A refund for an application fee on a payment." + }, + { + "name": "APP_FEE_REVENUE", + "description": "Revenue generated from an application fee on a payment." + }, + { + "name": "AUTOMATIC_SAVINGS", + "description": "An automatic transfer from the payment processing balance to the Square Savings account. These are generally proportional to the seller's sales." + }, + { + "name": "AUTOMATIC_SAVINGS_REVERSED", + "description": "An automatic transfer from the Square Savings account back to the processing balance. These are generally proportional to the seller's refunds." + }, + { + "name": "CHARGE", + "description": "A credit card payment capture." + }, + { + "name": "DEPOSIT_FEE", + "description": "A fee assessed because of a deposit, such as an instant deposit." + }, + { + "name": "DEPOSIT_FEE_REVERSED", + "description": "Indicates that Square returned a fee that was previously assessed because of a deposit, such as an instant deposit, back to the seller's account." + }, + { + "name": "DISPUTE", + "description": "The balance change due to a dispute event." + }, + { + "name": "ESCHEATMENT", + "description": "An escheatment entry for remittance." + }, + { + "name": "FEE", + "description": "The cost plus adjustment fee." + }, + { + "name": "FREE_PROCESSING", + "description": "Square offers free payments processing for a variety of business scenarios, including seller\nreferrals or when Square wants to apologize (for example, for a bug, customer service, or repricing complication).\nThis entry represents a credit to the seller for the purposes of free processing." + }, + { + "name": "HOLD_ADJUSTMENT", + "description": "An adjustment made by Square related to holding a payment." + }, + { + "name": "INITIAL_BALANCE_CHANGE", + "description": "An external change to a seller's balance (initial, in the sense that it causes the creation of the other activity types, such as a hold and refund)." + }, + { + "name": "MONEY_TRANSFER", + "description": "The balance change from a money transfer." + }, + { + "name": "MONEY_TRANSFER_REVERSAL", + "description": "The reversal of a money transfer." + }, + { + "name": "OPEN_DISPUTE", + "description": "The balance change for a chargeback that's been filed." + }, + { + "name": "OTHER", + "description": "Any other type that doesn't belong in the rest of the types." + }, + { + "name": "OTHER_ADJUSTMENT", + "description": "Any other type of adjustment that doesn't fall under existing types." + }, + { + "name": "PAID_SERVICE_FEE", + "description": "A fee paid to a third-party seller." + }, + { + "name": "PAID_SERVICE_FEE_REFUND", + "description": "A fee refunded to a third-party seller." + }, + { + "name": "REDEMPTION_CODE", + "description": "Repayment for a redemption code." + }, + { + "name": "REFUND", + "description": "A refund for an existing card payment." + }, + { + "name": "RELEASE_ADJUSTMENT", + "description": "An adjustment made by Square related to releasing a payment." + }, + { + "name": "RESERVE_HOLD", + "description": "Fees paid for a funding risk reserve." + }, + { + "name": "RESERVE_RELEASE", + "description": "Fees released from a risk reserve." + }, + { + "name": "RETURNED_PAYOUT", + "description": "An entry created when Square receives a response for the ACH file that Square sent indicating that the\nsettlement of the original entry failed." + }, + { + "name": "SQUARE_CAPITAL_PAYMENT", + "description": "A capital merchant cash advance (MCA) assessment. These are generally proportional to the merchant's sales but can be issued for other reasons related to the MCA." + }, + { + "name": "SQUARE_CAPITAL_REVERSED_PAYMENT", + "description": "A capital merchant cash advance (MCA) assessment refund. These are generally proportional to the merchant's refunds but can be issued for other reasons related to the MCA." + }, + { + "name": "SUBSCRIPTION_FEE", + "description": "A fee charged for subscription to a Square product." + }, + { + "name": "SUBSCRIPTION_FEE_PAID_REFUND", + "description": "A Square subscription fee that's been refunded." + }, + { + "name": "SUBSCRIPTION_FEE_REFUND", + "description": "The refund of a previously charged Square product subscription fee." + }, + { + "name": "TAX_ON_FEE", + "description": "The tax paid on fee amounts." + }, + { + "name": "THIRD_PARTY_FEE", + "description": "Fees collected by a third-party platform." + }, + { + "name": "THIRD_PARTY_FEE_REFUND", + "description": "Refunded fees from a third-party platform." + }, + { + "name": "PAYOUT", + "description": "The balance change due to a money transfer. Note that this type is never returned by the Payouts API." + }, + { + "name": "AUTOMATIC_BITCOIN_CONVERSIONS", + "description": "Indicates that the portion of each payment withheld by Square was automatically converted into bitcoin using Cash App. The seller manages their bitcoin in their Cash App account." + }, + { + "name": "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED", + "description": "Indicates that a withheld payment, which was scheduled to be converted into bitcoin using Cash App, was deposited back to the Square payments balance." + }, + { + "name": "CREDIT_CARD_REPAYMENT", + "description": "Indicates that a repayment toward the outstanding balance on the seller's Square credit card was made." + }, + { + "name": "CREDIT_CARD_REPAYMENT_REVERSED", + "description": "Indicates that a repayment toward the outstanding balance on the seller's Square credit card was reversed." + }, + { + "name": "LOCAL_OFFERS_CASHBACK", + "description": "Cashback amount given by a Square Local Offers seller to their customer for a purchase." + }, + { + "name": "LOCAL_OFFERS_FEE", + "description": "A commission fee paid by a Square Local Offers seller to Square for a purchase discovered through Square Local Offers." + }, + { + "name": "PERCENTAGE_PROCESSING_ENROLLMENT", + "description": "When activating Percentage Processing, a credit is applied to the seller’s account to offset any negative balance caused by a dispute." + }, + { + "name": "PERCENTAGE_PROCESSING_DEACTIVATION", + "description": "Deducting the outstanding Percentage Processing balance from the seller’s account. It's the final installment in repaying the dispute-induced negative balance through percentage processing." + }, + { + "name": "PERCENTAGE_PROCESSING_REPAYMENT", + "description": "Withheld funds from a payment to cover a negative balance. It's an installment to repay the amount from a dispute that had been offset during Percentage Processing enrollment." + }, + { + "name": "PERCENTAGE_PROCESSING_REPAYMENT_REVERSED", + "description": "The reversal of a percentage processing repayment that happens for example when a refund is issued for a payment." + }, + { + "name": "PROCESSING_FEE", + "description": "The processing fee for a payment. If sellers opt for Gross Settlement, i.e., direct bank withdrawal instead of deducting fees from daily sales, the processing fee is recorded separately as a new payout entry, not part of the CHARGE payout entry." + }, + { + "name": "PROCESSING_FEE_REFUND", + "description": "The processing fee for a payment refund issued by sellers enrolled in Gross Settlement. The refunded processing fee is recorded separately as a new payout entry, not part of the REFUND payout entry." + }, + { + "name": "UNDO_PROCESSING_FEE_REFUND", + "description": "When undoing a processing fee refund in a Gross Settlement payment, this payout entry type is used." + }, + { + "name": "GIFT_CARD_LOAD_FEE", + "description": "Fee collected during the sale or reload of a gift card. This fee, which is a portion of the amount loaded on the gift card, is deducted from the merchant's payment balance." + }, + { + "name": "GIFT_CARD_LOAD_FEE_REFUND", + "description": "Refund for fee charged during the sale or reload of a gift card." + }, + { + "name": "UNDO_GIFT_CARD_LOAD_FEE_REFUND", + "description": "The undo of a refund for a fee charged during the sale or reload of a gift card." + }, + { + "name": "BALANCE_FOLDERS_TRANSFER", + "description": "A transfer of funds to a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.'" + }, + { + "name": "BALANCE_FOLDERS_TRANSFER_REVERSED", + "description": "A reversal of transfer of funds from a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.'" + }, + { + "name": "GIFT_CARD_POOL_TRANSFER", + "description": "A transfer of gift card funds to a central gift card pool account. In franchises, when gift cards are loaded or reloaded at any location, the money transfers to the franchisor's account." + }, + { + "name": "GIFT_CARD_POOL_TRANSFER_REVERSED", + "description": "A reversal of transfer of gift card funds from a central gift card pool account. In franchises, when gift cards are loaded or reloaded at any location, the money transfers to the franchisor's account." + }, + { + "name": "SQUARE_PAYROLL_TRANSFER", + "description": "A payroll payment that was transferred to a team member’s bank account." + }, + { + "name": "SQUARE_PAYROLL_TRANSFER_REVERSED", + "description": "A payroll payment to a team member’s bank account that was deposited back to the seller’s account by Square." + } + ], + "x-release-status": "PUBLIC" + }, + "AddGroupToCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [AddGroupToCustomer](api-endpoint:Customers-AddGroupToCustomer) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "AdditionalRecipient": { + "type": "object", + "description": "Represents an additional recipient (other than the merchant) receiving a portion of this tender.", + "x-release-status": "DEPRECATED", + "required": [ + "location_id", + "amount_money" + ], + "properties": { + "location_id": { + "type": "string", + "description": "The location ID for a recipient (other than the merchant) receiving a portion of this tender.", + "minLength": 1, + "maxLength": 50 + }, + "description": { + "type": "string", + "description": "The description of the additional recipient.", + "maxLength": 100, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money distributed to the recipient." + }, + "receivable_id": { + "type": "string", + "description": "The unique ID for the RETIRED `AdditionalRecipientReceivable` object. This field should be empty for any `AdditionalRecipient` objects created after the retirement.", + "maxLength": 192, + "nullable": true + } + } + }, + "Address": { + "type": "object", + "description": "Represents a postal address in a country. \nFor more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).", + "x-release-status": "PUBLIC", + "properties": { + "address_line_1": { + "type": "string", + "description": "The first line of the address.\n\nFields that start with `address_line` provide the address's most specific\ndetails, like street number, street name, and building name. They do *not*\nprovide less specific details like city, state/province, or country (these\ndetails are provided in other fields).", + "nullable": true + }, + "address_line_2": { + "type": "string", + "description": "The second line of the address, if any.", + "nullable": true + }, + "address_line_3": { + "type": "string", + "description": "The third line of the address, if any.", + "nullable": true + }, + "locality": { + "type": "string", + "description": "The city or town of the address. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).", + "nullable": true + }, + "sublocality": { + "type": "string", + "description": "A civil region within the address's `locality`, if any.", + "nullable": true + }, + "sublocality_2": { + "type": "string", + "description": "A civil region within the address's `sublocality`, if any.", + "nullable": true + }, + "sublocality_3": { + "type": "string", + "description": "A civil region within the address's `sublocality_2`, if any.", + "nullable": true + }, + "administrative_district_level_1": { + "type": "string", + "description": "A civil entity within the address's country. In the US, this\nis the state. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).", + "nullable": true + }, + "administrative_district_level_2": { + "type": "string", + "description": "A civil entity within the address's `administrative_district_level_1`.\nIn the US, this is the county.", + "nullable": true + }, + "administrative_district_level_3": { + "type": "string", + "description": "A civil entity within the address's `administrative_district_level_2`,\nif any.", + "nullable": true + }, + "postal_code": { + "type": "string", + "description": "The address's postal code. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).", + "nullable": true + }, + "country": { + "$ref": "#/components/schemas/Country", + "description": "The address's country, in the two-letter format of ISO 3166. For example, `US` or `FR`.\nSee [Country](#type-country) for possible values", + "nullable": true + }, + "first_name": { + "type": "string", + "description": "Optional first name when it's representing recipient.", + "nullable": true + }, + "last_name": { + "type": "string", + "description": "Optional last name when it's representing recipient.", + "nullable": true + } + } + }, + "AdjustLoyaltyPointsRequest": { + "type": "object", + "description": "Represents an [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "required": [ + "idempotency_key", + "adjust_points" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `AdjustLoyaltyPoints` request. \nKeys can be any valid string, but must be unique for every request.", + "minLength": 1, + "maxLength": 128 + }, + "adjust_points": { + "$ref": "#/components/schemas/LoyaltyEventAdjustPoints", + "description": "The points to add or subtract and the reason for the adjustment. To add points, specify a positive integer.\nTo subtract points, specify a negative integer." + }, + "allow_negative_balance": { + "type": "boolean", + "description": "Indicates whether to allow a negative adjustment to result in a negative balance. If `true`, a negative\nbalance is allowed when subtracting points. If `false`, Square returns a `BAD_REQUEST` error when subtracting\nthe specified number of points would result in a negative balance. The default value is `false`.", + "nullable": true + } + }, + "example": { + "adjust_points": { + "points": 10, + "reason": "Complimentary points" + }, + "idempotency_key": "bc29a517-3dc9-450e-aa76-fae39ee849d1" + } + }, + "AdjustLoyaltyPointsResponse": { + "type": "object", + "description": "Represents an [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "event": { + "$ref": "#/components/schemas/LoyaltyEvent", + "description": "The resulting event data for the adjustment." + } + }, + "example": { + "event": { + "adjust_points": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "points": 10, + "reason": "Complimentary points" + }, + "created_at": "2020-05-08T21:42:32Z", + "id": "613a6fca-8d67-39d0-bad2-3b4bc45c8637", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "source": "LOYALTY_API", + "type": "ADJUST_POINTS" + } + } + }, + "AfterpayDetails": { + "type": "object", + "description": "Additional details about Afterpay payments.", + "x-release-status": "PUBLIC", + "properties": { + "email_address": { + "type": "string", + "description": "Email address on the buyer's Afterpay account.", + "maxLength": 255, + "nullable": true + } + } + }, + "ApplicationDetails": { + "type": "object", + "description": "Details about the application that took the payment.", + "x-release-status": "PUBLIC", + "properties": { + "square_product": { + "$ref": "#/components/schemas/ApplicationDetailsExternalSquareProduct", + "description": "The Square product, such as Square Point of Sale (POS), \nSquare Invoices, or Square Virtual Terminal.\nSee [ExternalSquareProduct](#type-externalsquareproduct) for possible values", + "nullable": true + }, + "application_id": { + "type": "string", + "description": "The Square ID assigned to the application used to take the payment. \nApplication developers can use this information to identify payments that \ntheir application processed. \nFor example, if a developer uses a custom application to process payments, \nthis field contains the application ID from the Developer Dashboard. \nIf a seller uses a [Square App Marketplace](https://developer.squareup.com/docs/app-marketplace) \napplication to process payments, the field contains the corresponding application ID.", + "nullable": true + } + } + }, + "ApplicationDetailsExternalSquareProduct": { + "type": "string", + "enum": [ + "APPOINTMENTS", + "ECOMMERCE_API", + "INVOICES", + "ONLINE_STORE", + "OTHER", + "RESTAURANTS", + "RETAIL", + "SQUARE_POS", + "TERMINAL_API", + "VIRTUAL_TERMINAL" + ], + "x-enum-elements": [ + { + "name": "APPOINTMENTS", + "description": "" + }, + { + "name": "ECOMMERCE_API", + "description": "" + }, + { + "name": "INVOICES", + "description": "" + }, + { + "name": "ONLINE_STORE", + "description": "" + }, + { + "name": "OTHER", + "description": "" + }, + { + "name": "RESTAURANTS", + "description": "" + }, + { + "name": "RETAIL", + "description": "" + }, + { + "name": "SQUARE_POS", + "description": "" + }, + { + "name": "TERMINAL_API", + "description": "" + }, + { + "name": "VIRTUAL_TERMINAL", + "description": "" + } + ], + "description": "A list of products to return to external callers.", + "x-release-status": "PUBLIC" + }, + "ApplicationType": { + "type": "string", + "enum": [ + "TERMINAL_API" + ], + "x-enum-elements": [ + { + "name": "TERMINAL_API", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "AppointmentSegment": { + "type": "object", + "description": "Defines an appointment segment of a booking.", + "x-release-status": "PUBLIC", + "required": [ + "team_member_id" + ], + "properties": { + "duration_minutes": { + "type": "integer", + "description": "The time span in minutes of an appointment segment.", + "maximum": 1500, + "nullable": true + }, + "service_variation_id": { + "type": "string", + "description": "The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.", + "maxLength": 36, + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "The ID of the [TeamMember](entity:TeamMember) object representing the team member booked in this segment.", + "minLength": 1, + "maxLength": 32 + }, + "service_variation_version": { + "type": "integer", + "description": "The current version of the item variation representing the service booked in this segment.", + "format": "int64", + "nullable": true + }, + "intermission_minutes": { + "type": "integer", + "description": "Time between the end of this segment and the beginning of the subsequent segment.", + "readOnly": true + }, + "any_team_member": { + "type": "boolean", + "description": "Whether the customer accepts any team member, instead of a specific one, to serve this segment.", + "readOnly": true + }, + "resource_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the seller-accessible resources used for this appointment segment.", + "readOnly": true + } + } + }, + "ArchivedState": { + "type": "string", + "enum": [ + "ARCHIVED_STATE_NOT_ARCHIVED", + "ARCHIVED_STATE_ARCHIVED", + "ARCHIVED_STATE_ALL" + ], + "x-enum-elements": [ + { + "name": "ARCHIVED_STATE_NOT_ARCHIVED", + "description": "Requested items are not archived with the `is_archived` attribute set to `false`." + }, + { + "name": "ARCHIVED_STATE_ARCHIVED", + "description": "Requested items are archived with the `is_archived` attribute set to `true`." + }, + { + "name": "ARCHIVED_STATE_ALL", + "description": "Requested items can be archived or not archived." + } + ], + "description": "Defines the values for the `archived_state` query expression \nused in [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) \nto return the archived, not archived or either type of catalog items.", + "x-release-status": "PUBLIC" + }, + "Availability": { + "type": "object", + "description": "Defines an appointment slot that encapsulates the appointment segments, location and starting time available for booking.", + "x-release-status": "PUBLIC", + "properties": { + "start_at": { + "type": "string", + "description": "The RFC 3339 timestamp specifying the beginning time of the slot available for booking.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location available for booking.", + "maxLength": 32, + "readOnly": true + }, + "appointment_segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AppointmentSegment" + }, + "description": "The list of appointment segments available for booking", + "nullable": true + } + } + }, + "BankAccount": { + "type": "object", + "description": "Represents a bank account. For more information about \nlinking a bank account to a Square account, see \n[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api).", + "x-release-status": "PUBLIC", + "required": [ + "id", + "account_number_suffix", + "country", + "currency", + "account_type", + "holder_name", + "primary_bank_identification_number", + "status", + "creditable", + "debitable" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique, Square-issued identifier for the bank account.", + "minLength": 1, + "maxLength": 30 + }, + "account_number_suffix": { + "type": "string", + "description": "The last few digits of the account number.", + "minLength": 1 + }, + "country": { + "$ref": "#/components/schemas/Country", + "description": "The ISO 3166 Alpha-2 country code where the bank account is based.\nSee [Country](#type-country) for possible values" + }, + "currency": { + "$ref": "#/components/schemas/Currency", + "description": "The 3-character ISO 4217 currency code indicating the operating\ncurrency of the bank account. For example, the currency code for US dollars\nis `USD`.\nSee [Currency](#type-currency) for possible values" + }, + "account_type": { + "$ref": "#/components/schemas/BankAccountType", + "description": "The financial purpose of the associated bank account.\nSee [BankAccountType](#type-bankaccounttype) for possible values" + }, + "holder_name": { + "type": "string", + "description": "Name of the account holder. This name must match the name \non the targeted bank account record.", + "minLength": 1 + }, + "primary_bank_identification_number": { + "type": "string", + "description": "Primary identifier for the bank. For more information, see \n[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api).", + "maxLength": 40 + }, + "secondary_bank_identification_number": { + "type": "string", + "description": "Secondary identifier for the bank. For more information, see \n[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api).", + "maxLength": 40, + "nullable": true + }, + "debit_mandate_reference_id": { + "type": "string", + "description": "Reference identifier that will be displayed to UK bank account owners\nwhen collecting direct debit authorization. Only required for UK bank accounts.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "Client-provided identifier for linking the banking account to an entity\nin a third-party system (for example, a bank account number or a user identifier).", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The location to which the bank account belongs.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/BankAccountStatus", + "description": "Read-only. The current verification status of this BankAccount object.\nSee [BankAccountStatus](#type-bankaccountstatus) for possible values" + }, + "creditable": { + "type": "boolean", + "description": "Indicates whether it is possible for Square to send money to this bank account." + }, + "debitable": { + "type": "boolean", + "description": "Indicates whether it is possible for Square to take money from this \nbank account." + }, + "fingerprint": { + "type": "string", + "description": "A Square-assigned, unique identifier for the bank account based on the\naccount information. The account fingerprint can be used to compare account\nentries and determine if the they represent the same real-world bank account.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The current version of the `BankAccount`." + }, + "bank_name": { + "type": "string", + "description": "Read only. Name of actual financial institution. \nFor example \"Bank of America\".", + "maxLength": 100, + "nullable": true + } + } + }, + "BankAccountCreatedEvent": { + "type": "object", + "description": "Published when you link an external bank account to a Square\naccount in the Seller Dashboard. Square sets the initial status to\n`VERIFICATION_IN_PROGRESS` and publishes the event.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"bank_account.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/BankAccountCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "bact:cgvL1yv43VFjexample", + "object": { + "bank_account": { + "account_number_suffix": "526", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": true, + "currency": "USD", + "debitable": true, + "holder_name": "John Doe", + "id": "bact:cgvL1yv43VFjexample", + "location_id": "S8GWD5DBJ3HF3", + "primary_bank_identification_number": "101211111", + "status": "VERIFICATION_IN_PROGRESS", + "version": 1 + } + }, + "type": "bank_account" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "location_id": "S8GWD5DBJ3HF3", + "merchant_id": "6SSW7HV8K2ST5", + "type": "bank_account.created" + }, + "x-webhook": { + "event": "bank_account.created", + "scopes": [ + "BANK_ACCOUNTS_READ" + ] + }, + "x-api": "#/components/x-apis/BankAccounts", + "x-since": "2020-02-26" + }, + "BankAccountCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"bank_account\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected bank account." + }, + "object": { + "$ref": "#/components/schemas/BankAccountCreatedEventObject", + "description": "An object containing the created bank account.", + "nullable": true + } + } + }, + "BankAccountCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "bank_account": { + "$ref": "#/components/schemas/BankAccount", + "description": "The created bank account.", + "nullable": true + } + } + }, + "BankAccountDisabledEvent": { + "type": "object", + "description": "Published when Square sets the status of a\n[BankAccount](entity:BankAccount) to `DISABLED`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"bank_account.disabled\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was disabled, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/BankAccountDisabledEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "bact:cgvL1yv43VFjexample", + "object": { + "bank_account": { + "account_number_suffix": "526", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": true, + "currency": "USD", + "debitable": true, + "holder_name": "John Doe", + "id": "bact:cgvL1yv43VFjexample", + "location_id": "S8GWD5DBJ3HF3", + "primary_bank_identification_number": "101211111", + "status": "DISABLED", + "version": 5 + } + }, + "type": "bank_account" + }, + "event_id": "43e8b5c7-706f-49bf-8e2a-90fbe96af93e", + "location_id": "S8GWD5DBJ3HF3", + "merchant_id": "6SSW7HV8K2ST5", + "type": "bank_account.disabled" + }, + "x-webhook": { + "event": "bank_account.disabled", + "scopes": [ + "BANK_ACCOUNTS_READ" + ] + }, + "x-api": "#/components/x-apis/BankAccounts", + "x-since": "2020-02-26" + }, + "BankAccountDisabledEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"bank_account\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected bank account." + }, + "object": { + "$ref": "#/components/schemas/BankAccountDisabledEventObject", + "description": "An object containing the disabled bank account.", + "nullable": true + } + } + }, + "BankAccountDisabledEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "bank_account": { + "$ref": "#/components/schemas/BankAccount", + "description": "The disabled bank account.", + "nullable": true + } + } + }, + "BankAccountPaymentDetails": { + "type": "object", + "description": "Additional details about BANK_ACCOUNT type payments.", + "x-release-status": "PUBLIC", + "properties": { + "bank_name": { + "type": "string", + "description": "The name of the bank associated with the bank account.", + "maxLength": 100, + "nullable": true + }, + "transfer_type": { + "type": "string", + "description": "The type of the bank transfer. The type can be `ACH` or `UNKNOWN`.", + "maxLength": 50, + "nullable": true + }, + "account_ownership_type": { + "type": "string", + "description": "The ownership type of the bank account performing the transfer.\nThe type can be `INDIVIDUAL`, `COMPANY`, or `ACCOUNT_TYPE_UNKNOWN`.", + "maxLength": 50, + "nullable": true + }, + "fingerprint": { + "type": "string", + "description": "Uniquely identifies the bank account for this seller and can be used\nto determine if payments are from the same bank account.", + "maxLength": 255, + "nullable": true + }, + "country": { + "type": "string", + "description": "The two-letter ISO code representing the country the bank account is located in.", + "minLength": 2, + "maxLength": 2, + "nullable": true + }, + "statement_description": { + "type": "string", + "description": "The statement description as sent to the bank.", + "maxLength": 1000, + "nullable": true + }, + "ach_details": { + "$ref": "#/components/schemas/ACHDetails", + "description": "ACH-specific information about the transfer. The information is only populated\nif the `transfer_type` is `ACH`.", + "nullable": true + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request.", + "nullable": true + } + } + }, + "BankAccountStatus": { + "type": "string", + "enum": [ + "VERIFICATION_IN_PROGRESS", + "VERIFIED", + "DISABLED" + ], + "x-enum-elements": [ + { + "name": "VERIFICATION_IN_PROGRESS", + "description": "Indicates that the verification process has started. Some features\n(for example, creditable or debitable) may be provisionally enabled on the bank\naccount." + }, + { + "name": "VERIFIED", + "description": "Indicates that the bank account was successfully verified." + }, + { + "name": "DISABLED", + "description": "Indicates that the bank account is disabled and is permanently unusable\nfor funds transfer. A bank account can be disabled because of a failed verification\nattempt or a failed deposit attempt." + } + ], + "description": "Indicates the current verification status of a `BankAccount` object.", + "x-release-status": "PUBLIC" + }, + "BankAccountType": { + "type": "string", + "enum": [ + "CHECKING", + "SAVINGS", + "INVESTMENT", + "OTHER", + "BUSINESS_CHECKING" + ], + "x-enum-elements": [ + { + "name": "CHECKING", + "description": "An account at a financial institution against which checks can be\ndrawn by the account depositor." + }, + { + "name": "SAVINGS", + "description": "An account at a financial institution that pays interest but cannot be\nused directly as money in the narrow sense of a medium of exchange." + }, + { + "name": "INVESTMENT", + "description": "An account at a financial institution that contains a deposit of funds\nand/or securities." + }, + { + "name": "OTHER", + "description": "An account at a financial institution which cannot be described by the\nother types." + }, + { + "name": "BUSINESS_CHECKING", + "description": "An account at a financial institution against which checks can be\ndrawn specifically for business purposes (non-personal use)." + } + ], + "description": "Indicates the financial purpose of the bank account.", + "x-release-status": "PUBLIC" + }, + "BankAccountVerifiedEvent": { + "type": "object", + "description": "Published when Square sets the status of a\n[BankAccount](entity:BankAccount) to `VERIFIED`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"bank_account.verified\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was verified, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/BankAccountVerifiedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "bact:cgvL1yv43VFjexample", + "object": { + "bank_account": { + "account_number_suffix": "526", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": true, + "currency": "USD", + "debitable": true, + "holder_name": "John Doe", + "id": "bact:cgvL1yv43VFjexample", + "location_id": "S8GWD5DBJ3HF3", + "primary_bank_identification_number": "101211111", + "status": "VERIFIED", + "version": 4 + } + }, + "type": "bank_account" + }, + "event_id": "4166853c-0e4c-4202-8fd8-7e65a8f42389", + "location_id": "S8GWD5DBJ3HF3", + "merchant_id": "6SSW7HV8K2ST5", + "type": "bank_account.verified" + }, + "x-webhook": { + "event": "bank_account.verified", + "scopes": [ + "BANK_ACCOUNTS_READ" + ] + }, + "x-api": "#/components/x-apis/BankAccounts", + "x-since": "2020-02-26" + }, + "BankAccountVerifiedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"bank_account\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected bank account." + }, + "object": { + "$ref": "#/components/schemas/BankAccountVerifiedEventObject", + "description": "An object containing the verified bank account.", + "nullable": true + } + } + }, + "BankAccountVerifiedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "bank_account": { + "$ref": "#/components/schemas/BankAccount", + "description": "The verified bank account.", + "nullable": true + } + } + }, + "BatchChangeInventoryRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A client-supplied, universally unique identifier (UUID) for the\nrequest.\n\nSee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the\n[API Development 101](https://developer.squareup.com/docs/buildbasics) section for more\ninformation.", + "minLength": 1, + "maxLength": 128 + }, + "changes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryChange" + }, + "description": "The set of physical counts and inventory adjustments to be made.\nChanges are applied based on the client-supplied timestamp and may be sent\nout of order.", + "nullable": true + }, + "ignore_unchanged_counts": { + "type": "boolean", + "description": "Indicates whether the current physical count should be ignored if\nthe quantity is unchanged since the last physical count. Default: `true`.", + "nullable": true + } + }, + "example": { + "changes": [ + { + "physical_count": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "location_id": "C6W5YS5QM06F5", + "occurred_at": "2016-11-16T22:25:24.878Z", + "quantity": "53", + "reference_id": "1536bfbf-efed-48bf-b17d-a197141b2a92", + "state": "IN_STOCK", + "team_member_id": "LRK57NSQ5X7PUD05" + }, + "type": "PHYSICAL_COUNT" + } + ], + "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", + "ignore_unchanged_counts": true + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.csharp", + "java": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.java", + "javascript": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.javascript", + "php": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.php", + "python": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.python", + "ruby": "/sdk_samples/Inventory/BatchChangeInventory/BatchChangeInventoryRequest.ruby" + } + }, + "BatchChangeInventoryResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "counts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryCount" + }, + "description": "The current counts for all objects referenced in the request." + }, + "changes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryChange" + }, + "description": "Changes created for the request.", + "x-release-status": "BETA" + } + }, + "example": { + "counts": [ + { + "calculated_at": "2016-11-16T22:28:01.223Z", + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "location_id": "C6W5YS5QM06F5", + "quantity": "53", + "state": "IN_STOCK" + } + ], + "errors": [] + } + }, + "BatchDeleteCatalogObjectsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "object_ids" + ], + "properties": { + "object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the CatalogObjects to be deleted. When an object is deleted, other objects\nin the graph that depend on that object will be deleted as well (for example, deleting a\nCatalogItem will delete its CatalogItemVariation." + } + }, + "example": { + "object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI", + "AA27W3M2GGTF3H6AVPNB77CK" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.csharp", + "java": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.java", + "javascript": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.javascript", + "php": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.php", + "python": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.python", + "ruby": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsRequest.ruby" + } + }, + "BatchDeleteCatalogObjectsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "deleted_object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of all CatalogObjects deleted by this request." + }, + "deleted_at": { + "type": "string", + "description": "The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this deletion in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"." + } + }, + "example": { + "deleted_at": "2016-11-16T22:25:24.878Z", + "deleted_object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI", + "AA27W3M2GGTF3H6AVPNB77CK" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.csharp", + "java": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.java", + "javascript": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.javascript", + "php": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.php", + "python": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.python", + "ruby": "/sdk_samples/Catalog/BatchDeleteCatalogObjects/BatchDeleteCatalogObjectsResponse.ruby" + } + }, + "BatchRetrieveCatalogObjectsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "object_ids" + ], + "properties": { + "object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the CatalogObjects to be retrieved." + }, + "include_related_objects": { + "type": "boolean", + "description": "If `true`, the response will include additional objects that are related to the\nrequested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field\nof the response. These objects are put in the `related_objects` field. Setting this to `true` is\nhelpful when the objects are needed for immediate display to a user.\nThis process only goes one level deep. Objects referenced by the related objects will not be included. For example,\n\nif the `objects` field of the response contains a CatalogItem, its associated\nCatalogCategory objects, CatalogTax objects, CatalogImage objects and\nCatalogModifierLists will be returned in the `related_objects` field of the\nresponse. If the `objects` field of the response contains a CatalogItemVariation,\nits parent CatalogItem will be returned in the `related_objects` field of\nthe response.\n\nDefault value: `false`", + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The specific version of the catalog objects to be included in the response. \nThis allows you to retrieve historical versions of objects. The specified version value is matched against\nthe [CatalogObject](entity:CatalogObject)s' `version` attribute. If not included, results will\nbe from the current version of the catalog.", + "format": "int64", + "x-release-status": "BETA", + "nullable": true + }, + "include_deleted_objects": { + "type": "boolean", + "description": "Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`.", + "nullable": true + }, + "include_category_path_to_root": { + "type": "boolean", + "description": "Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists\nof `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category\nand ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned\nin the response payload.", + "nullable": true + } + }, + "example": { + "include_related_objects": true, + "object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI", + "AA27W3M2GGTF3H6AVPNB77CK" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.csharp", + "java": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.java", + "javascript": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.javascript", + "php": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.php", + "python": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.python", + "ruby": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsRequest.ruby" + } + }, + "BatchRetrieveCatalogObjectsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of [CatalogObject](entity:CatalogObject)s returned." + }, + "related_objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of [CatalogObject](entity:CatalogObject)s referenced by the object in the `objects` field." + } + }, + "example": { + "objects": [ + { + "id": "W62UWFY35CWMYGVWK6TWJDNI", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "ordinal": 0 + } + ], + "description": "Hot Leaf Juice", + "name": "Tea", + "tax_ids": [ + "HURXQOOAIC4IZSI2BEXQRYFY" + ], + "variations": [ + { + "id": "2TZFAOHWGG7PAK2QEXWYPZSP", + "is_deleted": false, + "item_variation_data": { + "item_id": "W62UWFY35CWMYGVWK6TWJDNI", + "name": "Mug", + "ordinal": 0, + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + }, + { + "id": "AA27W3M2GGTF3H6AVPNB77CK", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "ordinal": 0 + } + ], + "description": "Hot Bean Juice", + "name": "Coffee", + "tax_ids": [ + "HURXQOOAIC4IZSI2BEXQRYFY" + ], + "variations": [ + { + "id": "LBTYIHNHU52WOIHWT7SNRIYH", + "is_deleted": false, + "item_variation_data": { + "item_id": "AA27W3M2GGTF3H6AVPNB77CK", + "name": "Regular", + "ordinal": 0, + "price_money": { + "amount": 250, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + }, + { + "id": "PKYIC7HGGKW5CYVSCVDEIMHY", + "is_deleted": false, + "item_variation_data": { + "item_id": "AA27W3M2GGTF3H6AVPNB77CK", + "name": "Large", + "ordinal": 1, + "price_money": { + "amount": 350, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ], + "related_objects": [ + { + "category_data": { + "name": "Beverages" + }, + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "is_deleted": false, + "present_at_all_locations": true, + "type": "CATEGORY", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + }, + { + "id": "HURXQOOAIC4IZSI2BEXQRYFY", + "is_deleted": false, + "present_at_all_locations": true, + "tax_data": { + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.csharp", + "java": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.java", + "javascript": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.javascript", + "php": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.php", + "python": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.python", + "ruby": "/sdk_samples/Catalog/BatchRetrieveCatalogObjects/BatchRetrieveCatalogObjectsResponse.ruby" + } + }, + "BatchRetrieveInventoryChangesRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "catalog_object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The filter to return results by `CatalogObject` ID.\nThe filter is only applicable when set. The default value is null.", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The filter to return results by `Location` ID.\nThe filter is only applicable when set. The default value is null.", + "nullable": true + }, + "types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryChangeType" + }, + "description": "The filter to return results by `InventoryChangeType` values other than `TRANSFER`.\nThe default value is `[PHYSICAL_COUNT, ADJUSTMENT]`.", + "nullable": true + }, + "states": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryState" + }, + "description": "The filter to return `ADJUSTMENT` query results by\n`InventoryState`. This filter is only applied when set.\nThe default value is null.", + "nullable": true + }, + "updated_after": { + "type": "string", + "description": "The filter to return results with their `calculated_at` value\nafter the given time as specified in an RFC 3339 timestamp.\nThe default value is the UNIX epoch of (`1970-01-01T00:00:00Z`).", + "nullable": true + }, + "updated_before": { + "type": "string", + "description": "The filter to return results with their `created_at` or `calculated_at` value\nstrictly before the given time as specified in an RFC 3339 timestamp.\nThe default value is the UNIX epoch of (`1970-01-01T00:00:00Z`).", + "nullable": true + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.", + "nullable": true + }, + "limit": { + "type": "integer", + "description": "The number of [records](entity:InventoryChange) to return.", + "minimum": 1, + "maximum": 1000, + "nullable": true + } + }, + "example": { + "catalog_object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI" + ], + "location_ids": [ + "C6W5YS5QM06F5" + ], + "states": [ + "IN_STOCK" + ], + "types": [ + "PHYSICAL_COUNT" + ], + "updated_after": "2016-11-01T00:00:00.000Z", + "updated_before": "2016-12-01T00:00:00.000Z" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.csharp", + "java": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.java", + "javascript": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.javascript", + "php": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.php", + "python": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.python", + "ruby": "/sdk_samples/Inventory/BatchRetrieveInventoryChanges/BatchRetrieveInventoryChangesRequest.ruby" + } + }, + "BatchRetrieveInventoryChangesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "changes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryChange" + }, + "description": "The current calculated inventory changes for the requested objects\nand locations." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "changes": [ + { + "physical_count": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-16T22:25:24.878Z", + "id": "46YDTW253DWGGK9HMAE6XCAO", + "location_id": "C6W5YS5QM06F5", + "occurred_at": "2016-11-16T22:24:49.028Z", + "quantity": "86", + "reference_id": "22c07cf4-5626-4224-89f9-691112019399", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "state": "IN_STOCK", + "team_member_id": "LRK57NSQ5X7PUD05" + }, + "type": "PHYSICAL_COUNT" + } + ], + "errors": [] + } + }, + "BatchRetrieveInventoryCountsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "catalog_object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The filter to return results by `CatalogObject` ID.\nThe filter is applicable only when set. The default is null.", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The filter to return results by `Location` ID.\nThis filter is applicable only when set. The default is null.", + "nullable": true + }, + "updated_after": { + "type": "string", + "description": "The filter to return results with their `calculated_at` value\nafter the given time as specified in an RFC 3339 timestamp.\nThe default value is the UNIX epoch of (`1970-01-01T00:00:00Z`).", + "nullable": true + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.", + "nullable": true + }, + "states": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryState" + }, + "description": "The filter to return results by `InventoryState`. The filter is only applicable when set.\nIgnored are untracked states of `NONE`, `SOLD`, and `UNLINKED_RETURN`.\nThe default is null.", + "nullable": true + }, + "limit": { + "type": "integer", + "description": "The number of [records](entity:InventoryCount) to return.", + "minimum": 1, + "maximum": 1000, + "nullable": true + } + }, + "example": { + "catalog_object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI" + ], + "location_ids": [ + "59TNP9SA8VGDA" + ], + "updated_after": "2016-11-16T00:00:00.000Z" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.csharp", + "java": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.java", + "javascript": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.javascript", + "php": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.php", + "python": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.python", + "ruby": "/sdk_samples/Inventory/BatchRetrieveInventoryCounts/BatchRetrieveInventoryCountsRequest.ruby" + } + }, + "BatchRetrieveInventoryCountsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "counts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryCount" + }, + "description": "The current calculated inventory counts for the requested objects\nand locations." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "counts": [ + { + "calculated_at": "2016-11-16T22:28:01.223Z", + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "location_id": "59TNP9SA8VGDA", + "quantity": "79", + "state": "IN_STOCK" + } + ], + "errors": [] + } + }, + "BatchRetrieveOrdersRequest": { + "type": "object", + "description": "Defines the fields that are included in requests to the\n`BatchRetrieveOrders` endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "order_ids" + ], + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the location for these orders. This field is optional: omit it to retrieve\norders within the scope of the current authorization's merchant ID.", + "nullable": true + }, + "order_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the orders to retrieve. A maximum of 100 orders can be retrieved per request." + } + }, + "example": { + "location_id": "057P5VYJ4A5X1", + "order_ids": [ + "CAISEM82RcpmcFBM0TfOyiHV3es", + "CAISENgvlJ6jLWAzERDzjyHVybY" + ] + } + }, + "BatchRetrieveOrdersResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `BatchRetrieveOrders` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + }, + "description": "The requested orders. This will omit any requested orders that do not exist." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "orders": [ + { + "id": "CAISEM82RcpmcFBM0TfOyiHV3es", + "line_items": [ + { + "base_price_money": { + "amount": 1599, + "currency": "USD" + }, + "name": "Awesome product", + "quantity": "1", + "total_money": { + "amount": 1599, + "currency": "USD" + }, + "uid": "945986d1-9586-11e6-ad5a-28cfe92138cf" + }, + { + "base_price_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Another awesome product", + "quantity": "3", + "total_money": { + "amount": 6000, + "currency": "USD" + }, + "uid": "a8f4168c-9586-11e6-bdf0-28cfe92138cf" + } + ], + "location_id": "057P5VYJ4A5X1", + "reference_id": "my-order-001", + "total_money": { + "amount": 7599, + "currency": "USD" + } + } + ] + } + }, + "BatchUpsertCatalogObjectsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "batches" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this\nrequest among all your requests. A common way to create\na valid idempotency key is to use a Universally unique\nidentifier (UUID).\n\nIf you're unsure whether a particular request was successful,\nyou can reattempt it with the same idempotency key without\nworrying about creating duplicate objects.\n\nSee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 128 + }, + "batches": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObjectBatch" + }, + "description": "A batch of CatalogObjects to be inserted/updated atomically.\nThe objects within a batch will be inserted in an all-or-nothing fashion, i.e., if an error occurs\nattempting to insert or update an object within a batch, the entire batch will be rejected. However, an error\nin one batch will not affect other batches within the same request.\n\nFor each object, its `updated_at` field is ignored and replaced with a current [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), and its\n`is_deleted` field must not be set to `true`.\n\nTo modify an existing object, supply its ID. To create a new object, use an ID starting\nwith `#`. These IDs may be used to create relationships between an object and attributes of\nother objects that reference it. For example, you can create a CatalogItem with\nID `#ABC` and a CatalogItemVariation with its `item_id` attribute set to\n`#ABC` in order to associate the CatalogItemVariation with its parent\nCatalogItem.\n\nAny `#`-prefixed IDs are valid only within a single atomic batch, and will be replaced by server-generated IDs.\n\nEach batch may contain up to 1,000 objects. The total number of objects across all batches for a single request\nmay not exceed 10,000. If either of these limits is violated, an error will be returned and no objects will\nbe inserted or updated." + } + }, + "example": { + "batches": [ + { + "objects": [ + { + "id": "#Tea", + "item_data": { + "categories": [ + { + "id": "#Beverages" + } + ], + "description_html": "\u003cp\u003e\u003cstrong\u003eHot\u003c/strong\u003e Leaf Juice\u003c/p\u003e", + "name": "Tea", + "tax_ids": [ + "#SalesTax" + ], + "variations": [ + { + "id": "#Tea_Mug", + "item_variation_data": { + "item_id": "#Tea", + "name": "Mug", + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION" + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM" + }, + { + "id": "#Coffee", + "item_data": { + "categories": [ + { + "id": "#Beverages" + } + ], + "description_html": "\u003cp\u003eHot \u003cem\u003eBean Juice\u003c/em\u003e\u003c/p\u003e", + "name": "Coffee", + "tax_ids": [ + "#SalesTax" + ], + "variations": [ + { + "id": "#Coffee_Regular", + "item_variation_data": { + "item_id": "#Coffee", + "name": "Regular", + "price_money": { + "amount": 250, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION" + }, + { + "id": "#Coffee_Large", + "item_variation_data": { + "item_id": "#Coffee", + "name": "Large", + "price_money": { + "amount": 350, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION" + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM" + }, + { + "category_data": { + "name": "Beverages" + }, + "id": "#Beverages", + "present_at_all_locations": true, + "type": "CATEGORY" + }, + { + "id": "#SalesTax", + "present_at_all_locations": true, + "tax_data": { + "applies_to_custom_amounts": true, + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX" + } + ] + } + ], + "idempotency_key": "789ff020-f723-43a9-b4b5-43b5dc1fa3dc" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.csharp", + "java": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.java", + "javascript": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.javascript", + "php": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.php", + "python": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.python", + "ruby": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsRequest.ruby" + } + }, + "BatchUpsertCatalogObjectsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "The created successfully created CatalogObjects." + }, + "updated_at": { + "type": "string", + "description": "The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\"." + }, + "id_mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogIdMapping" + }, + "description": "The mapping between client and server IDs for this upsert." + } + }, + "example": { + "id_mappings": [ + { + "client_object_id": "#Tea", + "object_id": "67GA7XA2FWMRYY2VCONTYZJR" + }, + { + "client_object_id": "#Coffee", + "object_id": "MQ4TZKOG3SR2EQI3TWEK4AH7" + }, + { + "client_object_id": "#Beverages", + "object_id": "XCS4SCGN4WQYE2VU4U3TKXEH" + }, + { + "client_object_id": "#SalesTax", + "object_id": "HP5VNYPKZKTNCKZ2Z5NPUH6A" + }, + { + "client_object_id": "#Tea_Mug", + "object_id": "CAJBHUIQH7ONTSZI2KTVOUP6" + }, + { + "client_object_id": "#Coffee_Regular", + "object_id": "GY2GXJTVVPQAPW43GFRR3NG6" + }, + { + "client_object_id": "#Coffee_Large", + "object_id": "JE6VHPSRQL6IWSN26C36CJ7W" + } + ], + "objects": [ + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "67GA7XA2FWMRYY2VCONTYZJR", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "XCS4SCGN4WQYE2VU4U3TKXEH", + "ordinal": -2251731094208512 + } + ], + "description": "Hot Leaf Juice", + "description_html": "\u003cp\u003e\u003cstrong\u003eHot\u003c/strong\u003e Leaf Juice\u003c/p\u003e", + "description_plaintext": "Hot Leaf Juice", + "is_archived": false, + "is_taxable": true, + "name": "Tea", + "product_type": "REGULAR", + "tax_ids": [ + "HP5VNYPKZKTNCKZ2Z5NPUH6A" + ], + "variations": [ + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "CAJBHUIQH7ONTSZI2KTVOUP6", + "is_deleted": false, + "item_variation_data": { + "item_id": "67GA7XA2FWMRYY2VCONTYZJR", + "name": "Mug", + "ordinal": 0, + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING", + "sellable": true, + "stockable": true + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + }, + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "MQ4TZKOG3SR2EQI3TWEK4AH7", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "XCS4SCGN4WQYE2VU4U3TKXEH", + "ordinal": -2251662374731776 + } + ], + "description": "Hot Bean Juice", + "description_html": "\u003cp\u003eHot \u003cem\u003eBean Juice\u003c/em\u003e\u003c/p\u003e", + "description_plaintext": "Hot Bean Juice", + "is_archived": false, + "is_taxable": true, + "name": "Coffee", + "product_type": "REGULAR", + "tax_ids": [ + "HP5VNYPKZKTNCKZ2Z5NPUH6A" + ], + "variations": [ + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "GY2GXJTVVPQAPW43GFRR3NG6", + "is_deleted": false, + "item_variation_data": { + "item_id": "MQ4TZKOG3SR2EQI3TWEK4AH7", + "name": "Regular", + "ordinal": 0, + "price_money": { + "amount": 250, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING", + "sellable": true, + "stockable": true + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + }, + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "JE6VHPSRQL6IWSN26C36CJ7W", + "is_deleted": false, + "item_variation_data": { + "item_id": "MQ4TZKOG3SR2EQI3TWEK4AH7", + "name": "Large", + "ordinal": 1, + "price_money": { + "amount": 350, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING", + "sellable": true, + "stockable": true + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + }, + { + "category_data": { + "category_type": "REGULAR_CATEGORY", + "is_top_level": true, + "name": "Beverages", + "online_visibility": true, + "parent_category": { + "ordinal": -2250837741010944 + } + }, + "created_at": "2023-11-30T19:24:35.4Z", + "id": "XCS4SCGN4WQYE2VU4U3TKXEH", + "is_deleted": false, + "present_at_all_locations": true, + "type": "CATEGORY", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + }, + { + "created_at": "2023-11-30T19:24:35.4Z", + "id": "HP5VNYPKZKTNCKZ2Z5NPUH6A", + "is_deleted": false, + "present_at_all_locations": true, + "tax_data": { + "applies_to_custom_amounts": true, + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX", + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.csharp", + "java": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.java", + "javascript": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.javascript", + "php": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.php", + "python": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.python", + "ruby": "/sdk_samples/Catalog/BatchUpsertCatalogObjects/BatchUpsertCatalogObjectsResponse.ruby" + } + }, + "Booking": { + "type": "object", + "description": "Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service\nat a given location to a requesting customer in one or more appointment segments.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique ID of this object representing a booking.", + "maxLength": 36, + "readOnly": true + }, + "version": { + "type": "integer", + "description": "The revision number for the booking used for optimistic concurrency." + }, + "status": { + "$ref": "#/components/schemas/BookingStatus", + "description": "The status of the booking, describing where the booking stands with respect to the booking state machine.\nSee [BookingStatus](#type-bookingstatus) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The RFC 3339 timestamp specifying the creation time of this booking.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The RFC 3339 timestamp specifying the most recent update time of this booking.", + "readOnly": true + }, + "start_at": { + "type": "string", + "description": "The RFC 3339 timestamp specifying the starting time of this booking.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the [Location](entity:Location) object representing the location where the booked service is provided. Once set when the booking is created, its value cannot be changed.", + "maxLength": 32, + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "The ID of the [Customer](entity:Customer) object representing the customer receiving the booked service.", + "maxLength": 192, + "nullable": true + }, + "customer_note": { + "type": "string", + "description": "The free-text field for the customer to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](entity:CatalogObject) instance.", + "maxLength": 4096, + "nullable": true + }, + "seller_note": { + "type": "string", + "description": "The free-text field for the seller to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a specific [CatalogObject](entity:CatalogObject) instance.\nThis field should not be visible to customers.", + "maxLength": 4096, + "nullable": true + }, + "appointment_segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AppointmentSegment" + }, + "description": "A list of appointment segments for this booking.", + "nullable": true + }, + "transition_time_minutes": { + "type": "integer", + "description": "Additional time at the end of a booking.\nApplications should not make this field visible to customers of a seller.", + "readOnly": true + }, + "all_day": { + "type": "boolean", + "description": "Whether the booking is of a full business day.", + "readOnly": true + }, + "location_type": { + "$ref": "#/components/schemas/BusinessAppointmentSettingsBookingLocationType", + "description": "The type of location where the booking is held.\nSee [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) for possible values", + "nullable": true + }, + "creator_details": { + "$ref": "#/components/schemas/BookingCreatorDetails", + "description": "Information about the booking creator.", + "readOnly": true + }, + "source": { + "$ref": "#/components/schemas/BookingBookingSource", + "description": "The source of the booking.\nAccess to this field requires seller-level permissions.\nSee [BookingBookingSource](#type-bookingbookingsource) for possible values", + "readOnly": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "Stores a customer address if the location type is `CUSTOMER_LOCATION`.", + "nullable": true + } + } + }, + "BookingBookingSource": { + "type": "string", + "enum": [ + "FIRST_PARTY_MERCHANT", + "FIRST_PARTY_BUYER", + "THIRD_PARTY_BUYER", + "API" + ], + "x-enum-elements": [ + { + "name": "FIRST_PARTY_MERCHANT", + "description": "The booking was created by a seller from a Square Appointments application, such as the Square Appointments Dashboard or a Square Appointments mobile app." + }, + { + "name": "FIRST_PARTY_BUYER", + "description": "The booking was created by a buyer from a Square Appointments application, such as Square Online Booking Site." + }, + { + "name": "THIRD_PARTY_BUYER", + "description": "The booking was created by a buyer created from a third-party application." + }, + { + "name": "API", + "description": "The booking was created by a seller or a buyer from the Square Bookings API." + } + ], + "description": "Supported sources a booking was created from.", + "x-release-status": "PUBLIC" + }, + "BookingCreatedEvent": { + "type": "object", + "description": "Published when a booking is created.\n\nTo receive this event with buyer-level permissions, you must have `APPOINTMENTS_READ` set for the OAuth scope. \nTo receive this event with seller-level permissions, you must have `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/BookingCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-08T19:56:53Z", + "data": { + "id": "i2id2g3enyspi7:0", + "object": { + "booking": { + "appointment_segments": [ + { + "duration_minutes": 30, + "service_variation_id": "T3WUWYFJOVW2EU6XGRU5YG4A", + "service_variation_version": 1605808735978, + "team_member_id": "_4GsfYnqGHyurOwzWdKj" + } + ], + "created_at": "2020-12-08T19:56:53Z", + "customer_id": "SSKBT02ECWZXK6W3VWYC78E52R", + "customer_note": "", + "id": "i2id2g3enyspi7", + "location_id": "L9R0X9X5SGDBJ", + "seller_note": "", + "start_at": "2020-12-17T16:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-12-08T19:56:53Z", + "version": 0 + } + }, + "type": "booking" + }, + "event_id": "76193e8a-db85-53c6-b538-1837519cbc12", + "location_id": "L9R0X9X5SGDBJ", + "merchant_id": "GQQWA3J6A3AEZ", + "type": "booking.created" + }, + "x-webhook": { + "event": "booking.created", + "scopes": [ + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Bookings", + "x-since": "2020-12-16" + }, + "BookingCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"booking\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/BookingCreatedEventObject", + "description": "An object containing the created booking.", + "nullable": true + } + } + }, + "BookingCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The created booking.", + "nullable": true + } + } + }, + "BookingCreatorDetails": { + "type": "object", + "description": "Information about a booking creator.", + "x-release-status": "PUBLIC", + "properties": { + "creator_type": { + "$ref": "#/components/schemas/BookingCreatorDetailsCreatorType", + "description": "The seller-accessible type of the creator of the booking.\nSee [BookingCreatorDetailsCreatorType](#type-bookingcreatordetailscreatortype) for possible values", + "readOnly": true + }, + "team_member_id": { + "type": "string", + "description": "The ID of the team member who created the booking, when the booking creator is of the `TEAM_MEMBER` type.\nAccess to this field requires seller-level permissions.", + "maxLength": 32, + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "The ID of the customer who created the booking, when the booking creator is of the `CUSTOMER` type.\nAccess to this field requires seller-level permissions.", + "maxLength": 192, + "readOnly": true + } + } + }, + "BookingCreatorDetailsCreatorType": { + "type": "string", + "enum": [ + "TEAM_MEMBER", + "CUSTOMER" + ], + "x-enum-elements": [ + { + "name": "TEAM_MEMBER", + "description": "The creator is of the seller type." + }, + { + "name": "CUSTOMER", + "description": "The creator is of the buyer type." + } + ], + "description": "Supported types of a booking creator.", + "x-release-status": "PUBLIC" + }, + "BookingCustomAttributeDefinitionOwnedCreatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nis created by the subscribing application. Subscribe to this event to be notified \nwhen your application creates a booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.owned.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite shampoo", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "name": "Favorite Shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "347ab320-c0ba-48f5-959a-4e147b9aefcf", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.owned.created" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.owned.created", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDefinitionOwnedDeletedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nis deleted by the subscribing application. Subscribe to this event to be notified \nwhen your application deletes a booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite shampoo", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "name": "Favorite Shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "49363646-7ae7-49b5-aaa0-296610883c61", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.owned.deleted" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.owned.deleted", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDefinitionOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nis updated by the subscribing application. Subscribe to this event to be notified \nwhen your application updates a booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "The customer's favorite shampoo", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "name": "Favorite Shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "d914e6ef-9e37-4bca-a663-ecc55f5d98d3", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.owned.updated" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.owned.updated", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDefinitionVisibleCreatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nwith the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is created.\nAn application that subscribes to this event is notified when a booking custom attribute definition is created \nby any application for which the subscribing application has read access to the booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.visible.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "Number of party members", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "name": "Party Size", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "f679dc4f-3619-4764-a4de-94a54735cd32", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.visible.created" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.visible.created", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDefinitionVisibleDeletedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nwith the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted.\nAn application that subscribes to this event is notified when a booking custom attribute definition is deleted \nby any application for which the subscribing application has read access to the booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "Number of party members", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "name": "Party Size", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "81c10a07-c329-4943-af20-7d70a300c7e6", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.visible.deleted" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.visible.deleted", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDefinitionVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) \nwith the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated.\nAn application that subscribes to this event is notified when a booking custom attribute definition is updated \nby any application for which the subscribing application has read access to the booking custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute_definition.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "Number of party members", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "name": "Party Size", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "ae376c21-d360-4694-96c7-1b27830f07d7", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute_definition.visible.updated" + }, + "x-webhook": { + "event": "booking.custom_attribute_definition.visible.updated", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeDeleteRequest": { + "type": "object", + "description": "Represents an individual delete request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes)\nrequest. An individual request contains a booking ID, the custom attribute to delete, and an optional idempotency key.", + "x-release-status": "PUBLIC", + "required": [ + "booking_id", + "key" + ], + "properties": { + "booking_id": { + "type": "string", + "description": "The ID of the target [booking](entity:Booking).", + "minLength": 1, + "maxLength": 36 + }, + "key": { + "type": "string", + "description": "The key of the custom attribute to delete. This key must match the `key` of a\ncustom attribute definition in the Square seller account. If the requesting application is not\nthe definition owner, you must use the qualified key.", + "minLength": 1 + } + } + }, + "BookingCustomAttributeDeleteResponse": { + "type": "object", + "description": "Represents a response for an individual upsert request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) operation.", + "x-release-status": "PUBLIC", + "properties": { + "booking_id": { + "type": "string", + "description": "The ID of the [booking](entity:Booking) associated with the custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred while processing the individual request." + } + }, + "example": { + "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", + "errors": [] + } + }, + "BookingCustomAttributeOwnedDeletedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute](entity:CustomAttribute) \nassociated with a [custom attribute definition](entity:CustomAttributeDefinition) that is\nowned by the subscribing application is deleted.\nSubscribe to this event to be notified \nwhen your application deletes a booking custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo:BOOKING:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "updated_at": "2022-04-27T11:31:29Z", + "value": "Generic shampoo", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "f57b27d4-a4d6-43de-9e58-bc6ff90525f1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute.owned.deleted" + }, + "x-webhook": { + "event": "booking.custom_attribute.owned.deleted", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute](entity:CustomAttribute) \nis updated by the subscribing application. Subscribe to this event to be notified \nwhen your application updates a booking custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:54Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo:BOOKING:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo", + "updated_at": "2022-04-21T21:40:54Z", + "value": "Volume up", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "e26ca6f2-97f8-426a-b4bf-873044617e94", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute.owned.updated" + }, + "x-webhook": { + "event": "booking.custom_attribute.owned.updated", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeUpsertRequest": { + "type": "object", + "description": "Represents an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes)\nrequest. An individual request contains a booking ID, the custom attribute to create or update,\nand an optional idempotency key.", + "x-release-status": "PUBLIC", + "required": [ + "booking_id", + "custom_attribute" + ], + "properties": { + "booking_id": { + "type": "string", + "description": "The ID of the target [booking](entity:Booking).", + "minLength": 1, + "maxLength": 36 + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with following fields:\n\n- `key`. This key must match the `key` of a custom attribute definition in the Square seller\naccount. If the requesting application is not the definition owner, you must provide the qualified key.\n\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Value data types](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for update operations, include this optional field in the request and set the\nvalue to the current version of the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this individual upsert request, used to ensure idempotency.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "BookingCustomAttributeUpsertResponse": { + "type": "object", + "description": "Represents a response for an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) operation.", + "x-release-status": "PUBLIC", + "properties": { + "booking_id": { + "type": "string", + "description": "The ID of the [booking](entity:Booking) associated with the custom attribute." + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred while processing the individual request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-11-16T00:14:47Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T00:16:23Z", + "value": "Spring Fresh", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + } + }, + "BookingCustomAttributeVisibleDeletedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute](entity:CustomAttribute) with\nthe `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted.\nAn application that subscribes to this event is notified when a booking custom attribute is deleted \nby any application for which the subscribing application has read access to the booking custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size:BOOKING:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "updated_at": "2022-04-27T11:31:29Z", + "value": "10", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "18ef5adc-2efc-4ad9-9b1a-b274a607da3e", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute.visible.deleted" + }, + "x-webhook": { + "event": "booking.custom_attribute.visible.deleted", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingCustomAttributeVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a booking [custom attribute](entity:CustomAttribute) \nwith the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated.\nAn application that subscribes to this event is notified when a booking custom attribute is updated \nby any application for which the subscribing application has read access to the booking custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.custom_attribute.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size:BOOKING:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:party-size", + "updated_at": "2022-04-26T01:22:29Z", + "value": "5", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "1cc2925c-f6e2-4fb6-a597-07c198de59e1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "booking.custom_attribute.visible.updated" + }, + "x-webhook": { + "event": "booking.custom_attribute.visible.updated", + "scopes": [ + "APPOINTMENTS_ALL_READ", + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/BookingCustomAttributes", + "x-since": "2022-11-16" + }, + "BookingStatus": { + "type": "string", + "enum": [ + "PENDING", + "CANCELLED_BY_CUSTOMER", + "CANCELLED_BY_SELLER", + "DECLINED", + "ACCEPTED", + "NO_SHOW" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "An unaccepted booking. It is visible to both sellers and customers." + }, + { + "name": "CANCELLED_BY_CUSTOMER", + "description": "A customer-cancelled booking. It is visible to both the seller and the customer." + }, + { + "name": "CANCELLED_BY_SELLER", + "description": "A seller-cancelled booking. It is visible to both the seller and the customer." + }, + { + "name": "DECLINED", + "description": "A declined booking. It had once been pending, but was then declined by the seller." + }, + { + "name": "ACCEPTED", + "description": "An accepted booking agreed to or accepted by the seller." + }, + { + "name": "NO_SHOW", + "description": "A no-show booking. The booking was accepted at one time, but have now been marked as a no-show by\nthe seller because the client either missed the booking or cancelled it without enough notice." + } + ], + "description": "Supported booking statuses.", + "x-release-status": "PUBLIC" + }, + "BookingUpdatedEvent": { + "type": "object", + "description": "Published when a booking is updated or cancelled.\n\nTo receive this event with buyer-level permissions, you must have `APPOINTMENTS_READ` set for the OAuth scope. \nTo receive this event with seller-level permissions, you must have `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` set for the OAuth scope.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"booking.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/BookingUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-08T20:05:00Z", + "data": { + "id": "i2id2g3enyspi7:1", + "object": { + "booking": { + "appointment_segments": [ + { + "duration_minutes": 30, + "service_variation_id": "T3WUWYFJOVW2EU6XGRU5YG4A", + "service_variation_version": 1605808735978, + "team_member_id": "_4GsfYnqGHyurOwzWdKj" + } + ], + "created_at": "2020-12-08T19:56:53Z", + "customer_id": "SSKBT02ECWZXK6W3VWYC78E52R", + "customer_note": "I would like to sit near the window please", + "id": "i2id2g3enyspi7", + "location_id": "L9R0X9X5SGDBJ", + "seller_note": "", + "start_at": "2020-12-17T16:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-12-08T20:05:00Z", + "version": 1 + } + }, + "type": "booking" + }, + "event_id": "d954ea4e-a393-52d4-bda6-bfd10cbd571f", + "location_id": "L9R0X9X5SGDBJ", + "merchant_id": "GQQWA3J6A3AEZ", + "type": "booking.updated" + }, + "x-webhook": { + "event": "booking.updated", + "scopes": [ + "APPOINTMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Bookings", + "x-since": "2020-12-16" + }, + "BookingUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"booking\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/BookingUpdatedEventObject", + "description": "An object containing the updated booking.", + "nullable": true + } + } + }, + "BookingUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The updated booking.", + "nullable": true + } + } + }, + "Break": { + "type": "object", + "description": "A record of a team member's break on a [timecard](entity:Timecard).", + "x-release-status": "PUBLIC", + "required": [ + "start_at", + "break_type_id", + "name", + "expected_duration", + "is_paid" + ], + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object." + }, + "start_at": { + "type": "string", + "description": "RFC 3339; follows the same timezone information as the [timecard](entity:Timecard). Precision up to\nthe minute is respected; seconds are truncated.", + "minLength": 1 + }, + "end_at": { + "type": "string", + "description": "RFC 3339; follows the same timezone information as the [timecard](entity:Timecard). Precision up to\nthe minute is respected; seconds are truncated.", + "nullable": true + }, + "break_type_id": { + "type": "string", + "description": "The [BreakType](entity:BreakType) that this break was templated on.", + "minLength": 1 + }, + "name": { + "type": "string", + "description": "A human-readable name.", + "minLength": 1 + }, + "expected_duration": { + "type": "string", + "description": "Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of\nthe break.\n\nExample for break expected duration of 15 minutes: PT15M", + "minLength": 1 + }, + "is_paid": { + "type": "boolean", + "description": "Whether this break counts towards time worked for compensation\npurposes." + } + } + }, + "BreakType": { + "type": "object", + "description": "A template for a type of [break](entity:Break) that can be added to a\n[timecard](entity:Timecard), including the expected duration and paid status.", + "x-release-status": "PUBLIC", + "required": [ + "location_id", + "break_name", + "expected_duration", + "is_paid" + ], + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object.", + "maxLength": 255 + }, + "location_id": { + "type": "string", + "description": "The ID of the business location this type of break applies to.", + "minLength": 1 + }, + "break_name": { + "type": "string", + "description": "A human-readable name for this type of break. The name is displayed to\nteam members in Square products.", + "minLength": 1 + }, + "expected_duration": { + "type": "string", + "description": "Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of\nthis break. Precision less than minutes is truncated.\n\nExample for break expected duration of 15 minutes: PT15M", + "minLength": 1 + }, + "is_paid": { + "type": "boolean", + "description": "Whether this break counts towards time worked for compensation\npurposes." + }, + "version": { + "type": "integer", + "description": "Used for resolving concurrency issues. The request fails if the version\nprovided does not match the server version at the time of the request. If a value is not\nprovided, Square's servers execute a \"blind\" write; potentially\noverwriting another writer's data." + }, + "created_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format.", + "readOnly": true + } + } + }, + "BulkCreateCustomerData": { + "type": "object", + "description": "Defines the customer data provided in individual create requests for a\n[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) operation.", + "x-release-status": "PUBLIC", + "properties": { + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the customer profile.", + "maxLength": 300, + "nullable": true + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the customer profile.", + "maxLength": 300, + "nullable": true + }, + "company_name": { + "type": "string", + "description": "A business name associated with the customer profile.", + "maxLength": 500, + "nullable": true + }, + "nickname": { + "type": "string", + "description": "A nickname for the customer profile.", + "maxLength": 100, + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address associated with the customer profile.", + "maxLength": 254, + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address associated with the customer profile. For maximum length constraints,\nsee [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).\nThe `first_name` and `last_name` fields are ignored if they are present in the request.", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number associated with the customer profile. The phone number must be valid\nand can contain 9–16 digits, with an optional `+` prefix and country code. For more information,\nsee [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "An optional second ID used to associate the customer profile with an\nentity in another system.", + "maxLength": 100, + "nullable": true + }, + "note": { + "type": "string", + "description": "A custom note associated with the customer profile.", + "nullable": true + }, + "birthday": { + "type": "string", + "description": "The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.\nFor example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.\nBirthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or\n`0000` if a birth year is not specified.", + "nullable": true + }, + "tax_ids": { + "$ref": "#/components/schemas/CustomerTaxIds", + "description": "The tax ID associated with the customer profile. This field is available only for\ncustomers of sellers in EU countries or the United Kingdom. For more information, see\n[Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).", + "nullable": true + } + } + }, + "BulkCreateCustomersRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in requests to the\n[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "customers" + ], + "properties": { + "customers": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkCreateCustomerData" + }, + "description": "A map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }`\nkey-value pairs.\n\nEach key is an [idempotency key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)\nthat uniquely identifies the create request. Each value contains the customer data used to create the\ncustomer profile." + } + }, + "example": { + "customers": { + "8bb76c4f-e35d-4c5b-90de-1194cd9179f0": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "reference_id": "YOUR_REFERENCE_ID" + }, + "d1689f23-b25d-4932-b2f0-aed00f5e2029": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 601", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "email_address": "Marie.Curie@example.com", + "family_name": "Curie", + "given_name": "Marie", + "note": "another customer", + "phone_number": "+1-212-444-4240", + "reference_id": "YOUR_REFERENCE_ID" + } + } + } + }, + "BulkCreateCustomersResponse": { + "type": "object", + "description": "Defines the fields included in the response body from the\n[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/CreateCustomerResponse" + }, + "description": "A map of responses that correspond to individual create requests, represented by\nkey-value pairs.\n\nEach key is the idempotency key that was provided for a create request and each value\nis the corresponding response.\nIf the request succeeds, the value is the new customer profile.\nIf the request fails, the value contains any errors that occurred during the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any top-level errors that prevented the bulk operation from running." + } + }, + "example": { + "responses": { + "8bb76c4f-e35d-4c5b-90de-1194cd9179f4": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2024-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "updated_at": "2024-03-23T20:21:54.859Z", + "version": 0 + } + }, + "d1689f23-b25d-4932-b2f0-aed00f5e2029": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 601", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2024-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Marie.Curie@example.com", + "family_name": "Curie", + "given_name": "Marie", + "id": "N18CPRVXR5214XPBBA6BZQWF3C", + "note": "another customer", + "phone_number": "+1-212-444-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "updated_at": "2024-03-23T20:21:54.859Z", + "version": 0 + } + } + } + } + }, + "BulkCreateTeamMembersRequest": { + "type": "object", + "description": "Represents a bulk create request for `TeamMember` objects.", + "x-release-status": "PUBLIC", + "required": [ + "team_members" + ], + "properties": { + "team_members": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/CreateTeamMemberRequest" + }, + "description": "The data used to create the `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`.\nThe maximum number of create objects is 25.\n\nIf you include a team member's `wage_setting`, you must provide `job_id` for each job assignment. To get job IDs,\ncall [ListJobs](api-endpoint:Team-ListJobs)." + } + }, + "example": { + "team_members": { + "idempotency-key-1": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "YSGH2WBKG94QZ", + "GA2Y9HSJ8KRYT" + ] + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "phone_number": "+14159283333", + "reference_id": "reference_id_1" + } + }, + "idempotency-key-2": { + "team_member": { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "email_address": "jane_smith@gmail.com", + "family_name": "Smith", + "given_name": "Jane", + "phone_number": "+14159223334", + "reference_id": "reference_id_2" + } + } + } + } + }, + "BulkCreateTeamMembersResponse": { + "type": "object", + "description": "Represents a response from a bulk create request containing the created `TeamMember` objects or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "team_members": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/CreateTeamMemberResponse" + }, + "description": "The successfully created `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "team_members": { + "idempotency-key-1": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "GA2Y9HSJ8KRYT", + "YSGH2WBKG94QZ" + ] + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "id": "ywhG1qfIOoqsHfVRubFV", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE" + } + }, + "idempotency-key-2": { + "team_member": { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "email_address": "jane_smith@gmail.com", + "family_name": "Smith", + "given_name": "Jane", + "id": "IF_Ncrg7fHhCqxVI9T6R", + "is_owner": false, + "phone_number": "+14159223334", + "reference_id": "reference_id_2", + "status": "ACTIVE" + } + } + } + } + }, + "BulkCreateVendorsRequest": { + "type": "object", + "description": "Represents an input to a call to [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors).", + "x-release-status": "BETA", + "required": [ + "vendors" + ], + "properties": { + "vendors": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Vendor" + }, + "description": "Specifies a set of new [Vendor](entity:Vendor) objects as represented by a collection of idempotency-key/`Vendor`-object pairs." + } + }, + "example": { + "47bb76a8-c9fb-4f33-9df8-25ce02ca4505": { + "contacts": [ + { + "email_address": "annie@annieshotsauce.com", + "name": "Annie Thomas", + "phone_number": "1-212-555-4250" + } + ], + "name": "Annie’s Hot Sauce" + }, + "vendors": { + "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "name": "Joe's Fresh Seafood", + "note": "a vendor" + } + } + } + }, + "BulkCreateVendorsResponse": { + "type": "object", + "description": "Represents an output from a call to [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/CreateVendorResponse" + }, + "description": "A set of [CreateVendorResponse](entity:CreateVendorResponse) objects encapsulating successfully created [Vendor](entity:Vendor)\nobjects or error responses for failed attempts. The set is represented by \na collection of idempotency-key/`Vendor`-object or idempotency-key/error-object pairs. The idempotency keys correspond to those specified\nin the input." + } + }, + "example": { + "47bb76a8-c9fb-4f33-9df8-25ce02ca4505": { + "vendor": { + "contacts": [ + { + "email_address": "annie@annieshotsauce.com", + "id": "INV_VC_ABYYHBWT1TPL8MFH52PBMENPJ4", + "name": "Annie Thomas", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Annie’s Hot Sauce", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 1 + } + }, + "responses": { + "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "a vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 0 + } + } + } + } + }, + "BulkDeleteBookingCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) request.", + "x-release-status": "PUBLIC", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BookingCustomAttributeDeleteRequest" + }, + "description": "A map containing 1 to 25 individual Delete requests. For each request, provide an\narbitrary ID that is unique for this `BulkDeleteBookingCustomAttributes` request and the\ninformation needed to delete a custom attribute." + } + } + }, + "BulkDeleteBookingCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual delete request.", + "x-release-status": "PUBLIC", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BookingCustomAttributeDeleteResponse" + }, + "description": "A map of responses that correspond to individual delete requests. Each response has the\nsame ID as the corresponding request and contains `booking_id` and `errors` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "errors": [], + "values": { + "id1": { + "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", + "errors": [] + }, + "id2": { + "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", + "errors": [] + }, + "id3": { + "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", + "errors": [] + } + } + } + }, + "BulkDeleteCustomersRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in requests to the\n[BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "customer_ids" + ], + "properties": { + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the [customer profiles](entity:Customer) to delete." + } + }, + "example": { + "customer_ids": [ + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" + ] + } + }, + "BulkDeleteCustomersResponse": { + "type": "object", + "description": "Defines the fields included in the response body from the\n[BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/DeleteCustomerResponse" + }, + "description": "A map of responses that correspond to individual delete requests, represented by\nkey-value pairs.\n\nEach key is the customer ID that was specified for a delete request and each value\nis the corresponding response.\nIf the request succeeds, the value is an empty object (`{ }`).\nIf the request fails, the value contains any errors that occurred during the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any top-level errors that prevented the bulk operation from running." + } + }, + "example": { + "responses": { + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found." + } + ] + }, + "8DDA5NZVBZFGAX0V3HPF81HHE0": {}, + "N18CPRVXR5214XPBBA6BZQWF3C": {} + } + } + }, + "BulkDeleteLocationCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest" + }, + "description": "The data used to update the `CustomAttribute` objects.\nThe keys must be unique and are used to map to the corresponding response." + } + }, + "example": { + "values": { + "id1": { + "key": "bestseller", + "location_id": "L0TBCBTB7P8RQ" + }, + "id2": { + "key": "bestseller", + "location_id": "L9XMD04V3STJX" + }, + "id3": { + "key": "phone-number", + "location_id": "L0TBCBTB7P8RQ" + } + } + } + }, + "BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest": { + "type": "object", + "description": "Represents an individual delete request in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes)\nrequest. An individual request contains an optional ID of the associated custom attribute definition\nand optional key of the associated custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "key": { + "type": "string", + "description": "The key of the associated custom attribute definition.\nRepresented as a qualified key if the requesting app is not the definition owner.", + "pattern": "^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$", + "readOnly": true + } + } + }, + "BulkDeleteLocationCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual delete request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse" + }, + "description": "A map of responses that correspond to individual delete requests. Each response has the\nsame key as the corresponding request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "values": { + "id1": { + "errors": [], + "location_id": "L0TBCBTB7P8RQ" + }, + "id2": { + "errors": [], + "location_id": "L9XMD04V3STJX" + }, + "id3": { + "errors": [], + "location_id": "L0TBCBTB7P8RQ" + } + } + } + }, + "BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse": { + "type": "object", + "description": "Represents an individual delete response in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes)\nrequest.", + "x-release-status": "BETA", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the location associated with the custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred while processing the individual LocationCustomAttributeDeleteRequest request" + } + }, + "example": { + "errors": [], + "location_id": "L0TBCBTB7P8RQ" + } + }, + "BulkDeleteMerchantCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest" + }, + "description": "The data used to update the `CustomAttribute` objects.\nThe keys must be unique and are used to map to the corresponding response." + } + }, + "example": { + "values": { + "id1": { + "key": "alternative_seller_name", + "merchant_id": "DM7VKY8Q63GNP" + }, + "id2": { + "key": "has_seen_tutorial", + "merchant_id": "DM7VKY8Q63GNP" + } + } + } + }, + "BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest": { + "type": "object", + "description": "Represents an individual delete request in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes)\nrequest. An individual request contains an optional ID of the associated custom attribute definition\nand optional key of the associated custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "key": { + "type": "string", + "description": "The key of the associated custom attribute definition.\nRepresented as a qualified key if the requesting app is not the definition owner.", + "pattern": "^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$", + "readOnly": true + } + } + }, + "BulkDeleteMerchantCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual delete request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse" + }, + "description": "A map of responses that correspond to individual delete requests. Each response has the\nsame key as the corresponding request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "values": { + "id1": { + "errors": [], + "merchant_id": "DM7VKY8Q63GNP" + }, + "id2": { + "errors": [], + "merchant_id": "DM7VKY8Q63GNP" + } + } + } + }, + "BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse": { + "type": "object", + "description": "Represents an individual delete response in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes)\nrequest.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred while processing the individual MerchantCustomAttributeDeleteRequest request" + } + }, + "example": { + "errors": [], + "merchant_id": "DM7VKY8Q63GNP" + } + }, + "BulkDeleteOrderCustomAttributesRequest": { + "type": "object", + "description": "Represents a bulk delete request for one or more order custom attributes.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute" + }, + "description": "A map of requests that correspond to individual delete operations for custom attributes." + } + }, + "example": { + "values": { + "cover-count": { + "key": "cover-count", + "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + }, + "table-number": { + "key": "table-number", + "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + } + } + } + }, + "BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute": { + "type": "object", + "description": "Represents one delete within the bulk operation.", + "x-release-status": "BETA", + "required": [ + "order_id" + ], + "properties": { + "key": { + "type": "string", + "description": "The key of the custom attribute to delete. This key must match the key \nof an existing custom attribute definition.", + "minLength": 1, + "pattern": "^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$", + "readOnly": true + }, + "order_id": { + "type": "string", + "description": "The ID of the target [order](entity:Order).", + "minLength": 1, + "maxLength": 255 + } + } + }, + "BulkDeleteOrderCustomAttributesResponse": { + "type": "object", + "description": "Represents a response from deleting one or more order custom attributes.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/DeleteOrderCustomAttributeResponse" + }, + "description": " A map of responses that correspond to individual delete requests. Each response has the same ID \nas the corresponding request and contains either a `custom_attribute` or an `errors` field." + } + }, + "example": { + "values": { + "cover-count": {}, + "table-number": {} + } + } + }, + "BulkPublishScheduledShiftsData": { + "type": "object", + "description": "Represents options for an individual publish request in a\n[BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts)\noperation, provided as the value in a key-value pair.", + "x-release-status": "BETA", + "properties": { + "version": { + "type": "integer", + "description": "The current version of the scheduled shift, used to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol. If the provided version doesn't match the server version, the request fails.\nIf omitted, Square executes a blind write, potentially overwriting data from another publish request." + } + } + }, + "BulkPublishScheduledShiftsRequest": { + "type": "object", + "description": "Represents a [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) request.", + "x-release-status": "BETA", + "required": [ + "scheduled_shifts" + ], + "properties": { + "scheduled_shifts": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkPublishScheduledShiftsData" + }, + "description": "A map of 1 to 100 key-value pairs that represent individual publish requests.\n\n- Each key is the ID of a scheduled shift you want to publish.\n- Each value is a `BulkPublishScheduledShiftsData` object that contains the\n`version` field or is an empty object." + }, + "scheduled_shift_notification_audience": { + "$ref": "#/components/schemas/ScheduledShiftNotificationAudience", + "description": "Indicates whether Square should send email notifications to team members and\nwhich team members should receive the notifications. This setting applies to all shifts\nspecified in the bulk operation. The default value is `AFFECTED`.\nSee [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudience) for possible values", + "nullable": true + } + }, + "example": { + "scheduled-shifts": { + "K0YH4CV5462JB": { + "version": 3 + }, + "scheduled-shift-2": { + "version": 2 + } + }, + "scheduled_shift_notification_audience": "AFFECTED" + } + }, + "BulkPublishScheduledShiftsResponse": { + "type": "object", + "description": "Represents a [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) response.\nEither `scheduled_shifts` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/PublishScheduledShiftResponse" + }, + "description": "A map of key-value pairs that represent responses for individual publish requests.\nThe order of responses might differ from the order in which the requests were provided.\n\n- Each key is the scheduled shift ID that was specified for a publish request.\n- Each value is the corresponding response. If the request succeeds, the value is the\npublished scheduled shift. If the request fails, the value is an `errors` array containing\nany errors that occurred while processing the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any top-level errors that prevented the bulk operation from succeeding." + } + }, + "example": { + "responses": { + "idp_key_1": { + "scheduled_shift": { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-03-25T13:18:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Don't forget to prep the vegetables", + "start_at": "2019-03-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "published_shift_details": { + "end_at": "2019-03-25T13:18:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Don't forget to prep the vegetables", + "start_at": "2019-03-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "updated_at": "2019-02-25T03:11:15-05:00", + "version": 3 + } + }, + "idp_key_2": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "INVALID_VALUE", + "detail": "Scheduled shift with id 'scheduled-shift-2' not found", + "field": "scheduled-shifts.scheduled-shift-2" + } + ] + } + } + } + }, + "BulkRetrieveBookingsRequest": { + "type": "object", + "description": "Request payload for bulk retrieval of bookings.", + "x-release-status": "PUBLIC", + "required": [ + "booking_ids" + ], + "properties": { + "booking_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A non-empty list of [Booking](entity:Booking) IDs specifying bookings to retrieve." + } + } + }, + "BulkRetrieveBookingsResponse": { + "type": "object", + "description": "Response payload for bulk retrieval of bookings.", + "x-release-status": "PUBLIC", + "properties": { + "bookings": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RetrieveBookingResponse" + }, + "description": "Requested bookings returned as a map containing `booking_id` as the key and `RetrieveBookingResponse` as the value." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "bookings": { + "sc3p3m7dvctfr1": { + "booking": { + "all_day": false, + "appointment_segments": [ + { + "any_team_member": false, + "duration_minutes": 60, + "service_variation_id": "VG4FYBKK3UL6UITOEYQ6MFLS", + "service_variation_version": 1641341724039, + "team_member_id": "TMjiqI3PxyLMKr4k" + } + ], + "created_at": "2023-04-26T18:19:21Z", + "customer_id": "4TDWKN9E8165X8Z77MRS0VFMJM", + "id": "sc3p3m7dvctfr1", + "location_id": "LY6WNBPVM6VGV", + "start_at": "2023-05-01T14:00:00Z", + "status": "ACCEPTED", + "updated_at": "2023-04-26T18:19:21Z", + "version": 0 + }, + "errors": [] + }, + "tdegug1dvctdef": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Specified booking was not found.", + "field": "booking_id" + } + ] + }, + "tdegug1fqni3wh": { + "booking": { + "all_day": false, + "appointment_segments": [ + { + "any_team_member": false, + "duration_minutes": 60, + "service_variation_id": "VG4FYBKK3UL6UITOEYQ6MFLS", + "service_variation_version": 1641341724039, + "team_member_id": "TMjiqI3PxyLMKr4k" + } + ], + "created_at": "2023-04-26T18:19:30Z", + "customer_id": "4TDWKN9E8165X8Z77MRS0VFMJM", + "id": "tdegug1fqni3wh", + "location_id": "LY6WNBPVM6VGV", + "start_at": "2023-05-02T14:00:00Z", + "status": "ACCEPTED", + "updated_at": "2023-04-26T18:19:30Z", + "version": 0 + }, + "errors": [] + } + }, + "errors": [] + } + }, + "BulkRetrieveChannelsRequest": { + "type": "object", + "description": "Defines the fields that are included in the request body for the\n[BulkRetrieveChannels](api-endpoint:Channels-BulkRetrieveChannels) endpoint.", + "x-release-status": "BETA", + "required": [ + "channel_ids" + ], + "properties": { + "channel_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "example": { + "channel_ids": [ + "CH_9C03D0B59", + "CH_6X139B5MN", + "NOT_EXISTING" + ] + } + }, + "BulkRetrieveChannelsRequestConstants": { + "type": "string", + "enum": [ + "MAX_BATCH_SIZE" + ], + "x-enum-elements": [ + { + "name": "MAX_BATCH_SIZE", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "BulkRetrieveChannelsResponse": { + "type": "object", + "description": "Defines the fields that are included in the request body for the\n[BulkRetrieveChannels](api-endpoint:Channels-BulkRetrieveChannels) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RetrieveChannelResponse" + }, + "description": "A map of channel IDs to channel responses which tell whether\nretrieval for a specific channel is success or not.\nChannel response of a success retrieval would contain channel info\nwhereas channel response of a failed retrieval would have error info." + } + }, + "example": { + "responses": { + "CH_6X139B5MN": { + "channel": { + "created_at": "2022-10-25T16:27:00Z", + "id": "CH_6X139B5MN", + "merchant_id": "ML64FACEA", + "name": "Contoso Fulfillment Application", + "reference": { + "id": "OA_9C03D0444", + "type": "OAUTH_APPLICATION" + }, + "status": "ACTIVE", + "updated_at": "2022-10-25T16:48:00Z", + "version": 1 + } + }, + "CH_9C03D0B59": { + "channel": { + "created_at": "2022-10-25T16:27:00Z", + "id": "CH_9C03D0B59", + "merchant_id": "ML64FACEA", + "name": "State Street Store", + "reference": { + "id": "OA_9C03D0B59", + "type": "LOCATION" + }, + "status": "ACTIVE", + "updated_at": "2022-10-25T16:48:00Z", + "version": 1 + } + }, + "NOT_EXISTING": { + "errors": [ + { + "code": "NOT_FOUND" + } + ] + } + } + } + }, + "BulkRetrieveCustomersRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in requests to the\n[BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "customer_ids" + ], + "properties": { + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the [customer profiles](entity:Customer) to retrieve." + } + }, + "example": { + "customer_ids": [ + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" + ] + } + }, + "BulkRetrieveCustomersResponse": { + "type": "object", + "description": "Defines the fields included in the response body from the\n[BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RetrieveCustomerResponse" + }, + "description": "A map of responses that correspond to individual retrieve requests, represented by\nkey-value pairs.\n\nEach key is the customer ID that was specified for a retrieve request and each value\nis the corresponding response.\nIf the request succeeds, the value is the requested customer profile.\nIf the request fails, the value contains any errors that occurred during the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any top-level errors that prevented the bulk operation from running." + } + }, + "example": { + "responses": { + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found." + } + ] + }, + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "customer": { + "birthday": "1897-07-24", + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "email_address": "New.Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", + "note": "updated customer note", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 3 + } + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "customer": { + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "family_name": "Curie", + "given_name": "Marie", + "id": "N18CPRVXR5214XPBBA6BZQWF3C", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 1 + } + } + } + } + }, + "BulkRetrieveTeamMemberBookingProfilesRequest": { + "type": "object", + "description": "Request payload for the [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "team_member_ids" + ], + "properties": { + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A non-empty list of IDs of team members whose booking profiles you want to retrieve." + } + } + }, + "BulkRetrieveTeamMemberBookingProfilesResponse": { + "type": "object", + "description": "Response payload for the [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "team_member_booking_profiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RetrieveTeamMemberBookingProfileResponse" + }, + "description": "The returned team members' booking profiles, as a map with `team_member_id` as the key and [TeamMemberBookingProfile](entity:TeamMemberBookingProfile) the value." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "errors": [], + "team_member_booking_profiles": { + "TMXUrsBWWcHTt79t": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Resource not found." + } + ] + }, + "TMaJcbiRqPIGZuS9": { + "errors": [], + "team_member_booking_profile": { + "display_name": "Sandbox Staff 1", + "is_bookable": true, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + }, + "TMtdegug1fqni3wh": { + "errors": [], + "team_member_booking_profile": { + "display_name": "Sandbox Staff 2", + "is_bookable": true, + "team_member_id": "TMtdegug1fqni3wh" + } + } + } + } + }, + "BulkRetrieveVendorsRequest": { + "type": "object", + "description": "Represents an input to a call to [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors).", + "x-release-status": "BETA", + "properties": { + "vendor_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IDs of the [Vendor](entity:Vendor) objects to retrieve.", + "nullable": true + } + }, + "example": { + "vendor_ids": [ + "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4" + ] + } + }, + "BulkRetrieveVendorsResponse": { + "type": "object", + "description": "Represents an output from a call to [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/RetrieveVendorResponse" + }, + "description": "The set of [RetrieveVendorResponse](entity:RetrieveVendorResponse) objects encapsulating successfully retrieved [Vendor](entity:Vendor)\nobjects or error responses for failed attempts. The set is represented by \na collection of `Vendor`-ID/`Vendor`-object or `Vendor`-ID/error-object pairs." + } + }, + "example": { + "responses": { + "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "a vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 1 + } + } + } + } + }, + "BulkSwapPlanRequest": { + "type": "object", + "description": "Defines input parameters in a call to the\n[BulkSwapPlan](api-endpoint:Subscriptions-BulkSwapPlan) endpoint.", + "x-release-status": "BETA", + "required": [ + "new_plan_variation_id", + "old_plan_variation_id", + "location_id" + ], + "properties": { + "new_plan_variation_id": { + "type": "string", + "description": "The ID of the new subscription plan variation.\n\nThis field is required.", + "minLength": 1 + }, + "old_plan_variation_id": { + "type": "string", + "description": "The ID of the plan variation whose subscriptions should be swapped. Active subscriptions\nusing this plan variation will be subscribed to the new plan variation on their next billing\nday.", + "minLength": 1 + }, + "location_id": { + "type": "string", + "description": "The ID of the location to associate with the swapped subscriptions.", + "minLength": 1 + } + }, + "example": { + "location_id": "S8GWD5R9QB376", + "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "old_plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H" + } + }, + "BulkSwapPlanResponse": { + "type": "object", + "description": "Defines output parameters in a response of the\n[BulkSwapPlan](api-endpoint:Subscriptions-BulkSwapPlan) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "affected_subscriptions": { + "type": "integer", + "description": "The number of affected subscriptions." + } + }, + "example": { + "affected_subscriptions": 12 + } + }, + "BulkUpdateCustomerData": { + "type": "object", + "description": "Defines the customer data provided in individual update requests for a\n[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) operation.", + "x-release-status": "PUBLIC", + "properties": { + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the customer profile.", + "maxLength": 300, + "nullable": true + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the customer profile.", + "maxLength": 300, + "nullable": true + }, + "company_name": { + "type": "string", + "description": "A business name associated with the customer profile.", + "maxLength": 500, + "nullable": true + }, + "nickname": { + "type": "string", + "description": "A nickname for the customer profile.", + "maxLength": 100, + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address associated with the customer profile.", + "maxLength": 254, + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address associated with the customer profile. For maximum length constraints,\nsee [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).\nThe `first_name` and `last_name` fields are ignored if they are present in the request.", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number associated with the customer profile. The phone number must be valid\nand can contain 9–16 digits, with an optional `+` prefix and country code. For more information,\nsee [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "An optional second ID used to associate the customer profile with an\nentity in another system.", + "maxLength": 100, + "nullable": true + }, + "note": { + "type": "string", + "description": "An custom note associates with the customer profile.", + "nullable": true + }, + "birthday": { + "type": "string", + "description": "The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.\nFor example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.\nBirthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or\n`0000` if a birth year is not specified.", + "nullable": true + }, + "tax_ids": { + "$ref": "#/components/schemas/CustomerTaxIds", + "description": "The tax ID associated with the customer profile. This field is available only for\ncustomers of sellers in EU countries or the United Kingdom. For more information, see\n[Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The current version of the customer profile.\n\nAs a best practice, you should include this field to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol.", + "format": "int64" + } + } + }, + "BulkUpdateCustomersRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in requests to the\n[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "customers" + ], + "properties": { + "customers": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpdateCustomerData" + }, + "description": "A map of 1 to 100 individual update requests, represented by `customer ID: { customer data }`\nkey-value pairs.\n\nEach key is the ID of the [customer profile](entity:Customer) to update. To update a customer profile\nthat was created by merging existing profiles, provide the ID of the newly created profile.\n\nEach value contains the updated customer data. Only new or changed fields are required. To add or\nupdate a field, specify the new value. To remove a field, specify `null`." + } + }, + "example": { + "customers": { + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "email_address": "New.Amelia.Earhart@example.com", + "note": "updated customer note", + "phone_number": null, + "version": 2 + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "family_name": "Curie", + "given_name": "Marie", + "version": 0 + } + } + } + }, + "BulkUpdateCustomersResponse": { + "type": "object", + "description": "Defines the fields included in the response body from the\n[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateCustomerResponse" + }, + "description": "A map of responses that correspond to individual update requests, represented by\nkey-value pairs.\n\nEach key is the customer ID that was specified for an update request and each value\nis the corresponding response.\nIf the request succeeds, the value is the updated customer profile.\nIf the request fails, the value contains any errors that occurred during the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any top-level errors that prevented the bulk operation from running." + } + }, + "example": { + "responses": { + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "customer": { + "birthday": "1897-07-24", + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "email_address": "New.Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "8DDA5NZVBZFGAX0V3HPF81HHE0", + "note": "updated customer note", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 3 + } + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "customer": { + "created_at": "2024-01-19T00:27:54.59Z", + "creation_source": "THIRD_PARTY", + "family_name": "Curie", + "given_name": "Marie", + "id": "N18CPRVXR5214XPBBA6BZQWF3C", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2024-01-19T00:38:06Z", + "version": 1 + } + } + } + } + }, + "BulkUpdateTeamMembersRequest": { + "type": "object", + "description": "Represents a bulk update request for `TeamMember` objects.", + "x-release-status": "PUBLIC", + "required": [ + "team_members" + ], + "properties": { + "team_members": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateTeamMemberRequest" + }, + "description": "The data used to update the `TeamMember` objects. Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`.\nThe maximum number of update objects is 25.\n\nFor each team member, include the fields to add, change, or clear. Fields can be cleared using a null value.\nTo update `wage_setting.job_assignments`, you must provide the complete list of job assignments. If needed,\ncall [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values." + } + }, + "example": { + "team_members": { + "AFMwA08kR-MIF-3Vs0OE": { + "team_member": { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "email_address": "jane_smith@gmail.com", + "family_name": "Smith", + "given_name": "Jane", + "is_owner": false, + "phone_number": "+14159223334", + "reference_id": "reference_id_2", + "status": "ACTIVE" + } + }, + "fpgteZNMaf0qOK-a4t6P": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "YSGH2WBKG94QZ", + "GA2Y9HSJ8KRYT" + ] + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE" + } + } + } + } + }, + "BulkUpdateTeamMembersResponse": { + "type": "object", + "description": "Represents a response from a bulk update request containing the updated `TeamMember` objects or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "team_members": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateTeamMemberResponse" + }, + "description": "The successfully updated `TeamMember` objects. Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "team_members": { + "AFMwA08kR-MIF-3Vs0OE": { + "team_member": { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:00Z", + "email_address": "jane_smith@example.com", + "family_name": "Smith", + "given_name": "Jane", + "id": "AFMwA08kR-MIF-3Vs0OE", + "is_owner": false, + "phone_number": "+14159223334", + "reference_id": "reference_id_2", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:18:00Z" + } + }, + "fpgteZNMaf0qOK-a4t6P": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "GA2Y9HSJ8KRYT", + "YSGH2WBKG94QZ" + ] + }, + "created_at": "2020-03-24T18:14:00Z", + "email_address": "joe_doe@example.com", + "family_name": "Doe", + "given_name": "Joe", + "id": "fpgteZNMaf0qOK-a4t6P", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:18:00Z" + } + } + } + } + }, + "BulkUpdateVendorsRequest": { + "type": "object", + "description": "Represents an input to a call to [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors).", + "x-release-status": "BETA", + "required": [ + "vendors" + ], + "properties": { + "vendors": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateVendorRequest" + }, + "description": "A set of [UpdateVendorRequest](entity:UpdateVendorRequest) objects encapsulating to-be-updated [Vendor](entity:Vendor)\nobjects. The set is represented by a collection of `Vendor`-ID/`UpdateVendorRequest`-object pairs." + } + }, + "example": { + "vendors": { + "FMCYHBWT1TPL8MFH52PBMEN92A": { + "address": { + "address_line_1": "202 Mill St", + "administrative_district_level_1": "NJ", + "country": "US", + "locality": "Moorestown", + "postal_code": "08057" + }, + "status": "ACTIVE", + "version": 10 + }, + "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4": { + "note": "favorite vendor", + "status": "ACTIVE", + "version": 30 + } + } + } + }, + "BulkUpdateVendorsResponse": { + "type": "object", + "description": "Represents an output from a call to [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered when the request fails." + }, + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpdateVendorResponse" + }, + "description": "A set of [UpdateVendorResponse](entity:UpdateVendorResponse) objects encapsulating successfully created [Vendor](entity:Vendor)\nobjects or error responses for failed attempts. The set is represented by a collection of `Vendor`-ID/`UpdateVendorResponse`-object or \n`Vendor`-ID/error-object pairs." + } + }, + "example": { + "responses": { + "INV_V_FMCYHBWT1TPL8MFH52PBMEN92A": { + "vendor": { + "address": { + "address_line_1": "202 Mill St", + "administrative_district_level_1": "NJ", + "country": "US", + "locality": "Moorestown", + "postal_code": "08057" + }, + "contacts": [ + { + "email_address": "annie@annieshotsauce.com", + "id": "INV_VC_ABYYHBWT1TPL8MFH52PBMENPJ4", + "name": "Annie Thomas", + "ordinal": 0, + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Annie’s Hot Sauce", + "status": "ACTIVE", + "updated_at": "2022-03-16T20:21:54.859Z", + "version": 11 + } + }, + "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "ordinal": 0, + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:10:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "favorite vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T20:21:54.859Z", + "version": 31 + } + } + } + } + }, + "BulkUpsertBookingCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) request.", + "x-release-status": "PUBLIC", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BookingCustomAttributeUpsertRequest" + }, + "description": "A map containing 1 to 25 individual upsert requests. For each request, provide an\narbitrary ID that is unique for this `BulkUpsertBookingCustomAttributes` request and the\ninformation needed to create or update a custom attribute." + } + } + }, + "BulkUpsertBookingCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual upsert request.", + "x-release-status": "PUBLIC", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BookingCustomAttributeUpsertResponse" + }, + "description": "A map of responses that correspond to individual upsert requests. Each response has the\nsame ID as the corresponding request and contains either a `booking_id` and `custom_attribute` or an `errors` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "errors": [], + "values": { + "id1": { + "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", + "custom_attribute": { + "created_at": "2022-11-16T23:14:47Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T00:16:23Z", + "value": "Spring Fresh", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + }, + "id2": { + "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", + "custom_attribute": { + "created_at": "2022-11-16T00:16:20Z", + "key": "hasShoes", + "updated_at": "2022-11-16T00:16:23Z", + "value": false, + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + }, + "id3": { + "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", + "custom_attribute": { + "created_at": "2022-11-16T00:16:20Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T00:16:23Z", + "value": "Hydro-Cool", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + }, + "id4": { + "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", + "custom_attribute": { + "created_at": "2022-11-16T23:14:47Z", + "key": "partySize", + "updated_at": "2022-11-16T00:16:23Z", + "value": 4, + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + }, + "id5": { + "booking_id": "70548QG1HN43B05G0KCZ4MMC1G", + "custom_attribute": { + "created_at": "2022-11-16T00:16:20Z", + "key": "celebrating", + "updated_at": "2022-11-16T00:16:23Z", + "value": "birthday", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + } + } + } + }, + "BulkUpsertCustomerCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) request.", + "x-release-status": "PUBLIC", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest" + }, + "description": "A map containing 1 to 25 individual upsert requests. For each request, provide an\narbitrary ID that is unique for this `BulkUpsertCustomerCustomAttributes` request and the\ninformation needed to create or update a custom attribute." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "key": "favoritemovie", + "value": "Dune" + }, + "customer_id": "N3NCVYY3WS27HF0HKANA3R9FP8" + }, + "id2": { + "custom_attribute": { + "key": "ownsmovie", + "value": false + }, + "customer_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM" + }, + "id3": { + "custom_attribute": { + "key": "favoritemovie", + "value": "Star Wars" + }, + "customer_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM" + }, + "id4": { + "custom_attribute": { + "key": "square:a0f1505a-2aa1-490d-91a8-8d31ff181808", + "value": "10.5" + }, + "customer_id": "N3NCVYY3WS27HF0HKANA3R9FP8" + }, + "id5": { + "custom_attribute": { + "key": "sq0ids-0evKIskIGaY45fCyNL66aw:backupemail", + "value": "fake-email@squareup.com" + }, + "customer_id": "70548QG1HN43B05G0KCZ4MMC1G" + } + } + } + }, + "BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest": { + "type": "object", + "description": "Represents an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes)\nrequest. An individual request contains a customer ID, the custom attribute to create or update,\nand an optional idempotency key.", + "x-release-status": "PUBLIC", + "required": [ + "customer_id", + "custom_attribute" + ], + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the target [customer profile](entity:Customer).", + "minLength": 1 + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with following fields:\n\n- `key`. This key must match the `key` of a custom attribute definition in the Square seller \naccount. If the requesting application is not the definition owner, you must provide the qualified key.\n\n- `value`. This value must conform to the `schema` specified by the definition. \nFor more information, see [Value data types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for update operations, include this optional field in the request and set the\nvalue to the current version of the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this individual upsert request, used to ensure idempotency.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "BulkUpsertCustomerCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual upsert request.", + "x-release-status": "PUBLIC", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse" + }, + "description": "A map of responses that correspond to individual upsert requests. Each response has the\nsame ID as the corresponding request and contains either a `customer_id` and `custom_attribute` or an `errors` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "created_at": "2021-12-08T23:14:47Z", + "key": "favoritemovie", + "updated_at": "2021-12-09T00:16:23Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "N3NCVYY3WS27HF0HKANA3R9FP8" + }, + "id2": { + "custom_attribute": { + "created_at": "2021-12-09T00:16:20Z", + "key": "ownsmovie", + "updated_at": "2021-12-09T00:16:23Z", + "value": false, + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM" + }, + "id3": { + "custom_attribute": { + "created_at": "2021-12-09T00:16:20Z", + "key": "favoritemovie", + "updated_at": "2021-12-09T00:16:23Z", + "value": "Star Wars", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM" + }, + "id4": { + "custom_attribute": { + "created_at": "2021-12-08T23:14:47Z", + "key": "square:a0f1505a-2aa1-490d-91a8-8d31ff181808", + "updated_at": "2021-12-09T00:16:23Z", + "value": "10.5", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "N3NCVYY3WS27HF0HKANA3R9FP8" + }, + "id5": { + "custom_attribute": { + "created_at": "2021-12-09T00:16:20Z", + "key": "sq0ids-0evKIskIGaY45fCyNL66aw:backupemail", + "updated_at": "2021-12-09T00:16:23Z", + "value": "fake-email@squareup.com", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "70548QG1HN43B05G0KCZ4MMC1G" + } + } + } + }, + "BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse": { + "type": "object", + "description": "Represents a response for an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) operation.", + "x-release-status": "PUBLIC", + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the customer profile associated with the custom attribute." + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred while processing the individual request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2021-12-08T23:14:47Z", + "key": "favoritemovie", + "updated_at": "2021-12-09T00:16:23Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "customer_id": "N3NCVYY3WS27HF0HKANA3R9FP8" + } + }, + "BulkUpsertLocationCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest" + }, + "description": "A map containing 1 to 25 individual upsert requests. For each request, provide an\narbitrary ID that is unique for this `BulkUpsertLocationCustomAttributes` request and the\ninformation needed to create or update a custom attribute." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "key": "bestseller", + "value": "hot cocoa" + }, + "location_id": "L0TBCBTB7P8RQ" + }, + "id2": { + "custom_attribute": { + "key": "bestseller", + "value": "berry smoothie" + }, + "location_id": "L9XMD04V3STJX" + }, + "id3": { + "custom_attribute": { + "key": "phone-number", + "value": "+12223334444" + }, + "location_id": "L0TBCBTB7P8RQ" + } + } + } + }, + "BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest": { + "type": "object", + "description": "Represents an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes)\nrequest. An individual request contains a location ID, the custom attribute to create or update,\nand an optional idempotency key.", + "x-release-status": "BETA", + "required": [ + "location_id", + "custom_attribute" + ], + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the target [location](entity:Location).", + "minLength": 1 + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with following fields:\n- `key`. This key must match the `key` of a custom attribute definition in the Square seller\naccount. If the requesting application is not the definition owner, you must provide the qualified key.\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types)..\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, specify the current version of the custom attribute. \nIf this is not important for your application, `version` can be set to -1." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this individual upsert request, used to ensure idempotency.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "BulkUpsertLocationCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual upsert request.", + "x-release-status": "BETA", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse" + }, + "description": "A map of responses that correspond to individual upsert requests. Each response has the\nsame ID as the corresponding request and contains either a `location_id` and `custom_attribute` or an `errors` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "created_at": "2023-01-09T19:02:58.647Z", + "key": "bestseller", + "updated_at": "2023-01-09T19:21:04.551Z", + "value": "hot cocoa", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "location_id": "L0TBCBTB7P8RQ" + }, + "id2": { + "custom_attribute": { + "created_at": "2023-01-09T19:02:58.647Z", + "key": "bestseller", + "updated_at": "2023-01-09T19:21:04.551Z", + "value": "berry smoothie", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "location_id": "L9XMD04V3STJX" + }, + "id3": { + "custom_attribute": { + "created_at": "2023-01-09T19:04:57.985Z", + "key": "phone-number", + "updated_at": "2023-01-09T19:21:04.563Z", + "value": "+12239903892", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "location_id": "L0TBCBTB7P8RQ" + } + } + } + }, + "BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse": { + "type": "object", + "description": "Represents a response for an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) operation.", + "x-release-status": "BETA", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the location associated with the custom attribute." + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred while processing the individual request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-01-09T19:02:58.647Z", + "key": "bestseller", + "updated_at": "2023-01-09T19:21:04.551Z", + "value": "hot cocoa", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "location_id": "L0TBCBTB7P8RQ" + } + }, + "BulkUpsertMerchantCustomAttributesRequest": { + "type": "object", + "description": "Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) request.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest" + }, + "description": "A map containing 1 to 25 individual upsert requests. For each request, provide an\narbitrary ID that is unique for this `BulkUpsertMerchantCustomAttributes` request and the\ninformation needed to create or update a custom attribute." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "key": "alternative_seller_name", + "value": "Ultimate Sneaker Store" + }, + "merchant_id": "DM7VKY8Q63GNP" + }, + "id2": { + "custom_attribute": { + "key": "has_seen_tutorial", + "value": true + }, + "merchant_id": "DM7VKY8Q63GNP" + } + } + } + }, + "BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest": { + "type": "object", + "description": "Represents an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes)\nrequest. An individual request contains a merchant ID, the custom attribute to create or update,\nand an optional idempotency key.", + "x-release-status": "BETA", + "required": [ + "merchant_id", + "custom_attribute" + ], + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target [merchant](entity:Merchant).", + "minLength": 1 + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with following fields:\n- `key`. This key must match the `key` of a custom attribute definition in the Square seller\naccount. If the requesting application is not the definition owner, you must provide the qualified key.\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).\n- The version field must match the current version of the custom attribute definition to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\nIf this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this individual upsert request, used to ensure idempotency.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "BulkUpsertMerchantCustomAttributesResponse": { + "type": "object", + "description": "Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) response,\nwhich contains a map of responses that each corresponds to an individual upsert request.", + "x-release-status": "BETA", + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse" + }, + "description": "A map of responses that correspond to individual upsert requests. Each response has the\nsame ID as the corresponding request and contains either a `merchant_id` and `custom_attribute` or an `errors` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "values": { + "id1": { + "custom_attribute": { + "created_at": "2023-05-06T19:02:58.647Z", + "key": "alternative_seller_name", + "updated_at": "2023-05-06T19:21:04.551Z", + "value": "Ultimate Sneaker Store", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "merchant_id": "DM7VKY8Q63GNP" + }, + "id2": { + "custom_attribute": { + "created_at": "2023-05-06T19:02:58.647Z", + "key": "has_seen_tutorial", + "updated_at": "2023-05-06T19:21:04.551Z", + "value": true, + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "merchant_id": "DM7VKY8Q63GNP" + } + } + } + }, + "BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse": { + "type": "object", + "description": "Represents a response for an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) operation.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the custom attribute." + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred while processing the individual request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-05-06T19:02:58.647Z", + "key": "alternative_seller_name", + "updated_at": "2023-05-06T19:21:04.551Z", + "value": "Ultimate Sneaker Store", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "merchant_id": "DM7VKY8Q63GNP" + } + }, + "BulkUpsertOrderCustomAttributesRequest": { + "type": "object", + "description": "Represents a bulk upsert request for one or more order custom attributes.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute" + }, + "description": "A map of requests that correspond to individual upsert operations for custom attributes." + } + }, + "example": { + "values": { + "cover-count": { + "custom_attribute": { + "key": "cover-count", + "value": "6", + "version": 2 + }, + "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + }, + "table-number": { + "custom_attribute": { + "key": "table-number", + "value": "11", + "version": 4 + }, + "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + } + } + } + }, + "BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute": { + "type": "object", + "description": "Represents one upsert within the bulk operation.", + "x-release-status": "BETA", + "required": [ + "custom_attribute", + "order_id" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n\n- `value`. This value must conform to the `schema` specified by the definition. \nFor more information, see [Value data types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, include this optional field and specify the current version of the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. \nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the target [order](entity:Order).", + "minLength": 1, + "maxLength": 255 + } + } + }, + "BulkUpsertOrderCustomAttributesResponse": { + "type": "object", + "description": "Represents a response from a bulk upsert of order custom attributes.", + "x-release-status": "BETA", + "required": [ + "values" + ], + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/UpsertOrderCustomAttributeResponse" + }, + "description": " A map of responses that correspond to individual upsert operations for custom attributes." + } + }, + "example": { + "values": { + "cover-count": { + "custom_attribute": { + "created_at": "2022-11-22T21:27:33.429Z", + "key": "cover-count", + "updated_at": "2022-11-22T21:28:35.721Z", + "value": "6", + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + }, + "table-number": { + "custom_attribute": { + "created_at": "2022-11-22T21:24:57.823Z", + "key": "table-number", + "updated_at": "2022-11-22T21:28:35.726Z", + "value": "11", + "visibility": "VISIBILITY_HIDDEN" + } + } + } + } + }, + "BusinessAppointmentSettings": { + "type": "object", + "description": "The service appointment settings, including where and how the service is provided.", + "x-release-status": "PUBLIC", + "properties": { + "location_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BusinessAppointmentSettingsBookingLocationType" + }, + "description": "Types of the location allowed for bookings.\nSee [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) for possible values", + "nullable": true + }, + "alignment_time": { + "$ref": "#/components/schemas/BusinessAppointmentSettingsAlignmentTime", + "description": "The time unit of the service duration for bookings.\nSee [BusinessAppointmentSettingsAlignmentTime](#type-businessappointmentsettingsalignmenttime) for possible values", + "nullable": true + }, + "min_booking_lead_time_seconds": { + "type": "integer", + "description": "The minimum lead time in seconds before a service can be booked. A booking must be created at least this amount of time before its starting time.", + "nullable": true + }, + "max_booking_lead_time_seconds": { + "type": "integer", + "description": "The maximum lead time in seconds before a service can be booked. A booking must be created at most this amount of time before its starting time.", + "nullable": true + }, + "any_team_member_booking_enabled": { + "type": "boolean", + "description": "Indicates whether a customer can choose from all available time slots and have a staff member assigned\nautomatically (`true`) or not (`false`).", + "nullable": true + }, + "multiple_service_booking_enabled": { + "type": "boolean", + "description": "Indicates whether a customer can book multiple services in a single online booking.", + "nullable": true + }, + "max_appointments_per_day_limit_type": { + "$ref": "#/components/schemas/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType", + "description": "Indicates whether the daily appointment limit applies to team members or to\nbusiness locations.\nSee [BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType](#type-businessappointmentsettingsmaxappointmentsperdaylimittype) for possible values", + "nullable": true + }, + "max_appointments_per_day_limit": { + "type": "integer", + "description": "The maximum number of daily appointments per team member or per location.", + "nullable": true + }, + "cancellation_window_seconds": { + "type": "integer", + "description": "The cut-off time in seconds for allowing clients to cancel or reschedule an appointment.", + "nullable": true + }, + "cancellation_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The flat-fee amount charged for a no-show booking.", + "nullable": true + }, + "cancellation_policy": { + "$ref": "#/components/schemas/BusinessAppointmentSettingsCancellationPolicy", + "description": "The cancellation policy adopted by the seller.\nSee [BusinessAppointmentSettingsCancellationPolicy](#type-businessappointmentsettingscancellationpolicy) for possible values", + "nullable": true + }, + "cancellation_policy_text": { + "type": "string", + "description": "The free-form text of the seller's cancellation policy.", + "maxLength": 65536, + "nullable": true + }, + "skip_booking_flow_staff_selection": { + "type": "boolean", + "description": "Indicates whether customers has an assigned staff member (`true`) or can select s staff member of their choice (`false`).", + "nullable": true + } + } + }, + "BusinessAppointmentSettingsAlignmentTime": { + "type": "string", + "enum": [ + "SERVICE_DURATION", + "QUARTER_HOURLY", + "HALF_HOURLY", + "HOURLY" + ], + "x-enum-elements": [ + { + "name": "SERVICE_DURATION", + "description": "The service duration unit is one visit of a fixed time interval specified by the seller." + }, + { + "name": "QUARTER_HOURLY", + "description": "The service duration unit is a 15-minute interval. Bookings can be scheduled every quarter hour." + }, + { + "name": "HALF_HOURLY", + "description": "The service duration unit is a 30-minute interval. Bookings can be scheduled every half hour." + }, + { + "name": "HOURLY", + "description": "The service duration unit is a 60-minute interval. Bookings can be scheduled every hour." + } + ], + "description": "Time units of a service duration for bookings.", + "x-release-status": "PUBLIC" + }, + "BusinessAppointmentSettingsBookingLocationType": { + "type": "string", + "enum": [ + "BUSINESS_LOCATION", + "CUSTOMER_LOCATION", + "PHONE" + ], + "x-enum-elements": [ + { + "name": "BUSINESS_LOCATION", + "description": "The service is provided at a seller location." + }, + { + "name": "CUSTOMER_LOCATION", + "description": "The service is provided at a customer location." + }, + { + "name": "PHONE", + "description": "The service is provided over the phone." + } + ], + "description": "Supported types of location where service is provided.", + "x-release-status": "PUBLIC" + }, + "BusinessAppointmentSettingsCancellationPolicy": { + "type": "string", + "enum": [ + "CANCELLATION_TREATED_AS_NO_SHOW", + "CUSTOM_POLICY" + ], + "x-enum-elements": [ + { + "name": "CANCELLATION_TREATED_AS_NO_SHOW", + "description": "Cancellations are treated as no shows and may incur a fee as specified by `cancellation_fee_money`." + }, + { + "name": "CUSTOM_POLICY", + "description": "Cancellations follow the seller-specified policy that is described in free-form text and not enforced automatically by Square." + } + ], + "description": "The category of the seller’s cancellation policy.", + "x-release-status": "PUBLIC" + }, + "BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType": { + "type": "string", + "enum": [ + "PER_TEAM_MEMBER", + "PER_LOCATION" + ], + "x-enum-elements": [ + { + "name": "PER_TEAM_MEMBER", + "description": "The maximum number of daily appointments is set on a per team member basis." + }, + { + "name": "PER_LOCATION", + "description": "The maximum number of daily appointments is set on a per location basis." + } + ], + "description": "Types of daily appointment limits.", + "x-release-status": "PUBLIC" + }, + "BusinessBookingProfile": { + "type": "object", + "description": "A seller's business booking profile, including booking policy, appointment settings, etc.", + "x-release-status": "PUBLIC", + "properties": { + "seller_id": { + "type": "string", + "description": "The ID of the seller, obtainable using the Merchants API.", + "maxLength": 32, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The RFC 3339 timestamp specifying the booking's creation time.", + "readOnly": true + }, + "booking_enabled": { + "type": "boolean", + "description": "Indicates whether the seller is open for booking.", + "nullable": true + }, + "customer_timezone_choice": { + "$ref": "#/components/schemas/BusinessBookingProfileCustomerTimezoneChoice", + "description": "The choice of customer's time zone information of a booking.\nThe Square online booking site and all notifications to customers uses either the seller location’s time zone\nor the time zone the customer chooses at booking.\nSee [BusinessBookingProfileCustomerTimezoneChoice](#type-businessbookingprofilecustomertimezonechoice) for possible values", + "nullable": true + }, + "booking_policy": { + "$ref": "#/components/schemas/BusinessBookingProfileBookingPolicy", + "description": "The policy for the seller to automatically accept booking requests (`ACCEPT_ALL`) or not (`REQUIRES_ACCEPTANCE`).\nSee [BusinessBookingProfileBookingPolicy](#type-businessbookingprofilebookingpolicy) for possible values", + "nullable": true + }, + "allow_user_cancel": { + "type": "boolean", + "description": "Indicates whether customers can cancel or reschedule their own bookings (`true`) or not (`false`).", + "nullable": true + }, + "business_appointment_settings": { + "$ref": "#/components/schemas/BusinessAppointmentSettings", + "description": "Settings for appointment-type bookings.", + "nullable": true + }, + "support_seller_level_writes": { + "type": "boolean", + "description": "Indicates whether the seller's subscription to Square Appointments supports creating, updating or canceling an appointment through the API (`true`) or not (`false`) using seller permission.", + "nullable": true + } + } + }, + "BusinessBookingProfileBookingPolicy": { + "type": "string", + "enum": [ + "ACCEPT_ALL", + "REQUIRES_ACCEPTANCE" + ], + "x-enum-elements": [ + { + "name": "ACCEPT_ALL", + "description": "The seller accepts all booking requests automatically." + }, + { + "name": "REQUIRES_ACCEPTANCE", + "description": "The seller must accept requests to complete bookings." + } + ], + "description": "Policies for accepting bookings.", + "x-release-status": "PUBLIC" + }, + "BusinessBookingProfileCustomerTimezoneChoice": { + "type": "string", + "enum": [ + "BUSINESS_LOCATION_TIMEZONE", + "CUSTOMER_CHOICE" + ], + "x-enum-elements": [ + { + "name": "BUSINESS_LOCATION_TIMEZONE", + "description": "Use the time zone of the business location for bookings." + }, + { + "name": "CUSTOMER_CHOICE", + "description": "Use the customer-chosen time zone for bookings." + } + ], + "description": "Choices of customer-facing time zone used for bookings.", + "x-release-status": "PUBLIC" + }, + "BusinessHours": { + "type": "object", + "description": "The hours of operation for a location.", + "x-release-status": "PUBLIC", + "properties": { + "periods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BusinessHoursPeriod" + }, + "description": "The list of time periods during which the business is open. There can be at most 10 periods per day.", + "nullable": true + } + } + }, + "BusinessHoursPeriod": { + "type": "object", + "description": "Represents a period of time during which a business location is open.", + "x-release-status": "PUBLIC", + "properties": { + "day_of_week": { + "$ref": "#/components/schemas/DayOfWeek", + "description": "The day of the week for this time period.\nSee [DayOfWeek](#type-dayofweek) for possible values", + "nullable": true + }, + "start_local_time": { + "type": "string", + "description": "The start time of a business hours period, specified in local time using partial-time\nRFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning.\nNote that the seconds value is always :00, but it is appended for conformance to the RFC.", + "nullable": true + }, + "end_local_time": { + "type": "string", + "description": "The end time of a business hours period, specified in local time using partial-time\nRFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening.\nNote that the seconds value is always :00, but it is appended for conformance to the RFC.", + "nullable": true + } + } + }, + "BuyNowPayLaterDetails": { + "type": "object", + "description": "Additional details about a Buy Now Pay Later payment type.", + "x-release-status": "PUBLIC", + "properties": { + "brand": { + "type": "string", + "description": "The brand used for the Buy Now Pay Later payment.\nThe brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.", + "maxLength": 50, + "nullable": true + }, + "afterpay_details": { + "$ref": "#/components/schemas/AfterpayDetails", + "description": "Details about an Afterpay payment. These details are only populated if the `brand` is\n`AFTERPAY`.", + "nullable": true + }, + "clearpay_details": { + "$ref": "#/components/schemas/ClearpayDetails", + "description": "Details about a Clearpay payment. These details are only populated if the `brand` is\n`CLEARPAY`.", + "nullable": true + } + } + }, + "CalculateLoyaltyPointsRequest": { + "type": "object", + "description": "Represents a [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?program_id=d619f755-2d17-41f3-990d-c04ecedd64dd", + "properties": { + "order_id": { + "type": "string", + "description": "The [order](entity:Order) ID for which to calculate the points.\nSpecify this field if your application uses the Orders API to process orders.\nOtherwise, specify the `transaction_amount_money`.", + "nullable": true + }, + "transaction_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The purchase amount for which to calculate the points. \nSpecify this field if your application does not use the Orders API to process orders.\nOtherwise, specify the `order_id`.", + "nullable": true + }, + "loyalty_account_id": { + "type": "string", + "description": "The ID of the target [loyalty account](entity:LoyaltyAccount). Optionally specify this field\nif your application uses the Orders API to process orders.\n\nIf specified, the `promotion_points` field in the response shows the number of points the buyer would\nearn from the purchase. In this case, Square uses the account ID to determine whether the promotion's\n`trigger_limit` (the maximum number of times that a buyer can trigger the promotion) has been reached.\nIf not specified, the `promotion_points` field shows the number of points the purchase qualifies\nfor regardless of the trigger limit.", + "minLength": 1, + "maxLength": 36, + "nullable": true + } + }, + "example": { + "loyalty_account_id": "79b807d2-d786-46a9-933b-918028d7a8c5", + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + } + }, + "CalculateLoyaltyPointsResponse": { + "type": "object", + "description": "Represents a [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "points": { + "type": "integer", + "description": "The number of points that the buyer can earn from the base loyalty program." + }, + "promotion_points": { + "type": "integer", + "description": "The number of points that the buyer can earn from a loyalty promotion. To be eligible\nto earn promotion points, the purchase must first qualify for program points. When `order_id`\nis not provided in the request, this value is always 0." + } + }, + "example": { + "points": 6, + "promotion_points": 12 + } + }, + "CalculateOrderRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "order" + ], + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The order to be calculated. Expects the entire order, not a sparse update." + }, + "proposed_rewards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReward" + }, + "description": "Identifies one or more loyalty reward tiers to apply during the order calculation.\nThe discounts defined by the reward tiers are added to the order only to preview the\neffect of applying the specified rewards. The rewards do not correspond to actual\nredemptions; that is, no `reward`s are created. Therefore, the reward `id`s are\nrandom strings used only to reference the reward tier.", + "nullable": true + } + }, + "example": { + "idempotency_key": "b3e98fe3-b8de-471c-82f1-545f371e637c", + "order": { + "discounts": [ + { + "name": "50% Off", + "percentage": "50", + "scope": "ORDER" + } + ], + "line_items": [ + { + "base_price_money": { + "amount": 500, + "currency": "USD" + }, + "name": "Item 1", + "quantity": "1" + }, + { + "base_price_money": { + "amount": 300, + "currency": "USD" + }, + "name": "Item 2", + "quantity": "2" + } + ], + "location_id": "D7AVYMEAPJ3A3" + } + } + }, + "CalculateOrderResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The calculated version of the order provided in the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "order": { + "created_at": "2020-05-18T16:30:49.614Z", + "discounts": [ + { + "applied_money": { + "amount": 550, + "currency": "USD" + }, + "name": "50% Off", + "percentage": "50", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "zGsRZP69aqSSR9lq9euSPB" + } + ], + "line_items": [ + { + "applied_discounts": [ + { + "applied_money": { + "amount": 250, + "currency": "USD" + }, + "discount_uid": "zGsRZP69aqSSR9lq9euSPB", + "uid": "9zr9S4dxvPAixvn0lpa1VC" + } + ], + "base_price_money": { + "amount": 500, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 500, + "currency": "USD" + }, + "name": "Item 1", + "quantity": "1", + "total_discount_money": { + "amount": 250, + "currency": "USD" + }, + "total_money": { + "amount": 250, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "ULkg0tQTRK2bkU9fNv3IJD", + "variation_total_price_money": { + "amount": 500, + "currency": "USD" + } + }, + { + "applied_discounts": [ + { + "applied_money": { + "amount": 300, + "currency": "USD" + }, + "discount_uid": "zGsRZP69aqSSR9lq9euSPB", + "uid": "qa8LwwZK82FgSEkQc2HYVC" + } + ], + "base_price_money": { + "amount": 300, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 600, + "currency": "USD" + }, + "name": "Item 2", + "quantity": "2", + "total_discount_money": { + "amount": 300, + "currency": "USD" + }, + "total_money": { + "amount": 300, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "mumY8Nun4BC5aKe2yyx5a", + "variation_total_price_money": { + "amount": 600, + "currency": "USD" + } + } + ], + "location_id": "D7AVYMEAPJ3A3", + "net_amounts": { + "discount_money": { + "amount": 550, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 0, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 550, + "currency": "USD" + } + }, + "state": "OPEN", + "total_discount_money": { + "amount": 550, + "currency": "USD" + }, + "total_money": { + "amount": 550, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2020-05-18T16:30:49.614Z", + "version": 1 + } + } + }, + "CancelBookingRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key to make this request an idempotent operation.", + "maxLength": 255, + "nullable": true + }, + "booking_version": { + "type": "integer", + "description": "The revision number for the booking used for optimistic concurrency.", + "nullable": true + } + } + }, + "CancelBookingResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The booking that was cancelled." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "booking": { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "created_at": "2020-10-28T15:47:41Z", + "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + "customer_note": "", + "id": "zkras0xv0xwswx", + "location_id": "LEQHH0YY8B42M", + "seller_note": "", + "start_at": "2020-11-26T13:00:00Z", + "status": "CANCELLED_BY_CUSTOMER", + "updated_at": "2020-10-28T15:49:25Z", + "version": 1 + }, + "errors": [] + } + }, + "CancelInvoiceRequest": { + "type": "object", + "description": "Describes a `CancelInvoice` request.", + "x-release-status": "PUBLIC", + "required": [ + "version" + ], + "properties": { + "version": { + "type": "integer", + "description": "The version of the [invoice](entity:Invoice) to cancel.\nIf you do not know the version, you can call \n[GetInvoice](api-endpoint:Invoices-GetInvoice) or [ListInvoices](api-endpoint:Invoices-ListInvoices)." + } + }, + "example": { + "version": 0 + } + }, + "CancelInvoiceResponse": { + "type": "object", + "description": "The response returned by the `CancelInvoice` request.", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The canceled invoice." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "CANCELED", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 1 + } + } + }, + "CancelLoyaltyPromotionResponse": { + "type": "object", + "description": "Represents a [CancelLoyaltyPromotion](api-endpoint:Loyalty-CancelLoyaltyPromotion) response.\nEither `loyalty_promotion` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The canceled loyalty promotion." + } + }, + "example": { + "loyalty_promotion": { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ] + }, + "canceled_at": "2022-08-17T12:42:49Z", + "created_at": "2022-08-16T08:38:54Z", + "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", + "incentive": { + "points_multiplier_data": { + "multiplier": "3.000", + "points_multiplier": 3 + }, + "type": "POINTS_MULTIPLIER" + }, + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Tuesday Happy Hour Promo", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "status": "CANCELED", + "trigger_limit": { + "interval": "DAY", + "times": 1 + }, + "updated_at": "2022-08-17T12:42:49Z" + } + } + }, + "CancelPaymentByIdempotencyKeyRequest": { + "type": "object", + "description": "Describes a request to cancel a payment using\n[CancelPaymentByIdempotencyKey](api-endpoint:Payments-CancelPaymentByIdempotencyKey).", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "The `idempotency_key` identifying the payment to be canceled.", + "minLength": 1, + "maxLength": 45 + } + }, + "example": { + "idempotency_key": "a7e36d40-d24b-11e8-b568-0800200c9a66" + } + }, + "CancelPaymentByIdempotencyKeyResponse": { + "type": "object", + "description": "Defines the response returned by\n[CancelPaymentByIdempotencyKey](api-endpoint:Payments-CancelPaymentByIdempotencyKey).\nOn success, `errors` is empty.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "CancelPaymentResponse": { + "type": "object", + "description": "Defines the response returned by [CancelPayment](api-endpoint:Payments-CancelPayment).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The successfully canceled `Payment` object." + } + }, + "example": { + "payment": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-TcgftTEtKxJTRF1lCFJ9TA", + "square_product": "ECOMMERCE_API" + }, + "approved_money": { + "amount": 1000, + "currency": "USD" + }, + "card_details": { + "auth_result_code": "68aLBM", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T20:26:44.364Z", + "voided_at": "2021-10-13T20:31:21.597Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "ON_FILE", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "VOIDED" + }, + "created_at": "2021-10-13T20:26:44.191Z", + "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T20:26:44.191Z", + "id": "1QjqpBVyrI9S4H9sTGDWU9JeiWdZY", + "location_id": "L88917AVBK2S5", + "note": "Example Note", + "order_id": "nUSN9TdxpiK3SrQg3wzmf6r8LP9YY", + "risk_evaluation": { + "created_at": "2021-10-13T20:26:45.271Z", + "risk_level": "NORMAL" + }, + "source_type": "CARD", + "status": "CANCELED", + "tip_money": { + "amount": 100, + "currency": "USD" + }, + "total_money": { + "amount": 1100, + "currency": "USD" + }, + "updated_at": "2021-10-13T20:31:21.597Z", + "version_token": "N8AGYgEjCiY9Q57Jw7aVHEpBq8bzGCDCQMRX8Vs56N06o" + } + } + }, + "CancelSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the \n[CancelSubscription](api-endpoint:Subscriptions-CancelSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The specified subscription scheduled for cancellation according to the action created by the request." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "A list of a single `CANCEL` action scheduled for the subscription.", + "x-release-status": "BETA" + } + }, + "example": { + "subscription": { + "canceled_date": "2023-06-05", + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "created_at": "2022-01-19T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "910afd30-464a-4e00-a8d8-2296e", + "invoice_ids": [ + "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA" + ], + "location_id": "S8GWD5R9QB376", + "paid_until_date": "2023-12-31", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2022-01-19", + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 3 + } + } + }, + "CancelTerminalActionResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The canceled `TerminalAction`" + } + }, + "example": { + "action": { + "app_id": "APP_ID", + "cancel_reason": "SELLER_CANCELED", + "created_at": "2021-07-28T23:22:07.476Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:jveJIAkkAjILHkdCE", + "location_id": "LOCATION_ID", + "save_card_options": { + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "CANCELED", + "type": "SAVE_CARD", + "updated_at": "2021-07-28T23:22:29.511Z" + } + } + }, + "CancelTerminalCheckoutResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The canceled `TerminalCheckout`." + } + }, + "example": { + "checkout": { + "amount_money": { + "amount": 123, + "currency": "USD" + }, + "app_id": "APP_ID", + "cancel_reason": "SELLER_CANCELED", + "created_at": "2020-03-16T15:31:19.934Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": true, + "tip_settings": { + "allow_tipping": true + } + }, + "id": "S1yDlPQx7slqO", + "location_id": "LOCATION_ID", + "reference_id": "id36815", + "status": "CANCELED", + "updated_at": "2020-03-16T15:31:45.787Z" + } + } + }, + "CancelTerminalRefundResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The updated `TerminalRefund`." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 100, + "currency": "CAD" + }, + "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", + "cancel_reason": "SELLER_CANCELED", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 1, + "exp_year": 2022, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "created_at": "2020-10-21T22:47:23.241Z", + "deadline_duration": "PT5M", + "device_id": "42690809-faa2-4701-a24b-19d3d34c9aaa", + "id": "g6ycb6HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "76C9W6K8CNNQ5", + "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "reason", + "status": "CANCELED", + "updated_at": "2020-10-21T22:47:30.096Z" + } + } + }, + "CancelTransferOrderRequest": { + "type": "object", + "description": "Request to cancel a transfer order, marking any unreceived quantities as canceled", + "x-release-status": "BETA", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this UpdateTransferOrder request. Keys can be\nany valid string but must be unique for every UpdateTransferOrder request.", + "minLength": 1 + }, + "version": { + "type": "integer", + "description": "Version for optimistic concurrency", + "format": "int64" + } + }, + "example": { + "idempotency_key": "65cc0586-3e82-4d08-b524-3885cffd52", + "transfer_order_id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "version": 1753117449752 + } + }, + "CancelTransferOrderResponse": { + "type": "object", + "description": "Response for canceling a transfer order", + "x-release-status": "BETA", + "properties": { + "transfer_order": { + "$ref": "#/components/schemas/TransferOrder", + "description": "The updated transfer order with status changed to CANCELED" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request" + } + }, + "example": { + "transfer_order": { + "completed_at": "2025-01-15T10:45:00Z", + "created_at": "2025-01-15T10:30:00Z", + "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", + "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", + "expected_at": "2025-11-09T05:00:00Z", + "id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "line_items": [ + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", + "quantity_canceled": "5", + "quantity_damaged": "0", + "quantity_ordered": "5", + "quantity_pending": "0", + "quantity_received": "0", + "uid": "1" + }, + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_002", + "quantity_canceled": "3", + "quantity_damaged": "0", + "quantity_ordered": "3", + "quantity_pending": "0", + "quantity_received": "0", + "uid": "2" + } + ], + "notes": "Example transfer order for inventory redistribution between locations", + "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", + "status": "CANCELED", + "tracking_number": "TRACK123456789", + "updated_at": "2025-01-15T10:45:00Z", + "version": 1753117461842 + } + } + }, + "CaptureTransactionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint.", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {}, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.csharp", + "java": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.java", + "javascript": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.javascript", + "php": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.php", + "python": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.python", + "ruby": "/sdk_samples/CaptureTransaction/CaptureTransactionResponse.ruby" + } + }, + "Card": { + "type": "object", + "description": "Represents the payment details of a card to be used for payments. These\ndetails are determined by the payment token generated by Web Payments SDK.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "Unique ID for this card. Generated by Square.", + "maxLength": 64, + "readOnly": true + }, + "card_brand": { + "$ref": "#/components/schemas/CardBrand", + "description": "The card's brand.\nSee [CardBrand](#type-cardbrand) for possible values", + "readOnly": true + }, + "last_4": { + "type": "string", + "description": "The last 4 digits of the card number.", + "maxLength": 4, + "readOnly": true + }, + "exp_month": { + "type": "integer", + "description": "The expiration month of the associated card as an integer between 1 and 12.", + "format": "int64", + "nullable": true + }, + "exp_year": { + "type": "integer", + "description": "The four-digit year of the card's expiration date.", + "format": "int64", + "nullable": true + }, + "cardholder_name": { + "type": "string", + "description": "The name of the cardholder.", + "maxLength": 96, + "nullable": true + }, + "billing_address": { + "$ref": "#/components/schemas/Address", + "description": "The billing address for this card. `US` postal codes can be provided as a 5-digit zip code\nor 9-digit ZIP+4 (example: `12345-6789`). For a full list of field meanings by country, see\n[Working with Addresses](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-addresses).", + "nullable": true + }, + "fingerprint": { + "type": "string", + "description": "Intended as a Square-assigned identifier, based\non the card number, to identify the card across multiple locations within a\nsingle application.", + "maxLength": 255, + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "**Required** The ID of a [customer](entity:Customer) to be associated with the card.", + "nullable": true + }, + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the card.", + "readOnly": true + }, + "reference_id": { + "type": "string", + "description": "An optional user-defined reference ID that associates this card with\nanother entity in an external system. For example, a customer ID from an\nexternal customer management system.", + "maxLength": 128, + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether or not a card can be used for payments.", + "readOnly": true + }, + "card_type": { + "$ref": "#/components/schemas/CardType", + "description": "The type of the card.\nThe Card object includes this field only in response to Payments API calls.\nSee [CardType](#type-cardtype) for possible values", + "readOnly": true + }, + "prepaid_type": { + "$ref": "#/components/schemas/CardPrepaidType", + "description": "Indicates whether the card is prepaid or not.\nSee [CardPrepaidType](#type-cardprepaidtype) for possible values", + "readOnly": true + }, + "bin": { + "type": "string", + "description": "The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API\nreturns this field.", + "maxLength": 6, + "readOnly": true + }, + "version": { + "type": "integer", + "description": "Current version number of the card. Increments with each card update. Requests to update an\nexisting Card object will be rejected unless the version in the request matches the current\nversion for the Card.", + "format": "int64" + }, + "card_co_brand": { + "$ref": "#/components/schemas/CardCoBrand", + "description": "The card's co-brand if available. For example, an Afterpay virtual card would have a\nco-brand of AFTERPAY.\nSee [CardCoBrand](#type-cardcobrand) for possible values", + "readOnly": true + }, + "issuer_alert": { + "$ref": "#/components/schemas/CardIssuerAlert", + "description": "An alert from the issuing bank about the card status. Alerts can indicate whether\nfuture charges to the card are likely to fail. For more information, see\n[Manage Card on File Declines](https://developer.squareup.com/docs/cards-api/manage-card-on-file-declines).\n\nThis field is present only if there's an active issuer alert.\nSee [IssuerAlert](#type-issueralert) for possible values", + "readOnly": true, + "x-release-status": "BETA" + }, + "issuer_alert_at": { + "type": "string", + "description": "The timestamp of when the current issuer alert was received and processed, in\nRFC 3339 format.\n\nThis field is present only if there's an active issuer alert.", + "readOnly": true, + "x-release-status": "BETA" + }, + "hsa_fsa": { + "type": "boolean", + "description": "Indicates whether the card is linked to a Health Savings Account (HSA) or Flexible\nSpending Account (FSA), based on the card BIN.", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "CardAutomaticallyUpdatedEvent": { + "type": "object", + "description": "Published when Square automatically updates the expiration date or\nprimary account number (PAN) of a [card](entity:Card) or adds or removes an issuer alert.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"card.automatically_updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CardAutomaticallyUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "ccof:uIbfJXhXETSP197M3GB", + "object": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-2", + "version": 2 + } + }, + "type": "card" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "merchant_id": "6SSW7HV8K2ST5", + "type": "card.automatically_updated" + }, + "x-webhook": { + "event": "card.automatically_updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Cards", + "x-since": "2021-06-16" + }, + "CardAutomaticallyUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"card\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CardAutomaticallyUpdatedEventObject", + "description": "An object containing the automatically updated card.", + "nullable": true + } + } + }, + "CardAutomaticallyUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/Card", + "description": "The automatically updated card.", + "nullable": true + } + } + }, + "CardBrand": { + "type": "string", + "enum": [ + "OTHER_BRAND", + "VISA", + "MASTERCARD", + "AMERICAN_EXPRESS", + "DISCOVER", + "DISCOVER_DINERS", + "JCB", + "CHINA_UNIONPAY", + "SQUARE_GIFT_CARD", + "SQUARE_CAPITAL_CARD", + "INTERAC", + "EFTPOS", + "FELICA", + "EBT" + ], + "x-enum-elements": [ + { + "name": "OTHER_BRAND", + "description": "" + }, + { + "name": "VISA", + "description": "" + }, + { + "name": "MASTERCARD", + "description": "" + }, + { + "name": "AMERICAN_EXPRESS", + "description": "" + }, + { + "name": "DISCOVER", + "description": "" + }, + { + "name": "DISCOVER_DINERS", + "description": "" + }, + { + "name": "JCB", + "description": "" + }, + { + "name": "CHINA_UNIONPAY", + "description": "" + }, + { + "name": "SQUARE_GIFT_CARD", + "description": "" + }, + { + "name": "SQUARE_CAPITAL_CARD", + "description": "" + }, + { + "name": "INTERAC", + "description": "" + }, + { + "name": "EFTPOS", + "description": "" + }, + { + "name": "FELICA", + "description": "" + }, + { + "name": "EBT", + "description": "" + } + ], + "description": "Indicates a card's brand, such as `VISA` or `MASTERCARD`.", + "x-release-status": "PUBLIC" + }, + "CardCoBrand": { + "type": "string", + "enum": [ + "UNKNOWN", + "AFTERPAY", + "CLEARPAY" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN", + "description": "" + }, + { + "name": "AFTERPAY", + "description": "" + }, + { + "name": "CLEARPAY", + "description": "" + } + ], + "description": "Indicates the brand for a co-branded card.", + "x-release-status": "PUBLIC" + }, + "CardCreatedEvent": { + "type": "object", + "description": "Published when a [card](entity:Card) is created or imported.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"card.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CardCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "ccof:uIbfJXhXETSP197M3GB", + "object": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + } + }, + "type": "card" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "merchant_id": "6SSW7HV8K2ST5", + "type": "card.created" + }, + "x-webhook": { + "event": "card.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Cards", + "x-since": "2021-06-16" + }, + "CardCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"card\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CardCreatedEventObject", + "description": "An object containing the created card.", + "nullable": true + } + } + }, + "CardCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/Card", + "description": "The created card.", + "nullable": true + } + } + }, + "CardDisabledEvent": { + "type": "object", + "description": "Published when a [card](entity:Card) is disabled.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"card.disabled\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CardDisabledEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "ccof:uIbfJXhXETSP197M3GB", + "object": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": false, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 2 + } + }, + "type": "card" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "merchant_id": "6SSW7HV8K2ST5", + "type": "card.disabled" + }, + "x-webhook": { + "event": "card.disabled", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Cards", + "x-since": "2021-06-16" + }, + "CardDisabledEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"card\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CardDisabledEventObject", + "description": "An object containing the disabled card.", + "nullable": true + } + } + }, + "CardDisabledEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/Card", + "description": "The disabled card.", + "nullable": true + } + } + }, + "CardForgottenEvent": { + "type": "object", + "description": "Published when a [card](entity:Card) is GDPR forgotten or vaulted.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"card.forgotten\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CardForgottenEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "ccof:uIbfJXhXETSP197M3GB", + "object": { + "card": { + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": false, + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "merchant_id": "6SSW7HV8K2ST5", + "reference_id": "user-id-1", + "version": 2 + } + }, + "type": "card" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "merchant_id": "6SSW7HV8K2ST5", + "type": "card.forgotten" + }, + "x-webhook": { + "event": "card.forgotten", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Cards", + "x-since": "2021-06-16" + }, + "CardForgottenEventCard": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "Unique ID for this card. Generated by Square.", + "maxLength": 64, + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "The ID of a customer created using the Customers API associated with the card.", + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether or not a card can be used for payments.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "An optional user-defined reference ID that associates this card with\nanother entity in an external system. For example, a customer ID from an\nexternal customer management system.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "Current version number of the card. Increments with each card update. Requests to update an\nexisting Card object will be rejected unless the version in the request matches the current\nversion for the Card.", + "format": "int64" + }, + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the card.", + "nullable": true + } + } + }, + "CardForgottenEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"card\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CardForgottenEventObject", + "description": "An object containing the forgotten card.", + "nullable": true + } + } + }, + "CardForgottenEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/CardForgottenEventCard", + "description": "The forgotten card.", + "nullable": true + } + } + }, + "CardIssuerAlert": { + "type": "string", + "enum": [ + "ISSUER_ALERT_CARD_CLOSED" + ], + "x-enum-elements": [ + { + "name": "ISSUER_ALERT_CARD_CLOSED", + "description": "The underlying account of the card was closed, which is a strong signal that future\ncharges to the card are likely to fail." + } + ], + "description": "Indicates the type of issuer alert for a [card on file](entity:Card).", + "x-release-status": "BETA" + }, + "CardPaymentDetails": { + "type": "object", + "description": "Reflects the current status of a card payment. Contains only non-confidential information.", + "x-release-status": "PUBLIC", + "properties": { + "status": { + "type": "string", + "description": "The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or\nFAILED.", + "maxLength": 50, + "readOnly": true + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The credit card's non-confidential details.", + "readOnly": true + }, + "entry_method": { + "type": "string", + "description": "The method used to enter the card's details for the payment. The method can be\n`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.", + "maxLength": 50, + "readOnly": true + }, + "cvv_status": { + "type": "string", + "description": "The status code returned from the Card Verification Value (CVV) check. The code can be\n`CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`.", + "maxLength": 50, + "readOnly": true + }, + "avs_status": { + "type": "string", + "description": "The status code returned from the Address Verification System (AVS) check. The code can be\n`AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`.", + "maxLength": 50, + "readOnly": true + }, + "auth_result_code": { + "type": "string", + "description": "The status code returned by the card issuer that describes the payment's\nauthorization status.", + "maxLength": 10, + "readOnly": true + }, + "application_identifier": { + "type": "string", + "description": "For EMV payments, the application ID identifies the EMV application used for the payment.", + "maxLength": 32, + "readOnly": true + }, + "application_name": { + "type": "string", + "description": "For EMV payments, the human-readable name of the EMV application used for the payment.", + "maxLength": 16, + "readOnly": true + }, + "application_cryptogram": { + "type": "string", + "description": "For EMV payments, the cryptogram generated for the payment.", + "maxLength": 16, + "readOnly": true + }, + "verification_method": { + "type": "string", + "description": "For EMV payments, the method used to verify the cardholder's identity. The method can be\n`PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`.", + "maxLength": 50, + "readOnly": true + }, + "verification_results": { + "type": "string", + "description": "For EMV payments, the results of the cardholder verification. The result can be\n`SUCCESS`, `FAILURE`, or `UNKNOWN`.", + "maxLength": 50, + "readOnly": true + }, + "statement_description": { + "type": "string", + "description": "The statement description sent to the card networks.\n\nNote: The actual statement description varies and is likely to be truncated and appended with\nadditional information on a per issuer basis.", + "maxLength": 50, + "readOnly": true + }, + "device_details": { + "$ref": "#/components/schemas/DeviceDetails", + "description": "__Deprecated__: Use `Payment.device_details` instead.\n\nDetails about the device that took the payment.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "card_payment_timeline": { + "$ref": "#/components/schemas/CardPaymentTimeline", + "description": "The timeline for card payments.", + "readOnly": true + }, + "refund_requires_card_presence": { + "type": "boolean", + "description": "Whether the card must be physically present for the payment to\nbe refunded. If set to `true`, the card must be present.", + "readOnly": true, + "x-release-status": "BETA" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request.", + "readOnly": true + } + } + }, + "CardPaymentTimeline": { + "type": "object", + "description": "The timeline for card payments.", + "x-release-status": "PUBLIC", + "properties": { + "authorized_at": { + "type": "string", + "description": "The timestamp when the payment was authorized, in RFC 3339 format.", + "nullable": true + }, + "captured_at": { + "type": "string", + "description": "The timestamp when the payment was captured, in RFC 3339 format.", + "nullable": true + }, + "voided_at": { + "type": "string", + "description": "The timestamp when the payment was voided, in RFC 3339 format.", + "nullable": true + } + } + }, + "CardPrepaidType": { + "type": "string", + "enum": [ + "UNKNOWN_PREPAID_TYPE", + "NOT_PREPAID", + "PREPAID" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_PREPAID_TYPE", + "description": "" + }, + { + "name": "NOT_PREPAID", + "description": "" + }, + { + "name": "PREPAID", + "description": "" + } + ], + "description": "Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`.", + "x-release-status": "PUBLIC" + }, + "CardType": { + "type": "string", + "enum": [ + "UNKNOWN_CARD_TYPE", + "CREDIT", + "DEBIT" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_CARD_TYPE", + "description": "" + }, + { + "name": "CREDIT", + "description": "" + }, + { + "name": "DEBIT", + "description": "" + } + ], + "description": "Indicates a card's type, such as `CREDIT` or `DEBIT`.", + "x-release-status": "PUBLIC" + }, + "CardUpdatedEvent": { + "type": "object", + "description": "Published when a [card](entity:Card) is updated by the seller in the Square Dashboard.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"card.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CardUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-15T04:38:13Z", + "data": { + "id": "ccof:uIbfJXhXETSP197M3GB", + "object": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-2", + "version": 2 + } + }, + "type": "card" + }, + "event_id": "d214f854-adb1-4f56-b078-4b8697a3187a", + "merchant_id": "6SSW7HV8K2ST5", + "type": "card.updated" + }, + "x-webhook": { + "event": "card.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Cards", + "x-since": "2021-06-16" + }, + "CardUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"card\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CardUpdatedEventObject", + "description": "An object containing the updated card.", + "nullable": true + } + } + }, + "CardUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/Card", + "description": "The updated card.", + "nullable": true + } + } + }, + "CashAppDetails": { + "type": "object", + "description": "Additional details about `WALLET` type payments with the `brand` of `CASH_APP`.", + "x-release-status": "PUBLIC", + "properties": { + "buyer_full_name": { + "type": "string", + "description": "The name of the Cash App account holder.", + "maxLength": 255, + "nullable": true + }, + "buyer_country_code": { + "type": "string", + "description": "The country of the Cash App account holder, in ISO 3166-1-alpha-2 format.\n\nFor possible values, see [Country](entity:Country).", + "minLength": 2, + "maxLength": 2, + "nullable": true + }, + "buyer_cashtag": { + "type": "string", + "description": "$Cashtag of the Cash App account holder.", + "minLength": 1, + "maxLength": 21, + "readOnly": true + } + } + }, + "CashDrawerDevice": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The device Square-issued ID" + }, + "name": { + "type": "string", + "description": "The device merchant-specified name.", + "nullable": true + } + } + }, + "CashDrawerEventType": { + "type": "string", + "enum": [ + "NO_SALE", + "CASH_TENDER_PAYMENT", + "OTHER_TENDER_PAYMENT", + "CASH_TENDER_CANCELLED_PAYMENT", + "OTHER_TENDER_CANCELLED_PAYMENT", + "CASH_TENDER_REFUND", + "OTHER_TENDER_REFUND", + "PAID_IN", + "PAID_OUT" + ], + "x-enum-elements": [ + { + "name": "NO_SALE", + "description": "Triggered when a no sale occurs on a cash drawer.\nA CashDrawerEvent of this type must have a zero money amount." + }, + { + "name": "CASH_TENDER_PAYMENT", + "description": "Triggered when a cash tender payment occurs on a cash drawer.\nA CashDrawerEvent of this type can must not have a negative amount." + }, + { + "name": "OTHER_TENDER_PAYMENT", + "description": "Triggered when a check, gift card, or other non-cash payment occurs\non a cash drawer.\nA CashDrawerEvent of this type must have a zero money amount." + }, + { + "name": "CASH_TENDER_CANCELLED_PAYMENT", + "description": "Triggered when a split tender bill is cancelled after cash has been\ntendered.\nA CASH_TENDER_CANCELLED_PAYMENT should have a corresponding CASH_TENDER_PAYMENT.\nA CashDrawerEvent of this type must not have a negative amount." + }, + { + "name": "OTHER_TENDER_CANCELLED_PAYMENT", + "description": "Triggered when a split tender bill is cancelled after a non-cash tender\nhas been tendered. An OTHER_TENDER_CANCELLED_PAYMENT should have a corresponding\nOTHER_TENDER_PAYMENT. A CashDrawerEvent of this type must have a zero money\namount." + }, + { + "name": "CASH_TENDER_REFUND", + "description": "Triggered when a cash tender refund occurs.\nA CashDrawerEvent of this type must not have a negative amount." + }, + { + "name": "OTHER_TENDER_REFUND", + "description": "Triggered when an other tender refund occurs.\nA CashDrawerEvent of this type must have a zero money amount." + }, + { + "name": "PAID_IN", + "description": "Triggered when money unrelated to a payment is added to the cash drawer.\nFor example, an employee adds coins to the drawer.\nA CashDrawerEvent of this type must not have a negative amount." + }, + { + "name": "PAID_OUT", + "description": "Triggered when money is removed from the drawer for other reasons\nthan making change.\nFor example, an employee pays a delivery person with cash from the cash drawer.\nA CashDrawerEvent of this type must not have a negative amount." + } + ], + "description": "The types of events on a CashDrawerShift.\nEach event type represents an employee action on the actual cash drawer\nrepresented by a CashDrawerShift.", + "x-release-status": "PUBLIC" + }, + "CashDrawerShift": { + "type": "object", + "description": "This model gives the details of a cash drawer shift.\nThe cash_payment_money, cash_refund_money, cash_paid_in_money,\nand cash_paid_out_money fields are all computed by summing their respective\nevent types.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The shift unique ID." + }, + "state": { + "$ref": "#/components/schemas/CashDrawerShiftState", + "description": "The shift current state.\nSee [CashDrawerShiftState](#type-cashdrawershiftstate) for possible values", + "nullable": true + }, + "opened_at": { + "type": "string", + "description": "The time when the shift began, in ISO 8601 format.", + "nullable": true + }, + "ended_at": { + "type": "string", + "description": "The time when the shift ended, in ISO 8601 format.", + "nullable": true + }, + "closed_at": { + "type": "string", + "description": "The time when the shift was closed, in ISO 8601 format.", + "nullable": true + }, + "description": { + "type": "string", + "description": "The free-form text description of a cash drawer by an employee.", + "nullable": true + }, + "opened_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money in the cash drawer at the start of the shift.\nThe amount must be greater than or equal to zero.", + "nullable": true + }, + "cash_payment_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money added to the cash drawer from cash payments.\nThis is computed by summing all events with the types CASH_TENDER_PAYMENT and\nCASH_TENDER_CANCELED_PAYMENT. The amount is always greater than or equal to\nzero.", + "nullable": true + }, + "cash_refunds_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money removed from the cash drawer from cash refunds.\nIt is computed by summing the events of type CASH_TENDER_REFUND. The amount\nis always greater than or equal to zero.", + "nullable": true + }, + "cash_paid_in_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money added to the cash drawer for reasons other than cash\npayments. It is computed by summing the events of type PAID_IN. The amount is\nalways greater than or equal to zero.", + "nullable": true + }, + "cash_paid_out_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money removed from the cash drawer for reasons other than\ncash refunds. It is computed by summing the events of type PAID_OUT. The amount\nis always greater than or equal to zero.", + "nullable": true + }, + "expected_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money that should be in the cash drawer at the end of the\nshift, based on the shift's other money amounts.\nThis can be negative if employees have not correctly recorded all the events\non the cash drawer.\ncash_paid_out_money is a summation of amounts from cash_payment_money (zero\nor positive), cash_refunds_money (zero or negative), cash_paid_in_money (zero\nor positive), and cash_paid_out_money (zero or negative) event types.", + "nullable": true + }, + "closed_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money found in the cash drawer at the end of the shift\nby an auditing employee. The amount should be positive.", + "nullable": true + }, + "device": { + "$ref": "#/components/schemas/CashDrawerDevice", + "description": "The device running Square Point of Sale that was connected to the cash drawer.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The shift start time in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The shift updated at time in RFC 3339 format.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location the cash drawer shift belongs to.", + "readOnly": true + }, + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of all team members that were logged into Square Point of Sale at any\npoint while the cash drawer shift was open.", + "readOnly": true + }, + "opening_team_member_id": { + "type": "string", + "description": "The ID of the team member that started the cash drawer shift.", + "readOnly": true + }, + "ending_team_member_id": { + "type": "string", + "description": "The ID of the team member that ended the cash drawer shift.", + "readOnly": true + }, + "closing_team_member_id": { + "type": "string", + "description": "The ID of the team member that closed the cash drawer shift by auditing\nthe cash drawer contents.", + "readOnly": true + } + } + }, + "CashDrawerShiftEvent": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the event." + }, + "event_type": { + "$ref": "#/components/schemas/CashDrawerEventType", + "description": "The type of cash drawer shift event.\nSee [CashDrawerEventType](#type-cashdrawereventtype) for possible values", + "nullable": true + }, + "event_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money that was added to or removed from the cash drawer\nin the event. The amount can be positive (for added money)\nor zero (for other tender type payments). The addition or removal of money can be determined by\nby the event type.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The event time in RFC 3339 format.", + "readOnly": true + }, + "description": { + "type": "string", + "description": "An optional description of the event, entered by the employee that\ncreated the event.", + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "The ID of the team member that created the event.", + "readOnly": true + } + } + }, + "CashDrawerShiftState": { + "type": "string", + "enum": [ + "OPEN", + "ENDED", + "CLOSED" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "An open cash drawer shift." + }, + { + "name": "ENDED", + "description": "A cash drawer shift that is ended but has not yet had an employee content audit." + }, + { + "name": "CLOSED", + "description": "An ended cash drawer shift that is closed with a completed employee\ncontent audit and recorded result." + } + ], + "description": "The current state of a cash drawer shift.", + "x-release-status": "PUBLIC" + }, + "CashDrawerShiftSummary": { + "type": "object", + "description": "The summary of a closed cash drawer shift.\nThis model contains only the money counted to start a cash drawer shift, counted\nat the end of the shift, and the amount that should be in the drawer at shift\nend based on summing all cash drawer shift events.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The shift unique ID." + }, + "state": { + "$ref": "#/components/schemas/CashDrawerShiftState", + "description": "The shift current state.\nSee [CashDrawerShiftState](#type-cashdrawershiftstate) for possible values", + "nullable": true + }, + "opened_at": { + "type": "string", + "description": "The shift start time in ISO 8601 format.", + "nullable": true + }, + "ended_at": { + "type": "string", + "description": "The shift end time in ISO 8601 format.", + "nullable": true + }, + "closed_at": { + "type": "string", + "description": "The shift close time in ISO 8601 format.", + "nullable": true + }, + "description": { + "type": "string", + "description": "An employee free-text description of a cash drawer shift.", + "nullable": true + }, + "opened_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money in the cash drawer at the start of the shift. This\nmust be a positive amount.", + "nullable": true + }, + "expected_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money that should be in the cash drawer at the end of the\nshift, based on the cash drawer events on the shift.\nThe amount is correct if all shift employees accurately recorded their\ncash drawer shift events. Unrecorded events and events with the wrong amount\nresult in an incorrect expected_cash_money amount that can be negative.", + "nullable": true + }, + "closed_cash_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money found in the cash drawer at the end of the shift by\nan auditing employee. The amount must be greater than or equal to zero.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The shift start time in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The shift updated at time in RFC 3339 format.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location the cash drawer shift belongs to.", + "readOnly": true + } + } + }, + "CashPaymentDetails": { + "type": "object", + "description": "Stores details about a cash payment. Contains only non-confidential information. For more information, see \n[Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments).", + "x-release-status": "PUBLIC", + "required": [ + "buyer_supplied_money" + ], + "properties": { + "buyer_supplied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount and currency of the money supplied by the buyer." + }, + "change_back_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of change due back to the buyer. \nThis read-only field is calculated\nfrom the `amount_money` and `buyer_supplied_money` fields.", + "readOnly": true + } + } + }, + "CatalogAvailabilityPeriod": { + "type": "object", + "description": "Represents a time period of availability.", + "x-release-status": "BETA", + "properties": { + "start_local_time": { + "type": "string", + "description": "The start time of an availability period, specified in local time using partial-time\nRFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning.\nNote that the seconds value is always :00, but it is appended for conformance to the RFC.", + "nullable": true + }, + "end_local_time": { + "type": "string", + "description": "The end time of an availability period, specified in local time using partial-time\nRFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening.\nNote that the seconds value is always :00, but it is appended for conformance to the RFC.", + "nullable": true + }, + "day_of_week": { + "$ref": "#/components/schemas/DayOfWeek", + "description": "The day of the week for this availability period.\nSee [DayOfWeek](#type-dayofweek) for possible values", + "nullable": true + } + } + }, + "CatalogCategory": { + "type": "object", + "description": "A category to which a `CatalogItem` instance belongs.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The category name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.", + "maxLength": 255, + "nullable": true + }, + "image_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of images associated with this `CatalogCategory` instance.\nCurrently these images are not displayed by Square, but are free to be displayed in 3rd party applications.", + "nullable": true + }, + "category_type": { + "$ref": "#/components/schemas/CatalogCategoryType", + "description": "The type of the category.\nSee [CatalogCategoryType](#type-catalogcategorytype) for possible values", + "nullable": true + }, + "parent_category": { + "$ref": "#/components/schemas/CatalogObjectCategory", + "description": "The ID of the parent category of this category instance.", + "nullable": true + }, + "is_top_level": { + "type": "boolean", + "description": "Indicates whether a category is a top level category, which does not have any parent_category.", + "nullable": true + }, + "channels": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of IDs representing channels, such as a Square Online site, where the category can be made visible.", + "nullable": true + }, + "availability_period_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the `CatalogAvailabilityPeriod` objects associated with the category.", + "nullable": true + }, + "online_visibility": { + "type": "boolean", + "description": "Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square Online sites.", + "nullable": true + }, + "root_category": { + "type": "string", + "description": "The top-level category in a category hierarchy.", + "readOnly": true + }, + "ecom_seo_data": { + "$ref": "#/components/schemas/CatalogEcomSeoData", + "description": "The SEO data for a seller's Square Online store.", + "nullable": true + }, + "path_to_root": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CategoryPathToRootNode" + }, + "description": "The path from the category to its root category. The first node of the path is the parent of the category\nand the last is the root category. The path is empty if the category is a root category.", + "nullable": true + } + }, + "example": { + "object": { + "category_data": { + "name": "Beverages" + }, + "id": "#Beverages", + "present_at_all_locations": true, + "type": "CATEGORY" + } + } + }, + "CatalogCategoryType": { + "type": "string", + "enum": [ + "REGULAR_CATEGORY", + "MENU_CATEGORY", + "KITCHEN_CATEGORY" + ], + "x-enum-elements": [ + { + "name": "REGULAR_CATEGORY", + "description": "The regular category." + }, + { + "name": "MENU_CATEGORY", + "description": "The menu category." + }, + { + "name": "KITCHEN_CATEGORY", + "description": "Kitchen categories are used by KDS (Kitchen Display System) to route items to specific clients" + } + ], + "description": "Indicates the type of a category.", + "x-release-status": "PUBLIC" + }, + "CatalogCustomAttributeDefinition": { + "type": "object", + "description": "Contains information defining a custom attribute. Custom attributes are\nintended to store additional information about a catalog object or to associate a\ncatalog object with an entity in another system. Do not use custom attributes\nto store any sensitive information (personally identifiable information, card details, etc.).\n[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes)", + "x-release-status": "PUBLIC", + "required": [ + "type", + "name", + "allowed_object_types" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionType", + "description": "The type of this custom attribute. Cannot be modified after creation.\nRequired.\nSee [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) for possible values" + }, + "name": { + "type": "string", + "description": " The name of this definition for API and seller-facing UI purposes.\nThe name must be unique within the (merchant, application) pair. Required.\nMay not be empty and may not exceed 255 characters. Can be modified after creation.", + "minLength": 1, + "maxLength": 255 + }, + "description": { + "type": "string", + "description": "Seller-oriented description of the meaning of this Custom Attribute,\nany constraints that the seller should observe, etc. May be displayed as a tooltip in Square UIs.", + "maxLength": 255, + "nullable": true + }, + "source_application": { + "$ref": "#/components/schemas/SourceApplication", + "description": "__Read only.__ Contains information about the application that\ncreated this custom attribute definition.", + "nullable": true + }, + "allowed_object_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObjectType" + }, + "description": "The set of `CatalogObject` types that this custom atttribute may be applied to.\nCurrently, only `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, and `CATEGORY` are allowed. At least one type must be included.\nSee [CatalogObjectType](#type-catalogobjecttype) for possible values" + }, + "seller_visibility": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionSellerVisibility", + "description": "The visibility of a custom attribute in seller-facing UIs (including Square Point\nof Sale applications and Square Dashboard). May be modified.\nSee [CatalogCustomAttributeDefinitionSellerVisibility](#type-catalogcustomattributedefinitionsellervisibility) for possible values", + "nullable": true + }, + "app_visibility": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionAppVisibility", + "description": "The visibility of a custom attribute to applications other than the application\nthat created the attribute.\nSee [CatalogCustomAttributeDefinitionAppVisibility](#type-catalogcustomattributedefinitionappvisibility) for possible values", + "nullable": true + }, + "string_config": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionStringConfig", + "description": "Optionally, populated when `type` = `STRING`, unset otherwise.", + "nullable": true + }, + "number_config": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionNumberConfig", + "description": "Optionally, populated when `type` = `NUMBER`, unset otherwise.", + "nullable": true + }, + "selection_config": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionSelectionConfig", + "description": "Populated when `type` is set to `SELECTION`, unset otherwise.", + "nullable": true + }, + "custom_attribute_usage_count": { + "type": "integer", + "description": "The number of custom attributes that reference this\ncustom attribute definition. Set by the server in response to a ListCatalog\nrequest with `include_counts` set to `true`. If the actual count is greater\nthan 100, `custom_attribute_usage_count` will be set to `100`.", + "readOnly": true + }, + "key": { + "type": "string", + "description": "The name of the desired custom attribute key that can be used to access\nthe custom attribute value on catalog objects. Cannot be modified after the\ncustom attribute definition has been created.\nMust be between 1 and 60 characters, and may only contain the characters `[a-zA-Z0-9_-]`.", + "minLength": 1, + "maxLength": 60, + "pattern": "^[a-zA-Z0-9_-]*$", + "nullable": true + } + } + }, + "CatalogCustomAttributeDefinitionAppVisibility": { + "type": "string", + "enum": [ + "APP_VISIBILITY_HIDDEN", + "APP_VISIBILITY_READ_ONLY", + "APP_VISIBILITY_READ_WRITE_VALUES" + ], + "x-enum-elements": [ + { + "name": "APP_VISIBILITY_HIDDEN", + "description": "Other applications cannot read this custom attribute." + }, + { + "name": "APP_VISIBILITY_READ_ONLY", + "description": "Other applications can read this custom attribute definition and\nvalues." + }, + { + "name": "APP_VISIBILITY_READ_WRITE_VALUES", + "description": "Other applications can read and write custom attribute values on objects.\nThey can read but cannot edit the custom attribute definition." + } + ], + "description": "Defines the visibility of a custom attribute to applications other than their\ncreating application.", + "x-release-status": "PUBLIC" + }, + "CatalogCustomAttributeDefinitionNumberConfig": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "precision": { + "type": "integer", + "description": "An integer between 0 and 5 that represents the maximum number of\npositions allowed after the decimal in number custom attribute values\nFor example:\n\n- if the precision is 0, the quantity can be 1, 2, 3, etc.\n- if the precision is 1, the quantity can be 0.1, 0.2, etc.\n- if the precision is 2, the quantity can be 0.01, 0.12, etc.\n\nDefault: 5", + "maximum": 5, + "nullable": true + } + } + }, + "CatalogCustomAttributeDefinitionSelectionConfig": { + "type": "object", + "description": "Configuration associated with `SELECTION`-type custom attribute definitions.", + "x-release-status": "PUBLIC", + "properties": { + "max_allowed_selections": { + "type": "integer", + "description": "The maximum number of selections that can be set. The maximum value for this\nattribute is 100. The default value is 1. The value can be modified, but changing the value will not\naffect existing custom attribute values on objects. Clients need to\nhandle custom attributes with more selected values than allowed by this limit.", + "maximum": 100, + "nullable": true + }, + "allowed_selections": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection" + }, + "description": "The set of valid `CatalogCustomAttributeSelections`. Up to a maximum of 100\nselections can be defined. Can be modified.", + "nullable": true + } + } + }, + "CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection": { + "type": "object", + "description": "A named selection for this `SELECTION`-type custom attribute definition.", + "x-release-status": "PUBLIC", + "required": [ + "name" + ], + "properties": { + "uid": { + "type": "string", + "description": "Unique ID set by Square.", + "nullable": true + }, + "name": { + "type": "string", + "description": "Selection name, unique within `allowed_selections`.", + "minLength": 1, + "maxLength": 255 + } + } + }, + "CatalogCustomAttributeDefinitionSellerVisibility": { + "type": "string", + "enum": [ + "SELLER_VISIBILITY_HIDDEN", + "SELLER_VISIBILITY_READ_WRITE_VALUES" + ], + "x-enum-elements": [ + { + "name": "SELLER_VISIBILITY_HIDDEN", + "description": "Sellers cannot read this custom attribute in Square client\napplications or Square APIs." + }, + { + "name": "SELLER_VISIBILITY_READ_WRITE_VALUES", + "description": "Sellers can read and write this custom attribute value in catalog objects,\nbut cannot edit the custom attribute definition." + } + ], + "description": "Defines the visibility of a custom attribute to sellers in Square\nclient applications, Square APIs or in Square UIs (including Square Point\nof Sale applications and Square Dashboard).", + "x-release-status": "PUBLIC" + }, + "CatalogCustomAttributeDefinitionStringConfig": { + "type": "object", + "description": "Configuration associated with Custom Attribute Definitions of type `STRING`.", + "x-release-status": "PUBLIC", + "properties": { + "enforce_uniqueness": { + "type": "boolean", + "description": "If true, each Custom Attribute instance associated with this Custom Attribute\nDefinition must have a unique value within the seller's catalog. For\nexample, this may be used for a value like a SKU that should not be\nduplicated within a seller's catalog. May not be modified after the\ndefinition has been created.", + "nullable": true + } + } + }, + "CatalogCustomAttributeDefinitionType": { + "type": "string", + "enum": [ + "STRING", + "BOOLEAN", + "NUMBER", + "SELECTION" + ], + "x-enum-elements": [ + { + "name": "STRING", + "description": "A free-form string containing up to 255 characters." + }, + { + "name": "BOOLEAN", + "description": "A `true` or `false` value." + }, + { + "name": "NUMBER", + "description": "A decimal string representation of a number. Can support up to 5 digits after the decimal point." + }, + { + "name": "SELECTION", + "description": "One or more choices from `allowed_selections`." + } + ], + "description": "Defines the possible types for a custom attribute.", + "x-release-status": "PUBLIC" + }, + "CatalogCustomAttributeValue": { + "type": "object", + "description": "An instance of a custom attribute. Custom attributes can be defined and\nadded to `ITEM` and `ITEM_VARIATION` type catalog objects.\n[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes).", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The name of the custom attribute.", + "nullable": true + }, + "string_value": { + "type": "string", + "description": "The string value of the custom attribute. Populated if `type` = `STRING`.", + "nullable": true + }, + "custom_attribute_definition_id": { + "type": "string", + "description": "The id of the [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) this value belongs to.", + "readOnly": true + }, + "type": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinitionType", + "description": "A copy of type from the associated `CatalogCustomAttributeDefinition`.\nSee [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) for possible values", + "readOnly": true + }, + "number_value": { + "type": "string", + "description": "Populated if `type` = `NUMBER`. Contains a string\nrepresentation of a decimal number, using a `.` as the decimal separator.", + "nullable": true + }, + "boolean_value": { + "type": "boolean", + "description": "A `true` or `false` value. Populated if `type` = `BOOLEAN`.", + "nullable": true + }, + "selection_uid_values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`.", + "nullable": true + }, + "key": { + "type": "string", + "description": "If the associated `CatalogCustomAttributeDefinition` object is defined by another application, this key is prefixed by the defining application ID.\nFor example, if the CatalogCustomAttributeDefinition has a key attribute of \"cocoa_brand\" and the defining application ID is \"abcd1234\", this key is \"abcd1234:cocoa_brand\"\nwhen the application making the request is different from the application defining the custom attribute definition. Otherwise, the key is simply \"cocoa_brand\".", + "readOnly": true + } + } + }, + "CatalogDiscount": { + "type": "object", + "description": "A discount applicable to items.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The discount name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.", + "maxLength": 255, + "nullable": true + }, + "discount_type": { + "$ref": "#/components/schemas/CatalogDiscountType", + "description": "Indicates whether the discount is a fixed amount or percentage, or entered at the time of sale.\nSee [CatalogDiscountType](#type-catalogdiscounttype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the discount as a string representation of a decimal number, using a `.` as the decimal\nseparator and without a `%` sign. A value of `7.5` corresponds to `7.5%`. Specify a percentage of `0` if `discount_type`\nis `VARIABLE_PERCENTAGE`.\n\nDo not use this field for amount-based or variable discounts.", + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of the discount. Specify an amount of `0` if `discount_type` is `VARIABLE_AMOUNT`.\n\nDo not use this field for percentage-based or variable discounts.", + "nullable": true + }, + "pin_required": { + "type": "boolean", + "description": "Indicates whether a mobile staff member needs to enter their PIN to apply the\ndiscount to a payment in the Square Point of Sale app.", + "nullable": true + }, + "label_color": { + "type": "string", + "description": "The color of the discount display label in the Square Point of Sale app. This must be a valid hex color code.", + "nullable": true + }, + "modify_tax_basis": { + "$ref": "#/components/schemas/CatalogDiscountModifyTaxBasis", + "description": "Indicates whether this discount should reduce the price used to calculate tax.\n\nMost discounts should use `MODIFY_TAX_BASIS`. However, in some circumstances taxes must\nbe calculated based on an item's price, ignoring a particular discount. For example,\nin many US jurisdictions, a manufacturer coupon or instant rebate reduces the price a\ncustomer pays but does not reduce the sale price used to calculate how much sales tax is\ndue. In this case, the discount representing that manufacturer coupon should have\n`DO_NOT_MODIFY_TAX_BASIS` for this field.\n\nIf you are unsure whether you need to use this field, consult your tax professional.\nSee [CatalogDiscountModifyTaxBasis](#type-catalogdiscountmodifytaxbasis) for possible values", + "nullable": true + }, + "maximum_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "For a percentage discount, the maximum absolute value of the discount. For example, if a\n50% discount has a `maximum_amount_money` of $20, a $100 purchase will yield a $20 discount,\nnot a $50 discount.", + "nullable": true + } + }, + "example": { + "object": { + "discount_data": { + "discount_type": "FIXED_PERCENTAGE", + "label_color": "red", + "name": "Welcome to the Dark(Roast) Side!", + "percentage": "5.4", + "pin_required": false + }, + "id": "#Maythe4th", + "present_at_all_locations": true, + "type": "DISCOUNT" + } + } + }, + "CatalogDiscountModifyTaxBasis": { + "type": "string", + "enum": [ + "MODIFY_TAX_BASIS", + "DO_NOT_MODIFY_TAX_BASIS" + ], + "x-enum-elements": [ + { + "name": "MODIFY_TAX_BASIS", + "description": "Application of the discount will modify the tax basis." + }, + { + "name": "DO_NOT_MODIFY_TAX_BASIS", + "description": "Application of the discount will not modify the tax basis." + } + ], + "x-release-status": "PUBLIC" + }, + "CatalogDiscountType": { + "type": "string", + "enum": [ + "FIXED_PERCENTAGE", + "FIXED_AMOUNT", + "VARIABLE_PERCENTAGE", + "VARIABLE_AMOUNT" + ], + "x-enum-elements": [ + { + "name": "FIXED_PERCENTAGE", + "description": "Apply the discount as a fixed percentage (e.g., 5%) off the item price." + }, + { + "name": "FIXED_AMOUNT", + "description": "Apply the discount as a fixed amount (e.g., $1.00) off the item price." + }, + { + "name": "VARIABLE_PERCENTAGE", + "description": "Apply the discount as a variable percentage off the item price. The percentage will be specified at the time of sale." + }, + { + "name": "VARIABLE_AMOUNT", + "description": "Apply the discount as a variable amount off the item price. The amount will be specified at the time of sale." + } + ], + "description": "How to apply a CatalogDiscount to a CatalogItem.", + "x-release-status": "PUBLIC" + }, + "CatalogEcomSeoData": { + "type": "object", + "description": "SEO data for for a seller's Square Online store.", + "x-release-status": "PUBLIC", + "properties": { + "page_title": { + "type": "string", + "description": "The SEO title used for the Square Online store.", + "nullable": true + }, + "page_description": { + "type": "string", + "description": "The SEO description used for the Square Online store.", + "nullable": true + }, + "permalink": { + "type": "string", + "description": "The SEO permalink used for the Square Online store.", + "nullable": true + } + } + }, + "CatalogIdMapping": { + "type": "object", + "description": "A mapping between a temporary client-supplied ID and a permanent server-generated ID.\n\nWhen calling [UpsertCatalogObject](api-endpoint:Catalog-UpsertCatalogObject) or\n[BatchUpsertCatalogObjects](api-endpoint:Catalog-BatchUpsertCatalogObjects) to\ncreate a [CatalogObject](entity:CatalogObject) instance, you can supply\na temporary ID for the to-be-created object, especially when the object is to be referenced\nelsewhere in the same request body. This temporary ID can be any string unique within\nthe call, but must be prefixed by \"#\".\n\nAfter the request is submitted and the object created, a permanent server-generated ID is assigned\nto the new object. The permanent ID is unique across the Square catalog.", + "x-release-status": "PUBLIC", + "properties": { + "client_object_id": { + "type": "string", + "description": "The client-supplied temporary `#`-prefixed ID for a new `CatalogObject`.", + "nullable": true + }, + "object_id": { + "type": "string", + "description": "The permanent ID for the CatalogObject created by the server.", + "nullable": true + } + } + }, + "CatalogImage": { + "type": "object", + "description": "An image file to use in Square catalogs. It can be associated with\n`CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and `CatalogModifierList` objects.\nOnly the images on items and item variations are exposed in Dashboard.\nOnly the first image on an item is displayed in Square Point of Sale (SPOS).\nImages on items and variations are displayed through Square Online Store.\nImages on other object types are for use by 3rd party application developers.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The internal name to identify this image in calls to the Square API.\nThis is a searchable attribute for use in applicable query filters\nusing the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects).\nIt is not unique and should not be shown in a buyer facing context.", + "nullable": true + }, + "url": { + "type": "string", + "description": "The URL of this image, generated by Square after an image is uploaded\nusing the [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) endpoint.\nTo modify the image, use the UpdateCatalogImage endpoint. Do not change the URL field.", + "nullable": true + }, + "caption": { + "type": "string", + "description": "A caption that describes what is shown in the image. Displayed in the\nSquare Online Store. This is a searchable attribute for use in applicable query filters\nusing the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects).", + "nullable": true + }, + "photo_studio_order_id": { + "type": "string", + "description": "The immutable order ID for this image object created by the Photo Studio service in Square Online Store.", + "nullable": true + } + } + }, + "CatalogInfoResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "limits": { + "$ref": "#/components/schemas/CatalogInfoResponseLimits", + "description": "Limits that apply to this API." + }, + "standard_unit_description_group": { + "$ref": "#/components/schemas/StandardUnitDescriptionGroup", + "description": "Names and abbreviations for standard units." + } + }, + "example": { + "limits": { + "batch_delete_max_object_ids": 200, + "batch_retrieve_max_object_ids": 1000, + "batch_upsert_max_objects_per_batch": 1000, + "batch_upsert_max_total_objects": 10000, + "search_max_page_limit": 1000, + "update_item_modifier_lists_max_item_ids": 1000, + "update_item_modifier_lists_max_modifier_lists_to_disable": 1000, + "update_item_modifier_lists_max_modifier_lists_to_enable": 1000, + "update_item_taxes_max_item_ids": 1000, + "update_item_taxes_max_taxes_to_disable": 1000, + "update_item_taxes_max_taxes_to_enable": 1000 + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.csharp", + "java": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.java", + "javascript": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.javascript", + "php": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.php", + "python": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.python", + "ruby": "/sdk_samples/Catalog/CatalogInfo/CatalogInfoResponse.ruby" + } + }, + "CatalogInfoResponseLimits": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "batch_upsert_max_objects_per_batch": { + "type": "integer", + "description": "The maximum number of objects that may appear within a single batch in a\n`/v2/catalog/batch-upsert` request.", + "nullable": true + }, + "batch_upsert_max_total_objects": { + "type": "integer", + "description": "The maximum number of objects that may appear across all batches in a\n`/v2/catalog/batch-upsert` request.", + "nullable": true + }, + "batch_retrieve_max_object_ids": { + "type": "integer", + "description": "The maximum number of object IDs that may appear in a `/v2/catalog/batch-retrieve`\nrequest.", + "nullable": true + }, + "search_max_page_limit": { + "type": "integer", + "description": "The maximum number of results that may be returned in a page of a\n`/v2/catalog/search` response.", + "nullable": true + }, + "batch_delete_max_object_ids": { + "type": "integer", + "description": "The maximum number of object IDs that may be included in a single\n`/v2/catalog/batch-delete` request.", + "nullable": true + }, + "update_item_taxes_max_item_ids": { + "type": "integer", + "description": "The maximum number of item IDs that may be included in a single\n`/v2/catalog/update-item-taxes` request.", + "nullable": true + }, + "update_item_taxes_max_taxes_to_enable": { + "type": "integer", + "description": "The maximum number of tax IDs to be enabled that may be included in a single\n`/v2/catalog/update-item-taxes` request.", + "nullable": true + }, + "update_item_taxes_max_taxes_to_disable": { + "type": "integer", + "description": "The maximum number of tax IDs to be disabled that may be included in a single\n`/v2/catalog/update-item-taxes` request.", + "nullable": true + }, + "update_item_modifier_lists_max_item_ids": { + "type": "integer", + "description": "The maximum number of item IDs that may be included in a single\n`/v2/catalog/update-item-modifier-lists` request.", + "nullable": true + }, + "update_item_modifier_lists_max_modifier_lists_to_enable": { + "type": "integer", + "description": "The maximum number of modifier list IDs to be enabled that may be included in\na single `/v2/catalog/update-item-modifier-lists` request.", + "nullable": true + }, + "update_item_modifier_lists_max_modifier_lists_to_disable": { + "type": "integer", + "description": "The maximum number of modifier list IDs to be disabled that may be included in\na single `/v2/catalog/update-item-modifier-lists` request.", + "nullable": true + } + } + }, + "CatalogItem": { + "type": "object", + "description": "A [CatalogObject](entity:CatalogObject) instance of the `ITEM` type, also referred to as an item, in the catalog.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The item's name. This is a searchable attribute for use in applicable query filters, its value must not be empty, and the length is of Unicode code points.", + "maxLength": 512, + "nullable": true + }, + "description": { + "type": "string", + "description": "The item's description. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.\n\nDeprecated at 2022-07-20, this field is planned to retire in 6 months. You should migrate to use `description_html` to set the description\nof the [CatalogItem](entity:CatalogItem) instance. The `description` and `description_html` field values are kept in sync. If you try to\nset the both fields, the `description_html` text value overwrites the `description` value. Updates in one field are also reflected in the other,\nexcept for when you use an early version before Square API 2022-07-20 and `description_html` is set to blank, setting the `description` value to null\ndoes not nullify `description_html`.", + "maxLength": 4096, + "x-release-status": "DEPRECATED", + "nullable": true + }, + "abbreviation": { + "type": "string", + "description": "The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used.\nThis attribute is searchable, and its value length is of Unicode code points.", + "maxLength": 24, + "nullable": true + }, + "label_color": { + "type": "string", + "description": "The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code.", + "nullable": true + }, + "is_taxable": { + "type": "boolean", + "description": "Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`.", + "nullable": true + }, + "category_id": { + "type": "string", + "description": "The ID of the item's category, if any. Deprecated since 2023-12-13. Use `CatalogItem.categories`, instead.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "tax_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A set of IDs indicating the taxes enabled for\nthis item. When updating an item, any taxes listed here will be added to the item.\nTaxes may also be added to or deleted from an item using `UpdateItemTaxes`.", + "nullable": true + }, + "modifier_list_info": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemModifierListInfo" + }, + "description": "A set of `CatalogItemModifierListInfo` objects\nrepresenting the modifier lists that apply to this item, along with the overrides and min\nand max limits that are specific to this item. Modifier lists\nmay also be added to or deleted from an item using `UpdateItemModifierLists`.", + "nullable": true + }, + "variations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must have\nat least one variation.", + "nullable": true + }, + "product_type": { + "$ref": "#/components/schemas/CatalogItemProductType", + "description": "The product type of the item. Once set, the `product_type` value cannot be modified.\n\nItems of the `LEGACY_SQUARE_ONLINE_SERVICE` and `LEGACY_SQUARE_ONLINE_MEMBERSHIP` product types can be updated\nbut cannot be created using the API.\nSee [CatalogItemProductType](#type-catalogitemproducttype) for possible values", + "nullable": true + }, + "skip_modifier_screen": { + "type": "boolean", + "description": "If `false`, the Square Point of Sale app will present the `CatalogItem`'s\ndetails screen immediately, allowing the merchant to choose `CatalogModifier`s\nbefore adding the item to the cart. This is the default behavior.\n\nIf `true`, the Square Point of Sale app will immediately add the item to the cart with the pre-selected\nmodifiers, and merchants can edit modifiers by drilling down onto the item's details.\n\nThird-party clients are encouraged to implement similar behaviors.", + "nullable": true + }, + "item_options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemOptionForItem" + }, + "description": "List of item options IDs for this item. Used to manage and group item\nvariations in a specified order.\n\nMaximum: 6 item options.", + "nullable": true + }, + "ecom_uri": { + "type": "string", + "description": "Deprecated. A URI pointing to a published e-commerce product page for the Item.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "ecom_image_uris": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Deprecated. A comma-separated list of encoded URIs pointing to a set of published e-commerce images for the Item.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "image_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of images associated with this `CatalogItem` instance.\nThese images will be shown to customers in Square Online Store.\nThe first image will show up as the icon for this item in POS.", + "x-release-status": "BETA", + "nullable": true + }, + "sort_name": { + "type": "string", + "description": "A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, the regular `name` field is used for sorting.\nIts value must not be empty.\n\nIt is currently supported for sellers of the Japanese locale only.", + "x-release-status": "BETA", + "nullable": true + }, + "categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObjectCategory" + }, + "description": "The list of categories.", + "nullable": true + }, + "description_html": { + "type": "string", + "description": "The item's description as expressed in valid HTML elements. The length of this field value, including those of HTML tags,\nis of Unicode points. With application query filters, the text values of the HTML elements and attributes are searchable. Invalid or\nunsupported HTML elements or attributes are ignored.\n\nSupported HTML elements include:\n- `a`: Link. Supports linking to website URLs, email address, and telephone numbers.\n- `b`, `strong`: Bold text\n- `br`: Line break\n- `code`: Computer code\n- `div`: Section\n- `h1-h6`: Headings\n- `i`, `em`: Italics\n- `li`: List element\n- `ol`: Numbered list\n- `p`: Paragraph\n- `ul`: Bullet list\n- `u`: Underline\n\n\nSupported HTML attributes include:\n- `align`: Alignment of the text content\n- `href`: Link destination\n- `rel`: Relationship between link's target and source\n- `target`: Place to open the linked document", + "maxLength": 65535, + "nullable": true + }, + "description_plaintext": { + "type": "string", + "description": "A server-generated plaintext version of the `description_html` field, without formatting tags.", + "maxLength": 65535, + "readOnly": true + }, + "channels": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of IDs representing channels, such as a Square Online site, where the item can be made visible or available.\nThis field is read only and cannot be edited.", + "nullable": true + }, + "is_archived": { + "type": "boolean", + "description": "Indicates whether this item is archived (`true`) or not (`false`).", + "nullable": true + }, + "ecom_seo_data": { + "$ref": "#/components/schemas/CatalogEcomSeoData", + "description": "The SEO data for a seller's Square Online store.", + "nullable": true + }, + "food_and_beverage_details": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetails", + "description": "The food and beverage-specific details for the `FOOD_AND_BEV` item.", + "nullable": true + }, + "reporting_category": { + "$ref": "#/components/schemas/CatalogObjectCategory", + "description": "The item's reporting category.", + "nullable": true + }, + "is_alcoholic": { + "type": "boolean", + "description": "Indicates whether this item is alcoholic (`true`) or not (`false`).", + "nullable": true + } + }, + "example": { + "object": { + "id": "#Cocoa", + "item_data": { + "abbreviation": "Ch", + "description": "Hot chocolate", + "name": "Cocoa", + "visibility": "PRIVATE" + }, + "present_at_all_locations": true, + "type": "ITEM" + } + } + }, + "CatalogItemFoodAndBeverageDetails": { + "type": "object", + "description": "The food and beverage-specific details of a `FOOD_AND_BEV` item.", + "x-release-status": "PUBLIC", + "properties": { + "calorie_count": { + "type": "integer", + "description": "The calorie count (in the unit of kcal) for the `FOOD_AND_BEV` type of items.", + "nullable": true + }, + "dietary_preferences": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsDietaryPreference" + }, + "description": "The dietary preferences for the `FOOD_AND_BEV` item.", + "nullable": true + }, + "ingredients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsIngredient" + }, + "description": "The ingredients for the `FOOD_AND_BEV` type item.", + "nullable": true + } + } + }, + "CatalogItemFoodAndBeverageDetailsDietaryPreference": { + "type": "object", + "description": "Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its ingredients.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType", + "description": "The dietary preference type. Supported values include `STANDARD` and `CUSTOM` as specified in `FoodAndBeverageDetails.DietaryPreferenceType`.\nSee [DietaryPreferenceType](#type-dietarypreferencetype) for possible values", + "nullable": true + }, + "standard_name": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference", + "description": "The name of the dietary preference from a standard pre-defined list. This should be null if it's a custom dietary preference.\nSee [StandardDietaryPreference](#type-standarddietarypreference) for possible values", + "nullable": true + }, + "custom_name": { + "type": "string", + "description": "The name of a user-defined custom dietary preference. This should be null if it's a standard dietary preference.", + "nullable": true + } + } + }, + "CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference": { + "type": "string", + "enum": [ + "DAIRY_FREE", + "GLUTEN_FREE", + "HALAL", + "KOSHER", + "NUT_FREE", + "VEGAN", + "VEGETARIAN" + ], + "x-enum-elements": [ + { + "name": "DAIRY_FREE", + "description": "" + }, + { + "name": "GLUTEN_FREE", + "description": "" + }, + { + "name": "HALAL", + "description": "" + }, + { + "name": "KOSHER", + "description": "" + }, + { + "name": "NUT_FREE", + "description": "" + }, + { + "name": "VEGAN", + "description": "" + }, + { + "name": "VEGETARIAN", + "description": "" + } + ], + "description": "Standard dietary preferences for food and beverage items that are recommended on item creation.", + "x-release-status": "PUBLIC" + }, + "CatalogItemFoodAndBeverageDetailsDietaryPreferenceType": { + "type": "string", + "enum": [ + "STANDARD", + "CUSTOM" + ], + "x-enum-elements": [ + { + "name": "STANDARD", + "description": "A standard value from a pre-determined list." + }, + { + "name": "CUSTOM", + "description": "A user-defined custom value." + } + ], + "description": "The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients.", + "x-release-status": "PUBLIC" + }, + "CatalogItemFoodAndBeverageDetailsIngredient": { + "type": "object", + "description": "Describes the ingredient used in a `FOOD_AND_BEV` item.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType", + "description": "The dietary preference type of the ingredient. Supported values include `STANDARD` and `CUSTOM` as specified in `FoodAndBeverageDetails.DietaryPreferenceType`.\nSee [DietaryPreferenceType](#type-dietarypreferencetype) for possible values", + "nullable": true + }, + "standard_name": { + "$ref": "#/components/schemas/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient", + "description": "The name of the ingredient from a standard pre-defined list. This should be null if it's a custom dietary preference.\nSee [StandardIngredient](#type-standardingredient) for possible values", + "nullable": true + }, + "custom_name": { + "type": "string", + "description": "The name of a custom user-defined ingredient. This should be null if it's a standard dietary preference.", + "nullable": true + } + } + }, + "CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient": { + "type": "string", + "enum": [ + "CELERY", + "CRUSTACEANS", + "EGGS", + "FISH", + "GLUTEN", + "LUPIN", + "MILK", + "MOLLUSCS", + "MUSTARD", + "PEANUTS", + "SESAME", + "SOY", + "SULPHITES", + "TREE_NUTS" + ], + "x-enum-elements": [ + { + "name": "CELERY", + "description": "" + }, + { + "name": "CRUSTACEANS", + "description": "" + }, + { + "name": "EGGS", + "description": "" + }, + { + "name": "FISH", + "description": "" + }, + { + "name": "GLUTEN", + "description": "" + }, + { + "name": "LUPIN", + "description": "" + }, + { + "name": "MILK", + "description": "" + }, + { + "name": "MOLLUSCS", + "description": "" + }, + { + "name": "MUSTARD", + "description": "" + }, + { + "name": "PEANUTS", + "description": "" + }, + { + "name": "SESAME", + "description": "" + }, + { + "name": "SOY", + "description": "" + }, + { + "name": "SULPHITES", + "description": "" + }, + { + "name": "TREE_NUTS", + "description": "" + } + ], + "description": "Standard ingredients for food and beverage items that are recommended on item creation.", + "x-release-status": "PUBLIC" + }, + "CatalogItemModifierListInfo": { + "type": "object", + "description": "Controls how a modifier list is applied to a specific item. This object allows for item-specific customization of modifier list behavior\nand provides the ability to override global modifier list settings.", + "x-release-status": "PUBLIC", + "required": [ + "modifier_list_id" + ], + "properties": { + "modifier_list_id": { + "type": "string", + "description": "The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`.", + "minLength": 1 + }, + "modifier_overrides": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogModifierOverride" + }, + "description": "A set of `CatalogModifierOverride` objects that override default modifier settings for this item.", + "nullable": true + }, + "min_selected_modifiers": { + "type": "integer", + "description": "The minimum number of modifiers that must be selected from this modifier list.\nValues:\n\n- 0: No selection is required.\n- -1: Default value, the attribute was not set by the client. When `max_selected_modifiers` is\nalso -1, use the minimum and maximum selection values set on the `CatalogItemModifierList`.\n- \u0026gt;0: The required minimum modifier selections. This can be larger than the total `CatalogModifiers` when `allow_quantities` is enabled.\n- \u0026lt; -1: Invalid. Treated as no selection required.", + "nullable": true + }, + "max_selected_modifiers": { + "type": "integer", + "description": "The maximum number of modifiers that can be selected.\nValues:\n\n- 0: No maximum limit.\n- -1: Default value, the attribute was not set by the client. When `min_selected_modifiers` is\nalso -1, use the minimum and maximum selection values set on the `CatalogItemModifierList`.\n- \u0026gt;0: The maximum total modifier selections. This can be larger than the total `CatalogModifiers` when `allow_quantities` is enabled.\n- \u0026lt; -1: Invalid. Treated as no maximum limit.", + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "If `true`, enable this `CatalogModifierList`. The default value is `true`.", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list applied \nto a `CatalogItem` instance.", + "x-release-status": "BETA", + "nullable": true + }, + "allow_quantities": { + "$ref": "#/components/schemas/CatalogModifierToggleOverrideType", + "description": "Controls whether multiple quantities of the same modifier can be selected for this item.\n- `YES` means that every modifier in the `CatalogModifierList` can have multiple quantities\nselected for this item.\n- `NO` means that each modifier in the `CatalogModifierList` can be selected only once for this item.\n- `NOT_SET` means that the `allow_quantities` setting on the `CatalogModifierList` is obeyed.\nSee [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "is_conversational": { + "$ref": "#/components/schemas/CatalogModifierToggleOverrideType", + "description": "Controls whether conversational mode is enabled for modifiers on this item.\n\n- `YES` means conversational mode is enabled for every modifier in the `CatalogModifierList`.\n- `NO` means that conversational mode is not enabled for any modifier in the `CatalogModifierList`.\n- `NOT_SET` means that conversational mode is not enabled for any modifier in the `CatalogModifierList`.\nSee [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "hidden_from_customer_override": { + "$ref": "#/components/schemas/CatalogModifierToggleOverrideType", + "description": "Controls whether all modifiers for this item are hidden from customer receipts.\n- `YES` means that all modifiers in the `CatalogModifierList` are hidden from customer\nreceipts for this item.\n- `NO` means that all modifiers in the `CatalogModifierList` are visible on customer receipts for this item.\n- `NOT_SET` means that the `hidden_from_customer` setting on the `CatalogModifierList` is obeyed.\nSee [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "CatalogItemOption": { + "type": "object", + "description": "A group of variations for a `CatalogItem`.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The item option's display name for the seller. Must be unique across\nall item options. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "display_name": { + "type": "string", + "description": "The item option's display name for the customer. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "description": { + "type": "string", + "description": "The item option's human-readable description. Displayed in the Square\nPoint of Sale app for the seller and in the Online Store or on receipts for\nthe buyer. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "show_colors": { + "type": "boolean", + "description": "If true, display colors for entries in `values` when present.", + "nullable": true + }, + "values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of CatalogObjects containing the\n`CatalogItemOptionValue`s for this item.", + "nullable": true + } + } + }, + "CatalogItemOptionForItem": { + "type": "object", + "description": " An option that can be assigned to an item.\nFor example, a t-shirt item may offer a color option or a size option.", + "x-release-status": "BETA", + "properties": { + "item_option_id": { + "type": "string", + "description": "The unique id of the item option, used to form the dimensions of the item option matrix in a specified order.", + "nullable": true + } + } + }, + "CatalogItemOptionValue": { + "type": "object", + "description": "An enumerated value that can link a\n`CatalogItemVariation` to an item option as one of\nits item option values.", + "x-release-status": "PUBLIC", + "properties": { + "item_option_id": { + "type": "string", + "description": "Unique ID of the associated item option.", + "nullable": true + }, + "name": { + "type": "string", + "description": "Name of this item option value. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "description": { + "type": "string", + "description": "A human-readable description for the option value. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "color": { + "type": "string", + "description": "The HTML-supported hex color for the item option (e.g., \"#ff8d4e85\").\nOnly displayed if `show_colors` is enabled on the parent `ItemOption`. When\nleft unset, `color` defaults to white (\"#ffffff\") when `show_colors` is\nenabled on the parent `ItemOption`.", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "Determines where this option value appears in a list of option values.", + "nullable": true + } + } + }, + "CatalogItemOptionValueForItemVariation": { + "type": "object", + "description": "A `CatalogItemOptionValue` links an item variation to an item option as\nan item option value. For example, a t-shirt item may offer a color option and\na size option. An item option value would represent each variation of t-shirt:\nFor example, \"Color:Red, Size:Small\" or \"Color:Blue, Size:Medium\".", + "x-release-status": "PUBLIC", + "properties": { + "item_option_id": { + "type": "string", + "description": "The unique id of an item option.", + "nullable": true + }, + "item_option_value_id": { + "type": "string", + "description": "The unique id of the selected value for the item option.", + "nullable": true + } + } + }, + "CatalogItemProductType": { + "type": "string", + "enum": [ + "REGULAR", + "GIFT_CARD", + "APPOINTMENTS_SERVICE", + "FOOD_AND_BEV", + "EVENT", + "DIGITAL", + "DONATION", + "LEGACY_SQUARE_ONLINE_SERVICE", + "LEGACY_SQUARE_ONLINE_MEMBERSHIP" + ], + "x-enum-elements": [ + { + "name": "REGULAR", + "description": "An ordinary item." + }, + { + "name": "GIFT_CARD", + "description": "A Square gift card." + }, + { + "name": "APPOINTMENTS_SERVICE", + "description": "A service that can be booked using the Square Appointments app." + }, + { + "name": "FOOD_AND_BEV", + "description": "A food or beverage item that can be sold by restaurants and other food venues." + }, + { + "name": "EVENT", + "description": "An event which tickets can be sold for, including location, address, and times." + }, + { + "name": "DIGITAL", + "description": "A digital item like an ebook or song." + }, + { + "name": "DONATION", + "description": "A donation which site visitors can send for any cause." + }, + { + "name": "LEGACY_SQUARE_ONLINE_SERVICE", + "description": "A legacy Square Online service that is manually fulfilled. This corresponds to the `Other` item type displayed in the Square Seller Dashboard and Square POS apps." + }, + { + "name": "LEGACY_SQUARE_ONLINE_MEMBERSHIP", + "description": "A legacy Square Online membership that is manually fulfilled. This corresponds to the `Membership` item type displayed in the Square Seller Dashboard and Square POS apps." + } + ], + "description": "The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items.", + "x-release-status": "PUBLIC" + }, + "CatalogItemVariation": { + "type": "object", + "description": "An item variation, representing a product for sale, in the Catalog object model. Each [item](entity:CatalogItem) must have at least one\nitem variation and can have at most 250 item variations.\n\nAn item variation can be sellable, stockable, or both if it has a unit of measure for its count for the sold number of the variation, the stocked\nnumber of the variation, or both. For example, when a variation representing wine is stocked and sold by the bottle, the variation is both\nstockable and sellable. But when a variation of the wine is sold by the glass, the sold units cannot be used as a measure of the stocked units. This by-the-glass\nvariation is sellable, but not stockable. To accurately keep track of the wine's inventory count at any time, the sellable count must be\nconverted to stockable count. Typically, the seller defines this unit conversion. For example, 1 bottle equals 5 glasses. The Square API exposes\nthe `stockable_conversion` property on the variation to specify the conversion. Thus, when two glasses of the wine are sold, the sellable count\ndecreases by 2, and the stockable count automatically decreases by 0.4 bottle according to the conversion.", + "x-release-status": "PUBLIC", + "properties": { + "item_id": { + "type": "string", + "description": "The ID of the `CatalogItem` associated with this item variation.", + "nullable": true + }, + "name": { + "type": "string", + "description": "The item variation's name. This is a searchable attribute for use in applicable query filters.\n\nIts value has a maximum length of 255 Unicode code points. However, when the parent [item](entity:CatalogItem)\nuses [item options](entity:CatalogItemOption), this attribute is auto-generated, read-only, and can be\nlonger than 255 Unicode code points.", + "nullable": true + }, + "sku": { + "type": "string", + "description": "The item variation's SKU, if any. This is a searchable attribute for use in applicable query filters.", + "nullable": true + }, + "upc": { + "type": "string", + "description": "The universal product code (UPC) of the item variation, if any. This is a searchable attribute for use in applicable query filters.\n\nThe value of this attribute should be a number of 12-14 digits long. This restriction is enforced on the Square Seller Dashboard,\nSquare Point of Sale or Retail Point of Sale apps, where this attribute shows in the GTIN field. If a non-compliant UPC value is assigned\nto this attribute using the API, the value is not editable on the Seller Dashboard, Square Point of Sale or Retail Point of Sale apps\nunless it is updated to fit the expected format.", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The order in which this item variation should be displayed. This value is read-only. On writes, the ordinal\nfor each item variation within a parent `CatalogItem` is set according to the item variations's\nposition. On reads, the value is not guaranteed to be sequential or unique.", + "readOnly": true + }, + "pricing_type": { + "$ref": "#/components/schemas/CatalogPricingType", + "description": "Indicates whether the item variation's price is fixed or determined at the time\nof sale.\nSee [CatalogPricingType](#type-catalogpricingtype) for possible values", + "nullable": true + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The item variation's price, if fixed pricing is used.", + "nullable": true + }, + "location_overrides": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemVariationLocationOverrides" + }, + "description": "Per-location price and inventory overrides.", + "nullable": true + }, + "track_inventory": { + "type": "boolean", + "description": "If `true`, inventory tracking is active for the variation.", + "nullable": true + }, + "inventory_alert_type": { + "$ref": "#/components/schemas/InventoryAlertType", + "description": "Indicates whether the item variation displays an alert when its inventory quantity is less than or equal\nto its `inventory_alert_threshold`.\nSee [InventoryAlertType](#type-inventoryalerttype) for possible values", + "nullable": true + }, + "inventory_alert_threshold": { + "type": "integer", + "description": "If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type`\nis `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard.\n\nThis value is always an integer.", + "format": "int64", + "nullable": true + }, + "user_data": { + "type": "string", + "description": "Arbitrary user metadata to associate with the item variation. This attribute value length is of Unicode code points.", + "maxLength": 255, + "nullable": true + }, + "service_duration": { + "type": "integer", + "description": "If the `CatalogItem` that owns this item variation is of type\n`APPOINTMENTS_SERVICE`, then this is the duration of the service in milliseconds. For\nexample, a 30 minute appointment would have the value `1800000`, which is equal to\n30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per second).", + "format": "int64", + "nullable": true + }, + "available_for_booking": { + "type": "boolean", + "description": "If the `CatalogItem` that owns this item variation is of type\n`APPOINTMENTS_SERVICE`, a bool representing whether this service is available for booking.", + "x-release-status": "BETA", + "nullable": true + }, + "item_option_values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemOptionValueForItemVariation" + }, + "description": "List of item option values associated with this item variation. Listed\nin the same order as the item options of the parent item.", + "nullable": true + }, + "measurement_unit_id": { + "type": "string", + "description": "ID of the ‘CatalogMeasurementUnit’ that is used to measure the quantity\nsold of this item variation. If left unset, the item will be sold in\nwhole quantities.", + "nullable": true + }, + "sellable": { + "type": "boolean", + "description": "Whether this variation can be sold. The inventory count of a sellable variation indicates\nthe number of units available for sale. When a variation is both stockable and sellable,\nits sellable inventory count can be smaller than or equal to its stockable count.", + "x-release-status": "BETA", + "nullable": true + }, + "stockable": { + "type": "boolean", + "description": "Whether stock is counted directly on this variation (TRUE) or only on its components (FALSE).\nWhen a variation is both stockable and sellable, the inventory count of a stockable variation keeps track of the number of units of this variation in stock\nand is not an indicator of the number of units of the variation that can be sold.", + "x-release-status": "BETA", + "nullable": true + }, + "image_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of images associated with this `CatalogItemVariation` instance.\nThese images will be shown to customers in Square Online Store.", + "nullable": true + }, + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tokens of employees that can perform the service represented by this variation. Only valid for\nvariations of type `APPOINTMENTS_SERVICE`.", + "x-release-status": "BETA", + "nullable": true + }, + "stockable_conversion": { + "$ref": "#/components/schemas/CatalogStockConversion", + "description": "The unit conversion rule, as prescribed by the [CatalogStockConversion](entity:CatalogStockConversion) type,\nthat describes how this non-stockable (i.e., sellable/receivable) item variation is converted\nto/from the stockable item variation sharing the same parent item. With the stock conversion,\nyou can accurately track inventory when an item variation is sold in one unit, but stocked in\nanother unit.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "CatalogMeasurementUnit": { + "type": "object", + "description": "Represents the unit used to measure a `CatalogItemVariation` and\nspecifies the precision for decimal quantities.", + "x-release-status": "PUBLIC", + "properties": { + "measurement_unit": { + "$ref": "#/components/schemas/MeasurementUnit", + "description": "Indicates the unit used to measure the quantity of a catalog item variation.", + "nullable": true + }, + "precision": { + "type": "integer", + "description": "An integer between 0 and 5 that represents the maximum number of\npositions allowed after the decimal in quantities measured with this unit.\nFor example:\n\n- if the precision is 0, the quantity can be 1, 2, 3, etc.\n- if the precision is 1, the quantity can be 0.1, 0.2, etc.\n- if the precision is 2, the quantity can be 0.01, 0.12, etc.\n\nDefault: 3", + "nullable": true + } + } + }, + "CatalogModifier": { + "type": "object", + "description": "A modifier that can be applied to items at the time of sale. For example, a cheese modifier for a burger, or a flavor modifier for a serving of ice cream.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The modifier name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.", + "maxLength": 255, + "nullable": true + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The modifier price.", + "nullable": true + }, + "on_by_default": { + "type": "boolean", + "description": "When `true`, this modifier is selected by default when displaying the modifier list.\nThis setting can be overridden at the item level using `CatalogModifierListInfo.modifier_overrides`.", + "x-release-status": "BETA", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "Determines where this `CatalogModifier` appears in the `CatalogModifierList`.", + "nullable": true + }, + "modifier_list_id": { + "type": "string", + "description": "The ID of the `CatalogModifierList` associated with this modifier.", + "nullable": true + }, + "location_overrides": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModifierLocationOverrides" + }, + "description": "Location-specific price overrides.", + "nullable": true + }, + "image_id": { + "type": "string", + "description": "The ID of the image associated with this `CatalogModifier` instance.\nCurrently this image is not displayed by Square, but is free to be displayed in 3rd party applications.", + "x-release-status": "BETA", + "nullable": true + }, + "hidden_online": { + "type": "boolean", + "description": "When `true`, this modifier is hidden from online ordering channels. This setting can be overridden at the item level using `CatalogModifierListInfo.modifier_overrides`.", + "x-release-status": "BETA", + "nullable": true + } + }, + "example": { + "object": { + "modifier_data": { + "name": "Almond Milk", + "price_money": { + "amount": 250, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + } + } + }, + "CatalogModifierList": { + "type": "object", + "description": "A container for a list of modifiers, or a text-based modifier.\nFor text-based modifiers, this represents text configuration for an item. (For example, custom text to print on a t-shirt).\nFor non text-based modifiers, this represents a list of modifiers that can be applied to items at the time of sale.\n(For example, a list of condiments for a hot dog, or a list of ice cream flavors).\nEach element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The name of the `CatalogModifierList` instance. This is a searchable attribute for use in applicable query filters, and its value length is of \nUnicode code points.", + "maxLength": 255, + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances.", + "nullable": true + }, + "selection_type": { + "$ref": "#/components/schemas/CatalogModifierListSelectionType", + "description": "__Deprecated__: Indicates whether a single (`SINGLE`) modifier or multiple (`MULTIPLE`) modifiers can be selected. Use\n`min_selected_modifiers` and `max_selected_modifiers` instead.\nSee [CatalogModifierListSelectionType](#type-catalogmodifierlistselectiontype) for possible values", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "modifiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A non-empty list of `CatalogModifier` objects to be included in the `CatalogModifierList`, \nfor non text-based modifiers when the `modifier_type` attribute is `LIST`. Each element of this list \nis a `CatalogObject` instance of the `MODIFIER` type, containing the following attributes:\n```\n{\n\"id\": \"{{catalog_modifier_id}}\",\n\"type\": \"MODIFIER\", \n\"modifier_data\": {{a CatalogModifier instance\u003e}} \n}\n```", + "nullable": true + }, + "image_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of images associated with this `CatalogModifierList` instance.\nCurrently these images are not displayed on Square products, but may be displayed in 3rd-party applications.", + "nullable": true + }, + "allow_quantities": { + "type": "boolean", + "description": "When `true`, allows multiple quantities of the same modifier to be selected.", + "x-release-status": "BETA", + "nullable": true + }, + "is_conversational": { + "type": "boolean", + "description": "True if modifiers belonging to this list can be used conversationally.", + "x-release-status": "BETA", + "nullable": true + }, + "modifier_type": { + "$ref": "#/components/schemas/CatalogModifierListModifierType", + "description": "The type of the modifier. \n\nWhen this `modifier_type` value is `TEXT`, the `CatalogModifierList` represents a text-based modifier. \nWhen this `modifier_type` value is `LIST`, the `CatalogModifierList` contains a list of `CatalogModifier` objects.\nSee [CatalogModifierListModifierType](#type-catalogmodifierlistmodifiertype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "max_length": { + "type": "integer", + "description": "The maximum length, in Unicode points, of the text string of the text-based modifier as represented by \nthis `CatalogModifierList` object with the `modifier_type` set to `TEXT`.", + "x-release-status": "BETA", + "nullable": true + }, + "text_required": { + "type": "boolean", + "description": "Whether the text string must be a non-empty string (`true`) or not (`false`) for a text-based modifier\nas represented by this `CatalogModifierList` object with the `modifier_type` set to `TEXT`.", + "x-release-status": "BETA", + "nullable": true + }, + "internal_name": { + "type": "string", + "description": "A note for internal use by the business. \n\nFor example, for a text-based modifier applied to a T-shirt item, if the buyer-supplied text of \"Hello, Kitty!\" \nis to be printed on the T-shirt, this `internal_name` attribute can be \"Use italic face\" as \nan instruction for the business to follow. \n\nFor non text-based modifiers, this `internal_name` attribute can be \nused to include SKUs, internal codes, or supplemental descriptions for internal use.", + "maxLength": 512, + "x-release-status": "BETA", + "nullable": true + }, + "min_selected_modifiers": { + "type": "integer", + "description": "The minimum number of modifiers that must be selected from this list. The value can be overridden with `CatalogItemModifierListInfo`.\n\nValues:\n\n- 0: No selection is required.\n- -1: Default value, the attribute was not set by the client. Treated as no selection required.\n- \u0026gt;0: The required minimum modifier selections. This can be larger than the total `CatalogModifiers` when `allow_quantities` is enabled.\n- \u0026lt; -1: Invalid. Treated as no selection required.", + "format": "int64", + "x-release-status": "BETA", + "nullable": true + }, + "max_selected_modifiers": { + "type": "integer", + "description": "The maximum number of modifiers that must be selected from this list. The value can be overridden with `CatalogItemModifierListInfo`.\n\nValues:\n\n- 0: No maximum limit.\n- -1: Default value, the attribute was not set by the client. Treated as no maximum limit.\n- \u0026gt;0: The maximum total modifier selections. This can be larger than the total `CatalogModifiers` when `allow_quantities` is enabled.\n- \u0026lt; -1: Invalid. Treated as no maximum limit.", + "format": "int64", + "x-release-status": "BETA", + "nullable": true + }, + "hidden_from_customer": { + "type": "boolean", + "description": "If `true`, modifiers from this list are hidden from customer receipts. The default value is `false`.\nThis setting can be overridden with `CatalogItemModifierListInfo.hidden_from_customer_override`.", + "x-release-status": "BETA", + "nullable": true + } + }, + "example": { + "id": "#MilkType", + "modifier_list_data": { + "allow_quantities": false, + "modifiers": [ + { + "modifier_data": { + "name": "Whole Milk", + "price_money": { + "amount": 0, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + }, + { + "modifier_data": { + "name": "Almond Milk", + "price_money": { + "amount": 250, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + }, + { + "modifier_data": { + "name": "Soy Milk", + "price_money": { + "amount": 250, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + } + ], + "name": "Milk Type", + "selection_type": "SINGLE" + }, + "present_at_all_locations": true, + "type": "MODIFIER_LIST" + } + }, + "CatalogModifierListModifierType": { + "type": "string", + "enum": [ + "LIST", + "TEXT" + ], + "x-enum-elements": [ + { + "name": "LIST", + "description": "The `CatalogModifierList` instance is a non-empty list of non text-based modifiers." + }, + { + "name": "TEXT", + "description": "The `CatalogModifierList` instance is a single text-based modifier." + } + ], + "description": "Defines the type of `CatalogModifierList`.", + "x-release-status": "BETA" + }, + "CatalogModifierListSelectionType": { + "type": "string", + "enum": [ + "SINGLE", + "MULTIPLE" + ], + "x-enum-elements": [ + { + "name": "SINGLE", + "description": "Indicates that a CatalogModifierList allows only a\nsingle CatalogModifier to be selected." + }, + { + "name": "MULTIPLE", + "description": "Indicates that a CatalogModifierList allows multiple\nCatalogModifier to be selected." + } + ], + "description": "Indicates whether a CatalogModifierList supports multiple selections.", + "x-release-status": "PUBLIC" + }, + "CatalogModifierOverride": { + "type": "object", + "description": "Options to control how to override the default behavior of the specified modifier.", + "x-release-status": "PUBLIC", + "required": [ + "modifier_id" + ], + "properties": { + "modifier_id": { + "type": "string", + "description": "The ID of the `CatalogModifier` whose default behavior is being overridden.", + "minLength": 1 + }, + "on_by_default": { + "type": "boolean", + "description": "__Deprecated__: Use `on_by_default_override` instead.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "hidden_online_override": { + "$ref": "#/components/schemas/CatalogModifierToggleOverrideType", + "description": "If `YES`, this setting overrides the `hidden_online` setting on the `CatalogModifier` object,\nand the modifier is always hidden from online sales channels.\nIf `NO`, the modifier is not hidden. It is always visible in online sales channels for this catalog item.\n`NOT_SET` means the `hidden_online` setting on the `CatalogModifier` object is obeyed.\nSee [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "on_by_default_override": { + "$ref": "#/components/schemas/CatalogModifierToggleOverrideType", + "description": "If `YES`, this setting overrides the `on_by_default` setting on the `CatalogModifier` object,\nand the modifier is always selected by default for the catalog item.\n\nIf `NO`, the modifier is not selected by default for this catalog item.\n`NOT_SET` means the `on_by_default` setting on the `CatalogModifier` object is obeyed.\nSee [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "CatalogObject": { + "type": "object", + "description": "The wrapper object for the catalog entries of a given object type.\n\nDepending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object.\n\nFor example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance.\n\nIn general, if `type=\u003cOBJECT_TYPE\u003e`, the `CatalogObject` instance must have the `\u003cOBJECT_TYPE\u003e`-specific data set on the `\u003cobject_type\u003e_data` attribute. The resulting `CatalogObject` instance is also a `Catalog\u003cObjectType\u003e` instance.\n\nFor a more detailed discussion of the Catalog data model, please see the\n[Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide.", + "x-release-status": "PUBLIC", + "required": [ + "type", + "id" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/CatalogObjectType", + "description": "The type of this object. Each object type has expected\nproperties expressed in a structured format within its corresponding `*_data` field below.\nSee [CatalogObjectType](#type-catalogobjecttype) for possible values" + }, + "id": { + "type": "string", + "description": "An identifier to reference this object in the catalog. When a new `CatalogObject`\nis inserted, the client should set the id to a temporary identifier starting with\na \"`#`\" character. Other objects being inserted or updated within the same request\nmay use this identifier to refer to the new object.\n\nWhen the server receives the new object, it will supply a unique identifier that\nreplaces the temporary identifier for all future references.", + "minLength": 1 + }, + "updated_at": { + "type": "string", + "description": "Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `\"2016-08-15T23:59:33.123Z\"`\nwould indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds.", + "readOnly": true + }, + "version": { + "type": "integer", + "description": "The version of the object. When updating an object, the version supplied\nmust match the version in the database, otherwise the write will be rejected as conflicting.", + "format": "int64" + }, + "is_deleted": { + "type": "boolean", + "description": "If `true`, the object has been deleted from the database. Must be `false` for new objects\nbeing inserted. When deleted, the `updated_at` field will equal the deletion time.", + "nullable": true + }, + "custom_attribute_values": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/CatalogCustomAttributeValue" + }, + "description": "A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair\nis a [CatalogCustomAttributeValue](entity:CatalogCustomAttributeValue) object. The key is the `key` attribute\nvalue defined in the associated [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition)\nobject defined by the application making the request.\n\nIf the `CatalogCustomAttributeDefinition` object is\ndefined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by\nthe defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of\n`\"cocoa_brand\"` and the defining application ID is `\"abcd1234\"`, the key in the map is `\"abcd1234:cocoa_brand\"`\nif the application making the request is different from the application defining the custom attribute definition.\nOtherwise, the key used in the map is simply `\"cocoa_brand\"`.\n\nApplication-defined custom attributes are set at a global (location-independent) level.\nCustom attribute values are intended to store additional information about a catalog object\nor associations with an entity in another system. Do not use custom attributes\nto store any sensitive information (personally identifiable information, card details, etc.).", + "nullable": true + }, + "catalog_v1_ids": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogV1Id" + }, + "description": "The Connect v1 IDs for this object at each location where it is present, where they\ndiffer from the object's Connect V2 ID. The field will only be present for objects that\nhave been created or modified by legacy APIs.", + "nullable": true + }, + "present_at_all_locations": { + "type": "boolean", + "description": "If `true`, this object is present at all locations (including future locations), except where specified in\nthe `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations),\nexcept where specified in the `present_at_location_ids` field. If not specified, defaults to `true`.", + "nullable": true + }, + "present_at_location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of locations where the object is present, even if `present_at_all_locations` is `false`.\nThis can include locations that are deactivated.", + "nullable": true + }, + "absent_at_location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of locations where the object is not present, even if `present_at_all_locations` is `true`.\nThis can include locations that are deactivated.", + "nullable": true + }, + "item_data": { + "$ref": "#/components/schemas/CatalogItem", + "description": "Structured data for a `CatalogItem`, set for CatalogObjects of type `ITEM`.", + "nullable": true + }, + "category_data": { + "$ref": "#/components/schemas/CatalogCategory", + "description": "Structured data for a `CatalogCategory`, set for CatalogObjects of type `CATEGORY`.", + "nullable": true + }, + "item_variation_data": { + "$ref": "#/components/schemas/CatalogItemVariation", + "description": "Structured data for a `CatalogItemVariation`, set for CatalogObjects of type `ITEM_VARIATION`.", + "nullable": true + }, + "tax_data": { + "$ref": "#/components/schemas/CatalogTax", + "description": "Structured data for a `CatalogTax`, set for CatalogObjects of type `TAX`.", + "nullable": true + }, + "discount_data": { + "$ref": "#/components/schemas/CatalogDiscount", + "description": "Structured data for a `CatalogDiscount`, set for CatalogObjects of type `DISCOUNT`.", + "nullable": true + }, + "modifier_list_data": { + "$ref": "#/components/schemas/CatalogModifierList", + "description": "Structured data for a `CatalogModifierList`, set for CatalogObjects of type `MODIFIER_LIST`.", + "nullable": true + }, + "modifier_data": { + "$ref": "#/components/schemas/CatalogModifier", + "description": "Structured data for a `CatalogModifier`, set for CatalogObjects of type `MODIFIER`.", + "nullable": true + }, + "time_period_data": { + "$ref": "#/components/schemas/CatalogTimePeriod", + "description": "Structured data for a `CatalogTimePeriod`, set for CatalogObjects of type `TIME_PERIOD`.", + "nullable": true + }, + "product_set_data": { + "$ref": "#/components/schemas/CatalogProductSet", + "description": "Structured data for a `CatalogProductSet`, set for CatalogObjects of type `PRODUCT_SET`.", + "nullable": true + }, + "pricing_rule_data": { + "$ref": "#/components/schemas/CatalogPricingRule", + "description": "Structured data for a `CatalogPricingRule`, set for CatalogObjects of type `PRICING_RULE`.\nA `CatalogPricingRule` object often works with a `CatalogProductSet` object or a `CatalogTimePeriod` object.", + "nullable": true + }, + "image_data": { + "$ref": "#/components/schemas/CatalogImage", + "description": "Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`.", + "nullable": true + }, + "measurement_unit_data": { + "$ref": "#/components/schemas/CatalogMeasurementUnit", + "description": "Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects of type `MEASUREMENT_UNIT`.", + "nullable": true + }, + "subscription_plan_data": { + "$ref": "#/components/schemas/CatalogSubscriptionPlan", + "description": "Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`.", + "nullable": true + }, + "item_option_data": { + "$ref": "#/components/schemas/CatalogItemOption", + "description": "Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`.", + "nullable": true + }, + "item_option_value_data": { + "$ref": "#/components/schemas/CatalogItemOptionValue", + "description": "Structured data for a `CatalogItemOptionValue`, set for CatalogObjects of type `ITEM_OPTION_VAL`.", + "nullable": true + }, + "custom_attribute_definition_data": { + "$ref": "#/components/schemas/CatalogCustomAttributeDefinition", + "description": "Structured data for a `CatalogCustomAttributeDefinition`, set for CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`.", + "nullable": true + }, + "quick_amounts_settings_data": { + "$ref": "#/components/schemas/CatalogQuickAmountsSettings", + "description": "Structured data for a `CatalogQuickAmountsSettings`, set for CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`.", + "x-release-status": "BETA", + "nullable": true + }, + "subscription_plan_variation_data": { + "$ref": "#/components/schemas/CatalogSubscriptionPlanVariation", + "description": "Structured data for a `CatalogSubscriptionPlanVariation`, set for CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`.", + "nullable": true + }, + "availability_period_data": { + "$ref": "#/components/schemas/CatalogAvailabilityPeriod", + "description": "Structured data for a `CatalogAvailabilityPeriod`, set for CatalogObjects of type `AVAILABILITY_PERIOD`.", + "nullable": true + } + }, + "example": { + "catalog_object": { + "absent_at_location_ids": [ + "{{ LOCATIONID-1 }}", + "{{ LOCATIONID-N }}" + ], + "category_data": "{{ CatalogCategory object only if type=CATEGORY }}", + "connect_v1_ids": { + "catalog_v1_id": "{{ itemID from Catalog v1 }}", + "location_id": "{{ location where v1 ID is used }}" + }, + "discount_data": "{{ CatalogDiscount object only if type=DISCOUNT }}", + "id": "{{ set by Catalog during object creation }}", + "is_deleted": "{{ [true | false] }}", + "item_data": "{{ CatalogItem object only if type=ITEM }}", + "item_variation_data": "{{ CatalogItemVariation object only if type=ITEM_VARIATION }}", + "modifier_data": "{{ CatalogModifier object only if type=MODIFIER }}", + "modifier_list_data": "{{ CatalogModifierList object only if type=MODIFIER_LIST }}", + "present_at_all_locations": "{{ [true | false] }}", + "present_at_location_ids": [ + "{{ LOCATIONID-1 }}", + "{{ LOCATIONID-N }}" + ], + "tax_data": "{{ CatalogTax object only if type=TAX }}", + "type": "{{ [ITEM | ITEM_VARIATION | MODIFIER | MODIFIER_LIST | CATEGORY | DISCOUNT | TAX] }}", + "updated_at": "{{ date \u0026 time of most recent update }}", + "version": "{{ version of the CatalogObject }}" + } + } + }, + "CatalogObjectBatch": { + "type": "object", + "description": "A batch of catalog objects.", + "x-release-status": "PUBLIC", + "required": [ + "objects" + ], + "properties": { + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of CatalogObjects belonging to this batch." + } + } + }, + "CatalogObjectCategory": { + "type": "object", + "description": "A category that can be assigned to an item or a parent category that can be assigned \nto another category. For example, a clothing category can be assigned to a t-shirt item or \nbe made as the parent category to the pants category.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "The ID of the object's category." + }, + "ordinal": { + "type": "integer", + "description": "The order of the object within the context of the category.", + "format": "int64", + "nullable": true + } + } + }, + "CatalogObjectReference": { + "type": "object", + "description": "A reference to a Catalog object at a specific version. In general this is\nused as an entry point into a graph of catalog objects, where the objects exist\nat a specific version.", + "x-release-status": "PUBLIC", + "properties": { + "object_id": { + "type": "string", + "description": "The ID of the referenced object.", + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the object.", + "format": "int64", + "nullable": true + } + } + }, + "CatalogObjectType": { + "type": "string", + "enum": [ + "ITEM", + "IMAGE", + "CATEGORY", + "ITEM_VARIATION", + "TAX", + "DISCOUNT", + "MODIFIER_LIST", + "MODIFIER", + "PRICING_RULE", + "PRODUCT_SET", + "TIME_PERIOD", + "MEASUREMENT_UNIT", + "SUBSCRIPTION_PLAN_VARIATION", + "ITEM_OPTION", + "ITEM_OPTION_VAL", + "CUSTOM_ATTRIBUTE_DEFINITION", + "QUICK_AMOUNTS_SETTINGS", + "SUBSCRIPTION_PLAN", + "AVAILABILITY_PERIOD" + ], + "x-enum-elements": [ + { + "name": "ITEM", + "description": "The `CatalogObject` instance is of the [CatalogItem](entity:CatalogItem) type and represents an item. The item-specific data\nmust be set on the `item_data` field." + }, + { + "name": "IMAGE", + "description": "The `CatalogObject` instance is of the [CatalogImage](entity:CatalogImage) type and represents an image. The image-specific data\nmust be set on the `image_data` field." + }, + { + "name": "CATEGORY", + "description": "The `CatalogObject` instance is of the [CatalogCategory](entity:CatalogCategory) type and represents a category. The category-specific data\nmust be set on the `category_data` field." + }, + { + "name": "ITEM_VARIATION", + "description": "The `CatalogObject` instance is of the [CatalogItemVariation](entity:CatalogItemVariation) type and represents an item variation, also referred to as variation.\nThe item variation-specific data must be set on the `item_variation_data` field." + }, + { + "name": "TAX", + "description": "The `CatalogObject` instance is of the [CatalogTax](entity:CatalogTax) type and represents a tax. The tax-specific data\nmust be set on the `tax_data` field." + }, + { + "name": "DISCOUNT", + "description": "The `CatalogObject` instance is of the [CatalogDiscount](entity:CatalogDiscount) type and represents a discount. The discount-specific data\nmust be set on the `discount_data` field." + }, + { + "name": "MODIFIER_LIST", + "description": "The `CatalogObject` instance is of the [CatalogModifierList](entity:CatalogModifierList) type and represents a modifier list.\nThe modifier-list-specific data must be set on the `modifier_list_data` field." + }, + { + "name": "MODIFIER", + "description": "The `CatalogObject` instance is of the [CatalogModifier](entity:CatalogModifier) type and represents a modifier. The modifier-specific data\nmust be set on the `modifier_data` field." + }, + { + "name": "PRICING_RULE", + "description": "The `CatalogObject` instance is of the [CatalogPricingRule](entity:CatalogPricingRule) type and represents a pricing rule. The pricing-rule-specific data\nmust be set on the `pricing_rule_data` field." + }, + { + "name": "PRODUCT_SET", + "description": "The `CatalogObject` instance is of the [CatalogProductSet](entity:CatalogProductSet) type and represents a product set.\nThe product-set-specific data will be stored in the `product_set_data` field." + }, + { + "name": "TIME_PERIOD", + "description": "The `CatalogObject` instance is of the [CatalogTimePeriod](entity:CatalogTimePeriod) type and represents a time period.\nThe time-period-specific data must be set on the `time_period_data` field." + }, + { + "name": "MEASUREMENT_UNIT", + "description": "The `CatalogObject` instance is of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) type and represents a measurement unit specifying the unit of\nmeasure and precision in which an item variation is sold. The measurement-unit-specific data must set on the `measurement_unit_data` field." + }, + { + "name": "SUBSCRIPTION_PLAN_VARIATION", + "description": "The `CatalogObject` instance is of the [CatalogSubscriptionPlan](entity:CatalogSubscriptionPlan) type and represents a subscription plan.\nThe subscription-plan-specific data must be stored on the `subscription_plan_data` field." + }, + { + "name": "ITEM_OPTION", + "description": "The `CatalogObject` instance is of the [CatalogItemOption](entity:CatalogItemOption) type and represents a list of options (such as a color or size of a T-shirt)\nthat can be assigned to item variations. The item-option-specific data must be on the `item_option_data` field." + }, + { + "name": "ITEM_OPTION_VAL", + "description": "The `CatalogObject` instance is of the [CatalogItemOptionValue](entity:CatalogItemOptionValue) type and represents a value associated with one or more item options.\nFor example, an item option of \"Size\" may have item option values such as \"Small\" or \"Medium\".\nThe item-option-value-specific data must be on the `item_option_value_data` field." + }, + { + "name": "CUSTOM_ATTRIBUTE_DEFINITION", + "description": "The `CatalogObject` instance is of the [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) type and represents the definition of a custom attribute.\nThe custom-attribute-definition-specific data must be set on the `custom_attribute_definition_data` field." + }, + { + "name": "QUICK_AMOUNTS_SETTINGS", + "description": "The `CatalogObject` instance is of the [CatalogQuickAmountsSettings](entity:CatalogQuickAmountsSettings) type and represents settings to configure preset charges for quick payments at each location.\nFor example, a location may have a list of both AUTO and MANUAL quick amounts that are set to DISABLED.\nThe quick-amounts-settings-specific data must be set on the `quick_amounts_settings_data` field." + }, + { + "name": "SUBSCRIPTION_PLAN", + "description": "The `CatalogObject` instance is of the [CatalogSubscriptionPlan](entity:CatalogSubscriptionPlan) type and represents a subscription plan.\nThe subscription plan specific data must be stored on the `subscription_plan_data` field." + }, + { + "name": "AVAILABILITY_PERIOD", + "description": "The `CatalogObject` instance is of the [CatalogAvailabilityPeriod](entity:CatalogAvailabilityPeriod) type and represents an availability period.\nThe availability period specific data must be stored on the `availability_period_data` field." + } + ], + "description": "Possible types of CatalogObjects returned from the catalog, each\ncontaining type-specific properties in the `*_data` field corresponding to the specified object type.", + "x-release-status": "PUBLIC" + }, + "CatalogPricingRule": { + "type": "object", + "description": "Defines how discounts are automatically applied to a set of items that match the pricing rule\nduring the active time period.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "User-defined name for the pricing rule. For example, \"Buy one get one\nfree\" or \"10% off\".", + "nullable": true + }, + "time_period_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique IDs for the catalog time periods when\nthis pricing rule is in effect. If left unset, the pricing rule is always\nin effect.", + "nullable": true + }, + "discount_id": { + "type": "string", + "description": "Unique ID for the `CatalogDiscount` to take off\nthe price of all matched items.", + "nullable": true + }, + "match_products_id": { + "type": "string", + "description": "Unique ID for the `CatalogProductSet` that will be matched by this rule. A match rule\nmatches within the entire cart, and can match multiple times. This field will always be set.", + "nullable": true + }, + "apply_products_id": { + "type": "string", + "description": "__Deprecated__: Please use the `exclude_products_id` field to apply\nan exclude set instead. Exclude sets allow better control over quantity\nranges and offer more flexibility for which matched items receive a discount.\n\n`CatalogProductSet` to apply the pricing to.\nAn apply rule matches within the subset of the cart that fits the match rules (the match set).\nAn apply rule can only match once in the match set.\nIf not supplied, the pricing will be applied to all products in the match set.\nOther products retain their base price, or a price generated by other rules.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "exclude_products_id": { + "type": "string", + "description": "`CatalogProductSet` to exclude from the pricing rule.\nAn exclude rule matches within the subset of the cart that fits the match rules (the match set).\nAn exclude rule can only match once in the match set.\nIf not supplied, the pricing will be applied to all products in the match set.\nOther products retain their base price, or a price generated by other rules.", + "nullable": true + }, + "valid_from_date": { + "type": "string", + "description": "Represents the date the Pricing Rule is valid from. Represented in RFC 3339 full-date format (YYYY-MM-DD).", + "nullable": true + }, + "valid_from_local_time": { + "type": "string", + "description": "Represents the local time the pricing rule should be valid from. Represented in RFC 3339 partial-time format\n(HH:MM:SS). Partial seconds will be truncated.", + "nullable": true + }, + "valid_until_date": { + "type": "string", + "description": "Represents the date the Pricing Rule is valid until. Represented in RFC 3339 full-date format (YYYY-MM-DD).", + "nullable": true + }, + "valid_until_local_time": { + "type": "string", + "description": "Represents the local time the pricing rule should be valid until. Represented in RFC 3339 partial-time format\n(HH:MM:SS). Partial seconds will be truncated.", + "nullable": true + }, + "exclude_strategy": { + "$ref": "#/components/schemas/ExcludeStrategy", + "description": "If an `exclude_products_id` was given, controls which subset of matched\nproducts is excluded from any discounts.\n\nDefault value: `LEAST_EXPENSIVE`\nSee [ExcludeStrategy](#type-excludestrategy) for possible values", + "nullable": true + }, + "minimum_order_subtotal_money": { + "$ref": "#/components/schemas/Money", + "description": "The minimum order subtotal (before discounts or taxes are applied)\nthat must be met before this rule may be applied.", + "nullable": true + }, + "customer_group_ids_any": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of IDs of customer groups, the members of which are eligible for discounts specified in this pricing rule.\nNotice that a group ID is generated by the Customers API.\nIf this field is not set, the specified discount applies to matched products sold to anyone whether the buyer\nhas a customer profile created or not. If this `customer_group_ids_any` field is set, the specified discount\napplies only to matched products sold to customers belonging to the specified customer groups.", + "nullable": true + } + } + }, + "CatalogPricingType": { + "type": "string", + "enum": [ + "FIXED_PRICING", + "VARIABLE_PRICING" + ], + "x-enum-elements": [ + { + "name": "FIXED_PRICING", + "description": "The catalog item variation's price is fixed." + }, + { + "name": "VARIABLE_PRICING", + "description": "The catalog item variation's price is entered at the time of sale." + } + ], + "description": "Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale.", + "x-release-status": "PUBLIC" + }, + "CatalogProductSet": { + "type": "object", + "description": "Represents a collection of catalog objects for the purpose of applying a\n`PricingRule`. Including a catalog object will include all of its subtypes.\nFor example, including a category in a product set will include all of its\nitems and associated item variations in the product set. Including an item in\na product set will also include its item variations.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "User-defined name for the product set. For example, \"Clearance Items\"\nor \"Winter Sale Items\".", + "nullable": true + }, + "product_ids_any": { + "type": "array", + "items": { + "type": "string" + }, + "description": " Unique IDs for any `CatalogObject` included in this product set. Any\nnumber of these catalog objects can be in an order for a pricing rule to apply.\n\nThis can be used with `product_ids_all` in a parent `CatalogProductSet` to\nmatch groups of products for a bulk discount, such as a discount for an\nentree and side combo.\n\nOnly one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.\n\nMax: 500 catalog object IDs.", + "nullable": true + }, + "product_ids_all": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique IDs for any `CatalogObject` included in this product set.\nAll objects in this set must be included in an order for a pricing rule to apply.\n\nOnly one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.\n\nMax: 500 catalog object IDs.", + "nullable": true + }, + "quantity_exact": { + "type": "integer", + "description": "If set, there must be exactly this many items from `products_any` or `products_all`\nin the cart for the discount to apply.\n\nCannot be combined with either `quantity_min` or `quantity_max`.", + "format": "int64", + "nullable": true + }, + "quantity_min": { + "type": "integer", + "description": "If set, there must be at least this many items from `products_any` or `products_all`\nin a cart for the discount to apply. See `quantity_exact`. Defaults to 0 if\n`quantity_exact`, `quantity_min` and `quantity_max` are all unspecified.", + "format": "int64", + "nullable": true + }, + "quantity_max": { + "type": "integer", + "description": "If set, the pricing rule will apply to a maximum of this many items from\n`products_any` or `products_all`.", + "format": "int64", + "nullable": true + }, + "all_products": { + "type": "boolean", + "description": "If set to `true`, the product set will include every item in the catalog.\nOnly one of `product_ids_all`, `product_ids_any`, or `all_products` can be set.", + "nullable": true + } + } + }, + "CatalogQuery": { + "type": "object", + "description": "A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint.\n\nAlthough a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects).\nAny combination of the following types may be used together:\n- [exact_query](entity:CatalogQueryExact)\n- [prefix_query](entity:CatalogQueryPrefix)\n- [range_query](entity:CatalogQueryRange)\n- [sorted_attribute_query](entity:CatalogQuerySortedAttribute)\n- [text_query](entity:CatalogQueryText)\n\nAll other query types cannot be combined with any others.\n\nWhen a query filter is based on an attribute, the attribute must be searchable.\nSearchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters.\n\nSearchable attribute and objects queryable by searchable attributes:\n- `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, `CatalogModifierList`, `CatalogItemOption`, `CatalogItemOptionValue`\n- `description`: `CatalogItem`, `CatalogItemOptionValue`\n- `abbreviation`: `CatalogItem`\n- `upc`: `CatalogItemVariation`\n- `sku`: `CatalogItemVariation`\n- `caption`: `CatalogImage`\n- `display_name`: `CatalogItemOption`\n\nFor example, to search for [CatalogItem](entity:CatalogItem) objects by searchable attributes, you can use\nthe `\"name\"`, `\"description\"`, or `\"abbreviation\"` attribute in an applicable query filter.", + "x-release-status": "PUBLIC", + "properties": { + "sorted_attribute_query": { + "$ref": "#/components/schemas/CatalogQuerySortedAttribute", + "description": "A query expression to sort returned query result by the given attribute.", + "nullable": true + }, + "exact_query": { + "$ref": "#/components/schemas/CatalogQueryExact", + "description": "An exact query expression to return objects with attribute name and value\nmatching the specified attribute name and value exactly. Value matching is case insensitive.", + "nullable": true + }, + "set_query": { + "$ref": "#/components/schemas/CatalogQuerySet", + "description": "A set query expression to return objects with attribute name and value\nmatching the specified attribute name and any of the specified attribute values exactly.\nValue matching is case insensitive.", + "nullable": true + }, + "prefix_query": { + "$ref": "#/components/schemas/CatalogQueryPrefix", + "description": "A prefix query expression to return objects with attribute values\nthat have a prefix matching the specified string value. Value matching is case insensitive.", + "nullable": true + }, + "range_query": { + "$ref": "#/components/schemas/CatalogQueryRange", + "description": "A range query expression to return objects with numeric values\nthat lie in the specified range.", + "nullable": true + }, + "text_query": { + "$ref": "#/components/schemas/CatalogQueryText", + "description": "A text query expression to return objects whose searchable attributes contain all of the given\nkeywords, irrespective of their order. For example, if a `CatalogItem` contains custom attribute values of\n`{\"name\": \"t-shirt\"}` and `{\"description\": \"Small, Purple\"}`, the query filter of `{\"keywords\": [\"shirt\", \"sma\", \"purp\"]}`\nreturns this item.", + "nullable": true + }, + "items_for_tax_query": { + "$ref": "#/components/schemas/CatalogQueryItemsForTax", + "description": "A query expression to return items that have any of the specified taxes (as identified by the corresponding `CatalogTax` object IDs) enabled.", + "nullable": true + }, + "items_for_modifier_list_query": { + "$ref": "#/components/schemas/CatalogQueryItemsForModifierList", + "description": "A query expression to return items that have any of the given modifier list (as identified by the corresponding `CatalogModifierList`s IDs) enabled.", + "nullable": true + }, + "items_for_item_options_query": { + "$ref": "#/components/schemas/CatalogQueryItemsForItemOptions", + "description": "A query expression to return items that contains the specified item options (as identified the corresponding `CatalogItemOption` IDs).", + "nullable": true + }, + "item_variations_for_item_option_values_query": { + "$ref": "#/components/schemas/CatalogQueryItemVariationsForItemOptionValues", + "description": "A query expression to return item variations (of the [CatalogItemVariation](entity:CatalogItemVariation) type) that\ncontain all of the specified `CatalogItemOption` IDs.", + "nullable": true + } + } + }, + "CatalogQueryExact": { + "type": "object", + "description": "The query filter to return the search result by exact match of the specified attribute name and value.", + "x-release-status": "PUBLIC", + "required": [ + "attribute_name", + "attribute_value" + ], + "properties": { + "attribute_name": { + "type": "string", + "description": "The name of the attribute to be searched. Matching of the attribute name is exact.", + "minLength": 1 + }, + "attribute_value": { + "type": "string", + "description": "The desired value of the search attribute. Matching of the attribute value is case insensitive and can be partial.\nFor example, if a specified value of \"sma\", objects with the named attribute value of \"Small\", \"small\" are both matched." + } + } + }, + "CatalogQueryItemVariationsForItemOptionValues": { + "type": "object", + "description": "The query filter to return the item variations containing the specified item option value IDs.", + "x-release-status": "PUBLIC", + "properties": { + "item_option_value_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A set of `CatalogItemOptionValue` IDs to be used to find associated\n`CatalogItemVariation`s. All ItemVariations that contain all of the given\nItem Option Values (in any order) will be returned.", + "nullable": true + } + } + }, + "CatalogQueryItemsForItemOptions": { + "type": "object", + "description": "The query filter to return the items containing the specified item option IDs.", + "x-release-status": "PUBLIC", + "properties": { + "item_option_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A set of `CatalogItemOption` IDs to be used to find associated\n`CatalogItem`s. All Items that contain all of the given Item Options (in any order)\nwill be returned.", + "nullable": true + } + } + }, + "CatalogQueryItemsForModifierList": { + "type": "object", + "description": "The query filter to return the items containing the specified modifier list IDs.", + "x-release-status": "PUBLIC", + "required": [ + "modifier_list_ids" + ], + "properties": { + "modifier_list_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A set of `CatalogModifierList` IDs to be used to find associated `CatalogItem`s." + } + } + }, + "CatalogQueryItemsForTax": { + "type": "object", + "description": "The query filter to return the items containing the specified tax IDs.", + "x-release-status": "PUBLIC", + "required": [ + "tax_ids" + ], + "properties": { + "tax_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A set of `CatalogTax` IDs to be used to find associated `CatalogItem`s." + } + } + }, + "CatalogQueryPrefix": { + "type": "object", + "description": "The query filter to return the search result whose named attribute values are prefixed by the specified attribute value.", + "x-release-status": "PUBLIC", + "required": [ + "attribute_name", + "attribute_prefix" + ], + "properties": { + "attribute_name": { + "type": "string", + "description": "The name of the attribute to be searched.", + "minLength": 1 + }, + "attribute_prefix": { + "type": "string", + "description": "The desired prefix of the search attribute value.", + "minLength": 1 + } + } + }, + "CatalogQueryRange": { + "type": "object", + "description": "The query filter to return the search result whose named attribute values fall between the specified range.", + "x-release-status": "PUBLIC", + "required": [ + "attribute_name" + ], + "properties": { + "attribute_name": { + "type": "string", + "description": "The name of the attribute to be searched.", + "minLength": 1 + }, + "attribute_min_value": { + "type": "integer", + "description": "The desired minimum value for the search attribute (inclusive).", + "format": "int64", + "nullable": true + }, + "attribute_max_value": { + "type": "integer", + "description": "The desired maximum value for the search attribute (inclusive).", + "format": "int64", + "nullable": true + } + } + }, + "CatalogQuerySet": { + "type": "object", + "description": "The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of\nthe `attribute_values`.", + "x-release-status": "PUBLIC", + "required": [ + "attribute_name", + "attribute_values" + ], + "properties": { + "attribute_name": { + "type": "string", + "description": "The name of the attribute to be searched. Matching of the attribute name is exact.", + "minLength": 1 + }, + "attribute_values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The desired values of the search attribute. Matching of the attribute values is exact and case insensitive.\nA maximum of 250 values may be searched in a request." + } + } + }, + "CatalogQuerySortedAttribute": { + "type": "object", + "description": "The query expression to specify the key to sort search results.", + "x-release-status": "PUBLIC", + "required": [ + "attribute_name" + ], + "properties": { + "attribute_name": { + "type": "string", + "description": "The attribute whose value is used as the sort key.", + "minLength": 1 + }, + "initial_attribute_value": { + "type": "string", + "description": "The first attribute value to be returned by the query. Ascending sorts will return only\nobjects with this value or greater, while descending sorts will return only objects with this value\nor less. If unset, start at the beginning (for ascending sorts) or end (for descending sorts).", + "nullable": true + }, + "sort_order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The desired sort order, `\"ASC\"` (ascending) or `\"DESC\"` (descending).\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "CatalogQueryText": { + "type": "object", + "description": "The query filter to return the search result whose searchable attribute values contain all of the specified keywords or tokens, independent of the token order or case.", + "x-release-status": "PUBLIC", + "required": [ + "keywords" + ], + "properties": { + "keywords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 alphanumeric characters are ignored." + } + } + }, + "CatalogQuickAmount": { + "type": "object", + "description": "Represents a Quick Amount in the Catalog.", + "x-release-status": "BETA", + "required": [ + "type", + "amount" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/CatalogQuickAmountType", + "description": "Represents the type of the Quick Amount.\nSee [CatalogQuickAmountType](#type-catalogquickamounttype) for possible values" + }, + "amount": { + "$ref": "#/components/schemas/Money", + "description": "Represents the actual amount of the Quick Amount with Money type." + }, + "score": { + "type": "integer", + "description": "Describes the ranking of the Quick Amount provided by machine learning model, in the range [0, 100].\nMANUAL type amount will always have score = 100.", + "format": "int64", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The order in which this Quick Amount should be displayed.", + "format": "int64", + "nullable": true + } + } + }, + "CatalogQuickAmountType": { + "type": "string", + "enum": [ + "QUICK_AMOUNT_TYPE_MANUAL", + "QUICK_AMOUNT_TYPE_AUTO" + ], + "x-enum-elements": [ + { + "name": "QUICK_AMOUNT_TYPE_MANUAL", + "description": "Quick Amount is created manually by the seller." + }, + { + "name": "QUICK_AMOUNT_TYPE_AUTO", + "description": "Quick Amount is generated automatically by machine learning algorithms." + } + ], + "description": "Determines the type of a specific Quick Amount.", + "x-release-status": "BETA" + }, + "CatalogQuickAmountsSettings": { + "type": "object", + "description": "A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts.", + "x-release-status": "BETA", + "required": [ + "option" + ], + "properties": { + "option": { + "$ref": "#/components/schemas/CatalogQuickAmountsSettingsOption", + "description": "Represents the option seller currently uses on Quick Amounts.\nSee [CatalogQuickAmountsSettingsOption](#type-catalogquickamountssettingsoption) for possible values" + }, + "eligible_for_auto_amounts": { + "type": "boolean", + "description": "Represents location's eligibility for auto amounts\nThe boolean should be consistent with whether there are AUTO amounts in the `amounts`.", + "nullable": true + }, + "amounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogQuickAmount" + }, + "description": "Represents a set of Quick Amounts at this location.", + "nullable": true + } + } + }, + "CatalogQuickAmountsSettingsOption": { + "type": "string", + "enum": [ + "DISABLED", + "MANUAL", + "AUTO" + ], + "x-enum-elements": [ + { + "name": "DISABLED", + "description": "Option for seller to disable Quick Amounts." + }, + { + "name": "MANUAL", + "description": "Option for seller to choose manually created Quick Amounts." + }, + { + "name": "AUTO", + "description": "Option for seller to choose automatically created Quick Amounts." + } + ], + "description": "Determines a seller's option on Quick Amounts feature.", + "x-release-status": "BETA" + }, + "CatalogStockConversion": { + "type": "object", + "description": "Represents the rule of conversion between a stockable [CatalogItemVariation](entity:CatalogItemVariation)\nand a non-stockable sell-by or receive-by `CatalogItemVariation` that\nshare the same underlying stock.", + "x-release-status": "BETA", + "required": [ + "stockable_item_variation_id", + "stockable_quantity", + "nonstockable_quantity" + ], + "properties": { + "stockable_item_variation_id": { + "type": "string", + "description": "References to the stockable [CatalogItemVariation](entity:CatalogItemVariation)\nfor this stock conversion. Selling, receiving or recounting the non-stockable `CatalogItemVariation`\ndefined with a stock conversion results in adjustments of this stockable `CatalogItemVariation`.\nThis immutable field must reference a stockable `CatalogItemVariation`\nthat shares the parent [CatalogItem](entity:CatalogItem) of the converted `CatalogItemVariation.`", + "minLength": 1 + }, + "stockable_quantity": { + "type": "string", + "description": "The quantity of the stockable item variation (as identified by `stockable_item_variation_id`)\nequivalent to the non-stockable item variation quantity (as specified in `nonstockable_quantity`)\nas defined by this stock conversion. It accepts a decimal number in a string format that can take\nup to 10 digits before the decimal point and up to 5 digits after the decimal point.", + "minLength": 1, + "maxLength": 16 + }, + "nonstockable_quantity": { + "type": "string", + "description": "The converted equivalent quantity of the non-stockable [CatalogItemVariation](entity:CatalogItemVariation)\nin its measurement unit. The `stockable_quantity` value and this `nonstockable_quantity` value together\ndefine the conversion ratio between stockable item variation and the non-stockable item variation.\nIt accepts a decimal number in a string format that can take up to 10 digits before the decimal point\nand up to 5 digits after the decimal point.", + "minLength": 1, + "maxLength": 16 + } + } + }, + "CatalogSubscriptionPlan": { + "type": "object", + "description": "Describes a subscription plan. A subscription plan represents what you want to sell in a subscription model, and includes references to each of the associated subscription plan variations.\nFor more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations).", + "x-release-status": "PUBLIC", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the plan." + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionPhase" + }, + "description": "A list of SubscriptionPhase containing the [SubscriptionPhase](entity:SubscriptionPhase) for this plan.\nThis field it required. Not including this field will throw a REQUIRED_FIELD_MISSING error", + "nullable": true + }, + "subscription_plan_variations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "The list of subscription plan variations available for this product", + "nullable": true + }, + "eligible_item_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's variations.", + "nullable": true + }, + "eligible_category_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's variations.", + "nullable": true + }, + "all_items": { + "type": "boolean", + "description": "If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan.", + "nullable": true + } + } + }, + "CatalogSubscriptionPlanVariation": { + "type": "object", + "description": "Describes a subscription plan variation. A subscription plan variation represents how the subscription for a product or service is sold.\nFor more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations).", + "x-release-status": "PUBLIC", + "required": [ + "name", + "phases" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the plan variation." + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionPhase" + }, + "description": "A list containing each [SubscriptionPhase](entity:SubscriptionPhase) for this plan variation." + }, + "subscription_plan_id": { + "type": "string", + "description": "The id of the subscription plan, if there is one.", + "nullable": true + }, + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The day of the month the billing period starts.", + "format": "int64", + "minimum": 1, + "maximum": 31, + "nullable": true + }, + "can_prorate": { + "type": "boolean", + "description": "Whether bills for this plan variation can be split for proration.", + "nullable": true + }, + "successor_plan_variation_id": { + "type": "string", + "description": "The ID of a \"successor\" plan variation to this one. If the field is set, and this object is disabled at all\nlocations, it indicates that this variation is deprecated and the object identified by the successor ID be used in\nits stead.", + "nullable": true + } + } + }, + "CatalogTax": { + "type": "object", + "description": "A tax applicable to an item.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The tax's name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.", + "maxLength": 255, + "nullable": true + }, + "calculation_phase": { + "$ref": "#/components/schemas/TaxCalculationPhase", + "description": "Whether the tax is calculated based on a payment's subtotal or total.\nSee [TaxCalculationPhase](#type-taxcalculationphase) for possible values", + "nullable": true + }, + "inclusion_type": { + "$ref": "#/components/schemas/TaxInclusionType", + "description": "Whether the tax is `ADDITIVE` or `INCLUSIVE`.\nSee [TaxInclusionType](#type-taxinclusiontype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign.\nA value of `7.5` corresponds to 7.5%. For a location-specific tax rate, contact the tax authority of the location or a tax consultant.", + "nullable": true + }, + "applies_to_custom_amounts": { + "type": "boolean", + "description": "If `true`, the fee applies to custom amounts entered into the Square Point of Sale\napp that are not associated with a particular `CatalogItem`.", + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of Sale app or not (`false`).", + "nullable": true + }, + "applies_to_product_set_id": { + "type": "string", + "description": "The ID of a `CatalogProductSet` object. If set, the tax is applicable to all products in the product set.", + "x-release-status": "BETA", + "nullable": true + } + }, + "example": { + "object": { + "id": "#SalesTax", + "present_at_all_locations": true, + "tax_data": { + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "fee_applies_to_custom_amounts": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX" + } + } + }, + "CatalogTimePeriod": { + "type": "object", + "description": "Represents a time period - either a single period or a repeating period.", + "x-release-status": "PUBLIC", + "properties": { + "event": { + "type": "string", + "description": "An iCalendar (RFC 5545) [event](https://tools.ietf.org/html/rfc5545#section-3.6.1), which\nspecifies the name, timing, duration and recurrence of this time period.\n\nExample:\n\n```\nDTSTART:20190707T180000\nDURATION:P2H\nRRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR\n```\n\nOnly `SUMMARY`, `DTSTART`, `DURATION` and `RRULE` fields are supported.\n`DTSTART` must be in local (unzoned) time format. Note that while `BEGIN:VEVENT`\nand `END:VEVENT` is not required in the request. The response will always\ninclude them.", + "nullable": true + } + } + }, + "CatalogV1Id": { + "type": "object", + "description": "A Square API V1 identifier of an item, including the object ID and its associated location ID.", + "x-release-status": "PUBLIC", + "properties": { + "catalog_v1_id": { + "type": "string", + "description": "The ID for an object used in the Square API V1, if the object ID differs from the Square API V2 object ID.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the `Location` this Connect V1 ID is associated with.", + "nullable": true + } + } + }, + "CatalogVersionUpdatedEvent": { + "type": "object", + "description": "Published when the catalog is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CatalogVersionUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "id": "732b6677-1acb-4d81-b09c-5a3a49399d8f", + "object": { + "catalog_version": { + "updated_at": "2019-10-29T17:26:16.53Z" + } + }, + "type": "catalog_version" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "catalog.version.updated" + }, + "x-webhook": { + "event": "catalog.version.updated", + "scopes": [ + "ITEMS_READ" + ] + }, + "x-api": "#/components/x-apis/Catalog", + "x-since": "2019-09-25" + }, + "CatalogVersionUpdatedEventCatalogVersion": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "updated_at": { + "type": "string", + "description": "Last modification timestamp in RFC 3339 format.", + "readOnly": true + } + } + }, + "CatalogVersionUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type.", + "nullable": true + }, + "object": { + "$ref": "#/components/schemas/CatalogVersionUpdatedEventObject", + "description": "An object containing fields and values relevant to the event. Is absent if affected object was deleted.", + "nullable": true + } + } + }, + "CatalogVersionUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "catalog_version": { + "$ref": "#/components/schemas/CatalogVersionUpdatedEventCatalogVersion", + "description": "The version of the object.", + "nullable": true + } + } + }, + "CategoryPathToRootNode": { + "type": "object", + "description": "A node in the path from a retrieved category to its root node.", + "x-release-status": "PUBLIC", + "properties": { + "category_id": { + "type": "string", + "description": "The category's ID.", + "nullable": true + }, + "category_name": { + "type": "string", + "description": "The category's name.", + "nullable": true + } + } + }, + "ChangeBillingAnchorDateRequest": { + "type": "object", + "description": "Defines input parameters in a request to the\n[ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint.", + "x-release-status": "BETA", + "properties": { + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The anchor day for the billing cycle.", + "minimum": 1, + "maximum": 31, + "nullable": true + }, + "effective_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the scheduled `BILLING_ANCHOR_CHANGE` action takes\nplace on the subscription.\n\nWhen this date is unspecified or falls within the current billing cycle, the billing anchor date\nis changed immediately.", + "nullable": true + } + }, + "example": { + "monthly_billing_anchor_date": 1 + } + }, + "ChangeBillingAnchorDateResponse": { + "type": "object", + "description": "Defines output parameters in a request to the\n[ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The specified subscription for updating billing anchor date." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "A list of a single billing anchor date change for the subscription." + } + }, + "example": { + "actions": [ + { + "effective_date": "2023-11-01", + "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83", + "monthly_billing_anchor_date": 1, + "type": "CHANGE_BILLING_ANCHOR_DATE" + } + ], + "subscription": { + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "9ba40961-995a-4a3d-8c53-048c40cafc13", + "location_id": "S8GWD5R9QB376", + "monthly_billing_anchor_date": 20, + "phases": [ + { + "order_template_id": "E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY", + "ordinal": 0, + "plan_phase_uid": "C66BKH3ASTDYGJJCEZXQQSS7", + "uid": "98d6f53b-40e1-4714-8827-032fd923be25" + } + ], + "plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "price_override_money": { + "amount": 2000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 3 + } + } + }, + "ChangeTiming": { + "type": "string", + "enum": [ + "IMMEDIATE", + "END_OF_BILLING_CYCLE" + ], + "x-enum-elements": [ + { + "name": "IMMEDIATE", + "description": "The action occurs immediately." + }, + { + "name": "END_OF_BILLING_CYCLE", + "description": "The action occurs at the end of the billing cycle." + } + ], + "description": "Supported timings when a pending change, as an action, takes place to a subscription.", + "x-release-status": "BETA" + }, + "Channel": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "The channel's unique ID.", + "readOnly": true + }, + "merchant_id": { + "type": "string", + "description": "The unique ID of the merchant this channel belongs to.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the channel.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number which is incremented each time an update is made to the channel.", + "readOnly": true + }, + "reference": { + "$ref": "#/components/schemas/Reference", + "description": "Represents an entity the channel is associated with.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ChannelStatus", + "description": "Status of the channel.\nSee [Status](#type-status) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the channel was created, in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").\nFor more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates).", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp for when the channel was last updated, in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").\nFor more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates).", + "readOnly": true + } + } + }, + "ChannelStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "" + }, + { + "name": "INACTIVE", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "ChargeRequestAdditionalRecipient": { + "type": "object", + "description": "Represents an additional recipient (other than the merchant) entitled to a portion of the tender.\nSupport is currently limited to USD, CAD and GBP currencies", + "x-release-status": "DEPRECATED", + "required": [ + "location_id", + "description", + "amount_money" + ], + "properties": { + "location_id": { + "type": "string", + "description": "The location ID for a recipient (other than the merchant) receiving a portion of the tender.", + "minLength": 1, + "maxLength": 50 + }, + "description": { + "type": "string", + "description": "The description of the additional recipient.", + "minLength": 1, + "maxLength": 100 + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money distributed to the recipient." + } + } + }, + "Checkout": { + "type": "object", + "description": "Square Checkout lets merchants accept online payments for supported\npayment types using a checkout workflow hosted on squareup.com.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "ID generated by Square Checkout when a new checkout is requested." + }, + "checkout_page_url": { + "type": "string", + "description": "The URL that the buyer's browser should be redirected to after the\ncheckout is completed.", + "nullable": true + }, + "ask_for_shipping_address": { + "type": "boolean", + "description": "If `true`, Square Checkout will collect shipping information on your\nbehalf and store that information with the transaction information in your\nSquare Dashboard.\n\nDefault: `false`.", + "nullable": true + }, + "merchant_support_email": { + "type": "string", + "description": "The email address to display on the Square Checkout confirmation page\nand confirmation email that the buyer can use to contact the merchant.\n\nIf this value is not set, the confirmation page and email will display the\nprimary email address associated with the merchant's Square account.\n\nDefault: none; only exists if explicitly set.", + "nullable": true + }, + "pre_populate_buyer_email": { + "type": "string", + "description": "If provided, the buyer's email is pre-populated on the checkout page\nas an editable text field.\n\nDefault: none; only exists if explicitly set.", + "nullable": true + }, + "pre_populate_shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "If provided, the buyer's shipping info is pre-populated on the\ncheckout page as editable text fields.\n\nDefault: none; only exists if explicitly set.", + "nullable": true + }, + "redirect_url": { + "type": "string", + "description": "The URL to redirect to after checkout is completed with `checkoutId`,\nSquare's `orderId`, `transactionId`, and `referenceId` appended as URL\nparameters. For example, if the provided redirect_url is\n`http://www.example.com/order-complete`, a successful transaction redirects\nthe customer to:\n\n\u003cpre\u003e\u003ccode\u003ehttp://www.example.com/order-complete?checkoutId=xxxxxx\u0026amp;orderId=xxxxxx\u0026amp;referenceId=xxxxxx\u0026amp;transactionId=xxxxxx\u003c/code\u003e\u003c/pre\u003e\n\nIf you do not provide a redirect URL, Square Checkout will display an order\nconfirmation page on your behalf; however Square strongly recommends that\nyou provide a redirect URL so you can verify the transaction results and\nfinalize the order through your existing/normal confirmation workflow.", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/Order", + "description": "Order to be checked out.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the checkout was created, in RFC 3339 format.", + "readOnly": true + }, + "additional_recipients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdditionalRecipient" + }, + "description": "Additional recipients (other than the merchant) receiving a portion of this checkout.\nFor example, fees assessed on the purchase by a third party integration.", + "x-release-status": "DEPRECATED", + "nullable": true + } + } + }, + "CheckoutLocationSettings": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the location that these settings apply to.", + "nullable": true + }, + "customer_notes_enabled": { + "type": "boolean", + "description": "Indicates whether customers are allowed to leave notes at checkout.", + "nullable": true + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CheckoutLocationSettingsPolicy" + }, + "description": "Policy information is displayed at the bottom of the checkout pages.\nYou can set a maximum of two policies.", + "nullable": true + }, + "branding": { + "$ref": "#/components/schemas/CheckoutLocationSettingsBranding", + "description": "The branding settings for this location.", + "nullable": true + }, + "tipping": { + "$ref": "#/components/schemas/CheckoutLocationSettingsTipping", + "description": "The tip settings for this location.", + "nullable": true + }, + "coupons": { + "$ref": "#/components/schemas/CheckoutLocationSettingsCoupons", + "description": "The coupon settings for this location.", + "nullable": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the settings were last updated, in RFC 3339 format.\nExamples for January 25th, 2020 6:25:34pm Pacific Standard Time:\nUTC: 2020-01-26T02:25:34Z\nPacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00", + "readOnly": true + } + } + }, + "CheckoutLocationSettingsBranding": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "header_type": { + "$ref": "#/components/schemas/CheckoutLocationSettingsBrandingHeaderType", + "description": "Show the location logo on the checkout page.\nSee [HeaderType](#type-headertype) for possible values", + "nullable": true + }, + "button_color": { + "type": "string", + "description": "The HTML-supported hex color for the button on the checkout page (for example, \"#FFFFFF\").", + "minLength": 7, + "maxLength": 7, + "nullable": true + }, + "button_shape": { + "$ref": "#/components/schemas/CheckoutLocationSettingsBrandingButtonShape", + "description": "The shape of the button on the checkout page.\nSee [ButtonShape](#type-buttonshape) for possible values", + "nullable": true + } + } + }, + "CheckoutLocationSettingsBrandingButtonShape": { + "type": "string", + "enum": [ + "SQUARED", + "ROUNDED", + "PILL" + ], + "x-enum-elements": [ + { + "name": "SQUARED", + "description": "" + }, + { + "name": "ROUNDED", + "description": "" + }, + { + "name": "PILL", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "CheckoutLocationSettingsBrandingHeaderType": { + "type": "string", + "enum": [ + "BUSINESS_NAME", + "FRAMED_LOGO", + "FULL_WIDTH_LOGO" + ], + "x-enum-elements": [ + { + "name": "BUSINESS_NAME", + "description": "" + }, + { + "name": "FRAMED_LOGO", + "description": "" + }, + { + "name": "FULL_WIDTH_LOGO", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "CheckoutLocationSettingsCoupons": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "enabled": { + "type": "boolean", + "description": "Indicates whether coupons are enabled for this location.", + "nullable": true + } + } + }, + "CheckoutLocationSettingsPolicy": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID to identify the policy when making changes. You must set the UID for policy updates, but it’s optional when setting new policies.", + "nullable": true + }, + "title": { + "type": "string", + "description": "The title of the policy. This is required when setting the description, though you can update it in a different request.", + "maxLength": 50, + "nullable": true + }, + "description": { + "type": "string", + "description": "The description of the policy.", + "maxLength": 4096, + "nullable": true + } + } + }, + "CheckoutLocationSettingsTipping": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "percentages": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "Set three custom percentage amounts that buyers can select at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more.", + "nullable": true + }, + "smart_tipping_enabled": { + "type": "boolean", + "description": "Enables Smart Tip Amounts. If Smart Tip Amounts is enabled, tipping works as follows:\nIf a transaction is less than $10, the available tipping options include No Tip, $1, $2, or $3.\nIf a transaction is $10 or more, the available tipping options include No Tip, 15%, 20%, or 25%. \nYou can set custom percentage amounts with the `percentages` field.", + "nullable": true + }, + "default_percent": { + "type": "integer", + "description": "Set the pre-selected percentage amounts that appear at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more.", + "nullable": true + }, + "smart_tips": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Money" + }, + "description": "Show the Smart Tip Amounts for this location.", + "nullable": true + }, + "default_smart_tip": { + "$ref": "#/components/schemas/Money", + "description": "Set the pre-selected whole amount that appears at checkout when Smart Tip is enabled and the transaction amount is less than $10.", + "nullable": true + } + } + }, + "CheckoutMerchantSettings": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "payment_methods": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethods", + "description": "The set of payment methods accepted for the merchant's account.", + "nullable": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the settings were last updated, in RFC 3339 format.\nExamples for January 25th, 2020 6:25:34pm Pacific Standard Time:\nUTC: 2020-01-26T02:25:34Z\nPacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00", + "readOnly": true + } + } + }, + "CheckoutMerchantSettingsPaymentMethods": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "apple_pay": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsPaymentMethod", + "nullable": true + }, + "google_pay": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsPaymentMethod", + "nullable": true + }, + "cash_app": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsPaymentMethod", + "nullable": true + }, + "afterpay_clearpay": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay", + "nullable": true + } + } + }, + "CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay": { + "type": "object", + "description": "The settings allowed for AfterpayClearpay.", + "x-release-status": "BETA", + "properties": { + "order_eligibility_range": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange", + "description": "Afterpay is shown as an option for order totals falling within the configured range.", + "nullable": true + }, + "item_eligibility_range": { + "$ref": "#/components/schemas/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange", + "description": "Afterpay is shown as an option for item totals falling within the configured range.", + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the payment method is enabled for the account.", + "readOnly": true + } + } + }, + "CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange": { + "type": "object", + "description": "A range of purchase price that qualifies.", + "x-release-status": "BETA", + "required": [ + "min", + "max" + ], + "properties": { + "min": { + "$ref": "#/components/schemas/Money" + }, + "max": { + "$ref": "#/components/schemas/Money" + } + } + }, + "CheckoutMerchantSettingsPaymentMethodsPaymentMethod": { + "type": "object", + "description": "The settings allowed for a payment method.", + "x-release-status": "BETA", + "properties": { + "enabled": { + "type": "boolean", + "description": "Indicates whether the payment method is enabled for the account.", + "nullable": true + } + } + }, + "CheckoutOptions": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "allow_tipping": { + "type": "boolean", + "description": "Indicates whether the payment allows tipping.", + "nullable": true + }, + "custom_fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomField" + }, + "description": "The custom fields requesting information from the buyer.", + "nullable": true + }, + "subscription_plan_id": { + "type": "string", + "description": "The ID of the subscription plan for the buyer to pay and subscribe.\nFor more information, see [Subscription Plan Checkout](https://developer.squareup.com/docs/checkout-api/subscription-plan-checkout).", + "maxLength": 255, + "nullable": true + }, + "redirect_url": { + "type": "string", + "description": "The confirmation page URL to redirect the buyer to after Square processes the payment.", + "maxLength": 2048, + "nullable": true + }, + "merchant_support_email": { + "type": "string", + "description": "The email address that buyers can use to contact the seller.", + "maxLength": 256, + "nullable": true + }, + "ask_for_shipping_address": { + "type": "boolean", + "description": "Indicates whether to include the address fields in the payment form.", + "nullable": true + }, + "accepted_payment_methods": { + "$ref": "#/components/schemas/AcceptedPaymentMethods", + "description": "The methods allowed for buyers during checkout.", + "nullable": true + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money that the developer is taking as a fee for facilitating the payment on behalf of the seller.\n\nThe amount cannot be more than 90% of the total amount of the payment.\n\nThe amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-monetary-amounts).\n\nThe fee currency code must match the currency associated with the seller that is accepting the payment. The application must be from a developer account in the same country and using the same currency code as the seller. For more information about the application fee scenario, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).\n\nTo set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/collect-fees/additional-considerations#permissions).", + "nullable": true + }, + "shipping_fee": { + "$ref": "#/components/schemas/ShippingFee", + "description": "The fee associated with shipping to be applied to the `Order` as a service charge.", + "nullable": true + }, + "enable_coupon": { + "type": "boolean", + "description": "Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing coupon in the payment form.", + "nullable": true + }, + "enable_loyalty": { + "type": "boolean", + "description": "Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem rewards in the payment form, or both.", + "nullable": true + } + } + }, + "CheckoutOptionsPaymentType": { + "type": "string", + "enum": [ + "CARD_PRESENT", + "MANUAL_CARD_ENTRY", + "FELICA_ID", + "FELICA_QUICPAY", + "FELICA_TRANSPORTATION_GROUP", + "FELICA_ALL", + "PAYPAY", + "QR_CODE" + ], + "x-enum-elements": [ + { + "name": "CARD_PRESENT", + "description": "Accept credit card or debit card payments via tap, dip or swipe." + }, + { + "name": "MANUAL_CARD_ENTRY", + "description": "Launches the manual credit or debit card entry screen for the buyer to complete." + }, + { + "name": "FELICA_ID", + "description": "Launches the iD checkout screen for the buyer to complete." + }, + { + "name": "FELICA_QUICPAY", + "description": "Launches the QUICPay checkout screen for the buyer to complete." + }, + { + "name": "FELICA_TRANSPORTATION_GROUP", + "description": "Launches the Transportation Group checkout screen for the buyer to complete." + }, + { + "name": "FELICA_ALL", + "description": "Launches a checkout screen for the buyer on the Square Terminal that\nallows them to select a specific FeliCa brand or select the check balance screen." + }, + { + "name": "PAYPAY", + "description": "Replaced by `QR_CODE`." + }, + { + "name": "QR_CODE", + "description": "Launches Square's QR Code checkout screen for the buyer to complete.\nDisplays a single code that supports all digital wallets connected to the target\nSeller location (e.g. PayPay)" + } + ], + "x-release-status": "PUBLIC" + }, + "ClearpayDetails": { + "type": "object", + "description": "Additional details about Clearpay payments.", + "x-release-status": "PUBLIC", + "properties": { + "email_address": { + "type": "string", + "description": "Email address on the buyer's Clearpay account.", + "maxLength": 255, + "nullable": true + } + } + }, + "CloneOrderRequest": { + "type": "object", + "description": "Defines the fields that are included in requests to the\n[CloneOrder](api-endpoint:Orders-CloneOrder) endpoint.", + "x-release-status": "BETA", + "required": [ + "order_id" + ], + "properties": { + "order_id": { + "type": "string", + "description": "The ID of the order to clone." + }, + "version": { + "type": "integer", + "description": "An optional order version for concurrency protection.\n\nIf a version is provided, it must match the latest stored version of the order to clone.\nIf a version is not provided, the API clones the latest version." + }, + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this clone request.\n\nIf you are unsure whether a particular order was cloned successfully,\nyou can reattempt the call with the same idempotency key without\nworrying about creating duplicate cloned orders.\nThe originally cloned order is returned.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "nullable": true + } + }, + "example": { + "idempotency_key": "UNIQUE_STRING", + "order_id": "ZAISEM52YcpmcWAzERDOyiWS123", + "version": 3 + } + }, + "CloneOrderResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CloneOrder](api-endpoint:Orders-CloneOrder) endpoint.", + "x-release-status": "BETA", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The cloned order." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "order": { + "created_at": "2020-01-17T20:47:53.293Z", + "discounts": [ + { + "applied_money": { + "amount": 30, + "currency": "USD" + }, + "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", + "name": "Membership Discount", + "percentage": "0.5", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "membership-discount" + }, + { + "applied_money": { + "amount": 303, + "currency": "USD" + }, + "name": "Labor Day Sale", + "percentage": "5", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "labor-day-sale" + }, + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "name": "Sale - $1.00 off", + "scope": "LINE_ITEM", + "type": "FIXED_AMOUNT", + "uid": "one-dollar-off" + } + ], + "id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "line_items": [ + { + "applied_discounts": [ + { + "applied_money": { + "amount": 8, + "currency": "USD" + }, + "discount_uid": "membership-discount", + "uid": "jWdgP1TpHPFBuVrz81mXVC" + }, + { + "applied_money": { + "amount": 79, + "currency": "USD" + }, + "discount_uid": "labor-day-sale", + "uid": "jnZOjjVY57eRcQAVgEwFuC" + } + ], + "applied_taxes": [ + { + "applied_money": { + "amount": 136, + "currency": "USD" + }, + "tax_uid": "state-sales-tax", + "uid": "aKG87ArnDpvMLSZJHxWUl" + } + ], + "base_price_money": { + "amount": 1599, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 1599, + "currency": "USD" + }, + "name": "New York Strip Steak", + "quantity": "1", + "total_discount_money": { + "amount": 87, + "currency": "USD" + }, + "total_money": { + "amount": 1648, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 136, + "currency": "USD" + }, + "uid": "8uSwfzvUImn3IRrvciqlXC", + "variation_total_price_money": { + "amount": 1599, + "currency": "USD" + } + }, + { + "applied_discounts": [ + { + "applied_money": { + "amount": 22, + "currency": "USD" + }, + "discount_uid": "membership-discount", + "uid": "nUXvdsIItfKko0dbYtY58C" + }, + { + "applied_money": { + "amount": 224, + "currency": "USD" + }, + "discount_uid": "labor-day-sale", + "uid": "qSdkOOOernlVQqsJ94SPjB" + }, + { + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "discount_uid": "one-dollar-off", + "uid": "y7bVl4njrWAnfDwmz19izB" + } + ], + "applied_taxes": [ + { + "applied_money": { + "amount": 374, + "currency": "USD" + }, + "tax_uid": "state-sales-tax", + "uid": "v1dAgrfUVUPTnVTf9sRPz" + } + ], + "base_price_money": { + "amount": 2200, + "currency": "USD" + }, + "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", + "gross_sales_money": { + "amount": 4500, + "currency": "USD" + }, + "modifiers": [ + { + "base_price_money": { + "amount": 50, + "currency": "USD" + }, + "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ", + "name": "Well", + "total_price_money": { + "amount": 100, + "currency": "USD" + }, + "uid": "Lo3qMMckDluu9Qsb58d4CC" + } + ], + "name": "New York Steak", + "quantity": "2", + "total_discount_money": { + "amount": 346, + "currency": "USD" + }, + "total_money": { + "amount": 4528, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 374, + "currency": "USD" + }, + "uid": "v8ZuEXpOJpb0bazLuvrLDB", + "variation_name": "Larger", + "variation_total_price_money": { + "amount": 4400, + "currency": "USD" + } + } + ], + "location_id": "057P5VYJ4A5X1", + "net_amounts": { + "discount_money": { + "amount": 433, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 510, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 6176, + "currency": "USD" + } + }, + "reference_id": "my-order-001", + "source": { + "name": "My App" + }, + "state": "DRAFT", + "taxes": [ + { + "applied_money": { + "amount": 510, + "currency": "USD" + }, + "name": "State Sales Tax", + "percentage": "9", + "scope": "ORDER", + "type": "ADDITIVE", + "uid": "state-sales-tax" + } + ], + "total_discount_money": { + "amount": 433, + "currency": "USD" + }, + "total_money": { + "amount": 6176, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 510, + "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2020-01-17T20:47:53.293Z", + "version": 1 + } + } + }, + "CollectedData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "input_text": { + "type": "string", + "description": "The buyer's input text.", + "readOnly": true + } + } + }, + "CompletePaymentRequest": { + "type": "object", + "description": "Describes a request to complete (capture) a payment using\n[CompletePayment](api-endpoint:Payments-CompletePayment).\n\nBy default, payments are set to `autocomplete` immediately after they are created.\nTo complete payments manually, set `autocomplete` to `false`.", + "x-release-status": "PUBLIC", + "properties": { + "version_token": { + "type": "string", + "description": "Used for optimistic concurrency. This opaque token identifies the current `Payment`\nversion that the caller expects. If the server has a different version of the Payment,\nthe update fails and a response with a VERSION_MISMATCH error is returned.", + "x-release-status": "BETA", + "nullable": true + } + }, + "example": {} + }, + "CompletePaymentResponse": { + "type": "object", + "description": "Defines the response returned by[CompletePayment](api-endpoint:Payments-CompletePayment).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The successfully completed payment." + } + }, + "example": { + "payment": { + "amount_money": { + "amount": 555, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", + "square_product": "VIRTUAL_TERMINAL" + }, + "approved_money": { + "amount": 555, + "currency": "USD" + }, + "card_details": { + "auth_result_code": "2Nkw7q", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T19:34:33.680Z", + "captured_at": "2021-10-13T19:34:34.340Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "KEYED", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "CAPTURED" + }, + "created_at": "2021-10-13T19:34:33.524Z", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T19:34:33.524Z", + "employee_id": "TMoK_ogh6rH1o4dV", + "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "location_id": "L88917AVBK2S5", + "note": "Test Note", + "order_id": "d7eKah653Z579f3gVtjlxpSlmUcZY", + "processing_fee": [ + { + "amount_money": { + "amount": 34, + "currency": "USD" + }, + "effective_at": "2021-10-13T21:34:35.000Z", + "type": "INITIAL" + } + ], + "receipt_number": "bP9m", + "receipt_url": "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "source_type": "CARD", + "status": "COMPLETED", + "team_member_id": "TMoK_ogh6rH1o4dV", + "total_money": { + "amount": 555, + "currency": "USD" + }, + "updated_at": "2021-10-13T19:34:34.339Z", + "version_token": "56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o" + } + } + }, + "Component": { + "type": "object", + "description": "The wrapper object for the component entries of a given component type.", + "x-release-status": "BETA", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/ComponentComponentType", + "description": "The type of this component. Each component type has expected properties expressed\nin a structured format within its corresponding `*_details` field.\nSee [ComponentType](#type-componenttype) for possible values" + }, + "application_details": { + "$ref": "#/components/schemas/DeviceComponentDetailsApplicationDetails", + "description": "Structured data for an `Application`, set for Components of type `APPLICATION`.", + "nullable": true + }, + "card_reader_details": { + "$ref": "#/components/schemas/DeviceComponentDetailsCardReaderDetails", + "description": "Structured data for a `CardReader`, set for Components of type `CARD_READER`.", + "nullable": true + }, + "battery_details": { + "$ref": "#/components/schemas/DeviceComponentDetailsBatteryDetails", + "description": "Structured data for a `Battery`, set for Components of type `BATTERY`.", + "nullable": true + }, + "wifi_details": { + "$ref": "#/components/schemas/DeviceComponentDetailsWiFiDetails", + "description": "Structured data for a `WiFi` interface, set for Components of type `WIFI`.", + "nullable": true + }, + "ethernet_details": { + "$ref": "#/components/schemas/DeviceComponentDetailsEthernetDetails", + "description": "Structured data for an `Ethernet` interface, set for Components of type `ETHERNET`.", + "nullable": true + } + } + }, + "ComponentComponentType": { + "type": "string", + "enum": [ + "APPLICATION", + "CARD_READER", + "BATTERY", + "WIFI", + "ETHERNET", + "PRINTER" + ], + "x-enum-elements": [ + { + "name": "APPLICATION", + "description": "" + }, + { + "name": "CARD_READER", + "description": "" + }, + { + "name": "BATTERY", + "description": "" + }, + { + "name": "WIFI", + "description": "" + }, + { + "name": "ETHERNET", + "description": "" + }, + { + "name": "PRINTER", + "description": "" + } + ], + "description": "An enum for ComponentType.", + "x-release-status": "BETA" + }, + "ConfirmationDecision": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "has_agreed": { + "type": "boolean", + "description": "The buyer's decision to the displayed terms.", + "readOnly": true + } + } + }, + "ConfirmationOptions": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "title", + "body", + "agree_button_text" + ], + "properties": { + "title": { + "type": "string", + "description": "The title text to display in the confirmation screen flow on the Terminal.", + "minLength": 1, + "maxLength": 250 + }, + "body": { + "type": "string", + "description": "The agreement details to display in the confirmation flow on the Terminal.", + "minLength": 1, + "maxLength": 10000 + }, + "agree_button_text": { + "type": "string", + "description": "The button text to display indicating the customer agrees to the displayed terms.", + "minLength": 1, + "maxLength": 250 + }, + "disagree_button_text": { + "type": "string", + "description": "The button text to display indicating the customer does not agree to the displayed terms.", + "minLength": 1, + "maxLength": 250, + "nullable": true + }, + "decision": { + "$ref": "#/components/schemas/ConfirmationDecision", + "description": "The result of the buyer’s actions when presented with the confirmation screen.", + "readOnly": true + } + } + }, + "Coordinates": { + "type": "object", + "description": "Latitude and longitude coordinates.", + "x-release-status": "PUBLIC", + "properties": { + "latitude": { + "type": "number", + "description": "The latitude of the coordinate expressed in degrees.", + "nullable": true + }, + "longitude": { + "type": "number", + "description": "The longitude of the coordinate expressed in degrees.", + "nullable": true + } + } + }, + "Country": { + "type": "string", + "enum": [ + "ZZ", + "AD", + "AE", + "AF", + "AG", + "AI", + "AL", + "AM", + "AO", + "AQ", + "AR", + "AS", + "AT", + "AU", + "AW", + "AX", + "AZ", + "BA", + "BB", + "BD", + "BE", + "BF", + "BG", + "BH", + "BI", + "BJ", + "BL", + "BM", + "BN", + "BO", + "BQ", + "BR", + "BS", + "BT", + "BV", + "BW", + "BY", + "BZ", + "CA", + "CC", + "CD", + "CF", + "CG", + "CH", + "CI", + "CK", + "CL", + "CM", + "CN", + "CO", + "CR", + "CU", + "CV", + "CW", + "CX", + "CY", + "CZ", + "DE", + "DJ", + "DK", + "DM", + "DO", + "DZ", + "EC", + "EE", + "EG", + "EH", + "ER", + "ES", + "ET", + "FI", + "FJ", + "FK", + "FM", + "FO", + "FR", + "GA", + "GB", + "GD", + "GE", + "GF", + "GG", + "GH", + "GI", + "GL", + "GM", + "GN", + "GP", + "GQ", + "GR", + "GS", + "GT", + "GU", + "GW", + "GY", + "HK", + "HM", + "HN", + "HR", + "HT", + "HU", + "ID", + "IE", + "IL", + "IM", + "IN", + "IO", + "IQ", + "IR", + "IS", + "IT", + "JE", + "JM", + "JO", + "JP", + "KE", + "KG", + "KH", + "KI", + "KM", + "KN", + "KP", + "KR", + "KW", + "KY", + "KZ", + "LA", + "LB", + "LC", + "LI", + "LK", + "LR", + "LS", + "LT", + "LU", + "LV", + "LY", + "MA", + "MC", + "MD", + "ME", + "MF", + "MG", + "MH", + "MK", + "ML", + "MM", + "MN", + "MO", + "MP", + "MQ", + "MR", + "MS", + "MT", + "MU", + "MV", + "MW", + "MX", + "MY", + "MZ", + "NA", + "NC", + "NE", + "NF", + "NG", + "NI", + "NL", + "NO", + "NP", + "NR", + "NU", + "NZ", + "OM", + "PA", + "PE", + "PF", + "PG", + "PH", + "PK", + "PL", + "PM", + "PN", + "PR", + "PS", + "PT", + "PW", + "PY", + "QA", + "RE", + "RO", + "RS", + "RU", + "RW", + "SA", + "SB", + "SC", + "SD", + "SE", + "SG", + "SH", + "SI", + "SJ", + "SK", + "SL", + "SM", + "SN", + "SO", + "SR", + "SS", + "ST", + "SV", + "SX", + "SY", + "SZ", + "TC", + "TD", + "TF", + "TG", + "TH", + "TJ", + "TK", + "TL", + "TM", + "TN", + "TO", + "TR", + "TT", + "TV", + "TW", + "TZ", + "UA", + "UG", + "UM", + "US", + "UY", + "UZ", + "VA", + "VC", + "VE", + "VG", + "VI", + "VN", + "VU", + "WF", + "WS", + "YE", + "YT", + "ZA", + "ZM", + "ZW" + ], + "x-enum-elements": [ + { + "name": "ZZ", + "description": "Unknown" + }, + { + "name": "AD", + "description": "Andorra" + }, + { + "name": "AE", + "description": "United Arab Emirates" + }, + { + "name": "AF", + "description": "Afghanistan" + }, + { + "name": "AG", + "description": "Antigua and Barbuda" + }, + { + "name": "AI", + "description": "Anguilla" + }, + { + "name": "AL", + "description": "Albania" + }, + { + "name": "AM", + "description": "Armenia" + }, + { + "name": "AO", + "description": "Angola" + }, + { + "name": "AQ", + "description": "Antartica" + }, + { + "name": "AR", + "description": "Argentina" + }, + { + "name": "AS", + "description": "American Samoa" + }, + { + "name": "AT", + "description": "Austria" + }, + { + "name": "AU", + "description": "Australia" + }, + { + "name": "AW", + "description": "Aruba" + }, + { + "name": "AX", + "description": "Åland Islands" + }, + { + "name": "AZ", + "description": "Azerbaijan" + }, + { + "name": "BA", + "description": "Bosnia and Herzegovina" + }, + { + "name": "BB", + "description": "Barbados" + }, + { + "name": "BD", + "description": "Bangladesh" + }, + { + "name": "BE", + "description": "Belgium" + }, + { + "name": "BF", + "description": "Burkina Faso" + }, + { + "name": "BG", + "description": "Bulgaria" + }, + { + "name": "BH", + "description": "Bahrain" + }, + { + "name": "BI", + "description": "Burundi" + }, + { + "name": "BJ", + "description": "Benin" + }, + { + "name": "BL", + "description": "Saint Barthélemy" + }, + { + "name": "BM", + "description": "Bermuda" + }, + { + "name": "BN", + "description": "Brunei" + }, + { + "name": "BO", + "description": "Bolivia" + }, + { + "name": "BQ", + "description": "Bonaire" + }, + { + "name": "BR", + "description": "Brazil" + }, + { + "name": "BS", + "description": "Bahamas" + }, + { + "name": "BT", + "description": "Bhutan" + }, + { + "name": "BV", + "description": "Bouvet Island" + }, + { + "name": "BW", + "description": "Botswana" + }, + { + "name": "BY", + "description": "Belarus" + }, + { + "name": "BZ", + "description": "Belize" + }, + { + "name": "CA", + "description": "Canada" + }, + { + "name": "CC", + "description": "Cocos Islands" + }, + { + "name": "CD", + "description": "Democratic Republic of the Congo" + }, + { + "name": "CF", + "description": "Central African Republic" + }, + { + "name": "CG", + "description": "Congo" + }, + { + "name": "CH", + "description": "Switzerland" + }, + { + "name": "CI", + "description": "Ivory Coast" + }, + { + "name": "CK", + "description": "Cook Islands" + }, + { + "name": "CL", + "description": "Chile" + }, + { + "name": "CM", + "description": "Cameroon" + }, + { + "name": "CN", + "description": "China" + }, + { + "name": "CO", + "description": "Colombia" + }, + { + "name": "CR", + "description": "Costa Rica" + }, + { + "name": "CU", + "description": "Cuba" + }, + { + "name": "CV", + "description": "Cabo Verde" + }, + { + "name": "CW", + "description": "Curaçao" + }, + { + "name": "CX", + "description": "Christmas Island" + }, + { + "name": "CY", + "description": "Cyprus" + }, + { + "name": "CZ", + "description": "Czechia" + }, + { + "name": "DE", + "description": "Germany" + }, + { + "name": "DJ", + "description": "Djibouti" + }, + { + "name": "DK", + "description": "Denmark" + }, + { + "name": "DM", + "description": "Dominica" + }, + { + "name": "DO", + "description": "Dominican Republic" + }, + { + "name": "DZ", + "description": "Algeria" + }, + { + "name": "EC", + "description": "Ecuador" + }, + { + "name": "EE", + "description": "Estonia" + }, + { + "name": "EG", + "description": "Egypt" + }, + { + "name": "EH", + "description": "Western Sahara" + }, + { + "name": "ER", + "description": "Eritrea" + }, + { + "name": "ES", + "description": "Spain" + }, + { + "name": "ET", + "description": "Ethiopia" + }, + { + "name": "FI", + "description": "Finland" + }, + { + "name": "FJ", + "description": "Fiji" + }, + { + "name": "FK", + "description": "Falkland Islands" + }, + { + "name": "FM", + "description": "Federated States of Micronesia" + }, + { + "name": "FO", + "description": "Faroe Islands" + }, + { + "name": "FR", + "description": "France" + }, + { + "name": "GA", + "description": "Gabon" + }, + { + "name": "GB", + "description": "United Kingdom" + }, + { + "name": "GD", + "description": "Grenada" + }, + { + "name": "GE", + "description": "Georgia" + }, + { + "name": "GF", + "description": "French Guiana" + }, + { + "name": "GG", + "description": "Guernsey" + }, + { + "name": "GH", + "description": "Ghana" + }, + { + "name": "GI", + "description": "Gibraltar" + }, + { + "name": "GL", + "description": "Greenland" + }, + { + "name": "GM", + "description": "Gambia" + }, + { + "name": "GN", + "description": "Guinea" + }, + { + "name": "GP", + "description": "Guadeloupe" + }, + { + "name": "GQ", + "description": "Equatorial Guinea" + }, + { + "name": "GR", + "description": "Greece" + }, + { + "name": "GS", + "description": "South Georgia and the South Sandwich Islands" + }, + { + "name": "GT", + "description": "Guatemala" + }, + { + "name": "GU", + "description": "Guam" + }, + { + "name": "GW", + "description": "Guinea-Bissau" + }, + { + "name": "GY", + "description": "Guyana" + }, + { + "name": "HK", + "description": "Hong Kong" + }, + { + "name": "HM", + "description": "Heard Island and McDonald Islands" + }, + { + "name": "HN", + "description": "Honduras" + }, + { + "name": "HR", + "description": "Croatia" + }, + { + "name": "HT", + "description": "Haiti" + }, + { + "name": "HU", + "description": "Hungary" + }, + { + "name": "ID", + "description": "Indonesia" + }, + { + "name": "IE", + "description": "Ireland" + }, + { + "name": "IL", + "description": "Israel" + }, + { + "name": "IM", + "description": "Isle of Man" + }, + { + "name": "IN", + "description": "India" + }, + { + "name": "IO", + "description": "British Indian Ocean Territory" + }, + { + "name": "IQ", + "description": "Iraq" + }, + { + "name": "IR", + "description": "Iran" + }, + { + "name": "IS", + "description": "Iceland" + }, + { + "name": "IT", + "description": "Italy" + }, + { + "name": "JE", + "description": "Jersey" + }, + { + "name": "JM", + "description": "Jamaica" + }, + { + "name": "JO", + "description": "Jordan" + }, + { + "name": "JP", + "description": "Japan" + }, + { + "name": "KE", + "description": "Kenya" + }, + { + "name": "KG", + "description": "Kyrgyzstan" + }, + { + "name": "KH", + "description": "Cambodia" + }, + { + "name": "KI", + "description": "Kiribati" + }, + { + "name": "KM", + "description": "Comoros" + }, + { + "name": "KN", + "description": "Saint Kitts and Nevis" + }, + { + "name": "KP", + "description": "Democratic People's Republic of Korea" + }, + { + "name": "KR", + "description": "Republic of Korea" + }, + { + "name": "KW", + "description": "Kuwait" + }, + { + "name": "KY", + "description": "Cayman Islands" + }, + { + "name": "KZ", + "description": "Kazakhstan" + }, + { + "name": "LA", + "description": "Lao People's Democratic Republic" + }, + { + "name": "LB", + "description": "Lebanon" + }, + { + "name": "LC", + "description": "Saint Lucia" + }, + { + "name": "LI", + "description": "Liechtenstein" + }, + { + "name": "LK", + "description": "Sri Lanka" + }, + { + "name": "LR", + "description": "Liberia" + }, + { + "name": "LS", + "description": "Lesotho" + }, + { + "name": "LT", + "description": "Lithuania" + }, + { + "name": "LU", + "description": "Luxembourg" + }, + { + "name": "LV", + "description": "Latvia" + }, + { + "name": "LY", + "description": "Libya" + }, + { + "name": "MA", + "description": "Morocco" + }, + { + "name": "MC", + "description": "Monaco" + }, + { + "name": "MD", + "description": "Moldova" + }, + { + "name": "ME", + "description": "Montenegro" + }, + { + "name": "MF", + "description": "Saint Martin" + }, + { + "name": "MG", + "description": "Madagascar" + }, + { + "name": "MH", + "description": "Marshall Islands" + }, + { + "name": "MK", + "description": "North Macedonia" + }, + { + "name": "ML", + "description": "Mali" + }, + { + "name": "MM", + "description": "Myanmar" + }, + { + "name": "MN", + "description": "Mongolia" + }, + { + "name": "MO", + "description": "Macao" + }, + { + "name": "MP", + "description": "Northern Mariana Islands" + }, + { + "name": "MQ", + "description": "Martinique" + }, + { + "name": "MR", + "description": "Mauritania" + }, + { + "name": "MS", + "description": "Montserrat" + }, + { + "name": "MT", + "description": "Malta" + }, + { + "name": "MU", + "description": "Mauritius" + }, + { + "name": "MV", + "description": "Maldives" + }, + { + "name": "MW", + "description": "Malawi" + }, + { + "name": "MX", + "description": "Mexico" + }, + { + "name": "MY", + "description": "Malaysia" + }, + { + "name": "MZ", + "description": "Mozambique" + }, + { + "name": "NA", + "description": "Namibia" + }, + { + "name": "NC", + "description": "New Caledonia" + }, + { + "name": "NE", + "description": "Niger" + }, + { + "name": "NF", + "description": "Norfolk Island" + }, + { + "name": "NG", + "description": "Nigeria" + }, + { + "name": "NI", + "description": "Nicaragua" + }, + { + "name": "NL", + "description": "Netherlands" + }, + { + "name": "NO", + "description": "Norway" + }, + { + "name": "NP", + "description": "Nepal" + }, + { + "name": "NR", + "description": "Nauru" + }, + { + "name": "NU", + "description": "Niue" + }, + { + "name": "NZ", + "description": "New Zealand" + }, + { + "name": "OM", + "description": "Oman" + }, + { + "name": "PA", + "description": "Panama" + }, + { + "name": "PE", + "description": "Peru" + }, + { + "name": "PF", + "description": "French Polynesia" + }, + { + "name": "PG", + "description": "Papua New Guinea" + }, + { + "name": "PH", + "description": "Philippines" + }, + { + "name": "PK", + "description": "Pakistan" + }, + { + "name": "PL", + "description": "Poland" + }, + { + "name": "PM", + "description": "Saint Pierre and Miquelon" + }, + { + "name": "PN", + "description": "Pitcairn" + }, + { + "name": "PR", + "description": "Puerto Rico" + }, + { + "name": "PS", + "description": "Palestine" + }, + { + "name": "PT", + "description": "Portugal" + }, + { + "name": "PW", + "description": "Palau" + }, + { + "name": "PY", + "description": "Paraguay" + }, + { + "name": "QA", + "description": "Qatar" + }, + { + "name": "RE", + "description": "Réunion" + }, + { + "name": "RO", + "description": "Romania" + }, + { + "name": "RS", + "description": "Serbia" + }, + { + "name": "RU", + "description": "Russia" + }, + { + "name": "RW", + "description": "Rwanda" + }, + { + "name": "SA", + "description": "Saudi Arabia" + }, + { + "name": "SB", + "description": "Solomon Islands" + }, + { + "name": "SC", + "description": "Seychelles" + }, + { + "name": "SD", + "description": "Sudan" + }, + { + "name": "SE", + "description": "Sweden" + }, + { + "name": "SG", + "description": "Singapore" + }, + { + "name": "SH", + "description": "Saint Helena, Ascension and Tristan da Cunha" + }, + { + "name": "SI", + "description": "Slovenia" + }, + { + "name": "SJ", + "description": "Svalbard and Jan Mayen" + }, + { + "name": "SK", + "description": "Slovakia" + }, + { + "name": "SL", + "description": "Sierra Leone" + }, + { + "name": "SM", + "description": "San Marino" + }, + { + "name": "SN", + "description": "Senegal" + }, + { + "name": "SO", + "description": "Somalia" + }, + { + "name": "SR", + "description": "Suriname" + }, + { + "name": "SS", + "description": "South Sudan" + }, + { + "name": "ST", + "description": "Sao Tome and Principe" + }, + { + "name": "SV", + "description": "El Salvador" + }, + { + "name": "SX", + "description": "Sint Maarten" + }, + { + "name": "SY", + "description": "Syrian Arab Republic" + }, + { + "name": "SZ", + "description": "Eswatini" + }, + { + "name": "TC", + "description": "Turks and Caicos Islands" + }, + { + "name": "TD", + "description": "Chad" + }, + { + "name": "TF", + "description": "French Southern Territories" + }, + { + "name": "TG", + "description": "Togo" + }, + { + "name": "TH", + "description": "Thailand" + }, + { + "name": "TJ", + "description": "Tajikistan" + }, + { + "name": "TK", + "description": "Tokelau" + }, + { + "name": "TL", + "description": "Timor-Leste" + }, + { + "name": "TM", + "description": "Turkmenistan" + }, + { + "name": "TN", + "description": "Tunisia" + }, + { + "name": "TO", + "description": "Tonga" + }, + { + "name": "TR", + "description": "Turkey" + }, + { + "name": "TT", + "description": "Trinidad and Tobago" + }, + { + "name": "TV", + "description": "Tuvalu" + }, + { + "name": "TW", + "description": "Taiwan" + }, + { + "name": "TZ", + "description": "Tanzania" + }, + { + "name": "UA", + "description": "Ukraine" + }, + { + "name": "UG", + "description": "Uganda" + }, + { + "name": "UM", + "description": "United States Minor Outlying Islands" + }, + { + "name": "US", + "description": "United States of America" + }, + { + "name": "UY", + "description": "Uruguay" + }, + { + "name": "UZ", + "description": "Uzbekistan" + }, + { + "name": "VA", + "description": "Vatican City" + }, + { + "name": "VC", + "description": "Saint Vincent and the Grenadines" + }, + { + "name": "VE", + "description": "Venezuela" + }, + { + "name": "VG", + "description": "British Virgin Islands" + }, + { + "name": "VI", + "description": "U.S. Virgin Islands" + }, + { + "name": "VN", + "description": "Vietnam" + }, + { + "name": "VU", + "description": "Vanuatu" + }, + { + "name": "WF", + "description": "Wallis and Futuna" + }, + { + "name": "WS", + "description": "Samoa" + }, + { + "name": "YE", + "description": "Yemen" + }, + { + "name": "YT", + "description": "Mayotte" + }, + { + "name": "ZA", + "description": "South Africa" + }, + { + "name": "ZM", + "description": "Zambia" + }, + { + "name": "ZW", + "description": "Zimbabwe" + } + ], + "description": "Indicates the country associated with another entity, such as a business.\nValues are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm).", + "x-release-status": "PUBLIC" + }, + "CreateBookingCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents a [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) request.", + "x-release-status": "PUBLIC", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition to create, with the following fields:\n\n- `key`\n\n- `name`. If provided, `name` must be unique (case-sensitive) across all visible booking-related custom attribute\ndefinitions for the seller.\n\n- `description`\n\n- `visibility`. Note that all custom attributes are visible in exported booking data, including those set to\n`VISIBILITY_HIDDEN`.\n\n- `schema`. With the exception of the `Selection` data type, the `schema` is specified as a\nsimple URL to the JSON schema definition hosted on the Square CDN. For more information, see\n[Specifying the schema](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attribute-definitions#specify-schema)." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45 + } + } + }, + "CreateBookingCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The newly created custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-11-16T15:27:30Z", + "description": "The favorite shampoo of the customer.", + "key": "favoriteShampoo", + "name": "Favorite Shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-16T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + }, + "errors": [] + } + }, + "CreateBookingRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "booking" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key to make this request an idempotent operation.", + "maxLength": 255 + }, + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The details of the booking to be created." + } + } + }, + "CreateBookingResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The booking that was created." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "booking": { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "created_at": "2020-10-28T15:47:41Z", + "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + "customer_note": "", + "id": "zkras0xv0xwswx", + "location_id": "LEQHH0YY8B42M", + "seller_note": "", + "start_at": "2020-11-26T13:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-10-28T15:47:41Z", + "version": 0 + }, + "errors": [] + } + }, + "CreateBreakTypeRequest": { + "type": "object", + "description": "A request to create a new `BreakType`.", + "x-release-status": "PUBLIC", + "required": [ + "break_type" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string value to ensure the idempotency of the operation.", + "maxLength": 128 + }, + "break_type": { + "$ref": "#/components/schemas/BreakType", + "description": "The `BreakType` to be created." + } + }, + "example": { + "break_type": { + "break_name": "Lunch Break", + "expected_duration": "PT30M", + "is_paid": true, + "location_id": "CGJN03P1D08GF" + }, + "idempotency_key": "PAD3NG5KSN2GL" + } + }, + "CreateBreakTypeResponse": { + "type": "object", + "description": "The response to the request to create a `BreakType`. The response contains\nthe created `BreakType` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "break_type": { + "$ref": "#/components/schemas/BreakType", + "description": "The `BreakType` that was created by the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "break_type": { + "break_name": "Lunch Break", + "created_at": "2019-02-26T22:42:54Z", + "expected_duration": "PT30M", + "id": "49SSVDJG76WF3", + "is_paid": true, + "location_id": "CGJN03P1D08GF", + "updated_at": "2019-02-26T22:42:54Z", + "version": 1 + } + } + }, + "CreateCardRequest": { + "type": "object", + "description": "Creates a card from the source (payment token or payment id). Accessible via\nHTTP requests at POST https://connect.squareup.com/v2/cards", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "source_id", + "card" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this CreateCard request. Keys can be\nany valid string and must be unique for every request.\n\nMax: 45 characters\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1 + }, + "source_id": { + "type": "string", + "description": "The ID of the source which represents the card information to be stored. This can be a card nonce or a payment id.", + "minLength": 1, + "maxLength": 16384 + }, + "verification_token": { + "type": "string", + "description": "An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).\nVerification tokens encapsulate customer device information and 3-D Secure\nchallenge results to indicate that Square has verified the buyer identity.\n\nSee the [SCA Overview](https://developer.squareup.com/docs/sca-overview)." + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "Payment details associated with the card to be stored." + } + }, + "example": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "reference_id": "user-id-1" + }, + "idempotency_key": "4935a656-a929-4792-b97c-8848be85c27c", + "source_id": "cnon:uIbfJXhXETSP197M3GB" + } + }, + "CreateCardResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CreateCard](api-endpoint:Cards-CreateCard) endpoint.\n\nNote: if there are errors processing the request, the card field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors resulting from the request." + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The card created by the request." + } + }, + "example": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + } + } + }, + "CreateCatalogImageRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "image" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this CreateCatalogImage request.\nKeys can be any valid string but must be unique for every CreateCatalogImage request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 128 + }, + "object_id": { + "type": "string", + "description": "Unique ID of the `CatalogObject` to attach this `CatalogImage` object to. Leave this\nfield empty to create unattached images, for example if you are building an integration\nwhere an image can be attached to catalog items at a later time." + }, + "image": { + "$ref": "#/components/schemas/CatalogObject", + "description": "The new `CatalogObject` of the `IMAGE` type, namely, a `CatalogImage` object, to encapsulate the specified image file." + }, + "is_primary": { + "type": "boolean", + "description": "If this is set to `true`, the image created will be the primary, or first image of the object referenced by `object_id`.\nIf the `CatalogObject` already has a primary `CatalogImage`, setting this field to `true` will replace the primary image.\nIf this is set to `false` and you use the Square API version 2021-12-15 or later, the image id will be appended to the list of `image_ids` on the object.\n\nWith Square API version 2021-12-15 or later, the default value is `false`. Otherwise, the effective default value is `true`.", + "x-release-status": "BETA" + } + }, + "example": { + "idempotency_key": "528dea59-7bfb-43c1-bd48-4a6bba7dd61f86", + "image": { + "id": "#TEMP_ID", + "image_data": { + "caption": "A picture of a cup of coffee" + }, + "type": "IMAGE" + }, + "object_id": "ND6EA5AAJEO5WL3JNNIAQA32" + } + }, + "CreateCatalogImageResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "image": { + "$ref": "#/components/schemas/CatalogObject", + "description": "The newly created `CatalogImage` including a Square-generated\nURL for the encapsulated image file." + } + }, + "example": { + "image": { + "id": "KQLFFHA6K6J3YQAQAWDQAL57", + "image_data": { + "caption": "A picture of a cup of coffee", + "url": "https://..." + }, + "type": "IMAGE" + } + } + }, + "CreateCheckoutRequest": { + "type": "object", + "description": "Defines the parameters that can be included in the body of\na request to the `CreateCheckout` endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "order" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this checkout among others you have created. It can be\nany valid string but must be unique for every order sent to Square Checkout for a given location ID.\n\nThe idempotency key is used to avoid processing the same order more than once. If you are \nunsure whether a particular checkout was created successfully, you can attempt it again with\nthe same idempotency key and all the same other parameters without worrying about creating duplicates.\n\nYou should use a random number/string generator native to the language\nyou are working in to generate strings for your idempotency keys.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1, + "maxLength": 192 + }, + "order": { + "$ref": "#/components/schemas/CreateOrderRequest", + "description": "The order including line items to be checked out." + }, + "ask_for_shipping_address": { + "type": "boolean", + "description": "If `true`, Square Checkout collects shipping information on your behalf and stores \nthat information with the transaction information in the Square Seller Dashboard.\n\nDefault: `false`." + }, + "merchant_support_email": { + "type": "string", + "description": "The email address to display on the Square Checkout confirmation page\nand confirmation email that the buyer can use to contact the seller.\n\nIf this value is not set, the confirmation page and email display the\nprimary email address associated with the seller's Square account.\n\nDefault: none; only exists if explicitly set.", + "maxLength": 254 + }, + "pre_populate_buyer_email": { + "type": "string", + "description": "If provided, the buyer's email is prepopulated on the checkout page\nas an editable text field.\n\nDefault: none; only exists if explicitly set.", + "maxLength": 254 + }, + "pre_populate_shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "If provided, the buyer's shipping information is prepopulated on the\ncheckout page as editable text fields.\n\nDefault: none; only exists if explicitly set." + }, + "redirect_url": { + "type": "string", + "description": "The URL to redirect to after the checkout is completed with `checkoutId`,\n`transactionId`, and `referenceId` appended as URL parameters. For example,\nif the provided redirect URL is `http://www.example.com/order-complete`, a\nsuccessful transaction redirects the customer to:\n\n`http://www.example.com/order-complete?checkoutId=xxxxxx\u0026amp;referenceId=xxxxxx\u0026amp;transactionId=xxxxxx`\n\nIf you do not provide a redirect URL, Square Checkout displays an order\nconfirmation page on your behalf; however, it is strongly recommended that\nyou provide a redirect URL so you can verify the transaction results and\nfinalize the order through your existing/normal confirmation workflow.\n\nDefault: none; only exists if explicitly set.", + "maxLength": 800 + }, + "additional_recipients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChargeRequestAdditionalRecipient" + }, + "description": "The basic primitive of a multi-party transaction. The value is optional.\nThe transaction facilitated by you can be split from here.\n\nIf you provide this value, the `amount_money` value in your `additional_recipients` field\ncannot be more than 90% of the `total_money` calculated by Square for your order.\nThe `location_id` must be a valid seller location where the checkout is occurring.\n\nThis field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission.\n\nThis field is currently not supported in the Square Sandbox." + }, + "note": { + "type": "string", + "description": "An optional note to associate with the `checkout` object.\n\nThis value cannot exceed 60 characters.", + "maxLength": 60 + } + }, + "example": { + "additional_recipients": [ + { + "amount_money": { + "amount": 60, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "ask_for_shipping_address": true, + "idempotency_key": "86ae1696-b1e3-4328-af6d-f1e04d947ad6", + "merchant_support_email": "merchant+support@website.com", + "order": { + "idempotency_key": "12ae1696-z1e3-4328-af6d-f1e04d947gd4", + "order": { + "customer_id": "customer_id", + "discounts": [ + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "scope": "LINE_ITEM", + "type": "FIXED_AMOUNT", + "uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" + } + ], + "line_items": [ + { + "applied_discounts": [ + { + "discount_uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" + } + ], + "applied_taxes": [ + { + "tax_uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" + } + ], + "base_price_money": { + "amount": 1500, + "currency": "USD" + }, + "name": "Printed T Shirt", + "quantity": "2" + }, + { + "base_price_money": { + "amount": 2500, + "currency": "USD" + }, + "name": "Slim Jeans", + "quantity": "1" + }, + { + "base_price_money": { + "amount": 3500, + "currency": "USD" + }, + "name": "Woven Sweater", + "quantity": "3" + } + ], + "location_id": "location_id", + "reference_id": "reference_id", + "taxes": [ + { + "percentage": "7.75", + "scope": "LINE_ITEM", + "type": "INCLUSIVE", + "uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" + } + ] + } + }, + "pre_populate_buyer_email": "example@email.com", + "pre_populate_shipping_address": { + "address_line_1": "1455 Market St.", + "address_line_2": "Suite 600", + "administrative_district_level_1": "CA", + "country": "US", + "first_name": "Jane", + "last_name": "Doe", + "locality": "San Francisco", + "postal_code": "94103" + }, + "redirect_url": "https://merchant.website.com/order-confirm" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.csharp", + "java": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.java", + "javascript": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.javascript", + "php": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.php", + "python": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.python", + "ruby": "/sdk_samples/CreateCheckout/CreateCheckoutRequest.ruby" + } + }, + "CreateCheckoutResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `CreateCheckout` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "checkout": { + "$ref": "#/components/schemas/Checkout", + "description": "The newly created `checkout` object associated with the provided idempotency key." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "checkout": { + "additional_recipients": [ + { + "amount_money": { + "amount": 60, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "ask_for_shipping_address": true, + "checkout_page_url": "https://connect.squareup.com/v2/checkout?c=CAISEHGimXh-C3RIT4og1a6u1qw\u0026l=CYTKRM7R7JMV8", + "created_at": "2017-06-16T22:25:35Z", + "id": "CAISEHGimXh-C3RIT4og1a6u1qw", + "merchant_support_email": "merchant+support@website.com", + "order": { + "customer_id": "customer_id", + "discounts": [ + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "scope": "LINE_ITEM", + "type": "FIXED_AMOUNT", + "uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" + } + ], + "line_items": [ + { + "applied_discounts": [ + { + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "discount_uid": "56ae1696-z1e3-9328-af6d-f1e04d947gd4" + } + ], + "applied_taxes": [ + { + "applied_money": { + "amount": 103, + "currency": "USD" + }, + "tax_uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" + } + ], + "base_price_money": { + "amount": 1500, + "currency": "USD" + }, + "name": "Printed T Shirt", + "quantity": "2", + "total_discount_money": { + "amount": 100, + "currency": "USD" + }, + "total_money": { + "amount": 1503, + "currency": "USD" + }, + "total_tax_money": { + "amount": 103, + "currency": "USD" + } + }, + { + "base_price_money": { + "amount": 2500, + "currency": "USD" + }, + "name": "Slim Jeans", + "quantity": "1", + "total_money": { + "amount": 2500, + "currency": "USD" + } + }, + { + "base_price_money": { + "amount": 3500, + "currency": "USD" + }, + "name": "Woven Sweater", + "quantity": "3", + "total_money": { + "amount": 10500, + "currency": "USD" + } + } + ], + "location_id": "location_id", + "reference_id": "reference_id", + "taxes": [ + { + "percentage": "7.75", + "scope": "LINE_ITEM", + "type": "INCLUSIVE", + "uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" + } + ], + "total_discount_money": { + "amount": 100, + "currency": "USD" + }, + "total_money": { + "amount": 14503, + "currency": "USD" + }, + "total_tax_money": { + "amount": 103, + "currency": "USD" + } + }, + "pre_populate_buyer_email": "example@email.com", + "pre_populate_shipping_address": { + "address_line_1": "1455 Market St.", + "address_line_2": "Suite 600", + "administrative_district_level_1": "CA", + "country": "US", + "first_name": "Jane", + "last_name": "Doe", + "locality": "San Francisco", + "postal_code": "94103" + }, + "redirect_url": "https://merchant.website.com/order-confirm", + "version": 1 + } + } + }, + "CreateCustomerCardRequest": { + "type": "object", + "description": "Defines the fields that are included in the request body of a request\nto the `CreateCustomerCard` endpoint.", + "x-release-status": "DEPRECATED", + "required": [ + "card_nonce" + ], + "properties": { + "card_nonce": { + "type": "string", + "description": "A card nonce representing the credit card to link to the customer.\n\nCard nonces are generated by the Square payment form when customers enter\ntheir card information. For more information, see\n[Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/web-payments/take-card-payment).\n\n__NOTE:__ Card nonces generated by digital wallets (such as Apple Pay)\ncannot be used to create a customer card." + }, + "billing_address": { + "$ref": "#/components/schemas/Address", + "description": "Address information for the card on file.\n\n__NOTE:__ If a billing address is provided in the request, the\n`CreateCustomerCardRequest.billing_address.postal_code` must match\nthe postal code encoded in the card nonce." + }, + "cardholder_name": { + "type": "string", + "description": "The full name printed on the credit card." + }, + "verification_token": { + "type": "string", + "description": "An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).\nVerification tokens encapsulate customer device information and 3-D Secure\nchallenge results to indicate that Square has verified the buyer identity." + } + }, + "example": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "card_nonce": "YOUR_CARD_NONCE", + "cardholder_name": "Amelia Earhart" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.csharp", + "java": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.java", + "javascript": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.javascript", + "php": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.php", + "python": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.python", + "ruby": "/sdk_samples/CreateCustomerCard/CreateCustomerCardRequest.ruby" + } + }, + "CreateCustomerCardResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `CreateCustomerCard` endpoint.\n\nEither `errors` or `card` is present in a given response (never both).", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The created card on file." + } + }, + "example": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "card_brand": "VISA", + "cardholder_name": "Amelia Earhart", + "exp_month": 11, + "exp_year": 2018, + "id": "icard-card_id", + "last_4": "1111" + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.csharp", + "java": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.java", + "javascript": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.javascript", + "php": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.php", + "python": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.python", + "ruby": "/sdk_samples/CreateCustomerCard/CreateCustomerCardResponse.ruby" + } + }, + "CreateCustomerCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents a [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) request.", + "x-release-status": "PUBLIC", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition to create. Note the following:\n- With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema\ndefinition hosted on the Square CDN. For more information, including supported values and constraints, see\n[Specifying the schema](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#specify-schema).\n- If provided, `name` must be unique (case-sensitive) across all visible customer-related custom attribute definitions for the seller.\n- All custom attributes are visible in exported customer data, including those set to `VISIBILITY_HIDDEN`." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45 + } + }, + "example": { + "custom_attribute_definition": { + "description": "The favorite movie of the customer.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "visibility": "VISIBILITY_HIDDEN" + } + } + }, + "CreateCustomerCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The new custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-04-26T15:27:30Z", + "description": "The favorite movie of the customer.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + } + }, + "CreateCustomerGroupRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in a request to the\n[CreateCustomerGroup](api-endpoint:CustomerGroups-CreateCustomerGroup) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "group" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)." + }, + "group": { + "$ref": "#/components/schemas/CustomerGroup", + "description": "The customer group to create." + } + }, + "example": { + "group": { + "name": "Loyal Customers" + } + } + }, + "CreateCustomerGroupResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CreateCustomerGroup](api-endpoint:CustomerGroups-CreateCustomerGroup) endpoint.\n\nEither `errors` or `group` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "group": { + "$ref": "#/components/schemas/CustomerGroup", + "description": "The successfully created customer group." + } + }, + "example": { + "group": { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + } + } + }, + "CreateCustomerRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in a request to the\n`CreateCustomer` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "The idempotency key for the request.\tFor more information, see\n[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)." + }, + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the customer profile.\n\nThe maximum length for this value is 300 characters." + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the customer profile.\n\nThe maximum length for this value is 300 characters." + }, + "company_name": { + "type": "string", + "description": "A business name associated with the customer profile.\n\nThe maximum length for this value is 500 characters." + }, + "nickname": { + "type": "string", + "description": "A nickname for the customer profile.\n\nThe maximum length for this value is 100 characters." + }, + "email_address": { + "type": "string", + "description": "The email address associated with the customer profile.\n\nThe maximum length for this value is 254 characters." + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address associated with the customer profile. For maximum length constraints, see \n[Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).\nThe `first_name` and `last_name` fields are ignored if they are present in the request." + }, + "phone_number": { + "type": "string", + "description": "The phone number associated with the customer profile. The phone number must be valid and can contain\n9–16 digits, with an optional `+` prefix and country code. For more information, see\n[Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number)." + }, + "reference_id": { + "type": "string", + "description": "An optional second ID used to associate the customer profile with an\nentity in another system.\n\nThe maximum length for this value is 100 characters." + }, + "note": { + "type": "string", + "description": "A custom note associated with the customer profile." + }, + "birthday": { + "type": "string", + "description": "The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,\nspecify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in `YYYY-MM-DD`\nformat, where `YYYY` is the specified birth year or `0000` if a birth year is not specified." + }, + "tax_ids": { + "$ref": "#/components/schemas/CustomerTaxIds", + "description": "The tax ID associated with the customer profile. This field is available only for customers of sellers\nin EU countries or the United Kingdom. For more information,\nsee [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids)." + } + }, + "example": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "reference_id": "YOUR_REFERENCE_ID" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CreateCustomer/CreateCustomerRequest.csharp", + "java": "/sdk_samples/CreateCustomer/CreateCustomerRequest.java", + "javascript": "/sdk_samples/CreateCustomer/CreateCustomerRequest.javascript", + "php": "/sdk_samples/CreateCustomer/CreateCustomerRequest.php", + "python": "/sdk_samples/CreateCustomer/CreateCustomerRequest.python", + "ruby": "/sdk_samples/CreateCustomer/CreateCustomerRequest.ruby" + } + }, + "CreateCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CreateCustomer](api-endpoint:Customers-CreateCustomer) or\n[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint.\n\nEither `errors` or `customer` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The created customer." + } + }, + "example": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "updated_at": "2016-03-23T20:21:54.859Z", + "version": 0 + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/CreateCustomer/CreateCustomerResponse.csharp", + "java": "/sdk_samples/CreateCustomer/CreateCustomerResponse.java", + "javascript": "/sdk_samples/CreateCustomer/CreateCustomerResponse.javascript", + "php": "/sdk_samples/CreateCustomer/CreateCustomerResponse.php", + "python": "/sdk_samples/CreateCustomer/CreateCustomerResponse.python", + "ruby": "/sdk_samples/CreateCustomer/CreateCustomerResponse.ruby" + } + }, + "CreateDeviceCodeRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "device_code" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this CreateDeviceCode request. Keys can\nbe any valid string but must be unique for every CreateDeviceCode request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 128 + }, + "device_code": { + "$ref": "#/components/schemas/DeviceCode", + "description": "The device code to create." + } + }, + "example": { + "device_code": { + "location_id": "B5E4484SHHNYH", + "name": "Counter 1", + "product_type": "TERMINAL_API" + }, + "idempotency_key": "01bb00a6-0c86-4770-94ed-f5fca973cd56" + } + }, + "CreateDeviceCodeResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "device_code": { + "$ref": "#/components/schemas/DeviceCode", + "description": "The created DeviceCode object containing the device code string." + } + }, + "example": { + "device_code": { + "code": "EBCARJ", + "created_at": "2020-02-06T18:44:33.000Z", + "id": "B3Z6NAMYQSMTM", + "location_id": "B5E4484SHHNYH", + "name": "Counter 1", + "pair_by": "2020-02-06T18:49:33.000Z", + "product_type": "TERMINAL_API", + "status": "UNPAIRED", + "status_changed_at": "2020-02-06T18:44:33.000Z" + } + } + }, + "CreateDisputeEvidenceFileRequest": { + "type": "object", + "description": "Defines the parameters for a `CreateDisputeEvidenceFile` request.", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1, + "maxLength": 45 + }, + "evidence_type": { + "$ref": "#/components/schemas/DisputeEvidenceType", + "description": "The type of evidence you are uploading.\nSee [DisputeEvidenceType](#type-disputeevidencetype) for possible values" + }, + "content_type": { + "type": "string", + "description": "The MIME type of the uploaded file.\nThe type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff.", + "minLength": 1, + "maxLength": 40 + } + } + }, + "CreateDisputeEvidenceFileResponse": { + "type": "object", + "description": "Defines the fields in a `CreateDisputeEvidenceFile` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "evidence": { + "$ref": "#/components/schemas/DisputeEvidence", + "description": "The metadata of the newly uploaded dispute evidence." + } + }, + "example": { + "evidence": { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_file": { + "filename": "customer-interaction.jpg", + "filetype": "image/jpeg" + }, + "id": "TOomLInj6iWmP3N8qfCXrB", + "uploaded_at": "2022-05-18T16:01:10.000Z" + } + } + }, + "CreateDisputeEvidenceTextRequest": { + "type": "object", + "description": "Defines the parameters for a `CreateDisputeEvidenceText` request.", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "evidence_text" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1, + "maxLength": 45 + }, + "evidence_type": { + "$ref": "#/components/schemas/DisputeEvidenceType", + "description": "The type of evidence you are uploading.\nSee [DisputeEvidenceType](#type-disputeevidencetype) for possible values" + }, + "evidence_text": { + "type": "string", + "description": "The evidence string.", + "minLength": 1, + "maxLength": 500 + } + }, + "example": { + "evidence_text": "1Z8888888888888888", + "evidence_type": "TRACKING_NUMBER", + "idempotency_key": "ed3ee3933d946f1514d505d173c82648" + } + }, + "CreateDisputeEvidenceTextResponse": { + "type": "object", + "description": "Defines the fields in a `CreateDisputeEvidenceText` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "evidence": { + "$ref": "#/components/schemas/DisputeEvidence", + "description": "The newly uploaded dispute evidence metadata." + } + }, + "example": { + "evidence": { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_text": "The customer purchased the item twice, on April 11 and April 28.", + "evidence_type": "REBUTTAL_EXPLANATION", + "id": "TOomLInj6iWmP3N8qfCXrB", + "uploaded_at": "2022-05-18T16:01:10.000Z" + } + } + }, + "CreateGiftCardActivityRequest": { + "type": "object", + "description": "A request to create a gift card activity.", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "gift_card_activity" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `CreateGiftCardActivity` request.", + "minLength": 1, + "maxLength": 128 + }, + "gift_card_activity": { + "$ref": "#/components/schemas/GiftCardActivity", + "description": "The activity to create for the gift card. This activity must specify `gift_card_id` or `gift_card_gan` for the target\ngift card, the `location_id` where the activity occurred, and the activity `type` along with the corresponding activity details." + } + }, + "example": { + "gift_card_activity": { + "activate_activity_details": { + "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", + "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" + }, + "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + "location_id": "81FN9BNFZTKS4", + "type": "ACTIVATE" + }, + "idempotency_key": "U16kfr-kA70er-q4Rsym-7U7NnY" + } + }, + "CreateGiftCardActivityResponse": { + "type": "object", + "description": "A response that contains a `GiftCardActivity` that was created.\nThe response might contain a set of `Error` objects if the request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card_activity": { + "$ref": "#/components/schemas/GiftCardActivity", + "description": "The gift card activity that was created." + } + }, + "example": { + "gift_card_activity": { + "activate_activity_details": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", + "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gift_card_balance_money": { + "amount": 1000, + "currency": "USD" + }, + "gift_card_gan": "7783320002929081", + "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", + "location_id": "81FN9BNFZTKS4", + "type": "ACTIVATE" + } + } + }, + "CreateGiftCardRequest": { + "type": "object", + "description": "Represents a [CreateGiftCard](api-endpoint:GiftCards-CreateGiftCard) request.", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "location_id", + "gift_card" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information, \nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 128 + }, + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location) where the gift card should be registered for \nreporting purposes. Gift cards can be redeemed at any of the seller's locations.", + "minLength": 1 + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card to create. The `type` field is required for this request. The `gan_source` \nand `gan` fields are included as follows: \n\nTo direct Square to generate a 16-digit GAN, omit `gan_source` and `gan`.\n\nTo provide a custom GAN, include `gan_source` and `gan`.\n- For `gan_source`, specify `OTHER`. \n- For `gan`, provide a custom GAN containing 8 to 20 alphanumeric characters. The GAN must be \nunique for the seller and cannot start with the same bank identification number (BIN) as major \ncredit cards. Do not use GANs that are easy to guess (such as 12345678) because they greatly \nincrease the risk of fraud. It is the responsibility of the developer to ensure the security \nof their custom GANs. For more information, see \n[Custom GANs](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#custom-gans). \n\nTo register an unused, physical gift card that the seller previously ordered from Square, \ninclude `gan` and provide the GAN that is printed on the gift card." + } + }, + "example": { + "gift_card": { + "type": "DIGITAL" + }, + "idempotency_key": "NC9Tm69EjbjtConu", + "location_id": "81FN9BNFZTKS4" + } + }, + "CreateGiftCardResponse": { + "type": "object", + "description": "A response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request\nresulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The new gift card." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 0, + "currency": "USD" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gan": "7783320006753271", + "gan_source": "SQUARE", + "id": "gftc:6cbacbb64cf54e2ca9f573d619038059", + "state": "PENDING", + "type": "DIGITAL" + } + } + }, + "CreateInvoiceAttachmentRequest": { + "type": "object", + "description": "Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) request.", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `CreateInvoiceAttachment` request.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 128 + }, + "description": { + "type": "string", + "description": "The description of the attachment to display on the invoice.", + "maxLength": 128 + } + }, + "example": { + "description": "Service contract", + "idempotency_key": "ae5e84f9-4742-4fc1-ba12-a3ce3748f1c3" + } + }, + "CreateInvoiceAttachmentResponse": { + "type": "object", + "description": "Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) response.", + "x-release-status": "PUBLIC", + "properties": { + "attachment": { + "$ref": "#/components/schemas/InvoiceAttachment", + "description": "Metadata about the attachment that was added to the invoice." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "attachment": { + "description": "Service contract", + "filename": "file.jpg", + "filesize": 102705, + "hash": "273ee02cb6f5f8a3a8ca23604930dd53", + "id": "inva:0-3bB9ZuDHiziThQhuC4fwWt", + "mime_type": "image/jpeg", + "uploaded_at": "2023-02-03T20:28:14Z" + } + } + }, + "CreateInvoiceRequest": { + "type": "object", + "description": "Describes a `CreateInvoice` request.", + "x-release-status": "PUBLIC", + "required": [ + "invoice" + ], + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The invoice to create." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `CreateInvoice` request. If you do not \nprovide `idempotency_key` (or provide an empty string as the value), the endpoint \ntreats each request as independent.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 128 + } + }, + "example": { + "idempotency_key": "ce3748f9-5fc1-4762-aa12-aae5e843f1f4", + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1 + } + ], + "request_type": "BALANCE", + "tipping_enabled": true + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "store_payment_method_enabled": false, + "title": "Event Planning Services" + } + } + }, + "CreateInvoiceResponse": { + "type": "object", + "description": "The response returned by the `CreateInvoice` request.", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The newly created invoice." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T17:45:13Z", + "version": 0 + } + } + }, + "CreateJobRequest": { + "type": "object", + "description": "Represents a [CreateJob](api-endpoint:Team-CreateJob) request.", + "x-release-status": "BETA", + "required": [ + "job", + "idempotency_key" + ], + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The job to create. The `title` field is required and `is_tip_eligible` defaults to true." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for the `CreateJob` request. Keys can be any valid string,\nbut must be unique for each request. For more information, see\n[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45 + } + }, + "example": { + "idempotency_key": "idempotency-key-0", + "job": { + "is_tip_eligible": true, + "title": "Cashier" + } + } + }, + "CreateJobResponse": { + "type": "object", + "description": "Represents a [CreateJob](api-endpoint:Team-CreateJob) response. Either `job` or `errors`\nis present in the response.", + "x-release-status": "BETA", + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The new job." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "job": { + "created_at": "2021-06-11T22:55:45Z", + "id": "1yJlHapkseYnNPETIU1B", + "is_tip_eligible": true, + "title": "Cashier", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + } + }, + "CreateLocationCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents a [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) request.", + "x-release-status": "BETA", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition to create. Note the following:\n- With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema\ndefinition hosted on the Square CDN. For more information, including supported values and constraints, see\n[Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).\n- `name` is required unless `visibility` is set to `VISIBILITY_HIDDEN`." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45 + } + }, + "example": { + "custom_attribute_definition": { + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "CreateLocationCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The new custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-12-02T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "CreateLocationRequest": { + "type": "object", + "description": "The request object for the [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "location": { + "$ref": "#/components/schemas/Location", + "description": "The initial values of the location being created. The `name` field is required and must be unique within a seller account.\nAll other fields are optional, but any information you care about for the location should be included.\nThe remaining fields are automatically added based on the data from the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location)." + } + }, + "example": { + "location": { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309" + }, + "description": "Midtown Atlanta store", + "name": "Midtown" + } + } + }, + "CreateLocationResponse": { + "type": "object", + "description": "The response object returned by the [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about [errors](https://developer.squareup.com/docs/build-basics/handling-errors) encountered during the request." + }, + "location": { + "$ref": "#/components/schemas/Location", + "description": "The newly created `Location` object." + } + }, + "example": { + "location": { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309" + }, + "business_name": "Jet Fuel Coffee", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ], + "coordinates": { + "latitude": 33.7889, + "longitude": -84.3841 + }, + "country": "US", + "created_at": "2022-02-19T17:58:25Z", + "currency": "USD", + "description": "Midtown Atlanta store", + "id": "3Z4V4WHQK64X9", + "language_code": "en-US", + "mcc": "7299", + "merchant_id": "3MYCJG5GVYQ8Q", + "name": "Midtown", + "status": "ACTIVE", + "timezone": "America/New_York", + "type": "PHYSICAL" + } + } + }, + "CreateLoyaltyAccountRequest": { + "type": "object", + "description": "A request to create a new loyalty account.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_account", + "idempotency_key" + ], + "properties": { + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The loyalty account to create." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateLoyaltyAccount` request. \nKeys can be any valid string, but must be unique for every request.", + "minLength": 1, + "maxLength": 128 + } + }, + "example": { + "idempotency_key": "ec78c477-b1c3-4899-a209-a4e71337c996", + "loyalty_account": { + "mapping": { + "phone_number": "+14155551234" + }, + "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd" + } + } + }, + "CreateLoyaltyAccountResponse": { + "type": "object", + "description": "A response that includes loyalty account created.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The newly created loyalty account." + } + }, + "example": { + "loyalty_account": { + "balance": 0, + "created_at": "2020-05-08T21:44:32Z", + "customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "id": "79b807d2-d786-46a9-933b-918028d7a8c5", + "lifetime_points": 0, + "mapping": { + "created_at": "2020-05-08T21:44:32Z", + "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234" + }, + "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "updated_at": "2020-05-08T21:44:32Z" + } + } + }, + "CreateLoyaltyPromotionRequest": { + "type": "object", + "description": "Represents a [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?program_id=d619f755-2d17-41f3-990d-c04ecedd64dd", + "required": [ + "loyalty_promotion", + "idempotency_key" + ], + "properties": { + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The loyalty promotion to create." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, which is used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 128 + } + }, + "example": { + "idempotency_key": "ec78c477-b1c3-4899-a209-a4e71337c996", + "loyalty_promotion": { + "available_time": { + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ] + }, + "incentive": { + "points_multiplier_data": { + "multiplier": "3.0" + }, + "type": "POINTS_MULTIPLIER" + }, + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Tuesday Happy Hour Promo", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "trigger_limit": { + "interval": "DAY", + "times": 1 + } + } + } + }, + "CreateLoyaltyPromotionResponse": { + "type": "object", + "description": "Represents a [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) response.\nEither `loyalty_promotion` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The new loyalty promotion." + } + }, + "example": { + "loyalty_promotion": { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ] + }, + "created_at": "2022-08-16T08:38:54Z", + "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", + "incentive": { + "points_multiplier_data": { + "multiplier": "3.000", + "points_multiplier": 3 + }, + "type": "POINTS_MULTIPLIER" + }, + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Tuesday Happy Hour Promo", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "status": "ACTIVE", + "trigger_limit": { + "interval": "DAY", + "times": 1 + }, + "updated_at": "2022-08-16T08:38:54Z" + } + } + }, + "CreateLoyaltyRewardRequest": { + "type": "object", + "description": "A request to create a loyalty reward.", + "x-release-status": "PUBLIC", + "required": [ + "reward", + "idempotency_key" + ], + "properties": { + "reward": { + "$ref": "#/components/schemas/LoyaltyReward", + "description": "The reward to create." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateLoyaltyReward` request. \nKeys can be any valid string, but must be unique for every request.", + "minLength": 1, + "maxLength": 128 + } + }, + "example": { + "idempotency_key": "18c2e5ea-a620-4b1f-ad60-7b167285e451", + "reward": { + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f" + } + } + }, + "CreateLoyaltyRewardResponse": { + "type": "object", + "description": "A response that includes the loyalty reward created.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "reward": { + "$ref": "#/components/schemas/LoyaltyReward", + "description": "The loyalty reward created." + } + }, + "example": { + "reward": { + "created_at": "2020-05-01T21:49:54Z", + "id": "a8f43ebe-2ad6-3001-bdd5-7d7c2da08943", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", + "points": 10, + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "ISSUED", + "updated_at": "2020-05-01T21:49:54Z" + } + } + }, + "CreateMerchantCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) request.", + "x-release-status": "BETA", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition to create. Note the following:\n- With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema\ndefinition hosted on the Square CDN. For more information, including supported values and constraints, see\n[Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).\n- `name` is required unless `visibility` is set to `VISIBILITY_HIDDEN`." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45 + } + }, + "example": { + "custom_attribute_definition": { + "description": "This is the other name this merchant goes by.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "CreateMerchantCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The new custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2023-05-05T19:06:36.559Z", + "description": "This is the other name this merchant goes by.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2023-05-05T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "CreateMobileAuthorizationCodeRequest": { + "type": "object", + "description": "Defines the body parameters that can be provided in a request to the\n`CreateMobileAuthorizationCode` endpoint.", + "x-release-status": "DEPRECATED", + "properties": { + "location_id": { + "type": "string", + "description": "The Square location ID that the authorization code should be tied to.", + "minLength": 1, + "maxLength": 191 + } + }, + "example": { + "location_id": "YOUR_LOCATION_ID" + } + }, + "CreateMobileAuthorizationCodeResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `CreateMobileAuthorizationCode` endpoint.", + "x-release-status": "DEPRECATED", + "properties": { + "authorization_code": { + "type": "string", + "description": "The generated authorization code that connects a mobile application instance\nto a Square account.", + "maxLength": 191 + }, + "expires_at": { + "type": "string", + "description": "The timestamp when `authorization_code` expires, in\n[RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, \"2016-09-04T23:59:33.123Z\").", + "minLength": 20, + "maxLength": 48 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "authorization_code": "YOUR_MOBILE_AUTHORIZATION_CODE", + "expires_at": "2019-01-10T19:42:08Z" + } + }, + "CreateOrderCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents a create request for an order custom attribute definition.", + "x-release-status": "BETA", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition to create. Note the following:\n- With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema\ndefinition hosted on the Square CDN. For more information, including supported values and constraints, see\n[Specifying the schema](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#specify-schema).\n- If provided, `name` must be unique (case-sensitive) across all visible customer-related custom attribute definitions for the seller.\n- All custom attributes are visible in exported customer data, including those set to `VISIBILITY_HIDDEN`." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. \nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45 + } + }, + "example": { + "custom_attribute_definition": { + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "idempotency_key": "IDEMPOTENCY_KEY" + } + }, + "CreateOrderCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from creating an order custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The new custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-10-06T16:53:23.141Z", + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-10-06T16:53:23.141Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "CreateOrderRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The order to create. If this field is set, the only other top-level field that can be\nset is the `idempotency_key`." + }, + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this\norder among orders you have created.\n\nIf you are unsure whether a particular order was created successfully,\nyou can try it again with the same idempotency key without\nworrying about creating duplicate orders.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 192 + } + }, + "example": { + "idempotency_key": "8193148c-9586-11e6-99f9-28cfe92138cf", + "order": { + "discounts": [ + { + "name": "Labor Day Sale", + "percentage": "5", + "scope": "ORDER", + "uid": "labor-day-sale" + }, + { + "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", + "scope": "ORDER", + "uid": "membership-discount" + }, + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "name": "Sale - $1.00 off", + "scope": "LINE_ITEM", + "uid": "one-dollar-off" + } + ], + "line_items": [ + { + "base_price_money": { + "amount": 1599, + "currency": "USD" + }, + "name": "New York Strip Steak", + "quantity": "1" + }, + { + "applied_discounts": [ + { + "discount_uid": "one-dollar-off" + } + ], + "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", + "modifiers": [ + { + "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ" + } + ], + "quantity": "2" + } + ], + "location_id": "057P5VYJ4A5X1", + "reference_id": "my-order-001", + "taxes": [ + { + "name": "State Sales Tax", + "percentage": "9", + "scope": "ORDER", + "uid": "state-sales-tax" + } + ] + } + } + }, + "CreateOrderResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `CreateOrder` endpoint.\n\nEither `errors` or `order` is present in a given response, but never both.", + "x-release-status": "PUBLIC", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The newly created order." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "order": { + "created_at": "2020-01-17T20:47:53.293Z", + "discounts": [ + { + "applied_money": { + "amount": 30, + "currency": "USD" + }, + "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7", + "name": "Membership Discount", + "percentage": "0.5", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "membership-discount" + }, + { + "applied_money": { + "amount": 303, + "currency": "USD" + }, + "name": "Labor Day Sale", + "percentage": "5", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "labor-day-sale" + }, + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "name": "Sale - $1.00 off", + "scope": "LINE_ITEM", + "type": "FIXED_AMOUNT", + "uid": "one-dollar-off" + } + ], + "id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "line_items": [ + { + "applied_discounts": [ + { + "applied_money": { + "amount": 8, + "currency": "USD" + }, + "discount_uid": "membership-discount", + "uid": "jWdgP1TpHPFBuVrz81mXVC" + }, + { + "applied_money": { + "amount": 79, + "currency": "USD" + }, + "discount_uid": "labor-day-sale", + "uid": "jnZOjjVY57eRcQAVgEwFuC" + } + ], + "applied_taxes": [ + { + "applied_money": { + "amount": 136, + "currency": "USD" + }, + "tax_uid": "state-sales-tax", + "uid": "aKG87ArnDpvMLSZJHxWUl" + } + ], + "base_price_money": { + "amount": 1599, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 1599, + "currency": "USD" + }, + "name": "New York Strip Steak", + "quantity": "1", + "total_discount_money": { + "amount": 87, + "currency": "USD" + }, + "total_money": { + "amount": 1648, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 136, + "currency": "USD" + }, + "uid": "8uSwfzvUImn3IRrvciqlXC", + "variation_total_price_money": { + "amount": 1599, + "currency": "USD" + } + }, + { + "applied_discounts": [ + { + "applied_money": { + "amount": 22, + "currency": "USD" + }, + "discount_uid": "membership-discount", + "uid": "nUXvdsIItfKko0dbYtY58C" + }, + { + "applied_money": { + "amount": 224, + "currency": "USD" + }, + "discount_uid": "labor-day-sale", + "uid": "qSdkOOOernlVQqsJ94SPjB" + }, + { + "applied_money": { + "amount": 100, + "currency": "USD" + }, + "discount_uid": "one-dollar-off", + "uid": "y7bVl4njrWAnfDwmz19izB" + } + ], + "applied_taxes": [ + { + "applied_money": { + "amount": 374, + "currency": "USD" + }, + "tax_uid": "state-sales-tax", + "uid": "v1dAgrfUVUPTnVTf9sRPz" + } + ], + "base_price_money": { + "amount": 2200, + "currency": "USD" + }, + "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", + "gross_sales_money": { + "amount": 4500, + "currency": "USD" + }, + "modifiers": [ + { + "base_price_money": { + "amount": 50, + "currency": "USD" + }, + "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ", + "name": "Well", + "total_price_money": { + "amount": 100, + "currency": "USD" + }, + "uid": "Lo3qMMckDluu9Qsb58d4CC" + } + ], + "name": "New York Steak", + "quantity": "2", + "total_discount_money": { + "amount": 346, + "currency": "USD" + }, + "total_money": { + "amount": 4528, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 374, + "currency": "USD" + }, + "uid": "v8ZuEXpOJpb0bazLuvrLDB", + "variation_name": "Larger", + "variation_total_price_money": { + "amount": 4400, + "currency": "USD" + } + } + ], + "location_id": "057P5VYJ4A5X1", + "net_amounts": { + "discount_money": { + "amount": 433, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 510, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 6176, + "currency": "USD" + } + }, + "reference_id": "my-order-001", + "source": { + "name": "My App" + }, + "state": "OPEN", + "taxes": [ + { + "applied_money": { + "amount": 510, + "currency": "USD" + }, + "name": "State Sales Tax", + "percentage": "9", + "scope": "ORDER", + "type": "ADDITIVE", + "uid": "state-sales-tax" + } + ], + "total_discount_money": { + "amount": 433, + "currency": "USD" + }, + "total_money": { + "amount": 6176, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 510, + "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2020-01-17T20:47:53.293Z", + "version": 1 + } + } + }, + "CreatePaymentLinkRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreatePaymentLinkRequest` request.\nIf you do not provide a unique string (or provide an empty string as the value),\nthe endpoint treats each request as independent.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "maxLength": 192 + }, + "description": { + "type": "string", + "description": "A description of the payment link. You provide this optional description that is useful in your\napplication context. It is not used anywhere.", + "maxLength": 4096 + }, + "quick_pay": { + "$ref": "#/components/schemas/QuickPay", + "description": "Describes an ad hoc item and price for which to generate a quick pay checkout link.\nFor more information,\nsee [Quick Pay Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout)." + }, + "order": { + "$ref": "#/components/schemas/Order", + "description": "Describes the `Order` for which to create a checkout link.\nFor more information,\nsee [Square Order Checkout](https://developer.squareup.com/docs/checkout-api/square-order-checkout)." + }, + "checkout_options": { + "$ref": "#/components/schemas/CheckoutOptions", + "description": "Describes optional fields to add to the resulting checkout page.\nFor more information,\nsee [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations)." + }, + "pre_populated_data": { + "$ref": "#/components/schemas/PrePopulatedData", + "description": "Describes fields to prepopulate in the resulting checkout page.\nFor more information, see [Prepopulate the shipping address](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#prepopulate-the-shipping-address)." + }, + "payment_note": { + "type": "string", + "description": "A note for the payment. After processing the payment, Square adds this note to the resulting `Payment`.", + "maxLength": 500 + } + }, + "example": { + "idempotency_key": "cd9e25dc-d9f2-4430-aedb-61605070e95f", + "quick_pay": { + "location_id": "A9Y43N9ABXZBP", + "name": "Auto Detailing", + "price_money": { + "amount": 10000, + "currency": "USD" + } + } + } + }, + "CreatePaymentLinkResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "payment_link": { + "$ref": "#/components/schemas/PaymentLink", + "description": "The created payment link." + }, + "related_resources": { + "$ref": "#/components/schemas/PaymentLinkRelatedResources", + "description": "The list of related objects." + } + }, + "example": { + "payment_link": { + "created_at": "2022-04-25T23:58:01Z", + "id": "PKVT6XGJZXYUP3NZ", + "long_url": "https://checkout.square.site/EXAMPLE", + "order_id": "o4b7saqp4HzhNttf5AJxC0Srjd4F", + "url": "https://square.link/u/EXAMPLE", + "version": 1 + }, + "related_resources": { + "orders": [ + { + "created_at": "2022-03-03T00:53:15.829Z", + "fulfillments": [ + { + "state": "PROPOSED", + "type": "DIGITAL", + "uid": "bBpNrxjdQxGQP16sTmdzi" + } + ], + "id": "o4b7saqp4HzhNttf5AJxC0Srjd4F", + "line_items": [ + { + "base_price_money": { + "amount": 12500, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 12500, + "currency": "USD" + }, + "item_type": "ITEM", + "name": "Auto Detailing", + "quantity": "1", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 12500, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "8YX13D1U3jO7czP8JVrAR", + "variation_total_price_money": { + "amount": 12500, + "currency": "USD" + } + } + ], + "location_id": "{LOCATION_ID}", + "net_amounts": { + "discount_money": { + "amount": 0, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 0, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 12500, + "currency": "USD" + } + }, + "source": { + "name": "Test Online Checkout Application" + }, + "state": "DRAFT", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 12500, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2022-03-03T00:53:15.829Z", + "version": 1 + } + ] + } + } + }, + "CreatePaymentRequest": { + "type": "object", + "description": "Describes a request to create a payment using\n[CreatePayment](api-endpoint:Payments-CreatePayment).", + "x-release-status": "PUBLIC", + "required": [ + "source_id", + "idempotency_key" + ], + "properties": { + "source_id": { + "type": "string", + "description": "The ID for the source of funds for this payment.\nThis could be a payment token generated by the Web Payments SDK for any of its\n[supported methods](https://developer.squareup.com/docs/web-payments/overview#explore-payment-methods),\nincluding cards, bank transfers, Afterpay or Cash App Pay. If recording a payment\nthat the seller received outside of Square, specify either \"CASH\" or \"EXTERNAL\".\nFor more information, see\n[Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).", + "minLength": 1 + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreatePayment` request. Keys can be any valid string\nbut must be unique for every `CreatePayment` request.\n\nNote: The number of allowed characters might be less than the stated maximum, if multi-byte\ncharacters are used.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1, + "maxLength": 45 + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money to accept for this payment, not including `tip_money`.\n\nThe amount must be specified in the smallest denomination of the applicable currency\n(for example, US dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).\n\nThe currency code must match the currency associated with the business\nthat is accepting the payment." + }, + "tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount designated as a tip, in addition to `amount_money`.\n\nThe amount must be specified in the smallest denomination of the applicable currency\n(for example, US dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).\n\nThe currency code must match the currency associated with the business\nthat is accepting the payment." + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money that the developer is taking as a fee\nfor facilitating the payment on behalf of the seller.\n\nThe amount cannot be more than 90% of the total amount of the payment.\n\nThe amount must be specified in the smallest denomination of the applicable currency\n(for example, US dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).\n\nThe fee currency code must match the currency associated with the seller\nthat is accepting the payment. The application must be from a developer\naccount in the same country and using the same currency code as the seller.\n\nFor more information about the application fee scenario, see\n[Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).\n\nTo set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.\nFor more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions)." + }, + "delay_duration": { + "type": "string", + "description": "The duration of time after the payment's creation when Square automatically\neither completes or cancels the payment depending on the `delay_action` field value.\nFor more information, see\n[Time threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold).\n\nThis parameter should be specified as a time duration, in RFC 3339 format.\n\nNote: This feature is only supported for card payments. This parameter can only be set for a delayed\ncapture payment (`autocomplete=false`).\n\nDefault:\n\n- Card-present payments: \"PT36H\" (36 hours) from the creation time.\n- Card-not-present payments: \"P7D\" (7 days) from the creation time." + }, + "delay_action": { + "type": "string", + "description": "The action to be applied to the payment when the `delay_duration` has elapsed. The action must be\nCANCEL or COMPLETE. For more information, see\n[Time Threshold](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold).\n\nDefault: CANCEL" + }, + "autocomplete": { + "type": "boolean", + "description": "If set to `true`, this payment will be completed when possible. If\nset to `false`, this payment is held in an approved state until either\nexplicitly completed (captured) or canceled (voided). For more information, see\n[Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment).\n\nDefault: true" + }, + "order_id": { + "type": "string", + "description": "Associates a previously created order with this payment." + }, + "customer_id": { + "type": "string", + "description": "The [Customer](entity:Customer) ID of the customer associated with the payment.\n\nThis is required if the `source_id` refers to a card on file created using the Cards API." + }, + "location_id": { + "type": "string", + "description": "The location ID to associate with the payment. If not specified, the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location) is\nused." + }, + "team_member_id": { + "type": "string", + "description": "An optional [TeamMember](entity:TeamMember) ID to associate with\nthis payment." + }, + "reference_id": { + "type": "string", + "description": "A user-defined ID to associate with the payment.\n\nYou can use this field to associate the payment to an entity in an external system\n(for example, you might specify an order ID that is generated by a third-party shopping cart).", + "maxLength": 40 + }, + "verification_token": { + "type": "string", + "description": "An identifying token generated by [payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).\nVerification tokens encapsulate customer device information and 3-D Secure\nchallenge results to indicate that Square has verified the buyer identity.\n\nFor more information, see [SCA Overview](https://developer.squareup.com/docs/sca-overview)." + }, + "accept_partial_authorization": { + "type": "boolean", + "description": "If set to `true` and charging a Square Gift Card, a payment might be returned with\n`amount_money` equal to less than what was requested. For example, a request for $20 when charging\na Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose\nto prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card\npayment. This field cannot be `true` when `autocomplete = true`.\n\nFor more information, see\n[Partial amount with Square Gift Cards](https://developer.squareup.com/docs/payments-api/take-payments#partial-payment-gift-card).\n\nDefault: false" + }, + "buyer_email_address": { + "type": "string", + "description": "The buyer's email address.", + "maxLength": 255 + }, + "buyer_phone_number": { + "type": "string", + "description": "The buyer's phone number.\nMust follow the following format:\n1. A leading + symbol (followed by a country code)\n2. The phone number can contain spaces and the special characters `(` , `)` , `-` , and `.`.\nAlphabetical characters aren't allowed.\n3. The phone number must contain between 9 and 16 digits." + }, + "billing_address": { + "$ref": "#/components/schemas/Address", + "description": "The buyer's billing address." + }, + "shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "The buyer's shipping address." + }, + "note": { + "type": "string", + "description": "An optional note to be entered by the developer when creating a payment.", + "maxLength": 500 + }, + "statement_description_identifier": { + "type": "string", + "description": "Optional additional payment information to include on the customer's card statement\nas part of the statement description. This can be, for example, an invoice number, ticket number,\nor short description that uniquely identifies the purchase.\n\nNote that the `statement_description_identifier` might get truncated on the statement description\nto fit the required information including the Square identifier (SQ *) and name of the\nseller taking the payment.", + "maxLength": 20 + }, + "cash_details": { + "$ref": "#/components/schemas/CashPaymentDetails", + "description": "Additional details required when recording a cash payment (`source_id` is CASH)." + }, + "external_details": { + "$ref": "#/components/schemas/ExternalPaymentDetails", + "description": "Additional details required when recording an external payment (`source_id` is EXTERNAL)." + }, + "customer_details": { + "$ref": "#/components/schemas/CustomerDetails", + "description": "Details about the customer making the payment." + }, + "offline_payment_details": { + "$ref": "#/components/schemas/OfflinePaymentDetails", + "description": "An optional field for specifying the offline payment details. This is intended for\ninternal 1st-party callers only.", + "x-release-status": "DEPRECATED" + } + }, + "example": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "app_fee_money": { + "amount": 10, + "currency": "USD" + }, + "autocomplete": true, + "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", + "idempotency_key": "7b0f3ec5-086a-4871-8f13-3c81b3875218", + "location_id": "L88917AVBK2S5", + "note": "Brief description", + "reference_id": "123456", + "source_id": "ccof:GaJGNaZa8x4OgDJn4GB" + } + }, + "CreatePaymentResponse": { + "type": "object", + "description": "Defines the response returned by [CreatePayment](api-endpoint:Payments-CreatePayment).\n\nIf there are errors processing the request, the `payment` field might not be\npresent, or it might be present with a status of `FAILED`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The newly created payment." + } + }, + "example": { + "payment": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "app_fee_money": { + "amount": 10, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-TcgftTEtKxJTRF1lCFJ9TA", + "square_product": "ECOMMERCE_API" + }, + "approved_money": { + "amount": 1000, + "currency": "USD" + }, + "card_details": { + "auth_result_code": "vNEn2f", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T21:14:29.732Z", + "captured_at": "2021-10-13T21:14:30.504Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "ON_FILE", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "CAPTURED" + }, + "created_at": "2021-10-13T21:14:29.577Z", + "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T21:14:29.577Z", + "id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", + "location_id": "L88917AVBK2S5", + "note": "Brief Description", + "order_id": "pRsjRTgFWATl7so6DxdKBJa7ssbZY", + "receipt_number": "R2B3", + "receipt_url": "https://squareup.com/receipt/preview/EXAMPLE_RECEIPT_ID", + "reference_id": "123456", + "risk_evaluation": { + "created_at": "2021-10-13T21:14:30.423Z", + "risk_level": "NORMAL" + }, + "source_type": "CARD", + "status": "COMPLETED", + "total_money": { + "amount": 1000, + "currency": "USD" + }, + "updated_at": "2021-10-13T21:14:30.504Z", + "version_token": "TPtNEOBOa6Qq6E3C3IjckSVOM6b3hMbfhjvTxHBQUsB6o" + } + } + }, + "CreateScheduledShiftRequest": { + "type": "object", + "description": "Represents a [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) request.", + "x-release-status": "BETA", + "required": [ + "scheduled_shift" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique identifier for the `CreateScheduledShift` request, used to ensure the\n[idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)\nof the operation.", + "maxLength": 128 + }, + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The scheduled shift with `draft_shift_details`.\nIf needed, call [ListLocations](api-endpoint:Locations-ListLocations) to get location IDs,\n[ListJobs](api-endpoint:Team-ListJobs) to get job IDs, and [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers)\nto get team member IDs and current job assignments.\n\nThe `start_at` and `end_at` timestamps must be provided in the time zone + offset of the\nshift location specified in `location_id`. Example for Pacific Standard Time: 2024-10-31T12:30:00-08:00" + } + }, + "example": { + "idempotency_key": "HIDSNG5KS478L", + "scheduled_shift": { + "draft_shift_details": { + "end_at": "2019-01-25T13:11:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI" + } + } + } + }, + "CreateScheduledShiftResponse": { + "type": "object", + "description": "Represents a [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) response.\nEither `scheduled_shift` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The new scheduled shift. To make the shift public, call \n[PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) or\n[BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "scheduled_shift": { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-01-25T13:11:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "updated_at": "2019-02-25T03:11:00-05:00", + "version": 1 + } + } + }, + "CreateShiftRequest": { + "type": "object", + "description": "Represents a request to create a `Shift`.", + "x-release-status": "DEPRECATED", + "required": [ + "shift" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string value to ensure the idempotency of the operation.", + "maxLength": 128 + }, + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The `Shift` to be created." + } + }, + "example": { + "idempotency_key": "HIDSNG5KS478L", + "shift": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "tip_eligible": true, + "title": "Barista" + } + } + } + }, + "CreateShiftResponse": { + "type": "object", + "description": "The response to a request to create a `Shift`. The response contains\nthe created `Shift` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The `Shift` that was created on the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "shift": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "created_at": "2019-02-28T00:39:02Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "ormj0jJJZ5OZIzxrZYJI", + "end_at": "2019-01-25T13:11:00-05:00", + "id": "K0YH4CV5462JB", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-28T00:39:02Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + } + }, + "CreateSubscriptionRequest": { + "type": "object", + "description": "Defines input parameters in a request to the \n[CreateSubscription](api-endpoint:Subscriptions-CreateSubscription) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "location_id", + "customer_id" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateSubscription` request.\nIf you do not provide a unique string (or provide an empty string as the value),\nthe endpoint treats each request as independent.\n\nFor more information, see [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)." + }, + "location_id": { + "type": "string", + "description": "The ID of the location the subscription is associated with.", + "minLength": 1 + }, + "plan_variation_id": { + "type": "string", + "description": "The ID of the [subscription plan variation](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations#plan-variations) created using the Catalog API." + }, + "customer_id": { + "type": "string", + "description": "The ID of the [customer](entity:Customer) subscribing to the subscription plan variation.", + "minLength": 1 + }, + "start_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date to start the subscription. \nIf it is unspecified, the subscription starts immediately." + }, + "canceled_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the newly created subscription is scheduled for cancellation. \n\nThis date overrides the cancellation date set in the plan variation configuration.\nIf the cancellation date is earlier than the end date of a subscription cycle, the subscription stops\nat the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle. \n\nWhen the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date`\noccurs before the subscription plan completes, the specified `canceled_date` sets the date when the subscription\nstops through the end of the last cycle." + }, + "tax_percentage": { + "type": "string", + "description": "The tax to add when billing the subscription.\nThe percentage is expressed in decimal form, using a `'.'` as the decimal\nseparator and without a `'%'` sign. For example, a value of 7.5\ncorresponds to 7.5%.", + "maxLength": 10 + }, + "price_override_money": { + "$ref": "#/components/schemas/Money", + "description": "A custom price which overrides the cost of a subscription plan variation with `STATIC` pricing.\nThis field does not affect itemized subscriptions with `RELATIVE` pricing. Instead, \nyou should edit the Subscription's [order template](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#phases-and-order-templates)." + }, + "card_id": { + "type": "string", + "description": "The ID of the [subscriber's](entity:Customer) [card](entity:Card) to charge.\nIf it is not specified, the subscriber receives an invoice via email with a link to pay for their subscription." + }, + "timezone": { + "type": "string", + "description": "The timezone that is used in date calculations for the subscription. If unset, defaults to\nthe location timezone. If a timezone is not configured for the location, defaults to \"America/New_York\".\nFormat: the IANA Timezone Database identifier for the location timezone. For\na list of time zones, see [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)." + }, + "source": { + "$ref": "#/components/schemas/SubscriptionSource", + "description": "The origination details of the subscription.", + "x-release-status": "BETA" + }, + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The day-of-the-month to change the billing date to.", + "minimum": 1, + "maximum": 31, + "x-release-status": "BETA" + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Phase" + }, + "description": "array of phases for this subscription" + } + }, + "example": { + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "idempotency_key": "8193148c-9586-11e6-99f9-28cfe92138cf", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + "ordinal": 0 + } + ], + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2023-06-20", + "timezone": "America/Los_Angeles" + } + }, + "CreateSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[CreateSubscription](api-endpoint:Subscriptions-CreateSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The newly created subscription.\n\nFor more information, see\n[Subscription object](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#subscription-object)." + } + }, + "example": { + "subscription": { + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + "ordinal": 0, + "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", + "uid": "873451e0-745b-4e87-ab0b-c574933fe616" + } + ], + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2023-06-20", + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 1 + } + } + }, + "CreateTeamMemberRequest": { + "type": "object", + "description": "Represents a create request for a `TeamMember` object.", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateTeamMember` request.\nKeys can be any valid string, but must be unique for every request.\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).\n\nThe minimum length is 1 and the maximum length is 45." + }, + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "**Required** The data used to create the `TeamMember` object. If you include `wage_setting`, you must provide\n`job_id` for each job assignment. To get job IDs, call [ListJobs](api-endpoint:Team-ListJobs)." + } + }, + "example": { + "idempotency_key": "idempotency-key-0", + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "YSGH2WBKG94QZ", + "GA2Y9HSJ8KRYT" + ] + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "wage_setting": { + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "pay_type": "HOURLY" + } + ] + } + } + } + }, + "CreateTeamMemberResponse": { + "type": "object", + "description": "Represents a response from a create request containing the created `TeamMember` object or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The successfully created `TeamMember` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "GA2Y9HSJ8KRYT", + "YSGH2WBKG94QZ" + ] + }, + "created_at": "2021-06-11T22:55:45Z", + "email_address": "joe_doe@example.com", + "family_name": "Doe", + "given_name": "Joe", + "id": "1yJlHapkseYnNPETIU1B", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "updated_at": "2021-06-11T22:55:45Z", + "wage_setting": { + "created_at": "2021-06-11T22:55:45Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 1443, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "1yJlHapkseYnNPETIU1B", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + } + } + }, + "CreateTerminalActionRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "idempotency_key", + "action" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateAction` request. Keys can be any valid string\nbut must be unique for every `CreateAction` request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more\ninformation.", + "minLength": 1, + "maxLength": 64 + }, + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The Action to create." + } + }, + "example": { + "action": { + "deadline_duration": "PT5M", + "device_id": "{{DEVICE_ID}}", + "save_card_options": { + "customer_id": "{{CUSTOMER_ID}}", + "reference_id": "user-id-1" + }, + "type": "SAVE_CARD" + }, + "idempotency_key": "thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e" + } + }, + "CreateTerminalActionResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The created `TerminalAction`" + } + }, + "example": { + "action": { + "app_id": "APP_ID", + "created_at": "2021-07-28T23:22:07.476Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:jveJIAkkAjILHkdCE", + "location_id": "LOCATION_ID", + "save_card_options": { + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "PENDING", + "type": "SAVE_CARD", + "updated_at": "2021-07-28T23:22:07.476Z" + } + } + }, + "CreateTerminalCheckoutRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "checkout" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateCheckout` request. Keys can be any valid string but\nmust be unique for every `CreateCheckout` request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 64 + }, + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The checkout to create." + } + }, + "example": { + "checkout": { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003" + }, + "note": "A brief note", + "reference_id": "id11572" + }, + "idempotency_key": "28a0c3bc-7839-11ea-bc55-0242ac130003" + } + }, + "CreateTerminalCheckoutResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The created `TerminalCheckout`." + } + }, + "example": { + "checkout": { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2020-04-06T16:39:32.545Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "08YceKh7B3ZqO", + "location_id": "LOCATION_ID", + "note": "A brief note", + "payment_type": "CARD_PRESENT", + "reference_id": "id11572", + "status": "PENDING", + "updated_at": "2020-04-06T16:39:32.545Z" + } + } + }, + "CreateTerminalRefundRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `CreateRefund` request. Keys can be any valid string but\nmust be unique for every `CreateRefund` request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 64 + }, + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The refund to create." + } + }, + "example": { + "idempotency_key": "402a640b-b26f-401f-b406-46f839590c04", + "refund": { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Returning items" + } + } + }, + "CreateTerminalRefundResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The created `TerminalRefund`." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 1, + "exp_year": 2022, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "created_at": "2020-09-29T15:21:46.771Z", + "deadline_duration": "PT5M", + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "id": "009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "76C9W6K8CNNQ5", + "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Returning items", + "status": "PENDING", + "updated_at": "2020-09-29T15:21:46.771Z" + } + } + }, + "CreateTimecardRequest": { + "type": "object", + "description": "Represents a request to create a `Timecard`.", + "x-release-status": "PUBLIC", + "required": [ + "timecard" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string value to ensure the idempotency of the operation.", + "maxLength": 128 + }, + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The `Timecard` to be created." + } + }, + "example": { + "idempotency_key": "HIDSNG5KS478L", + "timecard": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "tip_eligible": true, + "title": "Barista" + } + } + } + }, + "CreateTimecardResponse": { + "type": "object", + "description": "The response to a request to create a `Timecard`. The response contains\nthe created `Timecard` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The `Timecard` that was created on the request." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "timecard": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "created_at": "2019-02-28T00:39:02Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "id": "K0YH4CV5462JB", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-28T00:39:02Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + } + }, + "CreateTransferOrderData": { + "type": "object", + "description": "Data for creating a new transfer order to move [CatalogItemVariation](entity:CatalogItemVariation)s\nbetween [Location](entity:Location)s. Used with the [CreateTransferOrder](api-endpoint:TransferOrders-CreateTransferOrder)\nendpoint.", + "x-release-status": "BETA", + "required": [ + "source_location_id", + "destination_location_id" + ], + "properties": { + "source_location_id": { + "type": "string", + "description": "The source [Location](entity:Location) that will send the items. Must be an active location\nin your Square account with sufficient inventory of the requested items.", + "minLength": 1, + "maxLength": 64 + }, + "destination_location_id": { + "type": "string", + "description": "The destination [Location](entity:Location) that will receive the items. Must be an active location\nin your Square account", + "minLength": 1, + "maxLength": 64 + }, + "expected_at": { + "type": "string", + "description": "Expected transfer date in RFC 3339 format (e.g. \"2023-10-01T12:00:00Z\").", + "nullable": true + }, + "notes": { + "type": "string", + "description": "Optional notes about the transfer", + "maxLength": 4096, + "nullable": true + }, + "tracking_number": { + "type": "string", + "description": "Optional shipment tracking number", + "maxLength": 64, + "nullable": true + }, + "created_by_team_member_id": { + "type": "string", + "description": "ID of the [TeamMember](entity:TeamMember) creating this transfer order. Used for tracking\nand auditing purposes.", + "maxLength": 64, + "nullable": true + }, + "line_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateTransferOrderLineData" + }, + "description": "List of [CatalogItemVariation](entity:CatalogItemVariation)s to transfer, including quantities", + "nullable": true + } + } + }, + "CreateTransferOrderLineData": { + "type": "object", + "description": "Data for creating a new transfer order line item. Each line item specifies a \n[CatalogItemVariation](entity:CatalogItemVariation) and quantity to transfer.", + "x-release-status": "BETA", + "required": [ + "item_variation_id", + "quantity_ordered" + ], + "properties": { + "item_variation_id": { + "type": "string", + "description": "ID of the [CatalogItemVariation](entity:CatalogItemVariation) to transfer. Must reference a valid\nitem variation in the [Catalog](api:Catalog). The item variation must be:\n- Active and available for sale\n- Enabled for inventory tracking\n- Available at the source location", + "minLength": 1, + "maxLength": 64 + }, + "quantity_ordered": { + "type": "string", + "description": "Total quantity ordered", + "minLength": 1, + "maxLength": 16, + "pattern": "^(0|[1-9]\\d*)(\\.\\d{1,4})?$" + } + } + }, + "CreateTransferOrderRequest": { + "type": "object", + "description": "Request to create a new transfer order.", + "x-release-status": "BETA", + "required": [ + "idempotency_key", + "transfer_order" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this CreateTransferOrder request. Keys can be\nany valid string but must be unique for every CreateTransferOrder request.", + "minLength": 1 + }, + "transfer_order": { + "$ref": "#/components/schemas/CreateTransferOrderData", + "description": "The transfer order to create" + } + }, + "example": { + "idempotency_key": "65cc0586-3e82-384s-b524-3885cffd52", + "transfer_order": { + "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", + "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", + "expected_at": "2025-11-09T05:00:00Z", + "line_items": [ + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", + "quantity_ordered": "5" + }, + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_002", + "quantity_ordered": "3" + } + ], + "notes": "Example transfer order for inventory redistribution between locations", + "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", + "tracking_number": "TRACK123456789" + } + } + }, + "CreateTransferOrderResponse": { + "type": "object", + "description": "Response for creating a transfer order.", + "x-release-status": "BETA", + "properties": { + "transfer_order": { + "$ref": "#/components/schemas/TransferOrder", + "description": "The created transfer order" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request" + } + }, + "example": { + "transfer_order": { + "created_at": "2025-01-15T10:30:00Z", + "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", + "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", + "expected_at": "2025-11-09T05:00:00Z", + "id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "line_items": [ + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", + "quantity_canceled": "0", + "quantity_damaged": "0", + "quantity_ordered": "5", + "quantity_pending": "5", + "quantity_received": "0", + "uid": "1" + }, + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_002", + "quantity_canceled": "0", + "quantity_damaged": "0", + "quantity_ordered": "3", + "quantity_pending": "3", + "quantity_received": "0", + "uid": "2" + } + ], + "notes": "Example transfer order for inventory redistribution between locations", + "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", + "status": "DRAFT", + "tracking_number": "TRACK123456789", + "updated_at": "2025-01-15T10:30:00Z", + "version": 1753109537351 + } + } + }, + "CreateVendorRequest": { + "type": "object", + "description": "Represents an input to a call to [CreateVendor](api-endpoint:Vendors-CreateVendor).", + "x-release-status": "BETA", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A client-supplied, universally unique identifier (UUID) to make this [CreateVendor](api-endpoint:Vendors-CreateVendor) call idempotent.\n\nSee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the\n[API Development 101](https://developer.squareup.com/docs/buildbasics) section for more\ninformation.", + "minLength": 1, + "maxLength": 128 + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The requested [Vendor](entity:Vendor) to be created." + } + }, + "example": { + "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "name": "Joe's Fresh Seafood", + "note": "a vendor" + } + } + }, + "CreateVendorResponse": { + "type": "object", + "description": "Represents an output from a call to [CreateVendor](api-endpoint:Vendors-CreateVendor).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered when the request fails." + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The successfully created [Vendor](entity:Vendor) object." + } + }, + "example": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "a vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 1 + } + } + }, + "CreateWebhookSubscriptionRequest": { + "type": "object", + "description": "Creates a [Subscription](entity:WebhookSubscription).", + "x-release-status": "PUBLIC", + "required": [ + "subscription" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) request.", + "maxLength": 45 + }, + "subscription": { + "$ref": "#/components/schemas/WebhookSubscription", + "description": "The [Subscription](entity:WebhookSubscription) to create." + } + }, + "example": { + "idempotency_key": "63f84c6c-2200-4c99-846c-2670a1311fbf", + "subscription": { + "api_version": "2021-12-15", + "event_types": [ + "payment.created", + "payment.updated" + ], + "name": "Example Webhook Subscription", + "notification_url": "https://example-webhook-url.com" + } + } + }, + "CreateWebhookSubscriptionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) endpoint.\n\nNote: if there are errors processing the request, the [Subscription](entity:WebhookSubscription) will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/WebhookSubscription", + "description": "The new [Subscription](entity:WebhookSubscription)." + } + }, + "example": { + "subscription": { + "api_version": "2021-12-15", + "created_at": "2022-01-10 23:29:48 +0000 UTC", + "enabled": true, + "event_types": [ + "payment.created", + "payment.updated" + ], + "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", + "name": "Example Webhook Subscription", + "notification_url": "https://example-webhook-url.com", + "signature_key": "1k9bIJKCeTmSQwyagtNRLg", + "updated_at": "2022-01-10 23:29:48 +0000 UTC" + } + } + }, + "Currency": { + "type": "string", + "enum": [ + "UNKNOWN_CURRENCY", + "AED", + "AFN", + "ALL", + "AMD", + "ANG", + "AOA", + "ARS", + "AUD", + "AWG", + "AZN", + "BAM", + "BBD", + "BDT", + "BGN", + "BHD", + "BIF", + "BMD", + "BND", + "BOB", + "BOV", + "BRL", + "BSD", + "BTN", + "BWP", + "BYR", + "BZD", + "CAD", + "CDF", + "CHE", + "CHF", + "CHW", + "CLF", + "CLP", + "CNY", + "COP", + "COU", + "CRC", + "CUC", + "CUP", + "CVE", + "CZK", + "DJF", + "DKK", + "DOP", + "DZD", + "EGP", + "ERN", + "ETB", + "EUR", + "FJD", + "FKP", + "GBP", + "GEL", + "GHS", + "GIP", + "GMD", + "GNF", + "GTQ", + "GYD", + "HKD", + "HNL", + "HRK", + "HTG", + "HUF", + "IDR", + "ILS", + "INR", + "IQD", + "IRR", + "ISK", + "JMD", + "JOD", + "JPY", + "KES", + "KGS", + "KHR", + "KMF", + "KPW", + "KRW", + "KWD", + "KYD", + "KZT", + "LAK", + "LBP", + "LKR", + "LRD", + "LSL", + "LTL", + "LVL", + "LYD", + "MAD", + "MDL", + "MGA", + "MKD", + "MMK", + "MNT", + "MOP", + "MRO", + "MUR", + "MVR", + "MWK", + "MXN", + "MXV", + "MYR", + "MZN", + "NAD", + "NGN", + "NIO", + "NOK", + "NPR", + "NZD", + "OMR", + "PAB", + "PEN", + "PGK", + "PHP", + "PKR", + "PLN", + "PYG", + "QAR", + "RON", + "RSD", + "RUB", + "RWF", + "SAR", + "SBD", + "SCR", + "SDG", + "SEK", + "SGD", + "SHP", + "SLL", + "SLE", + "SOS", + "SRD", + "SSP", + "STD", + "SVC", + "SYP", + "SZL", + "THB", + "TJS", + "TMT", + "TND", + "TOP", + "TRY", + "TTD", + "TWD", + "TZS", + "UAH", + "UGX", + "USD", + "USN", + "USS", + "UYI", + "UYU", + "UZS", + "VEF", + "VND", + "VUV", + "WST", + "XAF", + "XAG", + "XAU", + "XBA", + "XBB", + "XBC", + "XBD", + "XCD", + "XDR", + "XOF", + "XPD", + "XPF", + "XPT", + "XTS", + "XXX", + "YER", + "ZAR", + "ZMK", + "ZMW", + "BTC", + "XUS" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_CURRENCY", + "description": "Unknown currency" + }, + { + "name": "AED", + "description": "United Arab Emirates dirham" + }, + { + "name": "AFN", + "description": "Afghan afghani" + }, + { + "name": "ALL", + "description": "Albanian lek" + }, + { + "name": "AMD", + "description": "Armenian dram" + }, + { + "name": "ANG", + "description": "Netherlands Antillean guilder" + }, + { + "name": "AOA", + "description": "Angolan kwanza" + }, + { + "name": "ARS", + "description": "Argentine peso" + }, + { + "name": "AUD", + "description": "Australian dollar" + }, + { + "name": "AWG", + "description": "Aruban florin" + }, + { + "name": "AZN", + "description": "Azerbaijani manat" + }, + { + "name": "BAM", + "description": "Bosnia and Herzegovina convertible mark" + }, + { + "name": "BBD", + "description": "Barbados dollar" + }, + { + "name": "BDT", + "description": "Bangladeshi taka" + }, + { + "name": "BGN", + "description": "Bulgarian lev" + }, + { + "name": "BHD", + "description": "Bahraini dinar" + }, + { + "name": "BIF", + "description": "Burundian franc" + }, + { + "name": "BMD", + "description": "Bermudian dollar" + }, + { + "name": "BND", + "description": "Brunei dollar" + }, + { + "name": "BOB", + "description": "Boliviano" + }, + { + "name": "BOV", + "description": "Bolivian Mvdol" + }, + { + "name": "BRL", + "description": "Brazilian real" + }, + { + "name": "BSD", + "description": "Bahamian dollar" + }, + { + "name": "BTN", + "description": "Bhutanese ngultrum" + }, + { + "name": "BWP", + "description": "Botswana pula" + }, + { + "name": "BYR", + "description": "Belarusian ruble" + }, + { + "name": "BZD", + "description": "Belize dollar" + }, + { + "name": "CAD", + "description": "Canadian dollar" + }, + { + "name": "CDF", + "description": "Congolese franc" + }, + { + "name": "CHE", + "description": "WIR Euro" + }, + { + "name": "CHF", + "description": "Swiss franc" + }, + { + "name": "CHW", + "description": "WIR Franc" + }, + { + "name": "CLF", + "description": "Unidad de Fomento" + }, + { + "name": "CLP", + "description": "Chilean peso" + }, + { + "name": "CNY", + "description": "Chinese yuan" + }, + { + "name": "COP", + "description": "Colombian peso" + }, + { + "name": "COU", + "description": "Unidad de Valor Real" + }, + { + "name": "CRC", + "description": "Costa Rican colon" + }, + { + "name": "CUC", + "description": "Cuban convertible peso" + }, + { + "name": "CUP", + "description": "Cuban peso" + }, + { + "name": "CVE", + "description": "Cape Verdean escudo" + }, + { + "name": "CZK", + "description": "Czech koruna" + }, + { + "name": "DJF", + "description": "Djiboutian franc" + }, + { + "name": "DKK", + "description": "Danish krone" + }, + { + "name": "DOP", + "description": "Dominican peso" + }, + { + "name": "DZD", + "description": "Algerian dinar" + }, + { + "name": "EGP", + "description": "Egyptian pound" + }, + { + "name": "ERN", + "description": "Eritrean nakfa" + }, + { + "name": "ETB", + "description": "Ethiopian birr" + }, + { + "name": "EUR", + "description": "Euro" + }, + { + "name": "FJD", + "description": "Fiji dollar" + }, + { + "name": "FKP", + "description": "Falkland Islands pound" + }, + { + "name": "GBP", + "description": "Pound sterling" + }, + { + "name": "GEL", + "description": "Georgian lari" + }, + { + "name": "GHS", + "description": "Ghanaian cedi" + }, + { + "name": "GIP", + "description": "Gibraltar pound" + }, + { + "name": "GMD", + "description": "Gambian dalasi" + }, + { + "name": "GNF", + "description": "Guinean franc" + }, + { + "name": "GTQ", + "description": "Guatemalan quetzal" + }, + { + "name": "GYD", + "description": "Guyanese dollar" + }, + { + "name": "HKD", + "description": "Hong Kong dollar" + }, + { + "name": "HNL", + "description": "Honduran lempira" + }, + { + "name": "HRK", + "description": "Croatian kuna" + }, + { + "name": "HTG", + "description": "Haitian gourde" + }, + { + "name": "HUF", + "description": "Hungarian forint" + }, + { + "name": "IDR", + "description": "Indonesian rupiah" + }, + { + "name": "ILS", + "description": "Israeli new shekel" + }, + { + "name": "INR", + "description": "Indian rupee" + }, + { + "name": "IQD", + "description": "Iraqi dinar" + }, + { + "name": "IRR", + "description": "Iranian rial" + }, + { + "name": "ISK", + "description": "Icelandic króna" + }, + { + "name": "JMD", + "description": "Jamaican dollar" + }, + { + "name": "JOD", + "description": "Jordanian dinar" + }, + { + "name": "JPY", + "description": "Japanese yen" + }, + { + "name": "KES", + "description": "Kenyan shilling" + }, + { + "name": "KGS", + "description": "Kyrgyzstani som" + }, + { + "name": "KHR", + "description": "Cambodian riel" + }, + { + "name": "KMF", + "description": "Comoro franc" + }, + { + "name": "KPW", + "description": "North Korean won" + }, + { + "name": "KRW", + "description": "South Korean won" + }, + { + "name": "KWD", + "description": "Kuwaiti dinar" + }, + { + "name": "KYD", + "description": "Cayman Islands dollar" + }, + { + "name": "KZT", + "description": "Kazakhstani tenge" + }, + { + "name": "LAK", + "description": "Lao kip" + }, + { + "name": "LBP", + "description": "Lebanese pound" + }, + { + "name": "LKR", + "description": "Sri Lankan rupee" + }, + { + "name": "LRD", + "description": "Liberian dollar" + }, + { + "name": "LSL", + "description": "Lesotho loti" + }, + { + "name": "LTL", + "description": "Lithuanian litas" + }, + { + "name": "LVL", + "description": "Latvian lats" + }, + { + "name": "LYD", + "description": "Libyan dinar" + }, + { + "name": "MAD", + "description": "Moroccan dirham" + }, + { + "name": "MDL", + "description": "Moldovan leu" + }, + { + "name": "MGA", + "description": "Malagasy ariary" + }, + { + "name": "MKD", + "description": "Macedonian denar" + }, + { + "name": "MMK", + "description": "Myanmar kyat" + }, + { + "name": "MNT", + "description": "Mongolian tögrög" + }, + { + "name": "MOP", + "description": "Macanese pataca" + }, + { + "name": "MRO", + "description": "Mauritanian ouguiya" + }, + { + "name": "MUR", + "description": "Mauritian rupee" + }, + { + "name": "MVR", + "description": "Maldivian rufiyaa" + }, + { + "name": "MWK", + "description": "Malawian kwacha" + }, + { + "name": "MXN", + "description": "Mexican peso" + }, + { + "name": "MXV", + "description": "Mexican Unidad de Inversion" + }, + { + "name": "MYR", + "description": "Malaysian ringgit" + }, + { + "name": "MZN", + "description": "Mozambican metical" + }, + { + "name": "NAD", + "description": "Namibian dollar" + }, + { + "name": "NGN", + "description": "Nigerian naira" + }, + { + "name": "NIO", + "description": "Nicaraguan córdoba" + }, + { + "name": "NOK", + "description": "Norwegian krone" + }, + { + "name": "NPR", + "description": "Nepalese rupee" + }, + { + "name": "NZD", + "description": "New Zealand dollar" + }, + { + "name": "OMR", + "description": "Omani rial" + }, + { + "name": "PAB", + "description": "Panamanian balboa" + }, + { + "name": "PEN", + "description": "Peruvian sol" + }, + { + "name": "PGK", + "description": "Papua New Guinean kina" + }, + { + "name": "PHP", + "description": "Philippine peso" + }, + { + "name": "PKR", + "description": "Pakistani rupee" + }, + { + "name": "PLN", + "description": "Polish złoty" + }, + { + "name": "PYG", + "description": "Paraguayan guaraní" + }, + { + "name": "QAR", + "description": "Qatari riyal" + }, + { + "name": "RON", + "description": "Romanian leu" + }, + { + "name": "RSD", + "description": "Serbian dinar" + }, + { + "name": "RUB", + "description": "Russian ruble" + }, + { + "name": "RWF", + "description": "Rwandan franc" + }, + { + "name": "SAR", + "description": "Saudi riyal" + }, + { + "name": "SBD", + "description": "Solomon Islands dollar" + }, + { + "name": "SCR", + "description": "Seychelles rupee" + }, + { + "name": "SDG", + "description": "Sudanese pound" + }, + { + "name": "SEK", + "description": "Swedish krona" + }, + { + "name": "SGD", + "description": "Singapore dollar" + }, + { + "name": "SHP", + "description": "Saint Helena pound" + }, + { + "name": "SLL", + "description": "Sierra Leonean first leone" + }, + { + "name": "SLE", + "description": "Sierra Leonean second leone" + }, + { + "name": "SOS", + "description": "Somali shilling" + }, + { + "name": "SRD", + "description": "Surinamese dollar" + }, + { + "name": "SSP", + "description": "South Sudanese pound" + }, + { + "name": "STD", + "description": "São Tomé and Príncipe dobra" + }, + { + "name": "SVC", + "description": "Salvadoran colón" + }, + { + "name": "SYP", + "description": "Syrian pound" + }, + { + "name": "SZL", + "description": "Swazi lilangeni" + }, + { + "name": "THB", + "description": "Thai baht" + }, + { + "name": "TJS", + "description": "Tajikstani somoni" + }, + { + "name": "TMT", + "description": "Turkmenistan manat" + }, + { + "name": "TND", + "description": "Tunisian dinar" + }, + { + "name": "TOP", + "description": "Tongan pa'anga" + }, + { + "name": "TRY", + "description": "Turkish lira" + }, + { + "name": "TTD", + "description": "Trinidad and Tobago dollar" + }, + { + "name": "TWD", + "description": "New Taiwan dollar" + }, + { + "name": "TZS", + "description": "Tanzanian shilling" + }, + { + "name": "UAH", + "description": "Ukrainian hryvnia" + }, + { + "name": "UGX", + "description": "Ugandan shilling" + }, + { + "name": "USD", + "description": "United States dollar" + }, + { + "name": "USN", + "description": "United States dollar (next day)" + }, + { + "name": "USS", + "description": "United States dollar (same day)" + }, + { + "name": "UYI", + "description": "Uruguay Peso en Unidedades Indexadas" + }, + { + "name": "UYU", + "description": "Uruguyan peso" + }, + { + "name": "UZS", + "description": "Uzbekistan som" + }, + { + "name": "VEF", + "description": "Venezuelan bolívar soberano" + }, + { + "name": "VND", + "description": "Vietnamese đồng" + }, + { + "name": "VUV", + "description": "Vanuatu vatu" + }, + { + "name": "WST", + "description": "Samoan tala" + }, + { + "name": "XAF", + "description": "CFA franc BEAC" + }, + { + "name": "XAG", + "description": "Silver" + }, + { + "name": "XAU", + "description": "Gold" + }, + { + "name": "XBA", + "description": "European Composite Unit" + }, + { + "name": "XBB", + "description": "European Monetary Unit" + }, + { + "name": "XBC", + "description": "European Unit of Account 9" + }, + { + "name": "XBD", + "description": "European Unit of Account 17" + }, + { + "name": "XCD", + "description": "East Caribbean dollar" + }, + { + "name": "XDR", + "description": "Special drawing rights (International Monetary Fund)" + }, + { + "name": "XOF", + "description": "CFA franc BCEAO" + }, + { + "name": "XPD", + "description": "Palladium" + }, + { + "name": "XPF", + "description": "CFP franc" + }, + { + "name": "XPT", + "description": "Platinum" + }, + { + "name": "XTS", + "description": "Code reserved for testing" + }, + { + "name": "XXX", + "description": "No currency" + }, + { + "name": "YER", + "description": "Yemeni rial" + }, + { + "name": "ZAR", + "description": "South African rand" + }, + { + "name": "ZMK", + "description": "Zambian kwacha" + }, + { + "name": "ZMW", + "description": "Zambian kwacha" + }, + { + "name": "BTC", + "description": "Bitcoin" + }, + { + "name": "XUS", + "description": "USD Coin" + } + ], + "description": "Indicates the associated currency for an amount of money. Values correspond\nto [ISO 4217](https://wikipedia.org/wiki/ISO_4217).", + "x-release-status": "PUBLIC" + }, + "CustomAttribute": { + "type": "object", + "description": "A custom attribute value. Each custom attribute value has a corresponding\n`CustomAttributeDefinition` object.", + "x-release-status": "PUBLIC", + "properties": { + "key": { + "type": "string", + "description": "The identifier\nof the custom attribute definition and its corresponding custom attributes. This value\ncan be a simple key, which is the key that is provided when the custom attribute definition\nis created, or a qualified key, if the requesting\napplication is not the definition owner. The qualified key consists of the application ID\nof the custom attribute definition owner\nfollowed by the simple key that was provided when the definition was created. It has the\nformat application_id:simple key.\n\nThe value for a simple key can contain up to 60 alphanumeric characters, periods (.),\nunderscores (_), and hyphens (-).", + "minLength": 1, + "pattern": "^([a-zA-Z0-9\\._-]+:)?[a-zA-Z0-9\\._-]{1,60}$", + "nullable": true + }, + "value": { + "description": "The value assigned to the custom attribute. It is validated against the custom\nattribute definition's schema on write operations. For more information about custom\nattribute values,\nsee [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview).", + "nullable": true + }, + "version": { + "type": "integer", + "description": "Read only. The current version of the custom attribute. This field is incremented when the custom attribute is changed.\nWhen updating an existing custom attribute value, you can provide this field\nand specify the current version of the custom attribute to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency).\nThis field can also be used to enforce strong consistency for reads. For more information about strong consistency for reads,\nsee [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview)." + }, + "visibility": { + "$ref": "#/components/schemas/CustomAttributeDefinitionVisibility", + "description": "A copy of the `visibility` field value for the associated custom attribute definition.\nSee [CustomAttributeDefinitionVisibility](#type-customattributedefinitionvisibility) for possible values", + "readOnly": true + }, + "definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "A copy of the associated custom attribute definition object. This field is only set when\nthe optional field is specified on the request.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp that indicates when the custom attribute was created or was most recently\nupdated, in RFC 3339 format.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the custom attribute was created, in RFC 3339 format.", + "readOnly": true + } + } + }, + "CustomAttributeDefinition": { + "type": "object", + "description": "Represents a definition for custom attribute values. A custom attribute definition\nspecifies the key, visibility, schema, and other properties for a custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "key": { + "type": "string", + "description": "The identifier\nof the custom attribute definition and its corresponding custom attributes. This value\ncan be a simple key, which is the key that is provided when the custom attribute definition\nis created, or a qualified key, if the requesting\napplication is not the definition owner. The qualified key consists of the application ID\nof the custom attribute definition owner\nfollowed by the simple key that was provided when the definition was created. It has the\nformat application_id:simple key.\n\nThe value for a simple key can contain up to 60 alphanumeric characters, periods (.),\nunderscores (_), and hyphens (-).\n\nThis field can not be changed\nafter the custom attribute definition is created. This field is required when creating\na definition and must be unique per application, seller, and resource type.", + "minLength": 1, + "pattern": "^([a-zA-Z0-9\\._-]+:)?[a-zA-Z0-9\\._-]{1,60}$", + "nullable": true + }, + "schema": { + "type": "object", + "description": "The JSON schema for the custom attribute definition, which determines the data type of the corresponding custom attributes. For more information,\nsee [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). This field is required when creating a definition.", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the custom attribute definition for API and seller-facing UI purposes. The name must\nbe unique within the seller and application pair. This field is required if the\n`visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "maxLength": 255, + "nullable": true + }, + "description": { + "type": "string", + "description": "Seller-oriented description of the custom attribute definition, including any constraints\nthat the seller should observe. May be displayed as a tooltip in Square UIs. This field is\nrequired if the `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "maxLength": 255, + "nullable": true + }, + "visibility": { + "$ref": "#/components/schemas/CustomAttributeDefinitionVisibility", + "description": "Specifies how the custom attribute definition and its values should be shared with\nthe seller and other applications. If no value is specified, the value defaults to `VISIBILITY_HIDDEN`.\nSee [Visibility](#type-visibility) for possible values", + "nullable": true + }, + "version": { + "type": "integer", + "description": "Read only. The current version of the custom attribute definition.\nThe value is incremented each time the custom attribute definition is updated.\nWhen updating a custom attribute definition, you can provide this field\nand specify the current version of the custom attribute definition to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency).\n\nOn writes, this field must be set to the latest version. Stale writes are rejected.\n\nThis field can also be used to enforce strong consistency for reads. For more information about strong consistency for reads,\nsee [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview)." + }, + "updated_at": { + "type": "string", + "description": "The timestamp that indicates when the custom attribute definition was created or most recently updated,\nin RFC 3339 format.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the custom attribute definition was created, in RFC 3339 format.", + "readOnly": true + } + } + }, + "CustomAttributeDefinitionEventData": { + "type": "object", + "description": "Represents an object in the CustomAttributeDefinition event notification\npayload that contains the affected custom attribute definition.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"custom_attribute_definition\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventDataObject", + "description": "An object containing the custom attribute definition.", + "nullable": true + } + } + }, + "CustomAttributeDefinitionEventDataObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition.", + "nullable": true + } + } + }, + "CustomAttributeDefinitionVisibility": { + "type": "string", + "enum": [ + "VISIBILITY_HIDDEN", + "VISIBILITY_READ_ONLY", + "VISIBILITY_READ_WRITE_VALUES" + ], + "x-enum-elements": [ + { + "name": "VISIBILITY_HIDDEN", + "description": "The custom attribute definition and values are hidden from the seller (except on export\nof all seller data) and other developers." + }, + { + "name": "VISIBILITY_READ_ONLY", + "description": "The seller and other developers can read the custom attribute definition and values\non resources." + }, + { + "name": "VISIBILITY_READ_WRITE_VALUES", + "description": "The seller and other developers can read the custom attribute definition,\nand can read and write values on resources. A custom attribute definition\ncan only be edited or deleted by the application that created it." + } + ], + "description": "The level of permission that a seller or other applications requires to\nview this custom attribute definition.\nThe `Visibility` field controls who can read and write the custom attribute values\nand custom attribute definition.", + "x-release-status": "PUBLIC" + }, + "CustomAttributeEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"custom_attribute\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CustomAttributeEventDataObject", + "description": "An object containing the custom attribute.", + "nullable": true + } + } + }, + "CustomAttributeEventDataObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute.", + "nullable": true + } + } + }, + "CustomAttributeFilter": { + "type": "object", + "description": "Supported custom attribute query expressions for calling the\n[SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems)\nendpoint to search for items or item variations.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition_id": { + "type": "string", + "description": "A query expression to filter items or item variations by matching their custom attributes'\n`custom_attribute_definition_id` property value against the the specified id.\nExactly one of `custom_attribute_definition_id` or `key` must be specified.", + "nullable": true + }, + "key": { + "type": "string", + "description": "A query expression to filter items or item variations by matching their custom attributes'\n`key` property value against the specified key.\nExactly one of `custom_attribute_definition_id` or `key` must be specified.", + "nullable": true + }, + "string_filter": { + "type": "string", + "description": "A query expression to filter items or item variations by matching their custom attributes'\n`string_value` property value against the specified text.\nExactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.", + "nullable": true + }, + "number_filter": { + "$ref": "#/components/schemas/Range", + "description": "A query expression to filter items or item variations with their custom attributes\ncontaining a number value within the specified range.\nExactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.", + "nullable": true + }, + "selection_uids_filter": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A query expression to filter items or item variations by matching their custom attributes'\n`selection_uid_values` values against the specified selection uids.\nExactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.", + "nullable": true + }, + "bool_filter": { + "type": "boolean", + "description": "A query expression to filter items or item variations by matching their custom attributes'\n`boolean_value` property values against the specified Boolean expression.\nExactly one of `string_filter`, `number_filter`, `selection_uids_filter`, or `bool_filter` must be specified.", + "nullable": true + } + } + }, + "CustomField": { + "type": "object", + "description": "Describes a custom form field to add to the checkout page to collect more information from buyers during checkout.\nFor more information,\nsee [Specify checkout options](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations#specify-checkout-options-1).", + "x-release-status": "PUBLIC", + "required": [ + "title" + ], + "properties": { + "title": { + "type": "string", + "description": "The title of the custom field.", + "minLength": 1, + "maxLength": 50 + } + } + }, + "Customer": { + "type": "object", + "description": "Represents a Square customer profile in the Customer Directory of a Square seller.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique Square-assigned ID for the customer profile.\n\nIf you need this ID for an API request, use the ID returned when you created the customer profile or call the [SearchCustomers](api-endpoint:Customers-SearchCustomers) \nor [ListCustomers](api-endpoint:Customers-ListCustomers) endpoint." + }, + "created_at": { + "type": "string", + "description": "The timestamp when the customer profile was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the customer profile was last updated, in RFC 3339 format.", + "readOnly": true + }, + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the customer profile.", + "nullable": true + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the customer profile.", + "nullable": true + }, + "nickname": { + "type": "string", + "description": "A nickname for the customer profile.", + "nullable": true + }, + "company_name": { + "type": "string", + "description": "A business name associated with the customer profile.", + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address associated with the customer profile.", + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address associated with the customer profile.", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number associated with the customer profile.", + "nullable": true + }, + "birthday": { + "type": "string", + "description": "The birthday associated with the customer profile, in `YYYY-MM-DD` format. For example, `1998-09-21`\nrepresents September 21, 1998, and `0000-09-21` represents September 21 (without a birth year).", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "An optional second ID used to associate the customer profile with an\nentity in another system.", + "nullable": true + }, + "note": { + "type": "string", + "description": "A custom note associated with the customer profile.", + "nullable": true + }, + "preferences": { + "$ref": "#/components/schemas/CustomerPreferences", + "description": "Represents general customer preferences.", + "nullable": true + }, + "creation_source": { + "$ref": "#/components/schemas/CustomerCreationSource", + "description": "The method used to create the customer profile.\nSee [CustomerCreationSource](#type-customercreationsource) for possible values", + "nullable": true + }, + "group_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of [customer groups](entity:CustomerGroup) the customer belongs to.", + "nullable": true + }, + "segment_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of [customer segments](entity:CustomerSegment) the customer belongs to.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership.", + "format": "int64" + }, + "tax_ids": { + "$ref": "#/components/schemas/CustomerTaxIds", + "description": "The tax ID associated with the customer profile. This field is present only for customers of sellers in EU countries or the United Kingdom. \nFor more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).", + "nullable": true + } + } + }, + "CustomerAddressFilter": { + "type": "object", + "description": "The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](entity:CustomerCustomAttributeFilterValue) filter when\nsearching by an `Address`-type custom attribute.", + "x-release-status": "PUBLIC", + "properties": { + "postal_code": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "The postal code to search for. Only an `exact` match is supported.", + "nullable": true + }, + "country": { + "$ref": "#/components/schemas/Country", + "description": "The country code to search for.\nSee [Country](#type-country) for possible values", + "nullable": true + } + } + }, + "CustomerCreatedEvent": { + "type": "object", + "description": "Published when a [customer](entity:Customer) is created. Subscribe to this event to track customer profiles affected by a merge operation.\nFor more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks).\n\nThe `customer` object in the event notification does not include the `segment_ids` field.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this object, the value is `customer.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for [idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomerCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:23:25Z", + "data": { + "id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "object": { + "customer": { + "address": { + "address_line_1": "1018 40th Street", + "administrative_district_level_1": "CA", + "locality": "Oakland", + "postal_code": "94608" + }, + "birthday": "1962-03-04", + "created_at": "2022-11-09T21:23:25.519Z", + "creation_source": "DIRECTORY", + "email_address": "jenkins+smorly@squareup.com", + "family_name": "Smorly", + "given_name": "Jenkins", + "group_ids": [ + "JGJCW9S0G68NE.APPOINTMENTS" + ], + "id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "phone_number": "+12126668929", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2022-11-09T21:23:25Z", + "version": 0 + } + }, + "type": "customer" + }, + "event_id": "e12b5591-e0b6-4967-810a-307c7efcb1a7", + "merchant_id": "G7MMEBVW021Q4", + "type": "customer.created" + }, + "x-webhook": { + "event": "customer.created", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/Customers", + "x-since": "2021-02-26" + }, + "CustomerCreatedEventData": { + "type": "object", + "description": "The data associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `customer`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the new customer.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CustomerCreatedEventObject", + "description": "An object that contains the new customer.", + "nullable": true + } + } + }, + "CustomerCreatedEventEventContext": { + "type": "object", + "description": "Information about the change that triggered the event.", + "x-release-status": "PUBLIC", + "properties": { + "merge": { + "$ref": "#/components/schemas/CustomerCreatedEventEventContextMerge", + "description": "Information about the merge operation associated with the event.", + "nullable": true + } + } + }, + "CustomerCreatedEventEventContextMerge": { + "type": "object", + "description": "Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers.", + "x-release-status": "PUBLIC", + "properties": { + "from_customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the existing customers that were merged and then deleted.", + "nullable": true + }, + "to_customer_id": { + "type": "string", + "description": "The ID of the new customer created by the merge.", + "nullable": true + } + } + }, + "CustomerCreatedEventObject": { + "type": "object", + "description": "An object that contains the customer associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The new customer.", + "nullable": true + }, + "event_context": { + "$ref": "#/components/schemas/CustomerCreatedEventEventContext", + "description": "Information about the change that triggered the event. This field is returned only if the customer is created by a merge operation.", + "nullable": true + } + } + }, + "CustomerCreationSource": { + "type": "string", + "enum": [ + "OTHER", + "APPOINTMENTS", + "COUPON", + "DELETION_RECOVERY", + "DIRECTORY", + "EGIFTING", + "EMAIL_COLLECTION", + "FEEDBACK", + "IMPORT", + "INVOICES", + "LOYALTY", + "MARKETING", + "MERGE", + "ONLINE_STORE", + "INSTANT_PROFILE", + "TERMINAL", + "THIRD_PARTY", + "THIRD_PARTY_IMPORT", + "UNMERGE_RECOVERY" + ], + "x-enum-elements": [ + { + "name": "OTHER", + "description": "The default creation source. This source is typically used for backward/future\ncompatibility when the original source of a customer profile is\nunrecognized. For example, when older clients do not support newer\nsource types." + }, + { + "name": "APPOINTMENTS", + "description": "The customer profile was created automatically when an appointment\nwas scheduled." + }, + { + "name": "COUPON", + "description": "The customer profile was created automatically when a coupon was issued\nusing Square Point of Sale." + }, + { + "name": "DELETION_RECOVERY", + "description": "The customer profile was restored through Square's deletion recovery\nprocess." + }, + { + "name": "DIRECTORY", + "description": "The customer profile was created manually through Square Seller Dashboard or the \nPoint of Sale application." + }, + { + "name": "EGIFTING", + "description": "The customer profile was created automatically when a gift card was\nissued using Square Point of Sale. Customer profiles are created for\nboth the buyer and the recipient of the gift card." + }, + { + "name": "EMAIL_COLLECTION", + "description": "The customer profile was created through Square Point of Sale when\nsigning up for marketing emails during checkout." + }, + { + "name": "FEEDBACK", + "description": "The customer profile was created automatically when providing feedback\nthrough a digital receipt." + }, + { + "name": "IMPORT", + "description": "The customer profile was created automatically when importing customer\ndata through Square Seller Dashboard." + }, + { + "name": "INVOICES", + "description": "The customer profile was created automatically during an invoice payment." + }, + { + "name": "LOYALTY", + "description": "The customer profile was created automatically when customers provide a\nphone number for loyalty reward programs during checkout." + }, + { + "name": "MARKETING", + "description": "The customer profile was created as the result of a campaign managed\nthrough Square’s Facebook integration." + }, + { + "name": "MERGE", + "description": "The customer profile was created as the result of explicitly merging\nmultiple customer profiles through the Square Seller Dashboard or the Point of\nSale application." + }, + { + "name": "ONLINE_STORE", + "description": "The customer profile was created through Square's Online Store solution\n(legacy service)." + }, + { + "name": "INSTANT_PROFILE", + "description": "The customer profile was created automatically as the result of a successful\ntransaction that did not explicitly link to an existing customer profile." + }, + { + "name": "TERMINAL", + "description": "The customer profile was created through Square's Virtual Terminal." + }, + { + "name": "THIRD_PARTY", + "description": "The customer profile was created through a Square API call." + }, + { + "name": "THIRD_PARTY_IMPORT", + "description": "The customer profile was created by a third-party product and imported\nthrough an official integration." + }, + { + "name": "UNMERGE_RECOVERY", + "description": "The customer profile was restored through Square's unmerge recovery\nprocess." + } + ], + "description": "Indicates the method used to create the customer profile.", + "x-release-status": "PUBLIC" + }, + "CustomerCreationSourceFilter": { + "type": "object", + "description": "The creation source filter.\n\nIf one or more creation sources are set, customer profiles are included in,\nor excluded from, the result if they match at least one of the filter criteria.", + "x-release-status": "PUBLIC", + "properties": { + "values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerCreationSource" + }, + "description": "The list of creation sources used as filtering criteria.\nSee [CustomerCreationSource](#type-customercreationsource) for possible values", + "nullable": true + }, + "rule": { + "$ref": "#/components/schemas/CustomerInclusionExclusion", + "description": "Indicates whether a customer profile matching the filter criteria\nshould be included in the result or excluded from the result.\n\nDefault: `INCLUDE`.\nSee [CustomerInclusionExclusion](#type-customerinclusionexclusion) for possible values", + "nullable": true + } + } + }, + "CustomerCustomAttributeDefinitionCreatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) \nis created by the subscribing application.\n\nThis event is replaced by \n[customer.custom_attribute_definition.owned.created](webhook:customer.custom_attribute_definition.owned.created).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "347ab320-c0ba-48f5-959a-4e147b9aefcf", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.created" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.created", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionCreatedPublicEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to all applications is created. A notification is sent when any application creates a custom\nattribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.\n\nThis event is replaced by \n[customer.custom_attribute_definition.visible.created](webhook:customer.custom_attribute_definition.visible.created),\nwhich applies to custom attribute definitions that are visible to the subscribing application.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.public.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "names": [ + "Small", + "Medium", + "Large" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "f679dc4f-3619-4764-a4de-94a54735cd32", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.public.created" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.public.created", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\ncreated by the subscribing application is deleted. A custom attribute definition can only be deleted by\nthe application that created it.\n\nThis event is replaced by \n[customer.custom_attribute_definition.owned.deleted](webhook:customer.custom_attribute_definition.owned.deleted).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "49363646-7ae7-49b5-aaa0-296610883c61", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionDeletedPublicEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to all applications is deleted. A notification is sent when any application deletes a custom\nattribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.\n\nThis event is replaced by \n[customer.custom_attribute_definition.visible.deleted](webhook:customer.custom_attribute_definition.visible.deleted),\nwhich applies to custom attribute definitions that are visible to the subscribing application.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.public.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's t-shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "T-Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08", + "89ca2c01-e4e3-43d6-b846-1495c4e8f97b", + "4f985a76-08fc-44b1-9ec4-b1904685c3a5" + ], + "names": [ + "Small", + "Medium", + "Large", + "Extra Large", + "Extra Small" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "81c10a07-c329-4943-af20-7d70a300c7e6", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.public.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.public.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionOwnedCreatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) \nis created by the subscribing application.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.owned.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "347ab320-c0ba-48f5-959a-4e147b9aefcf", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.owned.created" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.owned.created", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDefinitionOwnedDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\ncreated by the subscribing application is deleted. A custom attribute definition can only be deleted by\nthe application that created it.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "49363646-7ae7-49b5-aaa0-296610883c61", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.owned.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.owned.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDefinitionOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\ncreated by the subscribing application is updated. A custom attribute definition can only be updated by\nthe application that created it.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "d914e6ef-9e37-4bca-a663-ecc55f5d98d3", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.owned.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.owned.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDefinitionUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\ncreated by the subscribing application is updated. A custom attribute definition can only be updated by\nthe application that created it.\n\nThis event is replaced by \n[customer.custom_attribute_definition.owned.updated](webhook:customer.custom_attribute_definition.owned.updated).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "The customer's favorite drink", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "name": "Favorite Drink", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "d914e6ef-9e37-4bca-a663-ecc55f5d98d3", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionUpdatedPublicEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to all applications is updated. A notification is sent when any application updates a custom\nattribute definition whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.\n\nThis event is replaced by \n[customer.custom_attribute_definition.visible.updated](webhook:customer.custom_attribute_definition.visible.updated),\nwhich applies to custom attribute definitions that are visible to the subscribing application.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.public.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "The customer's t-shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "T-Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08", + "89ca2c01-e4e3-43d6-b846-1495c4e8f97b", + "4f985a76-08fc-44b1-9ec4-b1904685c3a5" + ], + "names": [ + "Small", + "Medium", + "Large", + "Extra Large", + "Extra Small" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "ae376c21-d360-4694-96c7-1b27830f07d7", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.public.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.public.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDefinitionVisibleCreatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is created. A notification is sent when your application\ncreates a custom attribute definition or another application creates a custom attribute definition whose\n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.visible.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "names": [ + "Small", + "Medium", + "Large" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "f679dc4f-3619-4764-a4de-94a54735cd32", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.visible.created" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.visible.created", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDefinitionVisibleDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is deleted. A custom attribute definition can only be deleted\nby the application that created it. A notification is sent when your application deletes a custom attribute\ndefinition or when another application deletes a custom attribute definition whose `visibility` is\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "The customer's t-shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "T-Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08", + "89ca2c01-e4e3-43d6-b846-1495c4e8f97b", + "4f985a76-08fc-44b1-9ec4-b1904685c3a5" + ], + "names": [ + "Small", + "Medium", + "Large", + "Extra Large", + "Extra Small" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "81c10a07-c329-4943-af20-7d70a300c7e6", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.visible.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.visible.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDefinitionVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is updated. A custom attribute definition can only be updated\nby the application that created it. A notification is sent when your application updates a custom\nattribute definition or when another application updates a custom attribute definition whose `visibility` is\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute_definition.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "The customer's t-shirt size", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "name": "T-Shirt Size", + "schema": { + "items": { + "enum": [ + "9492bdda-ab4d-4eeb-8496-0986c8f78499", + "6b96fba7-d8a5-ae72-48f4-8c3ee875633f", + "4032c1a2-d749-4c75-9c30-be6472cd2e08", + "89ca2c01-e4e3-43d6-b846-1495c4e8f97b", + "4f985a76-08fc-44b1-9ec4-b1904685c3a5" + ], + "names": [ + "Small", + "Medium", + "Large", + "Extra Large", + "Extra Small" + ] + }, + "maxItems": 1, + "type": "array", + "uniqueItems": true + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "ae376c21-d360-4694-96c7-1b27830f07d7", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute_definition.visible.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute_definition.visible.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) owned by the\nsubscribing application is deleted. Custom attributes are owned by the application that created the\ncorresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose\n`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application.\n\nThis event is replaced by \n[customer.custom_attribute.owned.deleted](webhook:customer.custom_attribute.owned.deleted).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "updated_at": "2022-04-27T11:31:29Z", + "value": "Medium coffee, 2 sugars", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "f57b27d4-a4d6-43de-9e58-bc6ff90525f1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeDeletedPublicEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) that is visible\nto all applications is deleted. A notification is sent when any application deletes a custom attribute\nwhose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.\n\nThis event is replaced by \n[customer.custom_attribute.visible.deleted](webhook:customer.custom_attribute.visible.deleted),\nwhich applies to custom attributes that are visible to the subscribing application.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.public.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "updated_at": "2022-04-27T11:31:29Z", + "value": [ + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "18ef5adc-2efc-4ad9-9b1a-b274a607da3e", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.public.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute.public.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeFilter": { + "type": "object", + "description": "The custom attribute filter. Use this filter in a set of [custom attribute filters](entity:CustomerCustomAttributeFilters) to search\nbased on the value or last updated date of a customer-related [custom attribute](entity:CustomAttribute).", + "x-release-status": "PUBLIC", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string", + "description": "The `key` of the [custom attribute](entity:CustomAttribute) to filter by. The key is the identifier of the custom attribute\n(and the corresponding custom attribute definition) and can be retrieved using the [Customer Custom Attributes API](api:CustomerCustomAttributes)." + }, + "filter": { + "$ref": "#/components/schemas/CustomerCustomAttributeFilterValue", + "description": "A filter that corresponds to the data type of the target custom attribute. For example, provide the `phone` filter to\nsearch based on the value of a `PhoneNumber`-type custom attribute. The data type is specified by the schema field of the custom attribute definition,\nwhich can be retrieved using the [Customer Custom Attributes API](api:CustomerCustomAttributes).\n\nYou must provide this `filter` field, the `updated_at` field, or both.", + "nullable": true + }, + "updated_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The date range for when the custom attribute was last updated. The date range can include `start_at`, `end_at`, or\nboth. Range boundaries are inclusive. Dates are specified as RFC 3339 timestamps.\n\nYou must provide this `updated_at` field, the `filter` field, or both." + } + } + }, + "CustomerCustomAttributeFilterValue": { + "type": "object", + "description": "A type-specific filter used in a [custom attribute filter](entity:CustomerCustomAttributeFilter) to search based on the value \nof a customer-related [custom attribute](entity:CustomAttribute).", + "x-release-status": "PUBLIC", + "properties": { + "email": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter for a query based on the value of an `Email`-type custom attribute. This filter is case-insensitive and can\ninclude `exact` or `fuzzy`, but not both.\n\nFor an `exact` match, provide the complete email address.\n\nFor a `fuzzy` match, provide a query expression containing one or more query tokens to match against the email address. Square removes\nany punctuation (including periods (.), underscores (_), and the @ symbol) and tokenizes the email addresses on spaces. A match is found\nif a tokenized email address contains all the tokens in the search query, irrespective of the token order. For example, `Steven gmail`\nmatches steven.jones@gmail.com and mygmail@stevensbakery.com.", + "nullable": true + }, + "phone": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter for a query based on the value of a `PhoneNumber`-type custom attribute. This filter is case-insensitive and\ncan include `exact` or `fuzzy`, but not both.\n\nFor an `exact` match, provide the complete phone number. This is always an E.164-compliant phone number that starts\nwith the + sign followed by the country code and subscriber number. For example, the format for a US phone number is +12061112222.\n\nFor a `fuzzy` match, provide a query expression containing one or more query tokens to match against the phone number.\nSquare removes any punctuation and tokenizes the expression on spaces. A match is found if a tokenized phone number contains\nall the tokens in the search query, irrespective of the token order. For example, `415 123 45` is tokenized to `415`, `123`, and `45`,\nwhich matches +14151234567 and +12345674158, but does not match +1234156780. Similarly, the expression `415` matches\n+14151234567, +12345674158, and +1234156780.", + "nullable": true + }, + "text": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter for a query based on the value of a `String`-type custom attribute. This filter is case-insensitive and \ncan include `exact` or `fuzzy`, but not both.\n\nFor an `exact` match, provide the complete string.\n\nFor a `fuzzy` match, provide a query expression containing one or more query tokens in any order that contain complete words\nto match against the string. Square tokenizes the expression using a grammar-based tokenizer. For example, the expressions `quick brown`,\n`brown quick`, and `quick fox` match \"The quick brown fox jumps over the lazy dog\". However, `quick foxes` and `qui` do not match.", + "nullable": true + }, + "selection": { + "$ref": "#/components/schemas/FilterValue", + "description": "A filter for a query based on the display name for a `Selection`-type custom attribute value. This filter is case-sensitive\nand can contain `any`, `all`, or both. The `none` condition is not supported.\n\nProvide the display name of each item that you want to search for. To find the display names for the selection, use the \n[Customer Custom Attributes API](api:CustomerCustomAttributes) to retrieve the corresponding custom attribute definition\nand then check the `schema.items.names` field. For more information, see\n[Search based on selection](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#custom-attribute-value-filter-selection).\n\nNote that when a `Selection`-type custom attribute is assigned to a customer profile, the custom attribute value is a list of one\nor more UUIDs (sourced from the `schema.items.enum` field) that map to the item names. These UUIDs are unique per seller.", + "nullable": true + }, + "date": { + "$ref": "#/components/schemas/TimeRange", + "description": "A filter for a query based on the value of a `Date`-type custom attribute.\n\nProvide a date range for this filter using `start_at`, `end_at`, or both. Range boundaries are inclusive. Dates can be specified\nin `YYYY-MM-DD` format or as RFC 3339 timestamps.", + "nullable": true + }, + "number": { + "$ref": "#/components/schemas/FloatNumberRange", + "description": "A filter for a query based on the value of a `Number`-type custom attribute, which can be an integer or a decimal with up to\n5 digits of precision.\n\nProvide a numerical range for this filter using `start_at`, `end_at`, or both. Range boundaries are inclusive. Numbers are specified\nas decimals or integers. The absolute value of range boundaries must not exceed `(2^63-1)/10^5`, or 92233720368547.", + "nullable": true + }, + "boolean": { + "type": "boolean", + "description": "A filter for a query based on the value of a `Boolean`-type custom attribute.", + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/CustomerAddressFilter", + "description": "A filter for a query based on the value of an `Address`-type custom attribute. The filter can include `postal_code`, `country`, or both.", + "nullable": true + } + } + }, + "CustomerCustomAttributeFilters": { + "type": "object", + "description": "The custom attribute filters in a set of [customer filters](entity:CustomerFilter) used in a search query. Use this filter\nto search based on [custom attributes](entity:CustomAttribute) that are assigned to customer profiles. For more information, see\n[Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute).", + "x-release-status": "PUBLIC", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerCustomAttributeFilter" + }, + "description": "The custom attribute filters. Each filter must specify `key` and include the `filter` field with a type-specific filter,\nthe `updated_at` field, or both. The provided keys must be unique within the list of custom attribute filters.", + "nullable": true + } + } + }, + "CustomerCustomAttributeOwnedDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) owned by the\nsubscribing application is deleted. Custom attributes are owned by the application that created the\ncorresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose\n`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "updated_at": "2022-04-27T11:31:29Z", + "value": "Medium coffee, 2 sugars", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "f57b27d4-a4d6-43de-9e58-bc6ff90525f1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.owned.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute.owned.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) owned by the\nsubscribing application is created or updated. Custom attributes are owned by the application that created\nthe corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose\n`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:54Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "updated_at": "2022-04-21T21:40:54Z", + "value": "Double-shot breve", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "e26ca6f2-97f8-426a-b4bf-873044617e94", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.owned.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute.owned.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) owned by the\nsubscribing application is created or updated. Custom attributes are owned by the application that created\nthe corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose\n`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application.\n\nThis event is replaced by \n[customer.custom_attribute.owned.updated](webhook:customer.custom_attribute.owned.updated).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:54Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-drink", + "updated_at": "2022-04-21T21:40:54Z", + "value": "Double-shot breve", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "e26ca6f2-97f8-426a-b4bf-873044617e94", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeUpdatedPublicEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) that is visible\nto all applications is created or updated. A notification is sent when any application creates or updates\na custom attribute whose `visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.\n\nThis event is replaced by \n[customer.custom_attribute.visible.updated](webhook:customer.custom_attribute.visible.updated),\nwhich applies to custom attributes that are visible to the subscribing application.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.public.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "updated_at": "2022-04-26T01:22:29Z", + "value": [ + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "1cc2925c-f6e2-4fb6-a597-07c198de59e1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.public.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute.public.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-05-12" + }, + "CustomerCustomAttributeVisibleDeletedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the\nsubscribing application is deleted. A notification is sent when:\n- Your application deletes a custom attribute owned by your application, regardless of the `visibility` setting.\n- Any application deletes a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`\nor `VISIBILITY_READ_WRITE_VALUES`.\n\nCustom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application, but those set to\n`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the owner. Custom attributes are owned\nby the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:58:59Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "updated_at": "2022-04-27T11:31:29Z", + "value": [ + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "18ef5adc-2efc-4ad9-9b1a-b274a607da3e", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.visible.deleted" + }, + "x-webhook": { + "event": "customer.custom_attribute.visible.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerCustomAttributeVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the\nsubscribing application is created or updated. A notification is sent when:\n- Your application creates or updates a custom attribute owned by your application, regardless of the `visibility` setting.\n- Any application creates or updates a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`\nor `VISIBILITY_READ_WRITE_VALUES`.\n\nCustom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application, but those set to\n`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or updated by the owner. Custom attributes are owned\nby the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"customer.custom_attribute.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size:CUSTOMER:TNQC0TYTWMRSFFQ157KK4V7MVR", + "object": { + "created_at": "2022-04-21T21:40:54Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:shirt-size", + "updated_at": "2022-04-26T01:22:29Z", + "value": [ + "4032c1a2-d749-4c75-9c30-be6472cd2e08" + ], + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "1cc2925c-f6e2-4fb6-a597-07c198de59e1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "customer.custom_attribute.visible.updated" + }, + "x-webhook": { + "event": "customer.custom_attribute.visible.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/CustomerCustomAttributes", + "x-since": "2022-08-17" + }, + "CustomerDeletedEvent": { + "type": "object", + "description": "Published when a [customer](entity:Customer) is deleted. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks).\n\nThe `customer` object in the event notification does not include the following fields: `group_ids` and `segment_ids`.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this object, the value is `customer.deleted`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for [idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomerDeletedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:26:50Z", + "data": { + "deleted": true, + "id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "object": { + "customer": { + "address": { + "address_line_1": "1018 1st Street", + "administrative_district_level_1": "NY", + "locality": "Brooklyn", + "postal_code": "11215" + }, + "birthday": "1962-03-04", + "creation_source": "IMPORT", + "email_address": "jenkins+smorly@squareup.com", + "family_name": "Smiley", + "given_name": "Jenkins", + "id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "phone_number": "+12126668929", + "preferences": { + "email_unsubscribed": false + }, + "version": 3 + } + }, + "type": "customer" + }, + "event_id": "8e84fec8-f04b-46f0-b66d-dbb8b59590fa", + "merchant_id": "G7MMEBVW021Q4", + "type": "customer.deleted" + }, + "x-webhook": { + "event": "customer.deleted", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/Customers", + "x-since": "2021-02-26" + }, + "CustomerDeletedEventData": { + "type": "object", + "description": "The data associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `customer`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the deleted customer.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CustomerDeletedEventObject", + "description": "An object that contains the deleted customer.", + "nullable": true + } + } + }, + "CustomerDeletedEventEventContext": { + "type": "object", + "description": "Information about the change that triggered the event.", + "x-release-status": "PUBLIC", + "properties": { + "merge": { + "$ref": "#/components/schemas/CustomerDeletedEventEventContextMerge", + "description": "Information about the merge operation associated with the event.", + "nullable": true + } + } + }, + "CustomerDeletedEventEventContextMerge": { + "type": "object", + "description": "Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers.", + "x-release-status": "PUBLIC", + "properties": { + "from_customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the existing customers that were merged and then deleted.", + "nullable": true + }, + "to_customer_id": { + "type": "string", + "description": "The ID of the new customer created by the merge.", + "nullable": true + } + } + }, + "CustomerDeletedEventObject": { + "type": "object", + "description": "An object that contains the customer associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The deleted customer.", + "nullable": true + }, + "event_context": { + "$ref": "#/components/schemas/CustomerDeletedEventEventContext", + "description": "Information about the change that triggered the event. This field is returned only if the customer is deleted by a merge operation.", + "nullable": true + } + } + }, + "CustomerDetails": { + "type": "object", + "description": "Details about the customer making the payment.", + "x-release-status": "PUBLIC", + "properties": { + "customer_initiated": { + "type": "boolean", + "description": "Indicates whether the customer initiated the payment.", + "nullable": true + }, + "seller_keyed_in": { + "type": "boolean", + "description": "Indicates that the seller keyed in payment details on behalf of the customer.\nThis is used to flag a payment as Mail Order / Telephone Order (MOTO).", + "nullable": true + } + } + }, + "CustomerFilter": { + "type": "object", + "description": "Represents the filtering criteria in a [search query](entity:CustomerQuery) that defines how to filter\ncustomer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results.", + "x-release-status": "PUBLIC", + "properties": { + "creation_source": { + "$ref": "#/components/schemas/CustomerCreationSourceFilter", + "description": "A filter to select customers based on their creation source.", + "nullable": true + }, + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "A filter to select customers based on when they were created." + }, + "updated_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "A filter to select customers based on when they were last updated." + }, + "email_address": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter to [select customers by their email address](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-email-address) \nvisible to the seller. \nThis filter is case-insensitive.\n\nFor [exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-email-address), this\nfilter causes the search to return customer profiles \nwhose `email_address` field value are identical to the email address provided\nin the query.\n\nFor [fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-email-address), \nthis filter causes the search to return customer profiles \nwhose `email_address` field value has a token-wise partial match against the filtering \nexpression in the query. For example, with `Steven gmail` provided in a search\nquery, the search returns customers whose email address is `steven.johnson@gmail.com` \nor `mygmail@stevensbakery.com`. Square removes any punctuation (including periods (.),\nunderscores (_), and the @ symbol) and tokenizes the email addresses on spaces. A match is\nfound if a tokenized email address contains all the tokens in the search query, \nirrespective of the token order.", + "nullable": true + }, + "phone_number": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter to [select customers by their phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-phone-number)\nvisible to the seller.\n\nFor [exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-phone-number),\nthis filter returns customers whose phone number matches the specified query expression. The number in the query must be of an\nE.164-compliant form. In particular, it must include the leading `+` sign followed by a country code and then a subscriber number.\nFor example, the standard E.164 form of a US phone number is `+12062223333` and an E.164-compliant variation is `+1 (206) 222-3333`.\nTo match the query expression, stored customer phone numbers are converted to the standard E.164 form.\n\nFor [fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-phone-number),\nthis filter returns customers whose phone number matches the token or tokens provided in the query expression. For example, with `415`\nprovided in a search query, the search returns customers with the phone numbers `+1-415-212-1200`, `+1-212-415-1234`, and `+1 (551) 234-1567`.\nSimilarly, a search query of `415 123` returns customers with the phone numbers `+1-212-415-1234` and `+1 (551) 234-1567` but not\n`+1-212-415-1200`. A match is found if a tokenized phone number contains all the tokens in the search query, irrespective of the token order.", + "nullable": true + }, + "reference_id": { + "$ref": "#/components/schemas/CustomerTextFilter", + "description": "A filter to [select customers by their reference IDs](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-reference-id).\nThis filter is case-insensitive.\n\n[Exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-reference-id) \nof a customer's reference ID against a query's reference ID is evaluated as an\nexact match between two strings, character by character in the given order.\n\n[Fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-reference-id) \nof stored reference IDs against queried reference IDs works \nexactly the same as fuzzy matching on email addresses. Non-alphanumeric characters \nare replaced by spaces to tokenize stored and queried reference IDs. A match is found\nif a tokenized stored reference ID contains all tokens specified in any order in the query. For example,\na query of `NYC M` matches customer profiles with the `reference_id` value of `NYC_M_35_JOHNSON`\nand `NYC_27_MURRAY`.", + "nullable": true + }, + "group_ids": { + "$ref": "#/components/schemas/FilterValue", + "description": "A filter to select customers based on the [groups](entity:CustomerGroup) they belong to.\nGroup membership is controlled by sellers and developers.\n\nThe `group_ids` filter has the following syntax:\n```\n\"group_ids\": {\n\"any\": [\"{group_a_id}\", \"{group_b_id}\", ...],\n\"all\": [\"{group_1_id}\", \"{group_2_id}\", ...],\n\"none\": [\"{group_i_id}\", \"{group_ii_id}\", ...]\n}\n```\n\nYou can use any combination of the `any`, `all`, and `none` fields in the filter.\nWith `any`, the search returns customers in groups `a` or `b` or any other group specified in the list.\nWith `all`, the search returns customers in groups `1` and `2` and all other groups specified in the list.\nWith `none`, the search returns customers not in groups `i` or `ii` or any other group specified in the list.\n\nIf any of the search conditions are not met, including when an invalid or non-existent group ID is provided,\nthe result is an empty object (`{}`).", + "nullable": true + }, + "custom_attribute": { + "$ref": "#/components/schemas/CustomerCustomAttributeFilters", + "description": "A filter to select customers based on one or more custom attributes. \nThis filter can contain up to 10 custom attribute filters. Each custom attribute filter specifies filtering criteria for a target custom\nattribute. If multiple custom attribute filters are provided, they are combined as an `AND` operation.\n\nTo be valid for a search, the custom attributes must be visible to the requesting application. For more information, including example queries,\nsee [Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute).\n\nSquare returns matching customer profiles, which do not contain custom attributes. To retrieve customer-related custom attributes,\nuse the [Customer Custom Attributes API](api:CustomerCustomAttributes). For example, you can call\n[RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) using a customer ID from the result set.", + "nullable": true + }, + "segment_ids": { + "$ref": "#/components/schemas/FilterValue", + "description": " A filter to select customers based on the [segments](entity:CustomerSegment) they belong to.\nSegment membership is dynamic and adjusts automatically based on whether customers meet the segment criteria.\n\nYou can provide up to three segment IDs in the filter, using any combination of the `all`, `any`, and `none` fields.\nFor the following example, the results include customers who belong to both segment A and segment B but do not belong to segment C.\n\n```\n\"segment_ids\": {\n\"all\": [\"{segment_A_id}\", \"{segment_B_id}\"],\n\"none\": [\"{segment_C_id}\"]\n}\n```\n\nIf an invalid or non-existent segment ID is provided in the filter, Square stops processing the request\nand returns a `400 BAD_REQUEST` error that includes the segment ID.", + "nullable": true + } + } + }, + "CustomerGroup": { + "type": "object", + "description": "Represents a group of customer profiles. \n\nCustomer groups can be created, be modified, and have their membership defined using \nthe Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale.", + "x-release-status": "PUBLIC", + "required": [ + "name" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique Square-generated ID for the customer group.", + "maxLength": 255, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the customer group." + }, + "created_at": { + "type": "string", + "description": "The timestamp when the customer group was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the customer group was last updated, in RFC 3339 format.", + "readOnly": true + } + } + }, + "CustomerInclusionExclusion": { + "type": "string", + "enum": [ + "INCLUDE", + "EXCLUDE" + ], + "x-enum-elements": [ + { + "name": "INCLUDE", + "description": "Customers should be included in the result set when they match the\nfiltering criteria." + }, + { + "name": "EXCLUDE", + "description": "Customers should be excluded from the result set when they match\nthe filtering criteria." + } + ], + "description": "Indicates whether customers should be included in, or excluded from,\nthe result set when they match the filtering criteria.", + "x-release-status": "PUBLIC" + }, + "CustomerPreferences": { + "type": "object", + "description": "Represents communication preferences for the customer profile.", + "x-release-status": "PUBLIC", + "properties": { + "email_unsubscribed": { + "type": "boolean", + "description": "Indicates whether the customer has unsubscribed from marketing campaign emails. A value of `true` means that the customer chose to opt out of email marketing from the current Square seller or from all Square sellers. This value is read-only from the Customers API.", + "nullable": true + } + } + }, + "CustomerQuery": { + "type": "object", + "description": "Represents filtering and sorting criteria for a [SearchCustomers](api-endpoint:Customers-SearchCustomers) request.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/CustomerFilter", + "description": "The filtering criteria for the search query. A query can contain multiple filters in any combination.\nMultiple filters are combined as `AND` statements.\n\n__Note:__ Combining multiple filters as `OR` statements is not supported. Instead, send multiple single-filter\nsearches and join the result sets.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/CustomerSort", + "description": "Sorting criteria for query results. The default behavior is to sort \ncustomers alphabetically by `given_name` and `family_name`.", + "nullable": true + } + } + }, + "CustomerSegment": { + "type": "object", + "description": "Represents a group of customer profiles that match one or more predefined filter criteria. \n\nSegments (also known as Smart Groups) are defined and created within the Customer Directory in the\nSquare Seller Dashboard or Point of Sale.", + "x-release-status": "PUBLIC", + "required": [ + "name" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique Square-generated ID for the segment.", + "maxLength": 255, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the segment.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the segment was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the segment was last updated, in RFC 3339 format.", + "readOnly": true + } + } + }, + "CustomerSort": { + "type": "object", + "description": "Represents the sorting criteria in a [search query](entity:CustomerQuery) that defines how to sort\ncustomer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results.", + "x-release-status": "PUBLIC", + "properties": { + "field": { + "$ref": "#/components/schemas/CustomerSortField", + "description": "Indicates the fields to use as the sort key, which is either the default set of fields or `created_at`.\n\nThe default value is `DEFAULT`.\nSee [CustomerSortField](#type-customersortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "Indicates the order in which results should be sorted based on the\nsort field value. Strings use standard alphabetic comparison\nto determine order. Strings representing numbers are sorted as strings.\n\nThe default value is `ASC`.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "CustomerSortField": { + "type": "string", + "enum": [ + "DEFAULT", + "CREATED_AT" + ], + "x-enum-elements": [ + { + "name": "DEFAULT", + "description": "Use the default sort key. By default, customers are sorted\nalphanumerically by concatenating their `given_name` and `family_name`. If\nneither name field is set, string comparison is performed using one of the\nremaining fields in the following order: `company_name`, `email`,\n`phone_number`." + }, + { + "name": "CREATED_AT", + "description": "Use the creation date attribute (`created_at`) of customer profiles as the sort key." + } + ], + "description": "Specifies customer attributes as the sort key to customer profiles returned from a search.", + "x-release-status": "PUBLIC" + }, + "CustomerTaxIds": { + "type": "object", + "description": "Represents the tax ID associated with a [customer profile](entity:Customer). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom. \nFor more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).", + "x-release-status": "PUBLIC", + "properties": { + "eu_vat": { + "type": "string", + "description": "The EU VAT identification number for the customer. For example, `IE3426675K`. The ID can contain alphanumeric characters only.", + "maxLength": 20, + "nullable": true + } + } + }, + "CustomerTextFilter": { + "type": "object", + "description": "A filter to select customers based on exact or fuzzy matching of\ncustomer attributes against a specified query. Depending on the customer attributes, \nthe filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both.", + "x-release-status": "PUBLIC", + "properties": { + "exact": { + "type": "string", + "description": "Use the exact filter to select customers whose attributes match exactly the specified query.", + "nullable": true + }, + "fuzzy": { + "type": "string", + "description": "Use the fuzzy filter to select customers whose attributes match the specified query \nin a fuzzy manner. When the fuzzy option is used, search queries are tokenized, and then \neach query token must be matched somewhere in the searched attribute. For single token queries, \nthis is effectively the same behavior as a partial match operation.", + "nullable": true + } + } + }, + "CustomerUpdatedEvent": { + "type": "object", + "description": "Published when a [customer](entity:Customer) is updated. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks).\n\nUpdates to the 'segment_ids' customer field does not invoke a `customer.updated` event. In addition, the `customer` object in the event notification does not include this field.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this object, the value is `customer.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for [idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomerUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:38:29Z", + "data": { + "id": "A0AP25A6SCVTH8JES9BX01GXM4", + "object": { + "customer": { + "created_at": "2022-07-09T18:23:01.795Z", + "creation_source": "THIRD_PARTY", + "email_address": "jenkins+smorly@squareup.com", + "family_name": "Smorly", + "given_name": "Jenkins", + "id": "A0AP25A6SCVTH8JES9BX01GXM4", + "phone_number": "+13477947111", + "preferences": { + "email_unsubscribed": false + }, + "updated_at": "2022-11-09T21:38:30Z", + "version": 1 + } + }, + "type": "customer" + }, + "event_id": "b4ce4698-00de-4b5d-a771-4941b3913b34", + "merchant_id": "G7MMEBVW021Q4", + "type": "customer.updated" + }, + "x-webhook": { + "event": "customer.updated", + "scopes": [ + "CUSTOMERS_READ" + ] + }, + "x-api": "#/components/x-apis/Customers", + "x-since": "2021-02-26" + }, + "CustomerUpdatedEventData": { + "type": "object", + "description": "The data associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `customer`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the updated customer.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/CustomerUpdatedEventObject", + "description": "An object that contains the updated customer.", + "nullable": true + } + } + }, + "CustomerUpdatedEventObject": { + "type": "object", + "description": "An object that contains the customer associated with the event.", + "x-release-status": "PUBLIC", + "properties": { + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The updated customer.", + "nullable": true + } + } + }, + "DataCollectionOptions": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "title", + "body", + "input_type" + ], + "properties": { + "title": { + "type": "string", + "description": "The title text to display in the data collection flow on the Terminal.", + "minLength": 1, + "maxLength": 250 + }, + "body": { + "type": "string", + "description": "The body text to display under the title in the data collection screen flow on the\nTerminal.", + "minLength": 1, + "maxLength": 10000 + }, + "input_type": { + "$ref": "#/components/schemas/DataCollectionOptionsInputType", + "description": "Represents the type of the input text.\nSee [InputType](#type-inputtype) for possible values" + }, + "collected_data": { + "$ref": "#/components/schemas/CollectedData", + "description": "The buyer’s input text from the data collection screen.", + "readOnly": true + } + } + }, + "DataCollectionOptionsInputType": { + "type": "string", + "enum": [ + "EMAIL", + "PHONE_NUMBER" + ], + "x-enum-elements": [ + { + "name": "EMAIL", + "description": "This value is used to represent an input text that contains a email validation on the\nclient." + }, + { + "name": "PHONE_NUMBER", + "description": "This value is used to represent an input text that contains a phone number validation on\nthe client." + } + ], + "description": "Describes the input type of the data.", + "x-release-status": "BETA" + }, + "DateRange": { + "type": "object", + "description": "A range defined by two dates. Used for filtering a query for Connect v2\nobjects that have date properties.", + "x-release-status": "PUBLIC", + "properties": { + "start_date": { + "type": "string", + "description": "A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601\nextended format for calendar dates.\nThe beginning of a date range (inclusive).", + "nullable": true + }, + "end_date": { + "type": "string", + "description": "A string in `YYYY-MM-DD` format, such as `2017-10-31`, per the ISO 8601\nextended format for calendar dates.\nThe end of a date range (inclusive).", + "nullable": true + } + } + }, + "DayOfWeek": { + "type": "string", + "enum": [ + "SUN", + "MON", + "TUE", + "WED", + "THU", + "FRI", + "SAT" + ], + "x-enum-elements": [ + { + "name": "SUN", + "description": "Sunday" + }, + { + "name": "MON", + "description": "Monday" + }, + { + "name": "TUE", + "description": "Tuesday" + }, + { + "name": "WED", + "description": "Wednesday" + }, + { + "name": "THU", + "description": "Thursday" + }, + { + "name": "FRI", + "description": "Friday" + }, + { + "name": "SAT", + "description": "Saturday" + } + ], + "description": "Indicates the specific day of the week.", + "x-release-status": "PUBLIC" + }, + "DeleteBookingCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [DeleteBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttributeDefinition) response\ncontaining error messages when errors occurred during the request. The successful response does not contain any payload.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "errors": [] + } + }, + "DeleteBookingCustomAttributeResponse": { + "type": "object", + "description": "Represents a [DeleteBookingCustomAttribute](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttribute) response.\nEither an empty object `{}` (for a successful deletion) or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "errors": [] + } + }, + "DeleteBreakTypeResponse": { + "type": "object", + "description": "The response to a request to delete a `BreakType`. The response might contain a set \nof `Error` objects if the request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteCatalogObjectResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "deleted_object_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of all catalog objects deleted by this request.\nMultiple IDs may be returned when associated objects are also deleted, for example\na catalog item variation will be deleted (and its ID included in this field)\nwhen its parent catalog item is deleted." + }, + "deleted_at": { + "type": "string", + "description": "The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nof this deletion in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`." + } + }, + "example": { + "deleted_at": "2016-11-16T22:25:24.878Z", + "deleted_object_ids": [ + "7SB3ZQYJ5GDMVFL7JK46JCHT", + "KQLFFHA6K6J3YQAQAWDQAL57" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.csharp", + "java": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.java", + "javascript": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.javascript", + "php": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.php", + "python": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.python", + "ruby": "/sdk_samples/Catalog/DeleteCatalogObject/DeleteCatalogObjectResponse.ruby" + } + }, + "DeleteCustomerCardResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `DeleteCustomerCard` endpoint.", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {}, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.csharp", + "java": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.java", + "javascript": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.javascript", + "php": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.php", + "python": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.python", + "ruby": "/sdk_samples/DeleteCustomerCard/DeleteCustomerCardResponse.ruby" + } + }, + "DeleteCustomerCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from a delete request containing error messages if there are any.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteCustomerCustomAttributeResponse": { + "type": "object", + "description": "Represents a [DeleteCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-DeleteCustomerCustomAttribute) response.\nEither an empty object `{}` (for a successful deletion) or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteCustomerGroupResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [DeleteCustomerGroup](api-endpoint:CustomerGroups-DeleteCustomerGroup) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `DeleteCustomer` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {}, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.csharp", + "java": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.java", + "javascript": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.javascript", + "php": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.php", + "python": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.python", + "ruby": "/sdk_samples/DeleteCustomer/DeleteCustomerResponse.ruby" + } + }, + "DeleteDisputeEvidenceResponse": { + "type": "object", + "description": "Defines the fields in a `DeleteDisputeEvidence` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": {} + }, + "DeleteInvoiceAttachmentResponse": { + "type": "object", + "description": "Represents a [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": {} + }, + "DeleteInvoiceResponse": { + "type": "object", + "description": "Describes a `DeleteInvoice` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": {} + }, + "DeleteLocationCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from a delete request containing error messages if there are any.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteLocationCustomAttributeResponse": { + "type": "object", + "description": "Represents a [DeleteLocationCustomAttribute](api-endpoint:LocationCustomAttributes-DeleteLocationCustomAttribute) response.\nEither an empty object `{}` (for a successful deletion) or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteLoyaltyRewardResponse": { + "type": "object", + "description": "A response returned by the API call.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteMerchantCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from a delete request containing error messages if there are any.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteMerchantCustomAttributeResponse": { + "type": "object", + "description": "Represents a [DeleteMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-DeleteMerchantCustomAttribute) response.\nEither an empty object `{}` (for a successful deletion) or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteOrderCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from deleting an order custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteOrderCustomAttributeResponse": { + "type": "object", + "description": "Represents a response from deleting an order custom attribute.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeletePaymentLinkResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + } + }, + "id": { + "type": "string", + "description": "The ID of the link that is deleted." + }, + "cancelled_order_id": { + "type": "string", + "description": "The ID of the order that is canceled. When a payment link is deleted, Square updates the\nthe `state` (of the order that the checkout link created) to CANCELED." + } + }, + "example": { + "cancelled_order_id": "asx8LgZ6MRzD0fObfkJ6obBmSh4F", + "id": "MQASNYL6QB6DFCJ3" + } + }, + "DeleteShiftResponse": { + "type": "object", + "description": "The response to a request to delete a `Shift`. The response might contain a set of \n`Error` objects if the request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteSnippetResponse": { + "type": "object", + "description": "Represents a `DeleteSnippet` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteSubscriptionActionResponse": { + "type": "object", + "description": "Defines output parameters in a response of the [DeleteSubscriptionAction](api-endpoint:Subscriptions-DeleteSubscriptionAction)\nendpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The subscription that has the specified action deleted." + } + }, + "example": { + "subscription": { + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "charged_through_date": "2023-11-20", + "created_at": "2022-07-27T21:53:10Z", + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "id": "8151fc89-da15-4eb9-a685-1a70883cebfc", + "invoice_ids": [ + "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA" + ], + "location_id": "S8GWD5R9QB376", + "paid_until_date": "2024-08-01", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "price_override_money": { + "amount": 25000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "start_date": "2022-07-27", + "status": "ACTIVE", + "timezone": "America/Los_Angeles" + } + } + }, + "DeleteTimecardResponse": { + "type": "object", + "description": "The response to a request to delete a `Timecard`. The response might contain a set of \n`Error` objects if the request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "DeleteTransferOrderResponse": { + "type": "object", + "description": "Response for deleting a transfer order", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request" + } + }, + "example": {} + }, + "DeleteWebhookSubscriptionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [DeleteWebhookSubscription](api-endpoint:WebhookSubscriptions-DeleteWebhookSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + } + }, + "example": {} + }, + "Destination": { + "type": "object", + "description": "Information about the destination against which the payout was made.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "$ref": "#/components/schemas/DestinationType", + "description": "Type of the destination such as a bank account or debit card.\nSee [DestinationType](#type-destinationtype) for possible values", + "nullable": true + }, + "id": { + "type": "string", + "description": "Square issued unique ID (also known as the instrument ID) associated with this destination." + } + } + }, + "DestinationDetails": { + "type": "object", + "description": "Details about a refund's destination.", + "x-release-status": "PUBLIC", + "properties": { + "card_details": { + "$ref": "#/components/schemas/DestinationDetailsCardRefundDetails", + "description": "Details about a card refund. Only populated if the destination_type is `CARD`.", + "nullable": true + }, + "cash_details": { + "$ref": "#/components/schemas/DestinationDetailsCashRefundDetails", + "description": "Details about a cash refund. Only populated if the destination_type is `CASH`.", + "nullable": true + }, + "external_details": { + "$ref": "#/components/schemas/DestinationDetailsExternalRefundDetails", + "description": "Details about an external refund. Only populated if the destination_type is `EXTERNAL`.", + "nullable": true + } + } + }, + "DestinationDetailsCardRefundDetails": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "$ref": "#/components/schemas/Card", + "description": "The card's non-confidential details.", + "nullable": true + }, + "entry_method": { + "type": "string", + "description": "The method used to enter the card's details for the refund. The method can be\n`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.", + "maxLength": 50, + "nullable": true + }, + "auth_result_code": { + "type": "string", + "description": "The authorization code provided by the issuer when a refund is approved.", + "maxLength": 10, + "nullable": true + } + } + }, + "DestinationDetailsCashRefundDetails": { + "type": "object", + "description": "Stores details about a cash refund. Contains only non-confidential information.", + "x-release-status": "PUBLIC", + "required": [ + "seller_supplied_money" + ], + "properties": { + "seller_supplied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount and currency of the money supplied by the seller." + }, + "change_back_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of change due back to the seller.\nThis read-only field is calculated\nfrom the `amount_money` and `seller_supplied_money` fields.", + "readOnly": true + } + } + }, + "DestinationDetailsExternalRefundDetails": { + "type": "object", + "description": "Stores details about an external refund. Contains only non-confidential information.", + "x-release-status": "PUBLIC", + "required": [ + "type", + "source" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of external refund the seller paid to the buyer. It can be one of the\nfollowing:\n- CHECK - Refunded using a physical check.\n- BANK_TRANSFER - Refunded using external bank transfer.\n- OTHER\\_GIFT\\_CARD - Refunded using a non-Square gift card.\n- CRYPTO - Refunded using a crypto currency.\n- SQUARE_CASH - Refunded using Square Cash App.\n- SOCIAL - Refunded using peer-to-peer payment applications.\n- EXTERNAL - A third-party application gathered this refund outside of Square.\n- EMONEY - Refunded using an E-money provider.\n- CARD - A credit or debit card that Square does not support.\n- STORED_BALANCE - Use for house accounts, store credit, and so forth.\n- FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals\n- OTHER - A type not listed here.", + "maxLength": 50 + }, + "source": { + "type": "string", + "description": "A description of the external refund source. For example,\n\"Food Delivery Service\".", + "maxLength": 255 + }, + "source_id": { + "type": "string", + "description": "An ID to associate the refund to its originating source.", + "maxLength": 255, + "nullable": true + } + } + }, + "DestinationType": { + "type": "string", + "enum": [ + "BANK_ACCOUNT", + "CARD", + "SQUARE_BALANCE", + "SQUARE_STORED_BALANCE" + ], + "x-enum-elements": [ + { + "name": "BANK_ACCOUNT", + "description": "An external bank account outside of Square." + }, + { + "name": "CARD", + "description": "An external card outside of Square used for the transfer." + }, + { + "name": "SQUARE_BALANCE", + "description": "" + }, + { + "name": "SQUARE_STORED_BALANCE", + "description": "Square Checking or Savings account (US), Square Card (CA)" + } + ], + "description": "List of possible destinations against which a payout can be made.", + "x-release-status": "PUBLIC" + }, + "Device": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "attributes" + ], + "properties": { + "id": { + "type": "string", + "description": "A synthetic identifier for the device. The identifier includes a standardized prefix and\nis otherwise an opaque id generated from key device fields.", + "readOnly": true + }, + "attributes": { + "$ref": "#/components/schemas/DeviceAttributes", + "description": "A collection of DeviceAttributes representing the device." + }, + "components": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Component" + }, + "description": "A list of components applicable to the device.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/DeviceStatus", + "description": "The current status of the device.", + "readOnly": true + } + } + }, + "DeviceAttributes": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "type", + "manufacturer" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/DeviceAttributesDeviceType", + "description": "The device type.\nSee [DeviceType](#type-devicetype) for possible values" + }, + "manufacturer": { + "type": "string", + "description": "The maker of the device." + }, + "model": { + "type": "string", + "description": "The specific model of the device.", + "nullable": true + }, + "name": { + "type": "string", + "description": "A seller-specified name for the device.", + "nullable": true + }, + "manufacturers_id": { + "type": "string", + "description": "The manufacturer-supplied identifier for the device (where available). In many cases,\nthis identifier will be a serial number.", + "nullable": true + }, + "updated_at": { + "type": "string", + "description": "The RFC 3339-formatted value of the most recent update to the device information.\n(Could represent any field update on the device.)", + "readOnly": true + }, + "version": { + "type": "string", + "description": "The current version of software installed on the device." + }, + "merchant_token": { + "type": "string", + "description": "The merchant_token identifying the merchant controlling the device.", + "nullable": true + } + } + }, + "DeviceAttributesDeviceType": { + "type": "string", + "enum": [ + "TERMINAL", + "HANDHELD" + ], + "x-enum-elements": [ + { + "name": "TERMINAL", + "description": "" + }, + { + "name": "HANDHELD", + "description": "" + } + ], + "description": "An enum identifier of the device type.", + "x-release-status": "BETA" + }, + "DeviceCheckoutOptions": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "device_id" + ], + "properties": { + "device_id": { + "type": "string", + "description": "The unique ID of the device intended for this `TerminalCheckout`.\nA list of `DeviceCode` objects can be retrieved from the /v2/devices/codes endpoint.\nMatch a `DeviceCode.device_id` value with `device_id` to get the associated device code." + }, + "skip_receipt_screen": { + "type": "boolean", + "description": "Instructs the device to skip the receipt screen. Defaults to false.", + "nullable": true + }, + "collect_signature": { + "type": "boolean", + "description": "Indicates that signature collection is desired during checkout. Defaults to false.", + "nullable": true + }, + "tip_settings": { + "$ref": "#/components/schemas/TipSettings", + "description": "Tip-specific settings.", + "nullable": true + }, + "show_itemized_cart": { + "type": "boolean", + "description": "Show the itemization screen prior to taking a payment. This field is only meaningful when the\ncheckout includes an order ID. Defaults to true.", + "nullable": true + } + } + }, + "DeviceCode": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "product_type" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique id for this device code.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "An optional user-defined name for the device code.", + "maxLength": 128, + "nullable": true + }, + "code": { + "type": "string", + "description": "The unique code that can be used to login.", + "readOnly": true + }, + "device_id": { + "type": "string", + "description": "The unique id of the device that used this code. Populated when the device is paired up.", + "readOnly": true + }, + "product_type": { + "$ref": "#/components/schemas/ProductType", + "description": "The targeting product type of the device code." + }, + "location_id": { + "type": "string", + "description": "The location assigned to this code.", + "maxLength": 50, + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/DeviceCodeStatus", + "description": "The pairing status of the device code.\nSee [DeviceCodeStatus](#type-devicecodestatus) for possible values", + "readOnly": true + }, + "pair_by": { + "type": "string", + "description": "When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "When this DeviceCode was created. Timestamp in RFC 3339 format.", + "readOnly": true + }, + "status_changed_at": { + "type": "string", + "description": "When this DeviceCode's status was last changed. Timestamp in RFC 3339 format.", + "readOnly": true + }, + "paired_at": { + "type": "string", + "description": "When this DeviceCode was paired. Timestamp in RFC 3339 format.", + "readOnly": true + } + } + }, + "DeviceCodePairedEvent": { + "type": "object", + "description": "Published when a Square Terminal has been paired with a\nTerminal API client and the device_id of the paired Square Terminal is\navailable.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"device.code.paired\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DeviceCodePairedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-10T14:41:58.036Z", + "data": { + "id": "05NK80TRSC2ZF", + "object": { + "device_code": { + "code": "ABCDEF", + "created_at": "2020-04-10T14:41:20.000Z", + "device_id": "907CS13101300122", + "id": "05NK80TRSC2ZF", + "location_id": "AR63EC48VXVBN", + "name": "Terminal API Device created on Apr 10, 2020", + "paired_at": "2020-04-10T14:41:50.000Z", + "product_type": "TERMINAL_API", + "status": "PAIRED", + "status_changed_at": "2020-04-10T14:41:50.000Z" + } + }, + "type": "device_code" + }, + "event_id": "84ccdb8a-da90-4b14-b6b0-c5a5abbccfe6", + "location_id": "AR63EC48VXVBN", + "merchant_id": "7NZR58EPNGNPC", + "type": "device.code.paired" + }, + "x-webhook": { + "event": "device.code.paired", + "scopes": [ + "DEVICE_CREDENTIAL_MANAGEMENT" + ] + }, + "x-api": "#/components/x-apis/Devices", + "x-since": "2020-04-22" + }, + "DeviceCodePairedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the paired object’s type, `\"device_code\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the paired device code." + }, + "object": { + "$ref": "#/components/schemas/DeviceCodePairedEventObject", + "description": "An object containing the paired device code.", + "nullable": true + } + } + }, + "DeviceCodePairedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "device_code": { + "$ref": "#/components/schemas/DeviceCode", + "description": "The created terminal checkout", + "nullable": true + } + } + }, + "DeviceCodeStatus": { + "type": "string", + "enum": [ + "UNKNOWN", + "UNPAIRED", + "PAIRED", + "EXPIRED" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN", + "description": "The status cannot be determined or does not exist." + }, + { + "name": "UNPAIRED", + "description": "The device code is just created and unpaired." + }, + { + "name": "PAIRED", + "description": "The device code has been signed in and paired to a device." + }, + { + "name": "EXPIRED", + "description": "The device code was unpaired and expired before it was paired." + } + ], + "description": "DeviceCode.Status enum.", + "x-release-status": "PUBLIC" + }, + "DeviceComponentDetailsApplicationDetails": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "application_type": { + "$ref": "#/components/schemas/ApplicationType", + "description": "The type of application.\nSee [ApplicationType](#type-applicationtype) for possible values", + "nullable": true + }, + "version": { + "type": "string", + "description": "The version of the application." + }, + "session_location": { + "type": "string", + "description": "The location_id of the session for the application.", + "nullable": true + }, + "device_code_id": { + "type": "string", + "description": "The id of the device code that was used to log in to the device.", + "nullable": true + } + } + }, + "DeviceComponentDetailsBatteryDetails": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "visible_percent": { + "type": "integer", + "description": "The battery charge percentage as displayed on the device.", + "nullable": true + }, + "external_power": { + "$ref": "#/components/schemas/DeviceComponentDetailsExternalPower", + "description": "The status of external_power.\nSee [ExternalPower](#type-externalpower) for possible values", + "nullable": true + } + } + }, + "DeviceComponentDetailsCardReaderDetails": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "version": { + "type": "string", + "description": "The version of the card reader." + } + } + }, + "DeviceComponentDetailsEthernetDetails": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "active": { + "type": "boolean", + "description": "A boolean to represent whether the Ethernet interface is currently active.", + "nullable": true + }, + "ip_address_v4": { + "type": "string", + "description": "The string representation of the device’s IPv4 address.", + "nullable": true + }, + "mac_address": { + "type": "string", + "description": "The mac address of the device in this network.", + "nullable": true + } + } + }, + "DeviceComponentDetailsExternalPower": { + "type": "string", + "enum": [ + "AVAILABLE_CHARGING", + "AVAILABLE_NOT_IN_USE", + "UNAVAILABLE", + "AVAILABLE_INSUFFICIENT" + ], + "x-enum-elements": [ + { + "name": "AVAILABLE_CHARGING", + "description": "Plugged in and charging." + }, + { + "name": "AVAILABLE_NOT_IN_USE", + "description": "Fully charged." + }, + { + "name": "UNAVAILABLE", + "description": "On battery power." + }, + { + "name": "AVAILABLE_INSUFFICIENT", + "description": "Not providing enough power for the device." + } + ], + "description": "An enum for ExternalPower.", + "x-release-status": "BETA" + }, + "DeviceComponentDetailsMeasurement": { + "type": "object", + "description": "A value qualified by unit of measure.", + "x-release-status": "BETA", + "properties": { + "value": { + "type": "integer", + "description": "Value of measure.", + "nullable": true + } + } + }, + "DeviceComponentDetailsWiFiDetails": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "active": { + "type": "boolean", + "description": "A boolean to represent whether the WiFI interface is currently active.", + "nullable": true + }, + "ssid": { + "type": "string", + "description": "The name of the connected WIFI network.", + "nullable": true + }, + "ip_address_v4": { + "type": "string", + "description": "The string representation of the device’s IPv4 address.", + "nullable": true + }, + "secure_connection": { + "type": "string", + "description": "The security protocol for a secure connection (e.g. WPA2). None provided if the connection\nis unsecured.", + "nullable": true + }, + "signal_strength": { + "$ref": "#/components/schemas/DeviceComponentDetailsMeasurement", + "description": "A representation of signal strength of the WIFI network connection.", + "nullable": true + }, + "mac_address": { + "type": "string", + "description": "The mac address of the device in this network.", + "nullable": true + } + } + }, + "DeviceCreatedEvent": { + "type": "object", + "description": "Published when a Device is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The merchant the newly created device belongs to.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents. The value is `\"device.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A UUID that uniquely identifies this device creation event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the device creation event was first created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DeviceCreatedEventData", + "description": "The metadata associated with the device creation event.", + "nullable": true + } + }, + "example": { + "created_at": "2023-08-08T16:49:54.990909221Z", + "data": { + "id": "device:3136f66b-f4b0-3846-8722-7fcc55270e50", + "object": { + "device": { + "attributes": { + "manufacturer": "SQUARE", + "manufacturers_id": "3136f66b-f4b0-3846-8722-7fcc55270e50", + "merchant_token": "MLF2HW14529P1", + "model": "T2", + "name": "San Francisco Store - Device 901", + "type": "TERMINAL", + "updated_at": "2023-08-08T16:49:54.990909221Z", + "version": "9.9.3" + }, + "components": [ + { + "battery_details": { + "external_power": "AVAILABLE_INSUFFICIENT", + "visible_percent": 11 + }, + "type": "BATTERY" + }, + { + "card_reader_details": { + "version": "8.5.6" + }, + "type": "CARD_READER" + }, + { + "ethernet_details": { + "active": false, + "ip_address_v4": "109.208.212.40" + }, + "type": "ETHERNET" + }, + { + "type": "WIFI", + "wifi_details": { + "active": true, + "ip_address_v4": "187.180.54.247", + "secure_connection": "WPA/WPA2 PSK", + "signal_strength": { + "value": 3 + }, + "ssid": "San Francisco Store Wifi" + } + }, + { + "application_details": { + "application_type": "TERMINAL_API", + "device_code_id": "G5D3VSVAFYTPB", + "session_location": "LN6WR64FV0VEP", + "version": "8.6.1" + }, + "type": "APPLICATION" + }, + { + "type": "PRINTER" + } + ], + "id": "device:3136f66b-f4b0-3846-8722-7fcc55270e50", + "status": "AVAILABLE" + } + }, + "type": "device" + }, + "event_id": "e2744346-e23d-31e8-9f52-660116750760", + "merchant_id": "MLF2HW14529P1", + "type": "device.created" + }, + "x-webhook": { + "event": "device.created", + "scopes": [ + "DEVICES_READ" + ] + }, + "x-api": "#/components/x-apis/Devices", + "x-since": "2023-09-25" + }, + "DeviceCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `\"device\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the device." + }, + "object": { + "$ref": "#/components/schemas/DeviceCreatedEventObject", + "description": "An object containing the created device.", + "nullable": true + } + } + }, + "DeviceCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "device": { + "$ref": "#/components/schemas/Device", + "description": "The created device.", + "nullable": true + } + } + }, + "DeviceDetails": { + "type": "object", + "description": "Details about the device that took the payment.", + "x-release-status": "PUBLIC", + "properties": { + "device_id": { + "type": "string", + "description": "The Square-issued ID of the device.", + "maxLength": 255, + "nullable": true + }, + "device_installation_id": { + "type": "string", + "description": "The Square-issued installation ID for the device.", + "maxLength": 255, + "nullable": true + }, + "device_name": { + "type": "string", + "description": "The name of the device set by the seller.", + "maxLength": 255, + "nullable": true + } + } + }, + "DeviceMetadata": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "battery_percentage": { + "type": "string", + "description": "The Terminal’s remaining battery percentage, between 1-100.", + "nullable": true + }, + "charging_state": { + "type": "string", + "description": "The current charging state of the Terminal.\nOptions: `CHARGING`, `NOT_CHARGING`", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the Square seller business location associated with the Terminal.", + "nullable": true + }, + "merchant_id": { + "type": "string", + "description": "The ID of the Square merchant account that is currently signed-in to the Terminal.", + "nullable": true + }, + "network_connection_type": { + "type": "string", + "description": "The Terminal’s current network connection type.\nOptions: `WIFI`, `ETHERNET`", + "nullable": true + }, + "payment_region": { + "type": "string", + "description": "The country in which the Terminal is authorized to take payments.", + "nullable": true + }, + "serial_number": { + "type": "string", + "description": "The unique identifier assigned to the Terminal, which can be found on the lower back\nof the device.", + "nullable": true + }, + "os_version": { + "type": "string", + "description": "The current version of the Terminal’s operating system.", + "nullable": true + }, + "app_version": { + "type": "string", + "description": "The current version of the application running on the Terminal.", + "nullable": true + }, + "wifi_network_name": { + "type": "string", + "description": "The name of the Wi-Fi network to which the Terminal is connected.", + "nullable": true + }, + "wifi_network_strength": { + "type": "string", + "description": "The signal strength of the Wi-FI network connection.\nOptions: `POOR`, `FAIR`, `GOOD`, `EXCELLENT`", + "nullable": true + }, + "ip_address": { + "type": "string", + "description": "The IP address of the Terminal.", + "nullable": true + } + } + }, + "DeviceStatus": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "category": { + "$ref": "#/components/schemas/DeviceStatusCategory", + "description": "Category of the device status.\nSee [Category](#type-category) for possible values", + "nullable": true + } + } + }, + "DeviceStatusCategory": { + "type": "string", + "enum": [ + "AVAILABLE", + "NEEDS_ATTENTION", + "OFFLINE" + ], + "x-enum-elements": [ + { + "name": "AVAILABLE", + "description": "" + }, + { + "name": "NEEDS_ATTENTION", + "description": "" + }, + { + "name": "OFFLINE", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "DigitalWalletDetails": { + "type": "object", + "description": "Additional details about `WALLET` type payments. Contains only non-confidential information.", + "x-release-status": "PUBLIC", + "properties": { + "status": { + "type": "string", + "description": "The status of the `WALLET` payment. The status can be `AUTHORIZED`, `CAPTURED`, `VOIDED`, or\n`FAILED`.", + "maxLength": 50, + "nullable": true + }, + "brand": { + "type": "string", + "description": "The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY`, `ALIPAY`,\n`RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or `UNKNOWN`.", + "maxLength": 50, + "nullable": true + }, + "cash_app_details": { + "$ref": "#/components/schemas/CashAppDetails", + "description": "Brand-specific details for payments with the `brand` of `CASH_APP`.", + "nullable": true + } + } + }, + "DisableCardResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [DisableCard](api-endpoint:Cards-DisableCard) endpoint.\n\nNote: if there are errors processing the request, the card field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The retrieved card." + } + }, + "example": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": false, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 2 + } + } + }, + "DisableEventsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [DisableEvents](api-endpoint:Events-DisableEvents) endpoint.\n\nNote: if there are errors processing the request, the events field will not be\npresent.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + } + }, + "example": {} + }, + "DismissTerminalActionResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "Current state of the action to be dismissed." + } + }, + "example": { + "action": { + "app_id": "APP_ID", + "await_next_action": true, + "await_next_action_duration": "PT5M", + "confirmation_options": { + "agree_button_text": "Agree", + "body": "I agree to receive promotional emails about future events and activities.", + "decision": { + "has_agreed": true + }, + "disagree_button_text": "Decline", + "title": "Marketing communications" + }, + "created_at": "2021-07-28T23:22:07.476Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:abcdefg1234567", + "status": "COMPLETED", + "type": "CONFIRMATION", + "updated_at": "2021-07-28T23:22:29.511Z" + } + } + }, + "DismissTerminalCheckoutResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "Current state of the checkout to be dismissed." + } + }, + "example": { + "checkout": { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2023-11-29T14:59:50.682Z", + "deadline_duration": "PT5M", + "device_options": { + "collect_signature": true, + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "loyalty_settings": { + "loyalty_screen_max_display_duration": "PT60S", + "show_card_linked_reward_redemption_screen": false, + "show_loyalty_screen": false, + "show_non_qualifying_loyalty_screen": false + }, + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": true, + "custom_tip_field": false, + "separate_tip_screen": true + } + }, + "id": "LmZEKbo3SBfqO", + "location_id": "LOCATION_ID", + "payment_ids": [ + "D7vLJqMkvSoAlX4yyFzUitOy4EPZY" + ], + "payment_options": { + "autocomplete": true + }, + "payment_type": "CARD_PRESENT", + "status": "COMPLETED", + "updated_at": "2023-11-29T15:00:18.936Z" + } + } + }, + "DismissTerminalRefundResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "Current state of the refund to be dismissed." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "app_id": "APP_ID", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 12, + "exp_year": 2024, + "fingerprint": "sq-1-ElNeDpZZqUBNDI7yNghyKO-o0yLXASp4qQDGIPtxnFvTTWoqdfdP6TV8gLsSxoztXA", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_details": { + "auth_result_code": "RNy6Lf", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 12, + "exp_year": 2024, + "fingerprint": "sq-1-ElNeDpZZqUBNDI7yNghyKO-o0yLXASp3qQDGIPtxnFvTTWoqdfdP6TV9gLsSxoztXA", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2023-11-30T16:15:06.645Z", + "captured_at": "2023-11-30T16:15:13.272Z" + }, + "cvv_status": "CVV_ACCEPTED", + "device_details": { + "device_credential": { + "name": "Terminal API Device created on Nov 2, 2023", + "token": "9BFDXEYKB7H8Y" + }, + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "device_installation_id": "0ef67d8e-61a3-4418-a0be-c143bfe6108d" + }, + "entry_method": "SWIPED", + "statement_description": "SQ TREATS", + "status": "CAPTURED" + }, + "created_at": "2023-11-30T16:16:39.299Z", + "deadline_duration": "PT5M", + "device_id": "47776348fd8b32b9", + "id": "vjkNb2HD-xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY", + "order_id": "s8OMhQcpEp1b61YywlccSHWqUaQZY", + "payment_id": "xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY", + "reason": "Returning item", + "status": "IN_PROGRESS", + "updated_at": "2023-11-30T16:16:57.863Z" + } + } + }, + "Dispute": { + "type": "object", + "description": "Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank.", + "x-release-status": "PUBLIC", + "properties": { + "dispute_id": { + "type": "string", + "description": "The unique ID for this `Dispute`, generated by Square.", + "minLength": 1, + "maxLength": 40, + "x-release-status": "DEPRECATED", + "nullable": true + }, + "id": { + "type": "string", + "description": "The unique ID for this `Dispute`, generated by Square.", + "minLength": 1, + "maxLength": 40 + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The disputed amount, which can be less than the total transaction amount.\nFor instance, if multiple items were purchased but the cardholder only initiates a dispute over some of the items.", + "nullable": true + }, + "reason": { + "$ref": "#/components/schemas/DisputeReason", + "description": "The reason why the cardholder initiated the dispute.\nSee [DisputeReason](#type-disputereason) for possible values", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/DisputeState", + "description": "The current state of this dispute.\nSee [DisputeState](#type-disputestate) for possible values", + "nullable": true + }, + "due_at": { + "type": "string", + "description": "The deadline by which the seller must respond to the dispute, in [RFC 3339 format](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates).", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "disputed_payment": { + "$ref": "#/components/schemas/DisputedPayment", + "description": "The payment challenged in this dispute.", + "nullable": true + }, + "evidence_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the evidence associated with the dispute.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "card_brand": { + "$ref": "#/components/schemas/CardBrand", + "description": "The card brand used in the disputed payment.\nSee [CardBrand](#type-cardbrand) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the dispute was created, in RFC 3339 format.", + "minLength": 1, + "maxLength": 40, + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the dispute was last updated, in RFC 3339 format.", + "minLength": 1, + "maxLength": 40, + "readOnly": true + }, + "brand_dispute_id": { + "type": "string", + "description": "The ID of the dispute in the card brand system, generated by the card brand.", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "reported_date": { + "type": "string", + "description": "The timestamp when the dispute was reported, in RFC 3339 format.", + "minLength": 1, + "maxLength": 40, + "x-release-status": "DEPRECATED", + "nullable": true + }, + "reported_at": { + "type": "string", + "description": "The timestamp when the dispute was reported, in RFC 3339 format.", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "version": { + "type": "integer", + "description": "The current version of the `Dispute`." + }, + "location_id": { + "type": "string", + "description": "The ID of the location where the dispute originated.", + "minLength": 1, + "maxLength": 40, + "nullable": true + } + } + }, + "DisputeCreatedEvent": { + "type": "object", + "description": "Published when a [Dispute](entity:Dispute) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:24:53.258Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "id": "ORSEVtZAJxb37RA1EiGw", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_at": "2020-02-19T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2020-02-19T21:24:53.258Z", + "version": 1 + } + }, + "type": "dispute" + }, + "event_id": "ce8464b5-6628-4ac2-9264-e06c34df3e82", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.created" + }, + "x-webhook": { + "event": "dispute.created", + "scopes": [ + "DISPUTES_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2020-02-26" + }, + "DisputeCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeCreatedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeEvidence": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "evidence_id": { + "type": "string", + "description": "The Square-generated ID of the evidence.", + "minLength": 1, + "maxLength": 40, + "x-release-status": "DEPRECATED", + "nullable": true + }, + "id": { + "type": "string", + "description": "The Square-generated ID of the evidence.", + "minLength": 1, + "maxLength": 40 + }, + "dispute_id": { + "type": "string", + "description": "The ID of the dispute the evidence is associated with.", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "evidence_file": { + "$ref": "#/components/schemas/DisputeEvidenceFile", + "description": "Image, PDF, TXT", + "nullable": true + }, + "evidence_text": { + "type": "string", + "description": "Raw text", + "minLength": 1, + "maxLength": 500, + "nullable": true + }, + "uploaded_at": { + "type": "string", + "description": "The time when the evidence was uploaded, in RFC 3339 format.", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "evidence_type": { + "$ref": "#/components/schemas/DisputeEvidenceType", + "description": "The type of the evidence.\nSee [DisputeEvidenceType](#type-disputeevidencetype) for possible values", + "nullable": true + } + } + }, + "DisputeEvidenceAddedEvent": { + "type": "object", + "description": "Published when evidence is added to a [Dispute](entity:Dispute)\nfrom the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,\nor by calling either [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) or [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeEvidenceAddedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:27:28.851Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "dispute_id": "ORSEVtZAJxb37RA1EiGw", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "evidence_ids": [ + "oThqMsDS9bM0LdjZzVB4qB" + ], + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_date": "2020-02-19T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2020-02-19T21:27:28.851Z", + "version": 2 + } + }, + "type": "dispute" + }, + "event_id": "6f606f30-53d0-495a-87f0-958576fc954f", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.evidence.added" + }, + "x-webhook": { + "event": "dispute.evidence.added", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2020-02-26" + }, + "DisputeEvidenceAddedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeEvidenceAddedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeEvidenceAddedEventObject": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeEvidenceCreatedEvent": { + "type": "object", + "description": "Published when evidence is added to a [Dispute](entity:Dispute)\nfrom the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,\nor by calling either [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) or [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeEvidenceCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:27:28.851Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "id": "ORSEVtZAJxb37RA1EiGw", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_at": "2020-02-19T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2020-02-19T21:27:28.851Z", + "version": 2 + } + }, + "type": "dispute" + }, + "event_id": "6f606f30-53d0-495a-87f0-958576fc954f", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.evidence.created" + }, + "x-webhook": { + "event": "dispute.evidence.created", + "scopes": [ + "DISPUTES_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2021-06-16" + }, + "DisputeEvidenceCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeEvidenceCreatedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeEvidenceCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeEvidenceDeletedEvent": { + "type": "object", + "description": "Published when evidence is removed from a [Dispute](entity:Dispute)\nfrom the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,\nor by calling [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeEvidenceDeletedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:31:55.186Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "id": "ORSEVtZAJxb37RA1EiGw", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_at": "2020-02-19T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2020-02-19T21:31:55.186Z", + "version": 3 + } + }, + "type": "dispute" + }, + "event_id": "e3fd10cc-953b-4f97-83cd-d5b7fa799a8c", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.evidence.deleted" + }, + "x-webhook": { + "event": "dispute.evidence.deleted", + "scopes": [ + "DISPUTES_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2021-06-16" + }, + "DisputeEvidenceDeletedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeEvidenceDeletedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeEvidenceDeletedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeEvidenceFile": { + "type": "object", + "description": "A file to be uploaded as dispute evidence.", + "x-release-status": "PUBLIC", + "properties": { + "filename": { + "type": "string", + "description": "The file name including the file extension. For example: \"receipt.tiff\".", + "minLength": 1, + "maxLength": 40, + "nullable": true + }, + "filetype": { + "type": "string", + "description": "Dispute evidence files must be application/pdf, image/heic, image/heif, image/jpeg, image/png, or image/tiff formats.", + "minLength": 1, + "maxLength": 40, + "nullable": true + } + } + }, + "DisputeEvidenceRemovedEvent": { + "type": "object", + "description": "Published when evidence is removed from a [Dispute](entity:Dispute)\nfrom the Disputes Dashboard in the Seller Dashboard, the Square Point of Sale app,\nor by calling [DeleteDisputeEvidence](api-endpoint:Disputes-DeleteDisputeEvidence).", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeEvidenceRemovedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:31:55.186Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "dispute_id": "ORSEVtZAJxb37RA1EiGw", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_date": "2020-02-19T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2020-02-19T21:31:55.186Z", + "version": 3 + } + }, + "type": "dispute" + }, + "event_id": "e3fd10cc-953b-4f97-83cd-d5b7fa799a8c", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.evidence.removed" + }, + "x-webhook": { + "event": "dispute.evidence.removed", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2020-02-26" + }, + "DisputeEvidenceRemovedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeEvidenceRemovedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeEvidenceRemovedEventObject": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeEvidenceType": { + "type": "string", + "enum": [ + "GENERIC_EVIDENCE", + "ONLINE_OR_APP_ACCESS_LOG", + "AUTHORIZATION_DOCUMENTATION", + "CANCELLATION_OR_REFUND_DOCUMENTATION", + "CARDHOLDER_COMMUNICATION", + "CARDHOLDER_INFORMATION", + "PURCHASE_ACKNOWLEDGEMENT", + "DUPLICATE_CHARGE_DOCUMENTATION", + "PRODUCT_OR_SERVICE_DESCRIPTION", + "RECEIPT", + "SERVICE_RECEIVED_DOCUMENTATION", + "PROOF_OF_DELIVERY_DOCUMENTATION", + "RELATED_TRANSACTION_DOCUMENTATION", + "REBUTTAL_EXPLANATION", + "TRACKING_NUMBER" + ], + "x-enum-elements": [ + { + "name": "GENERIC_EVIDENCE", + "description": "Square assumes this evidence type if you do not provide a type when uploading evidence.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "ONLINE_OR_APP_ACCESS_LOG", + "description": "Server or activity logs that show proof of the cardholder’s identity and that the\ncardholder successfully ordered and received the goods (digitally or otherwise).\nExample evidence includes IP addresses, corresponding timestamps/dates, cardholder’s name and email\naddress linked to a cardholder profile held by the seller, proof the same device and card (used\nin dispute) were previously used in prior undisputed transaction, and any related detailed activity.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "AUTHORIZATION_DOCUMENTATION", + "description": "Evidence that the cardholder did provide authorization for the charge.\nExample evidence includes a signed credit card authorization.\n\nUse when uploading evidence as a file." + }, + { + "name": "CANCELLATION_OR_REFUND_DOCUMENTATION", + "description": "Evidence that the cardholder acknowledged your refund or cancellation policy.\nExample evidence includes a signature or checkbox showing the cardholder’s acknowledgement of your\nrefund or cancellation policy.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "CARDHOLDER_COMMUNICATION", + "description": "Evidence that shows relevant communication with the cardholder.\nExample evidence includes emails or texts that show the cardholder received goods/services or\ndemonstrate cardholder satisfaction.\n\nUse when uploading evidence as a file." + }, + { + "name": "CARDHOLDER_INFORMATION", + "description": "Evidence that validates the customer's identity.\nExample evidence includes personally identifiable details such as name, email address, purchaser IP\naddress, and a copy of the cardholder ID.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "PURCHASE_ACKNOWLEDGEMENT", + "description": "Evidence that shows proof of the sale/transaction.\nExample evidence includes an invoice, contract, or other item showing the customer’s acknowledgement\nof the purchase and your terms.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "DUPLICATE_CHARGE_DOCUMENTATION", + "description": "Evidence that shows the charges in question are valid and distinct from one another.\nExample evidence includes receipts, shipping labels, and invoices along with their distinct payment IDs.\n\nUse when uploading evidence as a file." + }, + { + "name": "PRODUCT_OR_SERVICE_DESCRIPTION", + "description": "A description of the product or service sold.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "RECEIPT", + "description": "A receipt or message sent to the cardholder detailing the charge.\nNote: You do not need to upload the Square receipt; Square submits the receipt on your behalf.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "SERVICE_RECEIVED_DOCUMENTATION", + "description": "Evidence that the service was provided to the cardholder or the expected date that services will be rendered.\nExample evidence includes a signed delivery form, work order, expected delivery date, or other written agreements.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "PROOF_OF_DELIVERY_DOCUMENTATION", + "description": "Evidence that shows the product was provided to the cardholder or the expected date of delivery.\nExample evidence includes a signed delivery form or written agreement acknowledging receipt of the goods or services.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "RELATED_TRANSACTION_DOCUMENTATION", + "description": "Evidence that shows the cardholder previously processed transactions on the same card and did not dispute them.\nNote: Square automatically provides up to five distinct Square receipts for related transactions, when available.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "REBUTTAL_EXPLANATION", + "description": "An explanation of why the cardholder’s claim is invalid.\nExample evidence includes an explanation of why each distinct charge is a legitimate purchase, why the cardholder’s claim\nfor credit owed due to their attempt to cancel, return, or refund is invalid per your stated policy and cardholder\nagreement, or an explanation of how the cardholder did not attempt to remedy the issue with you first to receive credit.\n\nUse when uploading evidence as a file or string." + }, + { + "name": "TRACKING_NUMBER", + "description": "The tracking number for the order provided by the shipping carrier. If you have multiple numbers, they need to be\nsubmitted individually as separate pieces of evidence.\n\nUse when uploading evidence as a string." + } + ], + "description": "The type of the dispute evidence.", + "x-release-status": "PUBLIC" + }, + "DisputeReason": { + "type": "string", + "enum": [ + "AMOUNT_DIFFERS", + "CANCELLED", + "DUPLICATE", + "NO_KNOWLEDGE", + "NOT_AS_DESCRIBED", + "NOT_RECEIVED", + "PAID_BY_OTHER_MEANS", + "CUSTOMER_REQUESTS_CREDIT", + "EMV_LIABILITY_SHIFT" + ], + "x-enum-elements": [ + { + "name": "AMOUNT_DIFFERS", + "description": "The cardholder claims that they were charged the wrong amount for the purchase.\nTo challenge this dispute, provide specific and concrete evidence that the cardholder agreed\nto the amount charged." + }, + { + "name": "CANCELLED", + "description": "The cardholder claims that they attempted to return the goods or cancel the service.\nTo challenge this dispute, provide specific and concrete evidence to prove that the cardholder\nis not due a refund and that the cardholder acknowledged your cancellation policy." + }, + { + "name": "DUPLICATE", + "description": "The cardholder claims that they were charged twice for the same purchase.\nTo challenge this dispute, provide specific and concrete evidence that shows both charges are\nlegitimate and independent of one another." + }, + { + "name": "NO_KNOWLEDGE", + "description": "The cardholder claims that they did not make this purchase nor authorized the charge.\nTo challenge this dispute, provide specific and concrete evidence that proves that the cardholder\nidentity was verified at the time of purchase and that the purchase was authorized." + }, + { + "name": "NOT_AS_DESCRIBED", + "description": "The cardholder claims the product or service was provided, but the quality of the deliverable\ndid not align with the expectations of the cardholder based on the description.\nTo challenge this dispute, provide specific and concrete evidence that shows the cardholder is in\npossession of the product as described or received the service as described and agreed on." + }, + { + "name": "NOT_RECEIVED", + "description": "The cardholder claims the product or service was not received by the cardholder within the\nstated time frame.\nTo challenge this dispute, provide specific and concrete evidence to prove that the cardholder is\nin possession of or received the product or service sold." + }, + { + "name": "PAID_BY_OTHER_MEANS", + "description": "The cardholder claims that they previously paid for this purchase.\nTo challenge this dispute, provide specific and concrete evidence that shows both charges are\nlegitimate and independent of one another or proof that you already provided a credit for the charge." + }, + { + "name": "CUSTOMER_REQUESTS_CREDIT", + "description": "The cardholder claims that the purchase was canceled or returned, but they have not yet received\nthe credit.\nTo challenge this dispute, provide specific and concrete evidence to prove that the cardholder is not\ndue a refund and that they acknowledged your cancellation and/or refund policy." + }, + { + "name": "EMV_LIABILITY_SHIFT", + "description": "A chip-enabled card was not processed through a compliant chip-card reader (for example, it was swiped\ninstead of dipped into a chip-card reader).\nYou cannot challenge this dispute because the payment did not comply with EMV security requirements.\nFor more information, see [What Is EMV?](https://squareup.com/emv)" + } + ], + "description": "The list of possible reasons why a cardholder might initiate a\ndispute with their bank.", + "x-release-status": "PUBLIC" + }, + "DisputeState": { + "type": "string", + "enum": [ + "INQUIRY_EVIDENCE_REQUIRED", + "INQUIRY_PROCESSING", + "INQUIRY_CLOSED", + "EVIDENCE_REQUIRED", + "PROCESSING", + "WON", + "LOST", + "ACCEPTED" + ], + "x-enum-elements": [ + { + "name": "INQUIRY_EVIDENCE_REQUIRED", + "description": "The initial state of an inquiry with evidence required" + }, + { + "name": "INQUIRY_PROCESSING", + "description": "Inquiry evidence has been submitted and the bank is processing the inquiry" + }, + { + "name": "INQUIRY_CLOSED", + "description": "The inquiry is complete" + }, + { + "name": "EVIDENCE_REQUIRED", + "description": "The initial state of a dispute with evidence required" + }, + { + "name": "PROCESSING", + "description": "Dispute evidence has been submitted and the bank is processing the dispute" + }, + { + "name": "WON", + "description": "The bank has completed processing the dispute and the seller has won" + }, + { + "name": "LOST", + "description": "The bank has completed processing the dispute and the seller has lost" + }, + { + "name": "ACCEPTED", + "description": "The seller has accepted the dispute" + } + ], + "description": "The list of possible dispute states.", + "x-release-status": "PUBLIC" + }, + "DisputeStateChangedEvent": { + "type": "object", + "description": "Published when the state of a [Dispute](entity:Dispute) changes.\nThis includes the dispute resolution (WON, LOST) reported by the bank. The event\ndata includes details of what changed.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeStateChangedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:34:41.851Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "dispute_id": "ORSEVtZAJxb37RA1EiGw", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "evidence_ids": [ + "Vjq6LG8b95cnnq1AoG5bP" + ], + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_date": "2020-02-19T00:00:00.000Z", + "state": "WON", + "updated_at": "2020-02-19T21:34:41.851Z", + "version": 6 + } + }, + "type": "dispute" + }, + "event_id": "e89ff114-1972-4be0-9481-a621f2385fff", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.state.changed" + }, + "x-webhook": { + "event": "dispute.state.changed", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2020-02-26" + }, + "DisputeStateChangedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeStateChangedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeStateChangedEventObject": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputeStateUpdatedEvent": { + "type": "object", + "description": "Published when the state of a [Dispute](entity:Dispute) changes.\nThis includes the dispute resolution (WON, LOST) reported by the bank. The event\ndata includes details of what changed.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/DisputeStateUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-19T21:34:41.851Z", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "id": "ORSEVtZAJxb37RA1EiGw", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_at": "2020-02-19T00:00:00.000Z", + "state": "WON", + "updated_at": "2020-02-19T21:34:41.851Z", + "version": 6 + } + }, + "type": "dispute" + }, + "event_id": "e89ff114-1972-4be0-9481-a621f2385fff", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.state.updated" + }, + "x-webhook": { + "event": "dispute.state.updated", + "scopes": [ + "DISPUTES_READ" + ] + }, + "x-api": "#/components/x-apis/Disputes", + "x-since": "2021-06-16" + }, + "DisputeStateUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected dispute's type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected dispute." + }, + "object": { + "$ref": "#/components/schemas/DisputeStateUpdatedEventObject", + "description": "An object containing fields and values relevant to the event.", + "nullable": true + } + } + }, + "DisputeStateUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "object": { + "$ref": "#/components/schemas/Dispute", + "description": "The dispute object.", + "nullable": true + } + } + }, + "DisputedPayment": { + "type": "object", + "description": "The payment the cardholder disputed.", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "Square-generated unique ID of the payment being disputed.", + "minLength": 1, + "maxLength": 192, + "nullable": true + } + } + }, + "EcomVisibility": { + "type": "string", + "enum": [ + "UNINDEXED", + "UNAVAILABLE", + "HIDDEN", + "VISIBLE" + ], + "x-enum-elements": [ + { + "name": "UNINDEXED", + "description": "Item is not synced with Ecom (Weebly). This is the default state" + }, + { + "name": "UNAVAILABLE", + "description": "Item is synced but is unavailable within Ecom (Weebly) and Online Checkout" + }, + { + "name": "HIDDEN", + "description": "Option for seller to choose manually created Quick Amounts." + }, + { + "name": "VISIBLE", + "description": "Item is synced but available within Ecom (Weebly) and Online Checkout but is hidden from Ecom Store." + } + ], + "description": "Determines item visibility in Ecom (Online Store) and Online Checkout.", + "x-release-status": "PUBLIC" + }, + "Employee": { + "type": "object", + "description": "An employee object that is used by the external API.\n\nDEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember).", + "x-release-status": "DEPRECATED", + "properties": { + "id": { + "type": "string", + "description": "UUID for this object." + }, + "first_name": { + "type": "string", + "description": "The employee's first name.", + "nullable": true + }, + "last_name": { + "type": "string", + "description": "The employee's last name.", + "nullable": true + }, + "email": { + "type": "string", + "description": "The employee's email address", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The employee's phone number in E.164 format, i.e. \"+12125554250\"", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of location IDs where this employee has access to.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/EmployeeStatus", + "description": "Specifies the status of the employees being fetched.\nSee [EmployeeStatus](#type-employeestatus) for possible values", + "nullable": true + }, + "is_owner": { + "type": "boolean", + "description": "Whether this employee is the owner of the merchant. Each merchant\nhas one owner employee, and that employee has full authority over\nthe account.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format.", + "readOnly": true + } + } + }, + "EmployeeStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "Specifies that the employee is in the Active state." + }, + { + "name": "INACTIVE", + "description": "Specifies that the employee is in the Inactive state." + } + ], + "description": "The status of the Employee being retrieved.\n\nDEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus).", + "x-release-status": "DEPRECATED" + }, + "EmployeeWage": { + "type": "object", + "description": "The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage).", + "x-release-status": "DEPRECATED", + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object." + }, + "employee_id": { + "type": "string", + "description": "The `Employee` that this wage is assigned to.", + "nullable": true + }, + "title": { + "type": "string", + "description": "The job title that this wage relates to.", + "nullable": true + }, + "hourly_rate": { + "$ref": "#/components/schemas/Money", + "description": "Can be a custom-set hourly wage or the calculated effective hourly\nwage based on the annual wage and hours worked per week.", + "nullable": true + } + } + }, + "EnableEventsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [EnableEvents](api-endpoint:Events-EnableEvents) endpoint.\n\nNote: if there are errors processing the request, the events field will not be\npresent.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + } + }, + "example": {} + }, + "Error": { + "type": "object", + "description": "Represents an error encountered during a request to the Connect API.\n\nSee [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information.", + "x-release-status": "PUBLIC", + "required": [ + "category", + "code" + ], + "properties": { + "category": { + "$ref": "#/components/schemas/ErrorCategory", + "description": "The high-level category for the error.\nSee [ErrorCategory](#type-errorcategory) for possible values" + }, + "code": { + "$ref": "#/components/schemas/ErrorCode", + "description": "The specific code of the error.\nSee [ErrorCode](#type-errorcode) for possible values" + }, + "detail": { + "type": "string", + "description": "A human-readable description of the error for debugging purposes." + }, + "field": { + "type": "string", + "description": "The name of the field provided in the original request (if any) that\nthe error pertains to." + } + } + }, + "ErrorCategory": { + "type": "string", + "enum": [ + "API_ERROR", + "AUTHENTICATION_ERROR", + "INVALID_REQUEST_ERROR", + "RATE_LIMIT_ERROR", + "PAYMENT_METHOD_ERROR", + "REFUND_ERROR", + "MERCHANT_SUBSCRIPTION_ERROR", + "EXTERNAL_VENDOR_ERROR" + ], + "x-enum-elements": [ + { + "name": "API_ERROR", + "description": "An error occurred with the Connect API itself." + }, + { + "name": "AUTHENTICATION_ERROR", + "description": "An authentication error occurred. Most commonly, the request had\na missing, malformed, or otherwise invalid `Authorization` header." + }, + { + "name": "INVALID_REQUEST_ERROR", + "description": "The request was invalid. Most commonly, a required parameter was\nmissing, or a provided parameter had an invalid value." + }, + { + "name": "RATE_LIMIT_ERROR", + "description": "Your application reached the Square API rate limit. You might receive this error if your application sends a high number of requests\nto Square APIs in a short period of time.\n\nYour application should monitor responses for `429 RATE_LIMITED` errors and use a retry mechanism with an [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff)\nschedule to resend the requests at an increasingly slower rate. It is also a good practice to use a randomized delay (jitter) in your retry schedule." + }, + { + "name": "PAYMENT_METHOD_ERROR", + "description": "An error occurred while processing a payment method. Most commonly,\nthe details of the payment method were invalid (such as a card's CVV\nor expiration date)." + }, + { + "name": "REFUND_ERROR", + "description": "An error occurred while attempting to process a refund." + }, + { + "name": "MERCHANT_SUBSCRIPTION_ERROR", + "description": "An error occurred when checking a merchant subscription status" + }, + { + "name": "EXTERNAL_VENDOR_ERROR", + "description": "An error that is returned from an external vendor's API" + } + ], + "description": "Indicates which high-level category of error has occurred during a\nrequest to the Connect API.", + "x-release-status": "PUBLIC" + }, + "ErrorCode": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR", + "UNAUTHORIZED", + "ACCESS_TOKEN_EXPIRED", + "ACCESS_TOKEN_REVOKED", + "CLIENT_DISABLED", + "FORBIDDEN", + "INSUFFICIENT_SCOPES", + "APPLICATION_DISABLED", + "V1_APPLICATION", + "V1_ACCESS_TOKEN", + "CARD_PROCESSING_NOT_ENABLED", + "MERCHANT_SUBSCRIPTION_NOT_FOUND", + "BAD_REQUEST", + "MISSING_REQUIRED_PARAMETER", + "INCORRECT_TYPE", + "INVALID_TIME", + "INVALID_TIME_RANGE", + "INVALID_VALUE", + "INVALID_CURSOR", + "UNKNOWN_QUERY_PARAMETER", + "CONFLICTING_PARAMETERS", + "EXPECTED_JSON_BODY", + "INVALID_SORT_ORDER", + "VALUE_REGEX_MISMATCH", + "VALUE_TOO_SHORT", + "VALUE_TOO_LONG", + "VALUE_TOO_LOW", + "VALUE_TOO_HIGH", + "VALUE_EMPTY", + "ARRAY_LENGTH_TOO_LONG", + "ARRAY_LENGTH_TOO_SHORT", + "ARRAY_EMPTY", + "EXPECTED_BOOLEAN", + "EXPECTED_INTEGER", + "EXPECTED_FLOAT", + "EXPECTED_STRING", + "EXPECTED_OBJECT", + "EXPECTED_ARRAY", + "EXPECTED_MAP", + "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", + "INVALID_ARRAY_VALUE", + "INVALID_ENUM_VALUE", + "INVALID_CONTENT_TYPE", + "INVALID_FORM_VALUE", + "CUSTOMER_NOT_FOUND", + "ONE_INSTRUMENT_EXPECTED", + "NO_FIELDS_SET", + "TOO_MANY_MAP_ENTRIES", + "MAP_KEY_LENGTH_TOO_SHORT", + "MAP_KEY_LENGTH_TOO_LONG", + "CUSTOMER_MISSING_NAME", + "CUSTOMER_MISSING_EMAIL", + "INVALID_PAUSE_LENGTH", + "INVALID_DATE", + "UNSUPPORTED_COUNTRY", + "UNSUPPORTED_CURRENCY", + "APPLE_TTP_PIN_TOKEN", + "CARD_EXPIRED", + "INVALID_EXPIRATION", + "INVALID_EXPIRATION_YEAR", + "INVALID_EXPIRATION_DATE", + "UNSUPPORTED_CARD_BRAND", + "UNSUPPORTED_ENTRY_METHOD", + "INVALID_ENCRYPTED_CARD", + "INVALID_CARD", + "PAYMENT_AMOUNT_MISMATCH", + "GENERIC_DECLINE", + "CVV_FAILURE", + "ADDRESS_VERIFICATION_FAILURE", + "INVALID_ACCOUNT", + "CURRENCY_MISMATCH", + "INSUFFICIENT_FUNDS", + "INSUFFICIENT_PERMISSIONS", + "CARDHOLDER_INSUFFICIENT_PERMISSIONS", + "INVALID_LOCATION", + "TRANSACTION_LIMIT", + "VOICE_FAILURE", + "PAN_FAILURE", + "EXPIRATION_FAILURE", + "CARD_NOT_SUPPORTED", + "READER_DECLINED", + "INVALID_PIN", + "MISSING_PIN", + "MISSING_ACCOUNT_TYPE", + "INVALID_POSTAL_CODE", + "INVALID_FEES", + "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED", + "PAYMENT_LIMIT_EXCEEDED", + "GIFT_CARD_AVAILABLE_AMOUNT", + "ACCOUNT_UNUSABLE", + "BUYER_REFUSED_PAYMENT", + "DELAYED_TRANSACTION_EXPIRED", + "DELAYED_TRANSACTION_CANCELED", + "DELAYED_TRANSACTION_CAPTURED", + "DELAYED_TRANSACTION_FAILED", + "CARD_TOKEN_EXPIRED", + "CARD_TOKEN_USED", + "AMOUNT_TOO_HIGH", + "UNSUPPORTED_INSTRUMENT_TYPE", + "REFUND_AMOUNT_INVALID", + "REFUND_ALREADY_PENDING", + "PAYMENT_NOT_REFUNDABLE", + "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE", + "REFUND_ERROR_PAYMENT_NEEDS_COMPLETION", + "REFUND_DECLINED", + "INSUFFICIENT_PERMISSIONS_FOR_REFUND", + "INVALID_CARD_DATA", + "SOURCE_USED", + "SOURCE_EXPIRED", + "UNSUPPORTED_LOYALTY_REWARD_TIER", + "LOCATION_MISMATCH", + "ORDER_UNPAID_NOT_RETURNABLE", + "IDEMPOTENCY_KEY_REUSED", + "UNEXPECTED_VALUE", + "SANDBOX_NOT_SUPPORTED", + "INVALID_EMAIL_ADDRESS", + "INVALID_PHONE_NUMBER", + "CHECKOUT_EXPIRED", + "BAD_CERTIFICATE", + "INVALID_SQUARE_VERSION_FORMAT", + "API_VERSION_INCOMPATIBLE", + "CARD_PRESENCE_REQUIRED", + "UNSUPPORTED_SOURCE_TYPE", + "CARD_MISMATCH", + "PLAID_ERROR", + "PLAID_ERROR_ITEM_LOGIN_REQUIRED", + "PLAID_ERROR_RATE_LIMIT", + "CARD_DECLINED", + "VERIFY_CVV_FAILURE", + "VERIFY_AVS_FAILURE", + "CARD_DECLINED_CALL_ISSUER", + "CARD_DECLINED_VERIFICATION_REQUIRED", + "BAD_EXPIRATION", + "CHIP_INSERTION_REQUIRED", + "ALLOWABLE_PIN_TRIES_EXCEEDED", + "RESERVATION_DECLINED", + "UNKNOWN_BODY_PARAMETER", + "NOT_FOUND", + "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", + "METHOD_NOT_ALLOWED", + "NOT_ACCEPTABLE", + "REQUEST_TIMEOUT", + "CONFLICT", + "GONE", + "REQUEST_ENTITY_TOO_LARGE", + "UNSUPPORTED_MEDIA_TYPE", + "UNPROCESSABLE_ENTITY", + "RATE_LIMITED", + "NOT_IMPLEMENTED", + "BAD_GATEWAY", + "SERVICE_UNAVAILABLE", + "TEMPORARY_ERROR", + "GATEWAY_TIMEOUT" + ], + "x-enum-elements": [ + { + "name": "INTERNAL_SERVER_ERROR", + "description": "A general server error occurred.", + "error-category": "API_ERROR" + }, + { + "name": "UNAUTHORIZED", + "description": "A general authorization error occurred.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "ACCESS_TOKEN_EXPIRED", + "description": "The provided access token has expired.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "ACCESS_TOKEN_REVOKED", + "description": "The provided access token has been revoked.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "CLIENT_DISABLED", + "description": "The provided client has been disabled.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "FORBIDDEN", + "description": "A general access error occurred.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "INSUFFICIENT_SCOPES", + "description": "The provided access token does not have permission\nto execute the requested action.", + "error-category": "AUTHENTICATION_ERROR" + }, + { + "name": "APPLICATION_DISABLED", + "description": "The calling application was disabled.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "V1_APPLICATION", + "description": "The calling application was created prior to\n2016-03-30 and is not compatible with v2 Square API calls.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "V1_ACCESS_TOKEN", + "description": "The calling application is using an access token\ncreated prior to 2016-03-30 and is not compatible with v2 Square API\ncalls.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CARD_PROCESSING_NOT_ENABLED", + "description": "The location provided in the API call is not\nenabled for credit card processing.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "MERCHANT_SUBSCRIPTION_NOT_FOUND", + "description": "A required subscription was not found for the merchant", + "error-category": "MERCHANT_SUBSCRIPTION_ERROR" + }, + { + "name": "BAD_REQUEST", + "description": "A general error occurred with the request.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "MISSING_REQUIRED_PARAMETER", + "description": "The request is missing a required path, query, or\nbody parameter.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INCORRECT_TYPE", + "description": "The value provided in the request is the wrong\ntype. For example, a string instead of an integer.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_TIME", + "description": "Formatting for the provided time value is\nincorrect.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_TIME_RANGE", + "description": "The time range provided in the request is invalid.\nFor example, the end time is before the start time.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_VALUE", + "description": "The provided value is invalid. For example,\nincluding `%` in a phone number.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_CURSOR", + "description": "The pagination cursor included in the request is\ninvalid.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNKNOWN_QUERY_PARAMETER", + "description": "The query parameters provided is invalid for the\nrequested endpoint.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CONFLICTING_PARAMETERS", + "description": "One or more of the request parameters conflict with\neach other.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_JSON_BODY", + "description": "The request body is not a JSON object.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_SORT_ORDER", + "description": "The provided sort order is not a valid key.\nCurrently, sort order must be `ASC` or `DESC`.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_REGEX_MISMATCH", + "description": "The provided value does not match an expected\nregular expression.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_TOO_SHORT", + "description": "The provided string value is shorter than the\nminimum length allowed.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_TOO_LONG", + "description": "The provided string value is longer than the\nmaximum length allowed.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_TOO_LOW", + "description": "The provided value is less than the supported\nminimum.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_TOO_HIGH", + "description": "The provided value is greater than the supported\nmaximum.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "VALUE_EMPTY", + "description": "The provided value has a default (empty) value\nsuch as a blank string.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "ARRAY_LENGTH_TOO_LONG", + "description": "The provided array has too many elements.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "ARRAY_LENGTH_TOO_SHORT", + "description": "The provided array has too few elements.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "ARRAY_EMPTY", + "description": "The provided array is empty.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_BOOLEAN", + "description": "The endpoint expected the provided value to be a\nboolean.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_INTEGER", + "description": "The endpoint expected the provided value to be an\ninteger.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_FLOAT", + "description": "The endpoint expected the provided value to be a\nfloat.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_STRING", + "description": "The endpoint expected the provided value to be a\nstring.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_OBJECT", + "description": "The endpoint expected the provided value to be a\nJSON object.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_ARRAY", + "description": "The endpoint expected the provided value to be an\narray or list.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_MAP", + "description": "The endpoint expected the provided value to be a\nmap or associative array.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", + "description": "The endpoint expected the provided value to be an\narray encoded in base64.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_ARRAY_VALUE", + "description": "One or more objects in the array does not match the\narray type.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_ENUM_VALUE", + "description": "The provided static string is not valid for the\nfield.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_CONTENT_TYPE", + "description": "Invalid content type header.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_FORM_VALUE", + "description": "Only relevant for applications created prior to\n2016-03-30. Indicates there was an error while parsing form values.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CUSTOMER_NOT_FOUND", + "description": "The provided customer id can't be found in the merchant's customers list.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "ONE_INSTRUMENT_EXPECTED", + "description": "A general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "NO_FIELDS_SET", + "description": "A general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "TOO_MANY_MAP_ENTRIES", + "description": "Too many entries in the map field.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "MAP_KEY_LENGTH_TOO_SHORT", + "description": "The length of one of the provided keys in the map is too short.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "MAP_KEY_LENGTH_TOO_LONG", + "description": "The length of one of the provided keys in the map is too long.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CUSTOMER_MISSING_NAME", + "description": "The provided customer does not have a recorded name.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CUSTOMER_MISSING_EMAIL", + "description": "The provided customer does not have a recorded email.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_PAUSE_LENGTH", + "description": "The subscription cannot be paused longer than the duration of the current phase.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_DATE", + "description": "The subscription cannot be paused/resumed on the given date.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_COUNTRY", + "description": "The API request references an unsupported country.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_CURRENCY", + "description": "The API request references an unsupported currency.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "APPLE_TTP_PIN_TOKEN", + "description": "The payment was declined by the card issuer during an Apple Tap to Pay (TTP)\ntransaction with a request for the card's PIN. This code will be returned alongside\n`CARD_DECLINED_VERIFICATION_REQUIRED` as a supplemental error, and will include an\nissuer-provided token in the `details` field that is needed to initiate the PIN\ncollection flow on the iOS device.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CARD_EXPIRED", + "description": "The card issuer declined the request because the card is expired.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_EXPIRATION", + "description": "The expiration date for the payment card is invalid. For example,\nit indicates a date in the past.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_EXPIRATION_YEAR", + "description": "The expiration year for the payment card is invalid. For example,\nit indicates a year in the past or contains invalid characters.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_EXPIRATION_DATE", + "description": "The expiration date for the payment card is invalid. For example,\nit contains invalid characters.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_CARD_BRAND", + "description": "The credit card provided is not from a supported issuer.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "UNSUPPORTED_ENTRY_METHOD", + "description": "The entry method for the credit card (swipe, dip, tap) is not supported.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_ENCRYPTED_CARD", + "description": "The encrypted card information is invalid.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_CARD", + "description": "The credit card cannot be validated based on the provided details.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "PAYMENT_AMOUNT_MISMATCH", + "description": "The payment was declined because there was a payment amount mismatch.\nThe money amount Square was expecting does not match the amount provided.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "GENERIC_DECLINE", + "description": "Square received a decline without any additional information.\nIf the payment information seems correct, the buyer can contact their\nissuer to ask for more information.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CVV_FAILURE", + "description": "The card issuer declined the request because the CVV value is invalid.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "ADDRESS_VERIFICATION_FAILURE", + "description": "The card issuer declined the request because the postal code is invalid.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_ACCOUNT", + "description": "The issuer was not able to locate the account on record.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CURRENCY_MISMATCH", + "description": "The currency associated with the payment is not valid for the provided\nfunding source. For example, a gift card funded in USD cannot be used to process\npayments in GBP.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INSUFFICIENT_FUNDS", + "description": "The funding source has insufficient funds to cover the payment.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INSUFFICIENT_PERMISSIONS", + "description": "The Square account does not have the permissions to accept\nthis payment. For example, Square may limit which merchants are\nallowed to receive gift card payments.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CARDHOLDER_INSUFFICIENT_PERMISSIONS", + "description": "The card issuer has declined the transaction due to restrictions on where the card can be used.\nFor example, a gift card is limited to a single merchant.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_LOCATION", + "description": "The Square account cannot take payments in the specified region.\nA Square account can take payments only from the region where the account was created.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "TRANSACTION_LIMIT", + "description": "The card issuer has determined the payment amount is either too high or too low.\nThe API returns the error code mostly for credit cards (for example, the card reached\nthe credit limit). However, sometimes the issuer bank can indicate the error for debit\nor prepaid cards (for example, card has insufficient funds).", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "VOICE_FAILURE", + "description": "The card issuer declined the request because the issuer requires voice authorization from the cardholder. The seller should ask the customer to contact the card issuing bank to authorize the payment.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "PAN_FAILURE", + "description": "The specified card number is invalid. For example, it is of\nincorrect length or is incorrectly formatted.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "EXPIRATION_FAILURE", + "description": "The card expiration date is either invalid or indicates that the\ncard is expired.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CARD_NOT_SUPPORTED", + "description": "The card is not supported either in the geographic region or by\nthe [merchant category code](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) (MCC).", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "READER_DECLINED", + "description": "The Square Card Reader declined the payment for an unknown reason.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_PIN", + "description": "The card issuer declined the request because the PIN is invalid.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "MISSING_PIN", + "description": "The payment is missing a required PIN.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "MISSING_ACCOUNT_TYPE", + "description": "The payment is missing a required ACCOUNT_TYPE parameter.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_POSTAL_CODE", + "description": "The postal code is incorrectly formatted.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "INVALID_FEES", + "description": "The app_fee_money on a payment is too high.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED", + "description": "The card must be swiped, tapped, or dipped. Payments attempted by manually entering the card number are declined.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "PAYMENT_LIMIT_EXCEEDED", + "description": "Square declined the request because the payment amount exceeded the processing limit for this merchant.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "GIFT_CARD_AVAILABLE_AMOUNT", + "description": "When a Gift Card is a payment source, you can allow taking a partial payment\nby adding the `accept_partial_authorization` parameter in the request.\nHowever, taking such a partial payment does not work if your request also includes\n`tip_money`, `app_fee_money`, or both. Square declines such payments and returns\nthe `GIFT_CARD_AVAILABLE_AMOUNT` error.\nFor more information, see\n[CreatePayment errors (additional information)](https://developer.squareup.com/docs/payments-api/error-codes#createpayment-errors-additional-information).", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "ACCOUNT_UNUSABLE", + "description": "The account provided cannot carry out transactions.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "BUYER_REFUSED_PAYMENT", + "description": "Bank account rejected or was not authorized for the payment.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "DELAYED_TRANSACTION_EXPIRED", + "description": "The application tried to update a delayed-capture payment that has expired.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "DELAYED_TRANSACTION_CANCELED", + "description": "The application tried to cancel a delayed-capture payment that was already cancelled.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "DELAYED_TRANSACTION_CAPTURED", + "description": "The application tried to capture a delayed-capture payment that was already captured.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "DELAYED_TRANSACTION_FAILED", + "description": "The application tried to update a delayed-capture payment that failed.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CARD_TOKEN_EXPIRED", + "description": "The provided card token (nonce) has expired.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CARD_TOKEN_USED", + "description": "The provided card token (nonce) was already used to process the payment or refund.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "AMOUNT_TOO_HIGH", + "description": "The requested payment amount is too high for the provided payment source.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_INSTRUMENT_TYPE", + "description": "The API request references an unsupported instrument type.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "REFUND_AMOUNT_INVALID", + "description": "The requested refund amount exceeds the amount available to refund.", + "error-category": "REFUND_ERROR" + }, + { + "name": "REFUND_ALREADY_PENDING", + "description": "The payment already has a pending refund.", + "error-category": "REFUND_ERROR" + }, + { + "name": "PAYMENT_NOT_REFUNDABLE", + "description": "The payment is not refundable. For example, the payment is too old to be refunded.", + "error-category": "REFUND_ERROR" + }, + { + "name": "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE", + "description": "The payment is not refundable because it has been disputed.", + "error-category": "REFUND_ERROR" + }, + { + "name": "REFUND_ERROR_PAYMENT_NEEDS_COMPLETION", + "description": "The payment is not refundable because the payment is approved and needs to be completed first before the refund is issued.", + "error-category": "REFUND_ERROR" + }, + { + "name": "REFUND_DECLINED", + "description": "Request failed - The card issuer declined the refund.", + "error-category": "REFUND_ERROR" + }, + { + "name": "INSUFFICIENT_PERMISSIONS_FOR_REFUND", + "description": "The Square account does not have the permissions to process this refund.", + "error-category": "REFUND_ERROR" + }, + { + "name": "INVALID_CARD_DATA", + "description": "Generic error - the provided card data is invalid.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "SOURCE_USED", + "description": "The provided source id was already used to create a card.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "SOURCE_EXPIRED", + "description": "The provided source id has expired.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_LOYALTY_REWARD_TIER", + "description": "The referenced loyalty program reward tier is not supported.\nThis could happen if the reward tier created in a first party\napplication is incompatible with the Loyalty API.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "LOCATION_MISMATCH", + "description": "Generic error - the given location does not matching what is expected.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "ORDER_UNPAID_NOT_RETURNABLE", + "description": "The order attempting to be returned is not yet paid and cannot be returned.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "IDEMPOTENCY_KEY_REUSED", + "description": "The provided idempotency key has already been used.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNEXPECTED_VALUE", + "description": "General error - the value provided was unexpected.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "SANDBOX_NOT_SUPPORTED", + "description": "The API request is not supported in sandbox.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_EMAIL_ADDRESS", + "description": "The provided email address is invalid.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_PHONE_NUMBER", + "description": "The provided phone number is invalid.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CHECKOUT_EXPIRED", + "description": "The provided checkout URL has expired.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "BAD_CERTIFICATE", + "description": "Bad certificate.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "INVALID_SQUARE_VERSION_FORMAT", + "description": "The provided Square-Version is incorrectly formatted.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "API_VERSION_INCOMPATIBLE", + "description": "The provided Square-Version is incompatible with the requested action.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CARD_PRESENCE_REQUIRED", + "description": "The transaction requires that a card be present.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_SOURCE_TYPE", + "description": "The API request references an unsupported source type.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CARD_MISMATCH", + "description": "The provided card does not match what is expected.", + "error-category": "REFUND_ERROR" + }, + { + "name": "PLAID_ERROR", + "description": "Generic plaid error", + "error-category": "EXTERNAL_VENDOR_ERROR" + }, + { + "name": "PLAID_ERROR_ITEM_LOGIN_REQUIRED", + "description": "Plaid error - ITEM_LOGIN_REQUIRED", + "error-category": "EXTERNAL_VENDOR_ERROR" + }, + { + "name": "PLAID_ERROR_RATE_LIMIT", + "description": "Plaid error - RATE_LIMIT", + "error-category": "EXTERNAL_VENDOR_ERROR" + }, + { + "name": "CARD_DECLINED", + "description": "The card was declined.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "VERIFY_CVV_FAILURE", + "description": "The CVV could not be verified.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "VERIFY_AVS_FAILURE", + "description": "The AVS could not be verified.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CARD_DECLINED_CALL_ISSUER", + "description": "The payment card was declined with a request\nfor the card holder to call the issuer.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CARD_DECLINED_VERIFICATION_REQUIRED", + "description": "The payment card was declined with a request\nfor additional verification.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "BAD_EXPIRATION", + "description": "The card expiration date is either missing or\nincorrectly formatted.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "CHIP_INSERTION_REQUIRED", + "description": "The card issuer requires that the card be read\nusing a chip reader.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "ALLOWABLE_PIN_TRIES_EXCEEDED", + "description": "The card has exhausted its available pin entry\nretries set by the card issuer. Resolving the error typically requires the\ncard holder to contact the card issuer.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "RESERVATION_DECLINED", + "description": "The card issuer declined the refund.", + "error-category": "REFUND_ERROR" + }, + { + "name": "UNKNOWN_BODY_PARAMETER", + "description": "The body parameter is not recognized by the requested endpoint.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "NOT_FOUND", + "description": "Not Found - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", + "description": "Square could not find the associated Apple Pay certificate.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "METHOD_NOT_ALLOWED", + "description": "Method Not Allowed - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "NOT_ACCEPTABLE", + "description": "Not Acceptable - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "REQUEST_TIMEOUT", + "description": "Request Timeout - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "CONFLICT", + "description": "Conflict - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "GONE", + "description": "The target resource is no longer available and this\ncondition is likely to be permanent.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "REQUEST_ENTITY_TOO_LARGE", + "description": "Request Entity Too Large - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNSUPPORTED_MEDIA_TYPE", + "description": "Unsupported Media Type - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "UNPROCESSABLE_ENTITY", + "description": "Unprocessable Entity - a general error occurred.", + "error-category": "INVALID_REQUEST_ERROR" + }, + { + "name": "RATE_LIMITED", + "description": "Rate Limited - a general error occurred.", + "error-category": "RATE_LIMIT_ERROR" + }, + { + "name": "NOT_IMPLEMENTED", + "description": "Not Implemented - a general error occurred.", + "error-category": "API_ERROR" + }, + { + "name": "BAD_GATEWAY", + "description": "Bad Gateway - a general error occurred.", + "error-category": "API_ERROR" + }, + { + "name": "SERVICE_UNAVAILABLE", + "description": "Service Unavailable - a general error occurred.", + "error-category": "API_ERROR" + }, + { + "name": "TEMPORARY_ERROR", + "description": "A temporary internal error occurred. You can safely retry your call\nusing the same idempotency key.", + "error-category": "PAYMENT_METHOD_ERROR" + }, + { + "name": "GATEWAY_TIMEOUT", + "description": "Gateway Timeout - a general error occurred.", + "error-category": "API_ERROR" + } + ], + "description": "Indicates the specific error that occurred during a request to a\nSquare API.", + "x-release-status": "PUBLIC" + }, + "Event": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/EventData", + "description": "The data associated with the event.", + "nullable": true + } + } + }, + "EventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The name of the affected object’s type.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected object." + }, + "deleted": { + "type": "boolean", + "description": "This is true if the affected object has been deleted; otherwise, it's absent.", + "nullable": true + }, + "object": { + "type": "object", + "description": "An object containing fields and values relevant to the event. It is absent if the affected object has been deleted.", + "nullable": true + } + } + }, + "EventMetadata": { + "type": "object", + "description": "Contains metadata about a particular [Event](entity:Event).", + "x-release-status": "BETA", + "properties": { + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "api_version": { + "type": "string", + "description": "The API version of the event. This corresponds to the default API version of the developer application at the time when the event was created.", + "nullable": true + } + } + }, + "EventTypeMetadata": { + "type": "object", + "description": "Contains the metadata of a webhook event type.", + "x-release-status": "PUBLIC", + "properties": { + "event_type": { + "type": "string", + "description": "The event type.", + "readOnly": true + }, + "api_version_introduced": { + "type": "string", + "description": "The API version at which the event type was introduced.", + "readOnly": true + }, + "release_status": { + "type": "string", + "description": "The release status of the event type.", + "readOnly": true + } + } + }, + "ExcludeStrategy": { + "type": "string", + "enum": [ + "LEAST_EXPENSIVE", + "MOST_EXPENSIVE" + ], + "x-enum-elements": [ + { + "name": "LEAST_EXPENSIVE", + "description": "The least expensive matched products are excluded from the pricing. If\nthe pricing rule is set to exclude one product and multiple products in the\nmatch set qualify as least expensive, then one will be excluded at random.\n\nExcluding the least expensive product gives the best discount value to the buyer." + }, + { + "name": "MOST_EXPENSIVE", + "description": "The most expensive matched product is excluded from the pricing rule.\nIf multiple products have the same price and all qualify as least expensive,\none will be excluded at random.\n\nThis guarantees that the most expensive product is purchased at full price." + } + ], + "description": "Indicates which products matched by a CatalogPricingRule\nwill be excluded if the pricing rule uses an exclude set.", + "x-release-status": "BETA" + }, + "ExternalPaymentDetails": { + "type": "object", + "description": "Stores details about an external payment. Contains only non-confidential information.\nFor more information, see \n[Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external-payments).", + "x-release-status": "PUBLIC", + "required": [ + "type", + "source" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of external payment the seller received. It can be one of the following:\n- CHECK - Paid using a physical check.\n- BANK_TRANSFER - Paid using external bank transfer.\n- OTHER\\_GIFT\\_CARD - Paid using a non-Square gift card.\n- CRYPTO - Paid using a crypto currency.\n- SQUARE_CASH - Paid using Square Cash App.\n- SOCIAL - Paid using peer-to-peer payment applications.\n- EXTERNAL - A third-party application gathered this payment outside of Square.\n- EMONEY - Paid using an E-money provider.\n- CARD - A credit or debit card that Square does not support.\n- STORED_BALANCE - Use for house accounts, store credit, and so forth.\n- FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals\n- OTHER - A type not listed here.", + "maxLength": 50 + }, + "source": { + "type": "string", + "description": "A description of the external payment source. For example, \n\"Food Delivery Service\".", + "maxLength": 255 + }, + "source_id": { + "type": "string", + "description": "An ID to associate the payment to its originating source.", + "maxLength": 255, + "nullable": true + }, + "source_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The fees paid to the source. The `amount_money` minus this field is \nthe net amount seller receives.", + "nullable": true + } + } + }, + "FilterValue": { + "type": "object", + "description": "A filter to select resources based on an exact field value. For any given\nvalue, the value can only be in one property. Depending on the field, either\nall properties can be set or only a subset will be available.\n\nRefer to the documentation of the field.", + "x-release-status": "BETA", + "properties": { + "all": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of terms that must be present on the field of the resource.", + "nullable": true + }, + "any": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of terms where at least one of them must be present on the\nfield of the resource.", + "nullable": true + }, + "none": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of terms that must not be present on the field the resource", + "nullable": true + } + } + }, + "FloatNumberRange": { + "type": "object", + "description": "Specifies a decimal number range.", + "x-release-status": "PUBLIC", + "properties": { + "start_at": { + "type": "string", + "description": "A decimal value indicating where the range starts.", + "nullable": true + }, + "end_at": { + "type": "string", + "description": "A decimal value indicating where the range ends.", + "nullable": true + } + } + }, + "Fulfillment": { + "type": "object", + "description": "Contains details about how to fulfill this order.\nOrders can only be created with at most one fulfillment using the API.\nHowever, orders returned by the Orders API might contain multiple fulfillments because sellers can create multiple fulfillments using Square products such as Square Online.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the fulfillment only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/FulfillmentType", + "description": "The type of the fulfillment.\nSee [FulfillmentType](#type-fulfillmenttype) for possible values", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/FulfillmentState", + "description": "The state of the fulfillment.\nSee [FulfillmentState](#type-fulfillmentstate) for possible values", + "nullable": true + }, + "line_item_application": { + "$ref": "#/components/schemas/FulfillmentFulfillmentLineItemApplication", + "description": "Describes what order line items this fulfillment applies to.\nIt can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries.\nSee [FulfillmentFulfillmentLineItemApplication](#type-fulfillmentfulfillmentlineitemapplication) for possible values", + "readOnly": true, + "x-release-status": "BETA" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentFulfillmentEntry" + }, + "description": "A list of entries pertaining to the fulfillment of an order. Each entry must reference\na valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to\nfulfill.\n\nMultiple entries can reference the same line item `uid`, as long as the total quantity among\nall fulfillment entries referencing a single line item does not exceed the quantity of the\norder's line item itself.\n\nAn order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`,\n`CANCELED`, or `FAILED`. Fulfillments can be created and completed independently\nbefore order completion.", + "readOnly": true, + "x-release-status": "BETA" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this fulfillment. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "pickup_details": { + "$ref": "#/components/schemas/FulfillmentPickupDetails", + "description": "Contains details for a pickup fulfillment. These details are required when the fulfillment\ntype is `PICKUP`.", + "nullable": true + }, + "shipment_details": { + "$ref": "#/components/schemas/FulfillmentShipmentDetails", + "description": "Contains details for a shipment fulfillment. These details are required when the fulfillment type\nis `SHIPMENT`.\n\nA shipment fulfillment's relationship to fulfillment `state`:\n`PROPOSED`: A shipment is requested.\n`RESERVED`: Fulfillment in progress. Shipment processing.\n`PREPARED`: Shipment packaged. Shipping label created.\n`COMPLETED`: Package has been shipped.\n`CANCELED`: Shipment has been canceled.\n`FAILED`: Shipment has failed.", + "x-release-status": "BETA", + "nullable": true + }, + "delivery_details": { + "$ref": "#/components/schemas/FulfillmentDeliveryDetails", + "description": "Describes delivery details of an order fulfillment.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "FulfillmentDeliveryDetails": { + "type": "object", + "description": "Describes delivery details of an order fulfillment.", + "x-release-status": "BETA", + "properties": { + "recipient": { + "$ref": "#/components/schemas/FulfillmentRecipient", + "description": "The contact information for the person to receive the fulfillment.", + "nullable": true + }, + "schedule_type": { + "$ref": "#/components/schemas/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType", + "description": "Indicates the fulfillment delivery schedule type. If `SCHEDULED`, then\n`deliver_at` is required. If `ASAP`, then `prep_time_duration` is required. The default is `SCHEDULED`.\nSee [OrderFulfillmentDeliveryDetailsScheduleType](#type-orderfulfillmentdeliverydetailsscheduletype) for possible values", + "nullable": true + }, + "placed_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was placed.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").\n\nMust be in RFC 3339 timestamp format, e.g., \"2016-09-04T23:59:33.123Z\".", + "readOnly": true + }, + "deliver_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nthat represents the start of the delivery period.\nWhen the fulfillment `schedule_type` is `ASAP`, the field is automatically\nset to the current time plus the `prep_time_duration`.\nOtherwise, the application can set this field while the fulfillment `state` is\n`PROPOSED`, `RESERVED`, or `PREPARED` (any time before the\nterminal state such as `COMPLETED`, `CANCELED`, and `FAILED`).\n\nThe timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + }, + "prep_time_duration": { + "type": "string", + "description": "The duration of time it takes to prepare and deliver this fulfillment.\nThe duration must be in RFC 3339 format (for example, \"P1W3D\").", + "nullable": true + }, + "delivery_window_duration": { + "type": "string", + "description": "The time period after `deliver_at` in which to deliver the order.\nApplications can set this field when the fulfillment `state` is\n`PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state\nsuch as `COMPLETED`, `CANCELED`, and `FAILED`).\n\nThe duration must be in RFC 3339 format (for example, \"P1W3D\").", + "nullable": true + }, + "note": { + "type": "string", + "description": "Provides additional instructions about the delivery fulfillment.\nIt is displayed in the Square Point of Sale application and set by the API.", + "maxLength": 550, + "nullable": true + }, + "completed_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicates when the seller completed the fulfillment.\nThis field is automatically set when fulfillment `state` changes to `COMPLETED`.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + }, + "in_progress_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicates when the seller started processing the fulfillment.\nThis field is automatically set when the fulfillment `state` changes to `RESERVED`.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "rejected_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was rejected. This field is\nautomatically set when the fulfillment `state` changes to `FAILED`.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "ready_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the seller marked the fulfillment as ready for\ncourier pickup. This field is automatically set when the fulfillment `state` changes\nto PREPARED.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "delivered_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was delivered to the recipient.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "canceled_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was canceled. This field is automatically\nset when the fulfillment `state` changes to `CANCELED`.\n\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "cancel_reason": { + "type": "string", + "description": "The delivery cancellation reason. Max length: 100 characters.", + "maxLength": 100, + "nullable": true + }, + "courier_pickup_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when an order can be picked up by the courier for delivery.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + }, + "courier_pickup_window_duration": { + "type": "string", + "description": "The time period after `courier_pickup_at` in which the courier should pick up the order.\nThe duration must be in RFC 3339 format (for example, \"P1W3D\").", + "nullable": true + }, + "is_no_contact_delivery": { + "type": "boolean", + "description": "Whether the delivery is preferred to be no contact.", + "nullable": true + }, + "dropoff_notes": { + "type": "string", + "description": "A note to provide additional instructions about how to deliver the order.", + "maxLength": 550, + "nullable": true + }, + "courier_provider_name": { + "type": "string", + "description": "The name of the courier provider.", + "maxLength": 255, + "nullable": true + }, + "courier_support_phone_number": { + "type": "string", + "description": "The support phone number of the courier.", + "maxLength": 17, + "nullable": true + }, + "square_delivery_id": { + "type": "string", + "description": "The identifier for the delivery created by Square.", + "maxLength": 50, + "nullable": true + }, + "external_delivery_id": { + "type": "string", + "description": "The identifier for the delivery created by the third-party courier service.", + "maxLength": 50, + "nullable": true + }, + "managed_delivery": { + "type": "boolean", + "description": "The flag to indicate the delivery is managed by a third party (ie DoorDash), which means\nwe may not receive all recipient information for PII purposes.", + "nullable": true + } + } + }, + "FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType": { + "type": "string", + "enum": [ + "SCHEDULED", + "ASAP" + ], + "x-enum-elements": [ + { + "name": "SCHEDULED", + "description": "Indicates the fulfillment to deliver at a scheduled deliver time." + }, + { + "name": "ASAP", + "description": "Indicates that the fulfillment to deliver as soon as possible and should be prepared\nimmediately." + } + ], + "description": "The schedule type of the delivery fulfillment.", + "x-release-status": "BETA" + }, + "FulfillmentFulfillmentEntry": { + "type": "object", + "description": "Links an order line item to a fulfillment. Each entry must reference\na valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to\nfulfill.", + "x-release-status": "BETA", + "required": [ + "line_item_uid", + "quantity" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the fulfillment entry only within this order.", + "maxLength": 60, + "nullable": true + }, + "line_item_uid": { + "type": "string", + "description": "The `uid` from the order line item.", + "minLength": 1 + }, + "quantity": { + "type": "string", + "description": "The quantity of the line item being fulfilled, formatted as a decimal number.\nFor example, `\"3\"`.\n\nFulfillments for line items with a `quantity_unit` can have non-integer quantities.\nFor example, `\"1.70000\"`.", + "minLength": 1, + "maxLength": 12 + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this fulfillment entry. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "nullable": true + } + } + }, + "FulfillmentFulfillmentLineItemApplication": { + "type": "string", + "enum": [ + "ALL", + "ENTRY_LIST" + ], + "x-enum-elements": [ + { + "name": "ALL", + "description": "If `ALL`, `entries` must be unset." + }, + { + "name": "ENTRY_LIST", + "description": "If `ENTRY_LIST`, supply a list of `entries`." + } + ], + "description": "The `line_item_application` describes what order line items this fulfillment applies\nto. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries.", + "x-release-status": "BETA" + }, + "FulfillmentPickupDetails": { + "type": "object", + "description": "Contains details necessary to fulfill a pickup order.", + "x-release-status": "PUBLIC", + "properties": { + "recipient": { + "$ref": "#/components/schemas/FulfillmentRecipient", + "description": "Information about the person to pick up this fulfillment from a physical\nlocation.", + "nullable": true + }, + "expires_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when this fulfillment expires if it is not marked in progress. The timestamp must be\nin RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\"). The expiration time can only be set\nup to 7 days in the future. If `expires_at` is not set, any new payments attached to the order\nare automatically completed.", + "nullable": true + }, + "auto_complete_duration": { + "type": "string", + "description": "The duration of time after which an in progress pickup fulfillment is automatically moved\nto the `COMPLETED` state. The duration must be in RFC 3339 format (for example, \"P1W3D\").\n\nIf not set, this pickup fulfillment remains in progress until it is canceled or completed.", + "nullable": true + }, + "schedule_type": { + "$ref": "#/components/schemas/FulfillmentPickupDetailsScheduleType", + "description": "The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`.\nSee [FulfillmentPickupDetailsScheduleType](#type-fulfillmentpickupdetailsscheduletype) for possible values", + "nullable": true + }, + "pickup_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nthat represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g.,\n\"2016-09-04T23:59:33.123Z\".\n\nFor fulfillments with the schedule type `ASAP`, this is automatically set\nto the current time plus the expected duration to prepare the fulfillment.", + "nullable": true + }, + "pickup_window_duration": { + "type": "string", + "description": "The window of time in which the order should be picked up after the `pickup_at` timestamp.\nMust be in RFC 3339 duration format, e.g., \"P1W3D\". Can be used as an\ninformational guideline for merchants.", + "nullable": true + }, + "prep_time_duration": { + "type": "string", + "description": "The duration of time it takes to prepare this fulfillment.\nThe duration must be in RFC 3339 format (for example, \"P1W3D\").", + "nullable": true + }, + "note": { + "type": "string", + "description": "A note to provide additional instructions about the pickup\nfulfillment displayed in the Square Point of Sale application and set by the API.", + "maxLength": 500, + "nullable": true + }, + "placed_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was placed. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "accepted_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was marked in progress. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "rejected_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "ready_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "expired_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment expired. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "picked_up_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "canceled_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "cancel_reason": { + "type": "string", + "description": "A description of why the pickup was canceled. The maximum length: 100 characters.", + "maxLength": 100, + "nullable": true + }, + "is_curbside_pickup": { + "type": "boolean", + "description": "If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup.", + "x-release-status": "BETA", + "nullable": true + }, + "curbside_pickup_details": { + "$ref": "#/components/schemas/FulfillmentPickupDetailsCurbsidePickupDetails", + "description": "Specific details for curbside pickup. These details can only be populated if `is_curbside_pickup` is set to `true`.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "FulfillmentPickupDetailsCurbsidePickupDetails": { + "type": "object", + "description": "Specific details for curbside pickup.", + "x-release-status": "BETA", + "properties": { + "curbside_details": { + "type": "string", + "description": "Specific details for curbside pickup, such as parking number and vehicle model.", + "maxLength": 250, + "nullable": true + }, + "buyer_arrived_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + } + } + }, + "FulfillmentPickupDetailsScheduleType": { + "type": "string", + "enum": [ + "SCHEDULED", + "ASAP" + ], + "x-enum-elements": [ + { + "name": "SCHEDULED", + "description": "Indicates that the fulfillment will be picked up at a scheduled pickup time." + }, + { + "name": "ASAP", + "description": "Indicates that the fulfillment will be picked up as soon as possible and\nshould be prepared immediately." + } + ], + "description": "The schedule type of the pickup fulfillment.", + "x-release-status": "PUBLIC" + }, + "FulfillmentRecipient": { + "type": "object", + "description": "Information about the fulfillment recipient.", + "x-release-status": "PUBLIC", + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the customer associated with the fulfillment.\n\nIf `customer_id` is provided, the fulfillment recipient's `display_name`,\n`email_address`, and `phone_number` are automatically populated from the\ntargeted customer profile. If these fields are set in the request, the request\nvalues override the information from the customer profile. If the\ntargeted customer profile does not contain the necessary information and\nthese fields are left unset, the request results in an error.", + "maxLength": 191, + "nullable": true + }, + "display_name": { + "type": "string", + "description": "The display name of the fulfillment recipient. This field is required.\n\nIf provided, the display name overrides the corresponding customer profile value\nindicated by `customer_id`.", + "maxLength": 255, + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address of the fulfillment recipient.\n\nIf provided, the email address overrides the corresponding customer profile value\nindicated by `customer_id`.", + "maxLength": 255, + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number of the fulfillment recipient. This field is required.\n\nIf provided, the phone number overrides the corresponding customer profile value\nindicated by `customer_id`.", + "maxLength": 17, + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The address of the fulfillment recipient. This field is required.\n\nIf provided, the address overrides the corresponding customer profile value\nindicated by `customer_id`.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "FulfillmentShipmentDetails": { + "type": "object", + "description": "Contains the details necessary to fulfill a shipment order.", + "x-release-status": "BETA", + "properties": { + "recipient": { + "$ref": "#/components/schemas/FulfillmentRecipient", + "description": "Information about the person to receive this shipment fulfillment.", + "nullable": true + }, + "carrier": { + "type": "string", + "description": "The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).", + "maxLength": 50, + "nullable": true + }, + "shipping_note": { + "type": "string", + "description": "A note with additional information for the shipping carrier.", + "maxLength": 500, + "nullable": true + }, + "shipping_type": { + "type": "string", + "description": "A description of the type of shipping product purchased from the carrier\n(such as First Class, Priority, or Express).", + "maxLength": 50, + "nullable": true + }, + "tracking_number": { + "type": "string", + "description": "The reference number provided by the carrier to track the shipment's progress.", + "maxLength": 100, + "nullable": true + }, + "tracking_url": { + "type": "string", + "description": "A link to the tracking webpage on the carrier's website.", + "maxLength": 2000, + "nullable": true + }, + "placed_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the shipment was requested. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "in_progress_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when this fulfillment was moved to the `RESERVED` state, which indicates that preparation\nof this shipment has begun. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "packaged_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when this fulfillment was moved to the `PREPARED` state, which indicates that the\nfulfillment is packaged. The timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "expected_shipped_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the shipment is expected to be delivered to the shipping carrier.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + }, + "shipped_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when this fulfillment was moved to the `COMPLETED` state, which indicates that\nthe fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "canceled_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating the shipment was canceled.\nThe timestamp must be in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "nullable": true + }, + "cancel_reason": { + "type": "string", + "description": "A description of why the shipment was canceled.", + "maxLength": 100, + "nullable": true + }, + "failed_at": { + "type": "string", + "description": "The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)\nindicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format\n(for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "failure_reason": { + "type": "string", + "description": "A description of why the shipment failed to be completed.", + "maxLength": 100, + "nullable": true + } + } + }, + "FulfillmentState": { + "type": "string", + "enum": [ + "PROPOSED", + "RESERVED", + "PREPARED", + "COMPLETED", + "CANCELED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "PROPOSED", + "description": "Indicates that the fulfillment has been proposed." + }, + { + "name": "RESERVED", + "description": "Indicates that the fulfillment has been reserved." + }, + { + "name": "PREPARED", + "description": "Indicates that the fulfillment has been prepared." + }, + { + "name": "COMPLETED", + "description": "Indicates that the fulfillment was successfully completed." + }, + { + "name": "CANCELED", + "description": "Indicates that the fulfillment was canceled." + }, + { + "name": "FAILED", + "description": "Indicates that the fulfillment failed to be completed, but was not explicitly\ncanceled." + } + ], + "description": "The current state of this fulfillment.", + "x-release-status": "PUBLIC" + }, + "FulfillmentType": { + "type": "string", + "enum": [ + "PICKUP", + "SHIPMENT", + "DELIVERY" + ], + "x-enum-elements": [ + { + "name": "PICKUP", + "description": "A recipient to pick up the fulfillment from a physical [location](entity:Location)." + }, + { + "name": "SHIPMENT", + "description": "A shipping carrier to ship the fulfillment." + }, + { + "name": "DELIVERY", + "description": "A courier to deliver the fulfillment." + } + ], + "description": "The type of fulfillment.", + "x-release-status": "PUBLIC" + }, + "GetBankAccountByV1IdResponse": { + "type": "object", + "description": "Response object returned by GetBankAccountByV1Id.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "bank_account": { + "$ref": "#/components/schemas/BankAccount", + "description": "The requested `BankAccount` object." + } + }, + "example": { + "bank_account": { + "account_number_suffix": "971", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": false, + "currency": "USD", + "debitable": false, + "holder_name": "Jane Doe", + "id": "w3yRgCGYQnwmdl0R3GB", + "location_id": "S8GWD5example", + "primary_bank_identification_number": "112200303", + "status": "VERIFICATION_IN_PROGRESS", + "version": 5 + } + } + }, + "GetBankAccountResponse": { + "type": "object", + "description": "Response object returned by `GetBankAccount`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "bank_account": { + "$ref": "#/components/schemas/BankAccount", + "description": "The requested `BankAccount` object." + } + }, + "example": { + "bank_account": { + "account_number_suffix": "971", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": false, + "currency": "USD", + "debitable": false, + "holder_name": "Jane Doe", + "id": "w3yRgCGYQnwmdl0R3GB", + "location_id": "S8GWD5example", + "primary_bank_identification_number": "112200303", + "status": "VERIFICATION_IN_PROGRESS", + "version": 5 + } + } + }, + "GetBreakTypeResponse": { + "type": "object", + "description": "The response to a request to get a `BreakType`. The response contains\nthe requested `BreakType` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "break_type": { + "$ref": "#/components/schemas/BreakType", + "description": "The response object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "break_type": { + "break_name": "Lunch Break", + "created_at": "2019-02-21T17:50:00Z", + "expected_duration": "PT30M", + "id": "lA0mj_RSOprNPwMUXdYp", + "is_paid": true, + "location_id": "059SB0E0WCNWS", + "updated_at": "2019-02-21T17:50:00Z", + "version": 1 + } + } + }, + "GetDeviceCodeResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "device_code": { + "$ref": "#/components/schemas/DeviceCode", + "description": "The queried DeviceCode." + } + }, + "example": { + "device_code": { + "code": "EBCARJ", + "created_at": "2020-02-06T18:44:33.000Z", + "device_id": "907CS13101300122", + "id": "B3Z6NAMYQSMTM", + "location_id": "B5E4484SHHNYH", + "name": "Counter 1", + "pair_by": "2020-02-06T18:49:33.000Z", + "product_type": "TERMINAL_API", + "status": "PAIRED", + "status_changed_at": "2020-02-06T18:47:28.000Z" + } + } + }, + "GetDeviceResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "device": { + "$ref": "#/components/schemas/Device", + "description": "The requested `Device`." + } + }, + "example": { + "device": { + "attributes": { + "manufacturer": "Square", + "manufacturers_id": "995CS397A6475287", + "merchant_token": "MLCHXZCBWFGDW", + "model": "T2", + "name": "Square Terminal 995", + "type": "TERMINAL", + "updated_at": "2023-09-29T13:12:22.365049321Z", + "version": "5.41.0085" + }, + "components": [ + { + "application_details": { + "application_type": "TERMINAL_API", + "session_location": "LMN2K7S3RTOU3", + "version": "6.25" + }, + "type": "APPLICATION" + }, + { + "card_reader_details": { + "version": "3.53.70" + }, + "type": "CARD_READER" + }, + { + "battery_details": { + "external_power": "AVAILABLE_CHARGING", + "visible_percent": 5 + }, + "type": "BATTERY" + }, + { + "type": "WIFI", + "wifi_details": { + "active": true, + "ip_address_v4": "10.0.0.7", + "secure_connection": "WPA/WPA2 PSK", + "signal_strength": { + "value": 2 + }, + "ssid": "Staff Network" + } + }, + { + "ethernet_details": { + "active": false + }, + "type": "ETHERNET" + } + ], + "id": "device:995CS397A6475287", + "status": { + "category": "AVAILABLE" + } + } + } + }, + "GetEmployeeWageResponse": { + "type": "object", + "description": "A response to a request to get an `EmployeeWage`. The response contains\nthe requested `EmployeeWage` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "employee_wage": { + "$ref": "#/components/schemas/EmployeeWage", + "description": "The requested `EmployeeWage` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "employee_wage": { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "id": "pXS3qCv7BERPnEGedM4S8mhm", + "title": "Manager" + } + } + }, + "GetInvoiceResponse": { + "type": "object", + "description": "Describes a `GetInvoice` response.", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The invoice requested." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T17:45:13Z", + "version": 0 + } + } + }, + "GetPaymentRefundResponse": { + "type": "object", + "description": "Defines the response returned by [GetRefund](api-endpoint:Refunds-GetPaymentRefund).\n\nNote: If there are errors processing the request, the refund field might not be\npresent or it might be present in a FAILED state.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/PaymentRefund", + "description": "The requested `PaymentRefund`." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 555, + "currency": "USD" + }, + "created_at": "2021-10-13T19:59:05.073Z", + "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", + "location_id": "L88917AVBK2S5", + "order_id": "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", + "payment_id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "processing_fee": [ + { + "amount_money": { + "amount": -34, + "currency": "USD" + }, + "effective_at": "2021-10-13T21:34:35.000Z", + "type": "INITIAL" + } + ], + "reason": "Example Refund", + "status": "COMPLETED", + "updated_at": "2021-10-13T20:00:02.442Z" + } + } + }, + "GetPaymentResponse": { + "type": "object", + "description": "Defines the response returned by [GetPayment](api-endpoint:Payments-GetPayment).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The requested `Payment`." + } + }, + "example": { + "payment": { + "amount_money": { + "amount": 555, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", + "square_product": "VIRTUAL_TERMINAL" + }, + "approved_money": { + "amount": 555, + "currency": "USD" + }, + "card_details": { + "auth_result_code": "2Nkw7q", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T19:34:33.680Z", + "captured_at": "2021-10-13T19:34:34.340Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "KEYED", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "CAPTURED" + }, + "created_at": "2021-10-13T19:34:33.524Z", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T19:34:33.524Z", + "employee_id": "TMoK_ogh6rH1o4dV", + "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "location_id": "L88917AVBK2S5", + "note": "Test Note", + "order_id": "d7eKah653Z579f3gVtjlxpSlmUcZY", + "processing_fee": [ + { + "amount_money": { + "amount": 34, + "currency": "USD" + }, + "effective_at": "2021-10-13T21:34:35.000Z", + "type": "INITIAL" + } + ], + "receipt_number": "bP9m", + "receipt_url": "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "source_type": "CARD", + "status": "COMPLETED", + "team_member_id": "TMoK_ogh6rH1o4dV", + "total_money": { + "amount": 555, + "currency": "USD" + }, + "updated_at": "2021-10-13T19:34:34.339Z", + "version_token": "56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o" + } + } + }, + "GetPayoutResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout": { + "$ref": "#/components/schemas/Payout", + "description": "The requested payout." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "payout": { + "amount_money": { + "amount": -103, + "currency_code": "USD" + }, + "arrival_date": "2022-03-24", + "created_at": "2022-03-24T03:07:09Z", + "destination": { + "id": "bact:ZPp3oedR3AeEUNd3z7", + "type": "BANK_ACCOUNT" + }, + "id": "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", + "location_id": "L88917AVBK2S5", + "status": "PAID", + "type": "BATCH", + "updated_at": "2022-03-24T03:07:09Z", + "version": 1 + } + } + }, + "GetShiftResponse": { + "type": "object", + "description": "A response to a request to get a `Shift`. The response contains\nthe requested `Shift` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The requested `Shift`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "shift": { + "breaks": [ + { + "break_type_id": "92EPDRQKJ5088", + "end_at": "2019-02-23T20:00:00-05:00", + "expected_duration": "PT1H", + "id": "M9BBKEPQAQD2T", + "is_paid": true, + "name": "Lunch Break", + "start_at": "2019-02-23T19:00:00-05:00" + } + ], + "created_at": "2019-02-27T00:12:12Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "D71KRMQof6cXGUW0aAv7", + "end_at": "2019-02-23T21:00:00-05:00", + "id": "T35HMQSN89SV4", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-02-23T18:00:00-05:00", + "status": "CLOSED", + "team_member_id": "D71KRMQof6cXGUW0aAv7", + "timezone": "America/New_York", + "updated_at": "2019-02-27T00:12:12Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1457, + "currency": "USD" + }, + "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", + "tip_eligible": true, + "title": "Cashier" + } + } + } + }, + "GetTeamMemberWageResponse": { + "type": "object", + "description": "A response to a request to get a `TeamMemberWage`. The response contains\nthe requested `TeamMemberWage` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "team_member_wage": { + "$ref": "#/components/schemas/TeamMemberWage", + "description": "The requested `TeamMemberWage` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "team_member_wage": { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "id": "pXS3qCv7BERPnEGedM4S8mhm", + "job_id": "jxJNN6eCJsLrhg5UFJrDWDGE", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": false, + "title": "Manager" + } + } + }, + "GetTerminalActionResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The requested `TerminalAction`" + } + }, + "example": { + "action": { + "app_id": "APP_ID", + "created_at": "2021-07-28T23:22:07.476Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:jveJIAkkAjILHkdCE", + "location_id": "LOCATION_ID", + "save_card_options": { + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "IN_PROGRESS", + "type": "SAVE_CARD", + "updated_at": "2021-07-28T23:22:08.301Z" + } + } + }, + "GetTerminalCheckoutResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The requested `TerminalCheckout`." + } + }, + "example": { + "checkout": { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2020-04-06T16:39:32.545Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "08YceKh7B3ZqO", + "location_id": "LOCATION_ID", + "note": "A brief note", + "reference_id": "id11572", + "status": "IN_PROGRESS", + "updated_at": "2020-04-06T16:39:323.001Z" + } + } + }, + "GetTerminalRefundResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The requested `Refund`." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 1, + "exp_year": 2022, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "created_at": "2020-09-29T15:21:46.771Z", + "deadline_duration": "PT5M", + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "id": "009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "76C9W6K8CNNQ5", + "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Returning item", + "refund_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb", + "status": "COMPLETED", + "updated_at": "2020-09-29T15:21:48.675Z" + } + } + }, + "GiftCard": { + "type": "object", + "description": "Represents a Square gift card.", + "x-release-status": "PUBLIC", + "required": [ + "type" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the gift card.", + "readOnly": true + }, + "type": { + "$ref": "#/components/schemas/GiftCardType", + "description": "The gift card type.\nSee [Type](#type-type) for possible values" + }, + "gan_source": { + "$ref": "#/components/schemas/GiftCardGANSource", + "description": "The source that generated the gift card account number (GAN). The default value is `SQUARE`.\nSee [GANSource](#type-gansource) for possible values", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/GiftCardStatus", + "description": "The current gift card state.\nSee [Status](#type-status) for possible values", + "readOnly": true + }, + "balance_money": { + "$ref": "#/components/schemas/Money", + "description": "The current gift card balance. This balance is always greater than or equal to zero.", + "readOnly": true + }, + "gan": { + "type": "string", + "description": "The gift card account number (GAN). Buyers can use the GAN to make purchases or check \nthe gift card balance.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the gift card was created, in RFC 3339 format. \nIn the case of a digital gift card, it is the time when you create a card \n(using the Square Point of Sale application, Seller Dashboard, or Gift Cards API). \nIn the case of a plastic gift card, it is the time when Square associates the card with the \nseller at the time of activation.", + "readOnly": true + }, + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the [customer profiles](entity:Customer) to whom this gift card is linked.", + "readOnly": true + } + } + }, + "GiftCardActivity": { + "type": "object", + "description": "Represents an action performed on a [gift card](entity:GiftCard) that affects its state or balance. \nA gift card activity contains information about a specific activity type. For example, a `REDEEM` activity\nincludes a `redeem_activity_details` field that contains information about the redemption.", + "x-release-status": "PUBLIC", + "required": [ + "type", + "location_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the gift card activity.", + "readOnly": true + }, + "type": { + "$ref": "#/components/schemas/GiftCardActivityType", + "description": "The type of gift card activity.\nSee [Type](#type-type) for possible values" + }, + "location_id": { + "type": "string", + "description": "The ID of the [business location](entity:Location) where the activity occurred." + }, + "created_at": { + "type": "string", + "description": "The timestamp when the gift card activity was created, in RFC 3339 format.", + "readOnly": true + }, + "gift_card_id": { + "type": "string", + "description": "The gift card ID. When creating a gift card activity, `gift_card_id` is not required if \n`gift_card_gan` is specified.", + "nullable": true + }, + "gift_card_gan": { + "type": "string", + "description": "The gift card account number (GAN). When creating a gift card activity, `gift_card_gan` \nis not required if `gift_card_id` is specified.", + "nullable": true + }, + "gift_card_balance_money": { + "$ref": "#/components/schemas/Money", + "description": "The final balance on the gift card after the action is completed.", + "readOnly": true + }, + "load_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityLoad", + "description": "Additional details about a `LOAD` activity, which is used to reload money onto a gift card.", + "nullable": true + }, + "activate_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityActivate", + "description": "Additional details about an `ACTIVATE` activity, which is used to activate a gift card with \nan initial balance.", + "nullable": true + }, + "redeem_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityRedeem", + "description": "Additional details about a `REDEEM` activity, which is used to redeem a gift card for a purchase.\n\nFor applications that process payments using the Square Payments API, Square creates a `REDEEM` activity that \nupdates the gift card balance after the corresponding [CreatePayment](api-endpoint:Payments-CreatePayment) \nrequest is completed. Applications that use a custom payment processing system must call \n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) to create the `REDEEM` activity.", + "nullable": true + }, + "clear_balance_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityClearBalance", + "description": "Additional details about a `CLEAR_BALANCE` activity, which is used to set the balance of a gift card to zero.", + "nullable": true + }, + "deactivate_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityDeactivate", + "description": "Additional details about a `DEACTIVATE` activity, which is used to deactivate a gift card.", + "nullable": true + }, + "adjust_increment_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityAdjustIncrement", + "description": "Additional details about an `ADJUST_INCREMENT` activity, which is used to add money to a gift card \noutside of a typical `ACTIVATE`, `LOAD`, or `REFUND` activity flow.", + "nullable": true + }, + "adjust_decrement_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityAdjustDecrement", + "description": "Additional details about an `ADJUST_DECREMENT` activity, which is used to deduct money from a gift \ncard outside of a typical `REDEEM` activity flow.", + "nullable": true + }, + "refund_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityRefund", + "description": "Additional details about a `REFUND` activity, which is used to add money to a gift card when \nrefunding a payment.\n\nFor applications that refund payments to a gift card using the Square Refunds API, Square automatically\ncreates a `REFUND` activity that updates the gift card balance after a [RefundPayment](api-endpoint:Refunds-RefundPayment)\nrequest is completed. Applications that use a custom processing system must call\n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) to create the `REFUND` activity.", + "nullable": true + }, + "unlinked_activity_refund_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityUnlinkedActivityRefund", + "description": "Additional details about an `UNLINKED_ACTIVITY_REFUND` activity. This activity is used to add money \nto a gift card when refunding a payment that was processed using a custom payment processing system\nand not linked to the gift card.", + "nullable": true + }, + "import_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityImport", + "description": "Additional details about an `IMPORT` activity, which Square uses to import a third-party \ngift card with a balance.", + "readOnly": true + }, + "block_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityBlock", + "description": "Additional details about a `BLOCK` activity, which Square uses to temporarily block a gift card.", + "readOnly": true + }, + "unblock_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityUnblock", + "description": "Additional details about an `UNBLOCK` activity, which Square uses to unblock a gift card.", + "readOnly": true + }, + "import_reversal_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityImportReversal", + "description": "Additional details about an `IMPORT_REVERSAL` activity, which Square uses to reverse the \nimport of a third-party gift card.", + "readOnly": true + }, + "transfer_balance_to_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityTransferBalanceTo", + "description": "Additional details about a `TRANSFER_BALANCE_TO` activity, which Square uses to add money to\na gift card as the result of a transfer from another gift card.", + "readOnly": true + }, + "transfer_balance_from_activity_details": { + "$ref": "#/components/schemas/GiftCardActivityTransferBalanceFrom", + "description": "Additional details about a `TRANSFER_BALANCE_FROM` activity, which Square uses to deduct money from\na gift as the result of a transfer to another gift card.", + "readOnly": true + } + } + }, + "GiftCardActivityActivate": { + "type": "object", + "description": "Represents details about an `ACTIVATE` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card. This value is a positive integer.\n\nApplications that use a custom order processing system must specify this amount in the \n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item.\n\nApplications that use the Square Orders API to process orders must specify the order ID\n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "line_item_uid": { + "type": "string", + "description": "The UID of the `GIFT_CARD` line item in the order that represents the gift card purchase.\n\nApplications that use the Square Orders API to process orders must specify the line item UID\nin the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID that associates the gift card activity with an entity in another system. \n\nApplications that use a custom order processing system can use this field to track information \nrelated to an order or payment.", + "nullable": true + }, + "buyer_payment_instrument_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The payment instrument IDs used to process the gift card purchase, such as a credit card ID \nor bank account ID. \n\nApplications that use a custom order processing system must specify payment instrument IDs in \nthe [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.\nSquare uses this information to perform compliance checks. \n\nFor applications that use the Square Orders API to process payments, Square has the necessary \ninstrument IDs to perform compliance checks.\n\nEach buyer payment instrument ID can contain a maximum of 255 characters.", + "nullable": true + } + } + }, + "GiftCardActivityAdjustDecrement": { + "type": "object", + "description": "Represents details about an `ADJUST_DECREMENT` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "amount_money", + "reason" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount deducted from the gift card balance. This value is a positive integer." + }, + "reason": { + "$ref": "#/components/schemas/GiftCardActivityAdjustDecrementReason", + "description": "The reason the gift card balance was adjusted.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityAdjustDecrementReason": { + "type": "string", + "enum": [ + "SUSPICIOUS_ACTIVITY", + "BALANCE_ACCIDENTALLY_INCREASED", + "SUPPORT_ISSUE", + "PURCHASE_WAS_REFUNDED" + ], + "x-enum-elements": [ + { + "name": "SUSPICIOUS_ACTIVITY", + "description": "The balance was decreased because the seller detected suspicious or fraudulent activity\non the gift card." + }, + { + "name": "BALANCE_ACCIDENTALLY_INCREASED", + "description": "The balance was decreased to reverse an unintentional balance increase." + }, + { + "name": "SUPPORT_ISSUE", + "description": "The balance was decreased to accommodate support issues." + }, + { + "name": "PURCHASE_WAS_REFUNDED", + "description": "The balance was decreased because the order used to purchase or reload the\ngift card was refunded." + } + ], + "description": "Indicates the reason for deducting money from a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityAdjustIncrement": { + "type": "object", + "description": "Represents details about an `ADJUST_INCREMENT` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "amount_money", + "reason" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card balance. This value is a positive integer." + }, + "reason": { + "$ref": "#/components/schemas/GiftCardActivityAdjustIncrementReason", + "description": "The reason the gift card balance was adjusted.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityAdjustIncrementReason": { + "type": "string", + "enum": [ + "COMPLIMENTARY", + "SUPPORT_ISSUE", + "TRANSACTION_VOIDED" + ], + "x-enum-elements": [ + { + "name": "COMPLIMENTARY", + "description": "The seller gifted a complimentary gift card balance increase." + }, + { + "name": "SUPPORT_ISSUE", + "description": "The seller increased the gift card balance \nto accommodate support issues." + }, + { + "name": "TRANSACTION_VOIDED", + "description": "The transaction is voided." + } + ], + "description": "Indicates the reason for adding money to a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityBlock": { + "type": "object", + "description": "Represents details about a `BLOCK` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "reason" + ], + "properties": { + "reason": { + "$ref": "#/components/schemas/GiftCardActivityBlockReason", + "description": "The reason the gift card was blocked.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityBlockReason": { + "type": "string", + "enum": [ + "CHARGEBACK_BLOCK" + ], + "x-enum-elements": [ + { + "name": "CHARGEBACK_BLOCK", + "description": "The gift card is blocked because the buyer initiated a chargeback on the gift card purchase." + } + ], + "description": "Indicates the reason for blocking a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityClearBalance": { + "type": "object", + "description": "Represents details about a `CLEAR_BALANCE` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "reason" + ], + "properties": { + "reason": { + "$ref": "#/components/schemas/GiftCardActivityClearBalanceReason", + "description": "The reason the gift card balance was cleared.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityClearBalanceReason": { + "type": "string", + "enum": [ + "SUSPICIOUS_ACTIVITY", + "REUSE_GIFTCARD", + "UNKNOWN_REASON" + ], + "x-enum-elements": [ + { + "name": "SUSPICIOUS_ACTIVITY", + "description": "The seller suspects suspicious activity." + }, + { + "name": "REUSE_GIFTCARD", + "description": "The seller cleared the balance to reuse the gift card." + }, + { + "name": "UNKNOWN_REASON", + "description": "The gift card balance was cleared for an unknown reason.\n\nThis reason is read-only and cannot be used to create a `CLEAR_BALANCE` activity using the Gift Card Activities API." + } + ], + "description": "Indicates the reason for clearing the balance of a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityCreatedEvent": { + "type": "object", + "description": "Published when a [gift card activity](entity:GiftCardActivity) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `gift_card.activity.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardActivityCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T03:41:35.157Z", + "data": { + "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", + "object": { + "gift_card_activity": { + "activate_activity_details": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", + "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" + }, + "created_at": "2020-12-17T01:41:35.157Z", + "gift_card_balance_money": { + "amount": 1000, + "currency": "USD" + }, + "gift_card_gan": "7783320007480908", + "gift_card_id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", + "location_id": "81FN9BNFZTKS4", + "type": "ACTIVATE" + } + }, + "type": "gift_card_activity" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.activity.created" + }, + "x-webhook": { + "event": "gift_card.activity.created", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCardActivities", + "x-since": "2021-06-16" + }, + "GiftCardActivityCreatedEventData": { + "type": "object", + "description": "Represents the data associated with a `gift_card.activity.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card_activity`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the new gift card activity." + }, + "object": { + "$ref": "#/components/schemas/GiftCardActivityCreatedEventObject", + "description": "An object that contains the new gift card activity.", + "nullable": true + } + } + }, + "GiftCardActivityCreatedEventObject": { + "type": "object", + "description": "An object that contains the gift card activity associated with a \n`gift_card.activity.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card_activity": { + "$ref": "#/components/schemas/GiftCardActivity", + "description": "The new gift card activity.", + "nullable": true + } + } + }, + "GiftCardActivityDeactivate": { + "type": "object", + "description": "Represents details about a `DEACTIVATE` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "reason" + ], + "properties": { + "reason": { + "$ref": "#/components/schemas/GiftCardActivityDeactivateReason", + "description": "The reason the gift card was deactivated.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityDeactivateReason": { + "type": "string", + "enum": [ + "SUSPICIOUS_ACTIVITY", + "UNKNOWN_REASON", + "CHARGEBACK_DEACTIVATE" + ], + "x-enum-elements": [ + { + "name": "SUSPICIOUS_ACTIVITY", + "description": "The seller suspects suspicious activity." + }, + { + "name": "UNKNOWN_REASON", + "description": "The gift card was deactivated for an unknown reason.\n\nThis reason is read-only and cannot be used to create a `DEACTIVATE` activity using the Gift Card Activities API." + }, + { + "name": "CHARGEBACK_DEACTIVATE", + "description": "A chargeback on the gift card purchase (or the gift card load) was ruled in favor of the buyer.\n\nThis reason is read-only and cannot be used to create a `DEACTIVATE` activity using the Gift Card Activities API." + } + ], + "description": "Indicates the reason for deactivating a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityImport": { + "type": "object", + "description": "Represents details about an `IMPORT` [gift card activity type](entity:GiftCardActivityType).\nThis activity type is used when Square imports a third-party gift card, in which case the \n`gan_source` of the gift card is set to `OTHER`.", + "x-release-status": "PUBLIC", + "required": [ + "amount_money" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The balance amount on the imported gift card." + } + } + }, + "GiftCardActivityImportReversal": { + "type": "object", + "description": "Represents details about an `IMPORT_REVERSAL` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "amount_money" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money cleared from the third-party gift card when \nthe import was reversed." + } + } + }, + "GiftCardActivityLoad": { + "type": "object", + "description": "Represents details about a `LOAD` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card. This value is a positive integer.\n\nApplications that use a custom order processing system must specify this amount in the \n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item.\n\nApplications that use the Square Orders API to process orders must specify the order ID in the \n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "line_item_uid": { + "type": "string", + "description": "The UID of the `GIFT_CARD` line item in the order that represents the additional funds for the gift card.\n\nApplications that use the Square Orders API to process orders must specify the line item UID\nin the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID that associates the gift card activity with an entity in another system. \n\nApplications that use a custom order processing system can use this field to track information related to \nan order or payment.", + "nullable": true + }, + "buyer_payment_instrument_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The payment instrument IDs used to process the order for the additional funds, such as a credit card ID \nor bank account ID. \n\nApplications that use a custom order processing system must specify payment instrument IDs in \nthe [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.\nSquare uses this information to perform compliance checks. \n\nFor applications that use the Square Orders API to process payments, Square has the necessary \ninstrument IDs to perform compliance checks.\n\nEach buyer payment instrument ID can contain a maximum of 255 characters.", + "nullable": true + } + } + }, + "GiftCardActivityRedeem": { + "type": "object", + "description": "Represents details about a `REDEEM` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "amount_money" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount deducted from the gift card for the redemption. This value is a positive integer.\n\nApplications that use a custom payment processing system must specify this amount in the \n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request." + }, + "payment_id": { + "type": "string", + "description": "The ID of the payment that represents the gift card redemption. Square populates this field \nif the payment was processed by Square.", + "readOnly": true + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID that associates the gift card activity with an entity in another system. \n\nApplications that use a custom payment processing system can use this field to track information\nrelated to an order or payment.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/GiftCardActivityRedeemStatus", + "description": "The status of the gift card redemption. Gift cards redeemed from Square Point of Sale or the \nSquare Seller Dashboard use a two-state process: `PENDING` \nto `COMPLETED` or `PENDING` to `CANCELED`. Gift cards redeemed using the Gift Card Activities API \nalways have a `COMPLETED` status.\nSee [Status](#type-status) for possible values", + "readOnly": true + } + } + }, + "GiftCardActivityRedeemStatus": { + "type": "string", + "enum": [ + "PENDING", + "COMPLETED", + "CANCELED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The gift card redemption is pending. `PENDING` is a temporary status that applies when a \ngift card is redeemed from Square Point of Sale or another Square product. A `PENDING` status is updated to \n`COMPLETED` if the payment is captured or `CANCELED` if the authorization is voided." + }, + { + "name": "COMPLETED", + "description": "The gift card redemption is completed." + }, + { + "name": "CANCELED", + "description": "The gift card redemption is canceled. A redemption is canceled if the authorization \non the gift card is voided." + } + ], + "description": "Indicates the status of a [gift card](entity:GiftCard) redemption. This status is relevant only for\nredemptions made from Square products (such as Square Point of Sale) because Square products use a \ntwo-state process. Gift cards redeemed using the Gift Card Activities API always have a `COMPLETED` status.", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityRefund": { + "type": "object", + "description": "Represents details about a `REFUND` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "properties": { + "redeem_activity_id": { + "type": "string", + "description": "The ID of the refunded `REDEEM` gift card activity. Square populates this field if the \n`payment_id` in the corresponding [RefundPayment](api-endpoint:Refunds-RefundPayment) request \nrepresents a gift card redemption.\n\nFor applications that use a custom payment processing system, this field is required when creating\na `REFUND` activity. The provided `REDEEM` activity ID must be linked to the same gift card.", + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card for the refund. This value is a positive integer.\n\nThis field is required when creating a `REFUND` activity. The amount can represent a full or partial refund.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID that associates the gift card activity with an entity in another system.", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The ID of the refunded payment. Square populates this field if the refund is for a \npayment processed by Square. This field matches the `payment_id` in the corresponding\n[RefundPayment](api-endpoint:Refunds-RefundPayment) request.", + "readOnly": true + } + } + }, + "GiftCardActivityTransferBalanceFrom": { + "type": "object", + "description": "Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "transfer_to_gift_card_id", + "amount_money" + ], + "properties": { + "transfer_to_gift_card_id": { + "type": "string", + "description": "The ID of the gift card to which the specified amount was transferred." + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount deducted from the gift card for the transfer. This value is a positive integer." + } + } + }, + "GiftCardActivityTransferBalanceTo": { + "type": "object", + "description": "Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "transfer_from_gift_card_id", + "amount_money" + ], + "properties": { + "transfer_from_gift_card_id": { + "type": "string", + "description": "The ID of the gift card from which the specified amount was transferred." + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card balance for the transfer. This value is a positive integer." + } + } + }, + "GiftCardActivityType": { + "type": "string", + "enum": [ + "ACTIVATE", + "LOAD", + "REDEEM", + "CLEAR_BALANCE", + "DEACTIVATE", + "ADJUST_INCREMENT", + "ADJUST_DECREMENT", + "REFUND", + "UNLINKED_ACTIVITY_REFUND", + "IMPORT", + "BLOCK", + "UNBLOCK", + "IMPORT_REVERSAL", + "TRANSFER_BALANCE_FROM", + "TRANSFER_BALANCE_TO" + ], + "x-enum-elements": [ + { + "name": "ACTIVATE", + "description": "Activated a gift card with a balance. When a gift card is activated, Square changes \nthe gift card state from `PENDING` to `ACTIVE`. A gift card must be in the `ACTIVE` state \nto be used for other balance-changing activities." + }, + { + "name": "LOAD", + "description": "Loaded a gift card with additional funds." + }, + { + "name": "REDEEM", + "description": "Redeemed a gift card for a purchase." + }, + { + "name": "CLEAR_BALANCE", + "description": "Set the balance of a gift card to zero." + }, + { + "name": "DEACTIVATE", + "description": "Permanently blocked a gift card from balance-changing activities." + }, + { + "name": "ADJUST_INCREMENT", + "description": "Added money to a gift card outside of a typical `ACTIVATE`, `LOAD`, or `REFUND` activity flow." + }, + { + "name": "ADJUST_DECREMENT", + "description": "Deducted money from a gift card outside of a typical `REDEEM` activity flow." + }, + { + "name": "REFUND", + "description": "Added money to a gift card from a refunded transaction. A `REFUND` activity might be linked to \na Square payment, depending on how the payment and refund are processed. For example:\n- A payment processed by Square can be refunded to a `PENDING` or `ACTIVE` gift card using the Square\nSeller Dashboard, Square Point of Sale, or Refunds API.\n- A payment processed using a custom processing system can be refunded to the same gift card." + }, + { + "name": "UNLINKED_ACTIVITY_REFUND", + "description": "Added money to a gift card from a refunded transaction that was processed using a custom payment\nprocessing system and not linked to the gift card." + }, + { + "name": "IMPORT", + "description": "Imported a third-party gift card with a balance. `IMPORT` activities are managed \nby Square and cannot be created using the Gift Card Activities API." + }, + { + "name": "BLOCK", + "description": "Temporarily blocked a gift card from balance-changing activities. `BLOCK` activities \nare managed by Square and cannot be created using the Gift Card Activities API." + }, + { + "name": "UNBLOCK", + "description": "Unblocked a gift card, which enables it to resume balance-changing activities. `UNBLOCK` \nactivities are managed by Square and cannot be created using the Gift Card Activities API." + }, + { + "name": "IMPORT_REVERSAL", + "description": "Reversed the import of a third-party gift card, which sets the gift card state to \n`PENDING` and clears the balance. `IMPORT_REVERSAL` activities are managed by Square and \ncannot be created using the Gift Card Activities API." + }, + { + "name": "TRANSFER_BALANCE_FROM", + "description": "Deducted money from a gift card as the result of a transfer to the balance of another gift card.\n`TRANSFER_BALANCE_FROM` activities are managed by Square and cannot be created using the Gift Card Activities API." + }, + { + "name": "TRANSFER_BALANCE_TO", + "description": "Added money to a gift card as the result of a transfer from the balance of another gift card.\n`TRANSFER_BALANCE_TO` activities are managed by Square and cannot be created using the Gift Card Activities API." + } + ], + "description": "Indicates the type of [gift card activity](entity:GiftCardActivity).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityUnblock": { + "type": "object", + "description": "Represents details about an `UNBLOCK` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "reason" + ], + "properties": { + "reason": { + "$ref": "#/components/schemas/GiftCardActivityUnblockReason", + "description": "The reason the gift card was unblocked.\nSee [Reason](#type-reason) for possible values" + } + } + }, + "GiftCardActivityUnblockReason": { + "type": "string", + "enum": [ + "CHARGEBACK_UNBLOCK" + ], + "x-enum-elements": [ + { + "name": "CHARGEBACK_UNBLOCK", + "description": "The gift card is unblocked because a chargeback was ruled in favor of the seller." + } + ], + "description": "Indicates the reason for unblocking a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC" + }, + "GiftCardActivityUnlinkedActivityRefund": { + "type": "object", + "description": "Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](entity:GiftCardActivityType).", + "x-release-status": "PUBLIC", + "required": [ + "amount_money" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount added to the gift card for the refund. This value is a positive integer." + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID that associates the gift card activity with an entity in another system.", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The ID of the refunded payment. This field is not used starting in Square version 2022-06-16.", + "readOnly": true + } + } + }, + "GiftCardActivityUpdatedEvent": { + "type": "object", + "description": "Published when a [gift card activity](entity:GiftCardActivity) is updated. \nSubscribe to this event to be notified about the following changes:\n- An update to the `REDEEM` activity for a gift card redemption made from a Square product (such as Square Point of Sale). \nThese redemptions are initially assigned a `PENDING` state, but then change to a `COMPLETED` or `CANCELED` state.\n- An update to the `IMPORT` activity for an imported gift card when the balance is later adjusted by Square.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `gift_card.activity.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardActivityUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T03:41:35.157Z", + "data": { + "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", + "object": { + "gift_card_activity": { + "created_at": "2020-12-17T01:41:35.157Z", + "gift_card_balance_money": { + "amount": 1500, + "currency": "USD" + }, + "gift_card_gan": "7783320007480908", + "gift_card_id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "id": "gcact_c8f8cbf1f24b448d8ecf39ed03f97864", + "import_activity_details": { + "amount_money": { + "amount": 1500, + "currency": "USD" + } + }, + "location_id": "81FN9BNFZTKS4", + "type": "IMPORT" + } + }, + "type": "gift_card_activity" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.activity.updated" + }, + "x-webhook": { + "event": "gift_card.activity.updated", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCardActivities", + "x-since": "2022-06-16" + }, + "GiftCardActivityUpdatedEventData": { + "type": "object", + "description": "The data associated with a `gift_card.activity.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card_activity`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the updated gift card activity." + }, + "object": { + "$ref": "#/components/schemas/GiftCardActivityUpdatedEventObject", + "description": "An object that contains the updated gift card activity.", + "nullable": true + } + } + }, + "GiftCardActivityUpdatedEventObject": { + "type": "object", + "description": "An object that contains the gift card activity associated with a \n`gift_card.activity.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card_activity": { + "$ref": "#/components/schemas/GiftCardActivity", + "description": "The updated gift card activity.", + "nullable": true + } + } + }, + "GiftCardCreatedEvent": { + "type": "object", + "description": "Published when a [gift card](entity:GiftCard) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `gift_card.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T01:41:35.157Z", + "data": { + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "object": { + "gift_card": { + "balance_money": { + "amount": 0, + "currency": "USD" + }, + "created_at": "2020-12-17T01:41:35.157Z", + "gan": "7783320007480908", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "NOT_ACTIVE", + "type": "DIGITAL" + } + }, + "type": "gift_card" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.created" + }, + "x-webhook": { + "event": "gift_card.created", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCards", + "x-since": "2021-06-16" + }, + "GiftCardCreatedEventData": { + "type": "object", + "description": "The data associated with a `gift_card.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the new gift card." + }, + "object": { + "$ref": "#/components/schemas/GiftCardCreatedEventObject", + "description": "An object that contains the new gift card.", + "nullable": true + } + } + }, + "GiftCardCreatedEventObject": { + "type": "object", + "description": "An object that contains the gift card associated with a `gift_card.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The new gift card.", + "nullable": true + } + } + }, + "GiftCardCustomerLinkedEvent": { + "type": "object", + "description": "Published when a [customer](entity:Customer) is linked to a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `gift_card.customer_linked`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardCustomerLinkedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T03:41:35.157Z", + "data": { + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "object": { + "gift_card": { + "balance_money": { + "amount": 1500, + "currency": "USD" + }, + "created_at": "2020-12-17T01:41:35.157Z", + "customer_ids": [ + "QPTXM8PQNX3Q726ZYHPMNP46XC" + ], + "gan": "7783320007480908", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "ACTIVE", + "type": "DIGITAL" + }, + "linked_customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC" + }, + "type": "gift_card" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.customer_linked" + }, + "x-webhook": { + "event": "gift_card.customer_linked", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCards", + "x-since": "2021-06-16" + }, + "GiftCardCustomerLinkedEventData": { + "type": "object", + "description": "The data associated with a `gift_card.customer_linked` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the updated gift card." + }, + "object": { + "$ref": "#/components/schemas/GiftCardCustomerLinkedEventObject", + "description": "An object that contains the updated gift card and the ID of the linked customer.", + "nullable": true + } + } + }, + "GiftCardCustomerLinkedEventObject": { + "type": "object", + "description": "An object that contains the gift card and customer ID associated with a \n`gift_card.customer_linked` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card with the updated `customer_ids` field.", + "nullable": true + }, + "linked_customer_id": { + "type": "string", + "description": "The ID of the linked [customer](entity:Customer).", + "nullable": true + } + } + }, + "GiftCardCustomerUnlinkedEvent": { + "type": "object", + "description": "Published when a [customer](entity:Customer) is unlinked from a [gift card](entity:GiftCard).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `gift_card.customer_unlinked`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardCustomerUnlinkedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T03:41:35.157Z", + "data": { + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "object": { + "gift_card": { + "balance_money": { + "amount": 1500, + "currency": "USD" + }, + "created_at": "2020-12-17T01:41:35.157Z", + "gan": "7783320007480908", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "ACTIVE", + "type": "DIGITAL" + }, + "unlinked_customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC" + }, + "type": "gift_card" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.customer_unlinked" + }, + "x-webhook": { + "event": "gift_card.customer_unlinked", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCards", + "x-since": "2021-06-16" + }, + "GiftCardCustomerUnlinkedEventData": { + "type": "object", + "description": "The data associated with a `gift_card.customer_unlinked` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the updated gift card." + }, + "object": { + "$ref": "#/components/schemas/GiftCardCustomerUnlinkedEventObject", + "description": "An object that contains the updated gift card and the ID of the unlinked customer.", + "nullable": true + } + } + }, + "GiftCardCustomerUnlinkedEventObject": { + "type": "object", + "description": "An object that contains the gift card and the customer ID associated with a \n`gift_card.customer_linked` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card with the updated `customer_ids` field. \nThe field is removed if the gift card is not linked to any customers.", + "nullable": true + }, + "unlinked_customer_id": { + "type": "string", + "description": "The ID of the unlinked [customer](entity:Customer).", + "nullable": true + } + } + }, + "GiftCardGANSource": { + "type": "string", + "enum": [ + "SQUARE", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "SQUARE", + "description": "The GAN is generated by Square." + }, + { + "name": "OTHER", + "description": "The GAN is provided by a non-Square system. For more information, see \n[Custom GANs](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#custom-gans) or \n[Third-party gift cards](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#third-party-gift-cards)." + } + ], + "description": "Indicates the source that generated the gift card \naccount number (GAN).", + "x-release-status": "PUBLIC" + }, + "GiftCardStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "DEACTIVATED", + "BLOCKED", + "PENDING" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "The gift card is active and can be used as a payment source." + }, + { + "name": "DEACTIVATED", + "description": "Any activity that changes the gift card balance is permanently forbidden." + }, + { + "name": "BLOCKED", + "description": "Any activity that changes the gift card balance is temporarily forbidden." + }, + { + "name": "PENDING", + "description": "The gift card is pending activation.\nThis is the initial state when a gift card is created. Typically, you'll call\n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) to create an\n`ACTIVATE` activity that activates the gift card with an initial balance before first use." + } + ], + "description": "Indicates the gift card state.", + "x-release-status": "PUBLIC" + }, + "GiftCardType": { + "type": "string", + "enum": [ + "PHYSICAL", + "DIGITAL" + ], + "x-enum-elements": [ + { + "name": "PHYSICAL", + "description": "A plastic gift card." + }, + { + "name": "DIGITAL", + "description": "A digital gift card." + } + ], + "description": "Indicates the gift card type.", + "x-release-status": "PUBLIC" + }, + "GiftCardUpdatedEvent": { + "type": "object", + "description": "Published when a [gift card](entity:GiftCard) is updated. This includes\nchanges to the state, balance, and customer association.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. For this event, the value is `gift_card.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID of the event, which is used for \n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/GiftCardUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-12-17T02:41:35.157Z", + "data": { + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "object": { + "gift_card": { + "balance_money": { + "amount": 3000, + "currency": "USD" + }, + "created_at": "2020-12-17T01:41:35.157Z", + "gan": "7783320007480908", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "ACTIVE", + "type": "DIGITAL" + } + }, + "type": "gift_card" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "gift_card.updated" + }, + "x-webhook": { + "event": "gift_card.updated", + "scopes": [ + "GIFTCARDS_READ" + ] + }, + "x-api": "#/components/x-apis/GiftCards", + "x-since": "2021-06-16" + }, + "GiftCardUpdatedEventData": { + "type": "object", + "description": "The data associated with a `gift_card.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `gift_card`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the updated gift card." + }, + "object": { + "$ref": "#/components/schemas/GiftCardUpdatedEventObject", + "description": "An object that contains the updated gift card.", + "nullable": true + } + } + }, + "GiftCardUpdatedEventObject": { + "type": "object", + "description": "An object that contains the gift card associated with a `gift_card.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card with the updated `balance_money`, `state`, or `customer_ids` field. \nSome events can affect both `balance_money` and `state`.", + "nullable": true + } + } + }, + "InventoryAdjustment": { + "type": "object", + "description": "Represents a change in state or quantity of product inventory at a\nparticular time and location.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique ID generated by Square for the\n`InventoryAdjustment`.", + "maxLength": 100 + }, + "reference_id": { + "type": "string", + "description": "An optional ID provided by the application to tie the\n`InventoryAdjustment` to an external\nsystem.", + "maxLength": 255, + "nullable": true + }, + "from_state": { + "$ref": "#/components/schemas/InventoryState", + "description": "The [inventory state](entity:InventoryState) of the related quantity\nof items before the adjustment.\nSee [InventoryState](#type-inventorystate) for possible values", + "nullable": true + }, + "to_state": { + "$ref": "#/components/schemas/InventoryState", + "description": "The [inventory state](entity:InventoryState) of the related quantity\nof items after the adjustment.\nSee [InventoryState](#type-inventorystate) for possible values", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The Square-generated ID of the [Location](entity:Location) where the related\nquantity of items is being tracked.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The Square-generated ID of the\n[CatalogObject](entity:CatalogObject) being tracked.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_type": { + "type": "string", + "description": "The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. \n\nThe Inventory API supports setting and reading the `\"catalog_object_type\": \"ITEM_VARIATION\"` field value. \nIn addition, it can also read the `\"catalog_object_type\": \"ITEM\"` field value that is set by the Square Restaurants app.", + "maxLength": 14, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The number of items affected by the adjustment as a decimal string.\nCan support up to 5 digits after the decimal point.", + "maxLength": 26, + "nullable": true + }, + "total_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The total price paid for goods associated with the\nadjustment. Present if and only if `to_state` is `SOLD`. Always\nnon-negative.", + "readOnly": true + }, + "occurred_at": { + "type": "string", + "description": "A client-generated RFC 3339-formatted timestamp that indicates when\nthe inventory adjustment took place. For inventory adjustment updates, the `occurred_at`\ntimestamp cannot be older than 24 hours or in the future relative to the\ntime of the request.", + "maxLength": 34, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received.", + "maxLength": 34, + "readOnly": true + }, + "source": { + "$ref": "#/components/schemas/SourceApplication", + "description": "Information about the application that caused the\ninventory adjustment.", + "readOnly": true + }, + "employee_id": { + "type": "string", + "description": "The Square-generated ID of the [Employee](entity:Employee) responsible for the\ninventory adjustment.", + "maxLength": 100, + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the\ninventory adjustment.", + "maxLength": 100, + "nullable": true + }, + "transaction_id": { + "type": "string", + "description": "The Square-generated ID of the [Transaction](entity:Transaction) that\ncaused the adjustment. Only relevant for payment-related state\ntransitions.", + "maxLength": 255, + "readOnly": true + }, + "refund_id": { + "type": "string", + "description": "The Square-generated ID of the [Refund](entity:Refund) that\ncaused the adjustment. Only relevant for refund-related state\ntransitions.", + "maxLength": 255, + "readOnly": true + }, + "purchase_order_id": { + "type": "string", + "description": "The Square-generated ID of the purchase order that caused the\nadjustment. Only relevant for state transitions from the Square for Retail\napp.", + "maxLength": 100, + "readOnly": true + }, + "goods_receipt_id": { + "type": "string", + "description": "The Square-generated ID of the goods receipt that caused the\nadjustment. Only relevant for state transitions from the Square for Retail\napp.", + "maxLength": 100, + "readOnly": true + }, + "adjustment_group": { + "$ref": "#/components/schemas/InventoryAdjustmentGroup", + "description": "An adjustment group bundling the related adjustments of item variations through stock conversions in a single inventory event.", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "InventoryAdjustmentGroup": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "A unique ID generated by Square for the\n`InventoryAdjustmentGroup`.", + "maxLength": 100, + "readOnly": true + }, + "root_adjustment_id": { + "type": "string", + "description": "The inventory adjustment of the composed variation.", + "maxLength": 100, + "readOnly": true + }, + "from_state": { + "$ref": "#/components/schemas/InventoryState", + "description": "Representative `from_state` for adjustments within the group. For example, for a group adjustment from `IN_STOCK` to `SOLD`,\nthere can be two component adjustments in the group: one from `IN_STOCK`to `COMPOSED` and the other one from `COMPOSED` to `SOLD`.\nHere, the representative `from_state` for the `InventoryAdjustmentGroup` is `IN_STOCK`.\nSee [InventoryState](#type-inventorystate) for possible values", + "readOnly": true + }, + "to_state": { + "$ref": "#/components/schemas/InventoryState", + "description": "Representative `to_state` for adjustments within group. For example, for a group adjustment from `IN_STOCK` to `SOLD`,\nthe two component adjustments in the group can be from `IN_STOCK` to `COMPOSED` and from `COMPOSED` to `SOLD`.\nHere, the representative `to_state` of the `InventoryAdjustmentGroup` is `SOLD`.\nSee [InventoryState](#type-inventorystate) for possible values", + "readOnly": true + } + } + }, + "InventoryAlertType": { + "type": "string", + "enum": [ + "NONE", + "LOW_QUANTITY" + ], + "x-enum-elements": [ + { + "name": "NONE", + "description": "The variation does not display an alert." + }, + { + "name": "LOW_QUANTITY", + "description": "The variation generates an alert when its quantity is low." + } + ], + "description": "Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low.", + "x-release-status": "PUBLIC" + }, + "InventoryChange": { + "type": "object", + "description": "Represents a single physical count, inventory, adjustment, or transfer\nthat is part of the history of inventory changes for a particular\n[CatalogObject](entity:CatalogObject) instance.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "$ref": "#/components/schemas/InventoryChangeType", + "description": "Indicates how the inventory change is applied. See\n[InventoryChangeType](entity:InventoryChangeType) for all possible values.\nSee [InventoryChangeType](#type-inventorychangetype) for possible values", + "nullable": true + }, + "physical_count": { + "$ref": "#/components/schemas/InventoryPhysicalCount", + "description": "Contains details about the physical count when `type` is\n`PHYSICAL_COUNT`, and is unset for all other change types.", + "nullable": true + }, + "adjustment": { + "$ref": "#/components/schemas/InventoryAdjustment", + "description": "Contains details about the inventory adjustment when `type` is\n`ADJUSTMENT`, and is unset for all other change types.", + "nullable": true + }, + "transfer": { + "$ref": "#/components/schemas/InventoryTransfer", + "description": "Contains details about the inventory transfer when `type` is\n`TRANSFER`, and is unset for all other change types.\n\n_Note:_ An [InventoryTransfer](entity:InventoryTransfer) object can only be set in the input to the\n[BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) endpoint when the seller has an active Retail Plus subscription.", + "nullable": true + }, + "measurement_unit": { + "$ref": "#/components/schemas/CatalogMeasurementUnit", + "description": "The [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change.", + "readOnly": true + }, + "measurement_unit_id": { + "type": "string", + "description": "The ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change.", + "readOnly": true + } + } + }, + "InventoryChangeType": { + "type": "string", + "enum": [ + "PHYSICAL_COUNT", + "ADJUSTMENT", + "TRANSFER" + ], + "x-enum-elements": [ + { + "name": "PHYSICAL_COUNT", + "description": "The change occurred as part of a physical count update." + }, + { + "name": "ADJUSTMENT", + "description": "The change occurred as part of the normal lifecycle of goods\n(e.g., as an inventory adjustment)." + }, + { + "name": "TRANSFER", + "description": "The change occurred as part of an inventory transfer." + } + ], + "description": "Indicates how the inventory change was applied to a tracked product quantity.", + "x-release-status": "PUBLIC" + }, + "InventoryCount": { + "type": "object", + "description": "Represents Square-estimated quantity of items in a particular state at a\nparticular seller location based on the known history of physical counts and\ninventory adjustments.", + "x-release-status": "PUBLIC", + "properties": { + "catalog_object_id": { + "type": "string", + "description": "The Square-generated ID of the\n[CatalogObject](entity:CatalogObject) being tracked.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_type": { + "type": "string", + "description": "The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. \n\nThe Inventory API supports setting and reading the `\"catalog_object_type\": \"ITEM_VARIATION\"` field value. \nIn addition, it can also read the `\"catalog_object_type\": \"ITEM\"` field value that is set by the Square Restaurants app.", + "maxLength": 14, + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/InventoryState", + "description": "The current [inventory state](entity:InventoryState) for the related\nquantity of items.\nSee [InventoryState](#type-inventorystate) for possible values", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The Square-generated ID of the [Location](entity:Location) where the related\nquantity of items is being tracked.", + "maxLength": 100, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The number of items affected by the estimated count as a decimal string.\nCan support up to 5 digits after the decimal point.", + "maxLength": 26, + "nullable": true + }, + "calculated_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when the most recent physical count or adjustment affecting\nthe estimated count is received.", + "maxLength": 34, + "readOnly": true + }, + "is_estimated": { + "type": "boolean", + "description": "Whether the inventory count is for composed variation (TRUE) or not (FALSE). If true, the inventory count will not be present in the response of\nany of these endpoints: [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory),\n[BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges),\n[BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts), and\n[RetrieveInventoryChanges](api-endpoint:Inventory-RetrieveInventoryChanges).", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "InventoryCountUpdatedEvent": { + "type": "object", + "description": "Published when the quantity is updated for a\n[CatalogItemVariation](entity:CatalogItemVariation).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InventoryCountUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T18:38:45.455006797Z", + "data": { + "id": "84e4ac73-d605-4dbd-a9e5-ffff794ddb9d", + "object": { + "inventory_counts": [ + { + "calculated_at": "2019-10-29T18:38:45.10296Z", + "catalog_object_id": "FGQ5JJWT2PYTHF35CKZ2DSKP", + "catalog_object_type": "ITEM_VARIATION", + "location_id": "YYQR03DGCTXA4", + "quantity": "10", + "state": "IN_STOCK" + } + ] + }, + "type": "inventory_counts" + }, + "event_id": "df5f3813-a913-45a1-94e9-fdc3f7d5e3b6", + "merchant_id": "6SSW7HV8K2ST5", + "type": "inventory.count.updated" + }, + "x-webhook": { + "event": "inventory.count.updated", + "scopes": [ + "INVENTORY_READ" + ] + }, + "x-api": "#/components/x-apis/Inventory", + "x-since": "2019-06-12" + }, + "InventoryCountUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type. For this event, the value is `inventory_counts`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected object." + }, + "object": { + "$ref": "#/components/schemas/InventoryCountUpdatedEventObject", + "description": "An object containing fields and values relevant to the event. Is absent if affected object was deleted.", + "nullable": true + } + } + }, + "InventoryCountUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "inventory_counts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryCount" + }, + "description": "The inventory counts.", + "nullable": true + } + } + }, + "InventoryPhysicalCount": { + "type": "object", + "description": "Represents the quantity of an item variation that is physically present\nat a specific location, verified by a seller or a seller's employee. For example,\na physical count might come from an employee counting the item variations on\nhand or from syncing with an external system.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique Square-generated ID for the\n[InventoryPhysicalCount](entity:InventoryPhysicalCount).", + "maxLength": 100 + }, + "reference_id": { + "type": "string", + "description": "An optional ID provided by the application to tie the\n[InventoryPhysicalCount](entity:InventoryPhysicalCount) to an external\nsystem.", + "maxLength": 255, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The Square-generated ID of the\n[CatalogObject](entity:CatalogObject) being tracked.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_type": { + "type": "string", + "description": "The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. \n\nThe Inventory API supports setting and reading the `\"catalog_object_type\": \"ITEM_VARIATION\"` field value. \nIn addition, it can also read the `\"catalog_object_type\": \"ITEM\"` field value that is set by the Square Restaurants app.", + "maxLength": 14, + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/InventoryState", + "description": "The current [inventory state](entity:InventoryState) for the related\nquantity of items.\nSee [InventoryState](#type-inventorystate) for possible values", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The Square-generated ID of the [Location](entity:Location) where the related\nquantity of items is being tracked.", + "maxLength": 100, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The number of items affected by the physical count as a decimal string.\nThe number can support up to 5 digits after the decimal point.", + "maxLength": 26, + "nullable": true + }, + "source": { + "$ref": "#/components/schemas/SourceApplication", + "description": "Information about the application with which the\nphysical count is submitted.", + "readOnly": true + }, + "employee_id": { + "type": "string", + "description": "The Square-generated ID of the [Employee](entity:Employee) responsible for the\nphysical count.", + "maxLength": 100, + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the\nphysical count.", + "maxLength": 100, + "nullable": true + }, + "occurred_at": { + "type": "string", + "description": "A client-generated RFC 3339-formatted timestamp that indicates when\nthe physical count was examined. For physical count updates, the `occurred_at`\ntimestamp cannot be older than 24 hours or in the future relative to the\ntime of the request.", + "maxLength": 34, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when the physical count is received.", + "maxLength": 34, + "readOnly": true + } + } + }, + "InventoryState": { + "type": "string", + "enum": [ + "CUSTOM", + "IN_STOCK", + "SOLD", + "RETURNED_BY_CUSTOMER", + "RESERVED_FOR_SALE", + "SOLD_ONLINE", + "ORDERED_FROM_VENDOR", + "RECEIVED_FROM_VENDOR", + "IN_TRANSIT_TO", + "NONE", + "WASTE", + "UNLINKED_RETURN", + "COMPOSED", + "DECOMPOSED", + "SUPPORTED_BY_NEWER_VERSION", + "IN_TRANSIT" + ], + "x-enum-elements": [ + { + "name": "CUSTOM", + "description": "The related quantity of items are in a custom state. **READ-ONLY**:\nthe Inventory API cannot move quantities to or from this state." + }, + { + "name": "IN_STOCK", + "description": "The related quantity of items are on hand and available for sale." + }, + { + "name": "SOLD", + "description": "The related quantity of items were sold as part of an itemized\ntransaction. Quantities in the `SOLD` state are no longer tracked." + }, + { + "name": "RETURNED_BY_CUSTOMER", + "description": "The related quantity of items were returned through the Square Point\nof Sale application, but are not yet available for sale. **READ-ONLY**:\nthe Inventory API cannot move quantities to or from this state." + }, + { + "name": "RESERVED_FOR_SALE", + "description": "The related quantity of items are on hand, but not currently\navailable for sale. **READ-ONLY**: the Inventory API cannot move\nquantities to or from this state." + }, + { + "name": "SOLD_ONLINE", + "description": "The related quantity of items were sold online. **READ-ONLY**: the\nInventory API cannot move quantities to or from this state." + }, + { + "name": "ORDERED_FROM_VENDOR", + "description": "The related quantity of items were ordered from a vendor but not yet\nreceived. **READ-ONLY**: the Inventory API cannot move quantities to or\nfrom this state." + }, + { + "name": "RECEIVED_FROM_VENDOR", + "description": "The related quantity of items were received from a vendor but are\nnot yet available for sale. **READ-ONLY**: the Inventory API cannot move\nquantities to or from this state." + }, + { + "name": "IN_TRANSIT_TO", + "description": "Replaced by `IN_TRANSIT` to represent quantities\nof items that are in transit between locations." + }, + { + "name": "NONE", + "description": "A placeholder indicating that the related quantity of items are not\ncurrently tracked in Square. Transferring quantities from the `NONE` state\nto a tracked state (e.g., `IN_STOCK`) introduces stock into the system." + }, + { + "name": "WASTE", + "description": "The related quantity of items are lost or damaged and cannot be\nsold." + }, + { + "name": "UNLINKED_RETURN", + "description": "The related quantity of items were returned but not linked to a\nprevious transaction. Unlinked returns are not tracked in Square.\nTransferring a quantity from `UNLINKED_RETURN` to a tracked state (e.g.,\n`IN_STOCK`) introduces new stock into the system." + }, + { + "name": "COMPOSED", + "description": "The related quantity of items that are part of a composition consisting one or more components." + }, + { + "name": "DECOMPOSED", + "description": "The related quantity of items that are part of a component." + }, + { + "name": "SUPPORTED_BY_NEWER_VERSION", + "description": "This state is not supported by this version of the Square API. We recommend that you upgrade the client to use the appropriate version of the Square API supporting this state." + }, + { + "name": "IN_TRANSIT", + "description": "The related quantity of items are in transit between locations. **READ-ONLY:** the Inventory API cannot currently be used to move quantities to or from this inventory state." + } + ], + "description": "Indicates the state of a tracked item quantity in the lifecycle of goods.", + "x-release-status": "PUBLIC" + }, + "InventoryTransfer": { + "type": "object", + "description": "Represents the transfer of a quantity of product inventory at a\nparticular time from one location to another.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique ID generated by Square for the\n`InventoryTransfer`.", + "maxLength": 100 + }, + "reference_id": { + "type": "string", + "description": "An optional ID provided by the application to tie the\n`InventoryTransfer` to an external system.", + "maxLength": 255, + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/InventoryState", + "description": "The [inventory state](entity:InventoryState) for the quantity of\nitems being transferred.\nSee [InventoryState](#type-inventorystate) for possible values", + "nullable": true + }, + "from_location_id": { + "type": "string", + "description": "The Square-generated ID of the [Location](entity:Location) where the related\nquantity of items was tracked before the transfer.", + "maxLength": 100, + "nullable": true + }, + "to_location_id": { + "type": "string", + "description": "The Square-generated ID of the [Location](entity:Location) where the related\nquantity of items was tracked after the transfer.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The Square-generated ID of the\n[CatalogObject](entity:CatalogObject) being tracked.", + "maxLength": 100, + "nullable": true + }, + "catalog_object_type": { + "type": "string", + "description": "The [type](entity:CatalogObjectType) of the [CatalogObject](entity:CatalogObject) being tracked. \n\nThe Inventory API supports setting and reading the `\"catalog_object_type\": \"ITEM_VARIATION\"` field value. \nIn addition, it can also read the `\"catalog_object_type\": \"ITEM\"` field value that is set by the Square Restaurants app.", + "maxLength": 14, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The number of items affected by the transfer as a decimal string.\nCan support up to 5 digits after the decimal point.", + "maxLength": 26, + "nullable": true + }, + "occurred_at": { + "type": "string", + "description": "A client-generated RFC 3339-formatted timestamp that indicates when\nthe transfer took place. For write actions, the `occurred_at` timestamp\ncannot be older than 24 hours or in the future relative to the time of the\nrequest.", + "maxLength": 34, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when Square\nreceived the transfer request.", + "maxLength": 34, + "readOnly": true + }, + "source": { + "$ref": "#/components/schemas/SourceApplication", + "description": "Information about the application that initiated the\ninventory transfer.", + "readOnly": true + }, + "employee_id": { + "type": "string", + "description": "The Square-generated ID of the [Employee](entity:Employee) responsible for the\ninventory transfer.", + "maxLength": 100, + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the\ninventory transfer.", + "maxLength": 100, + "nullable": true + } + } + }, + "Invoice": { + "type": "object", + "description": "Stores information about an invoice. You use the Invoices API to create and manage\ninvoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the invoice.", + "readOnly": true + }, + "version": { + "type": "integer", + "description": "The Square-assigned version number, which is incremented each time an update is committed to the invoice." + }, + "location_id": { + "type": "string", + "description": "The ID of the location that this invoice is associated with. \n\nIf specified in a `CreateInvoice` request, the value must match the `location_id` of the associated order.", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) for which the invoice is created. \nThis field is required when creating an invoice, and the order must be in the `OPEN` state.\n\nTo view the line items and other information for the associated order, call the \n[RetrieveOrder](api-endpoint:Orders-RetrieveOrder) endpoint using the order ID.", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "primary_recipient": { + "$ref": "#/components/schemas/InvoiceRecipient", + "description": "The customer who receives the invoice. This customer data is displayed on the invoice and used by Square to deliver the invoice. \n\nThis field is required to publish an invoice, and it must specify the `customer_id`.", + "nullable": true + }, + "payment_requests": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InvoicePaymentRequest" + }, + "description": "The payment schedule for the invoice, represented by one or more payment requests that\ndefine payment settings, such as amount due and due date. An invoice supports the following payment request combinations:\n- One balance\n- One deposit with one balance\n- 2–12 installments \n- One deposit with 2–12 installments\n\nThis field is required when creating an invoice. It must contain at least one payment request. \nAll payment requests for the invoice must equal the total order amount. For more information, see \n[Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests).\n\nAdding `INSTALLMENT` payment requests to an invoice requires an \n[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription).", + "nullable": true + }, + "delivery_method": { + "$ref": "#/components/schemas/InvoiceDeliveryMethod", + "description": "The delivery method that Square uses to send the invoice, reminders, and receipts to\nthe customer. After the invoice is published, Square processes the invoice based on the delivery\nmethod and payment request settings, either immediately or on the `scheduled_at` date, if specified.\nFor example, Square might send the invoice or receipt for an automatic payment. For invoices with\nautomatic payments, this field must be set to `EMAIL`.\n\nOne of the following is required when creating an invoice:\n- (Recommended) This `delivery_method` field. To configure an automatic payment, the\n`automatic_payment_source` field of the payment request is also required.\n- The deprecated `request_method` field of the payment request. Note that `invoice`\nobjects returned in responses do not include `request_method`.\nSee [InvoiceDeliveryMethod](#type-invoicedeliverymethod) for possible values", + "nullable": true + }, + "invoice_number": { + "type": "string", + "description": "A user-friendly invoice number that is displayed on the invoice. The value is unique within a location.\nIf not provided when creating an invoice, Square assigns a value.\nIt increments from 1 and is padded with zeros making it 7 characters long\n(for example, 0000001 and 0000002).", + "minLength": 1, + "maxLength": 191, + "nullable": true + }, + "title": { + "type": "string", + "description": "The title of the invoice, which is displayed on the invoice.", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "description": { + "type": "string", + "description": "The description of the invoice, which is displayed on the invoice.", + "minLength": 1, + "maxLength": 65536, + "nullable": true + }, + "scheduled_at": { + "type": "string", + "description": "The timestamp when the invoice is scheduled for processing, in RFC 3339 format.\nAfter the invoice is published, Square processes the invoice on the specified date,\naccording to the delivery method and payment request settings.\n\nIf the field is not set, Square processes the invoice immediately after it is published.", + "nullable": true + }, + "public_url": { + "type": "string", + "description": "A temporary link to the Square-hosted payment page where the customer can pay the\ninvoice. If the link expires, customers can provide the email address or phone number\nassociated with the invoice and request a new link directly from the expired payment page. \n\nThis field is added after the invoice is published and reaches the scheduled date\n(if one is defined).", + "readOnly": true + }, + "next_payment_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The current amount due for the invoice. In addition to the\namount due on the next payment request, this includes any overdue payment amounts.", + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/InvoiceStatus", + "description": "The status of the invoice.\nSee [InvoiceStatus](#type-invoicestatus) for possible values", + "readOnly": true + }, + "timezone": { + "type": "string", + "description": "The time zone used to interpret calendar dates on the invoice, such as `due_date`.\nWhen an invoice is created, this field is set to the `timezone` specified for the seller\nlocation. The value cannot be changed.\n\nFor example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\\_Angeles\nbecomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC timestamp\nof 2021-03-10T08:00:00Z).", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the invoice was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the invoice was last updated, in RFC 3339 format.", + "readOnly": true + }, + "accepted_payment_methods": { + "$ref": "#/components/schemas/InvoiceAcceptedPaymentMethods", + "description": "The payment methods that customers can use to pay the invoice on the Square-hosted\ninvoice page. This setting is independent of any automatic payment requests for the invoice.\n\nThis field is required when creating an invoice and must set at least one payment method to `true`.", + "nullable": true + }, + "custom_fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InvoiceCustomField" + }, + "description": "Additional seller-defined fields that are displayed on the invoice. For more information, see\n[Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields).\n\nAdding custom fields to an invoice requires an \n[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription).\n\nMax: 2 custom fields", + "nullable": true + }, + "subscription_id": { + "type": "string", + "description": "The ID of the [subscription](entity:Subscription) associated with the invoice.\nThis field is present only on subscription billing invoices.", + "readOnly": true + }, + "sale_or_service_date": { + "type": "string", + "description": "The date of the sale or the date that the service is rendered, in `YYYY-MM-DD` format.\nThis field can be used to specify a past or future date which is displayed on the invoice.", + "nullable": true + }, + "payment_conditions": { + "type": "string", + "description": "**France only.** The payment terms and conditions that are displayed on the invoice. For more information, \nsee [Payment conditions](https://developer.squareup.com/docs/invoices-api/overview#payment-conditions).\n\nFor countries other than France, Square returns an `INVALID_REQUEST_ERROR` with a `BAD_REQUEST` code and \n\"Payment conditions are not supported for this location's country\" detail if this field is included in `CreateInvoice` or `UpdateInvoice` requests.", + "minLength": 1, + "maxLength": 2000, + "nullable": true + }, + "store_payment_method_enabled": { + "type": "boolean", + "description": "Indicates whether to allow a customer to save a credit or debit card as a card on file or a bank transfer as a\nbank account on file. If `true`, Square displays a __Save my card on file__ or __Save my bank on file__ checkbox on the\ninvoice payment page. Stored payment information can be used for future automatic payments. The default value is `false`.", + "nullable": true + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InvoiceAttachment" + }, + "description": "Metadata about the attachments on the invoice. Invoice attachments are managed using the\n[CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) and [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) endpoints.", + "readOnly": true + }, + "creator_team_member_id": { + "type": "string", + "description": "The ID of the [team member](entity:TeamMember) who created the invoice.\nThis field is present only on invoices created in the Square Dashboard or Square Invoices app by a logged-in team member.", + "readOnly": true + } + } + }, + "InvoiceAcceptedPaymentMethods": { + "type": "object", + "description": "The payment methods that customers can use to pay an [invoice](entity:Invoice) on the Square-hosted invoice payment page.", + "x-release-status": "PUBLIC", + "properties": { + "card": { + "type": "boolean", + "description": "Indicates whether credit card or debit card payments are accepted. The default value is `false`.", + "nullable": true + }, + "square_gift_card": { + "type": "boolean", + "description": "Indicates whether Square gift card payments are accepted. The default value is `false`.", + "nullable": true + }, + "bank_account": { + "type": "boolean", + "description": "Indicates whether ACH bank transfer payments are accepted. The default value is `false`.", + "nullable": true + }, + "buy_now_pay_later": { + "type": "boolean", + "description": "Indicates whether Afterpay (also known as Clearpay) payments are accepted. The default value is `false`.\n\nThis option is allowed only for invoices that have a single payment request of the `BALANCE` type. This payment method is\nsupported if the seller account accepts Afterpay payments and the seller location is in a country where Afterpay\ninvoice payments are supported. As a best practice, consider enabling an additional payment method when allowing\n`buy_now_pay_later` payments. For more information, including detailed requirements and processing limits, see\n[Buy Now Pay Later payments with Afterpay](https://developer.squareup.com/docs/invoices-api/overview#buy-now-pay-later).", + "nullable": true + }, + "cash_app_pay": { + "type": "boolean", + "description": "Indicates whether Cash App payments are accepted. The default value is `false`.\n\nThis payment method is supported only for seller [locations](entity:Location) in the United States.", + "nullable": true + } + } + }, + "InvoiceAttachment": { + "type": "object", + "description": "Represents a file attached to an [invoice](entity:Invoice).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the attachment.", + "readOnly": true + }, + "filename": { + "type": "string", + "description": "The file name of the attachment, which is displayed on the invoice.", + "readOnly": true + }, + "description": { + "type": "string", + "description": "The description of the attachment, which is displayed on the invoice.\nThis field maps to the seller-defined **Message** field.", + "readOnly": true + }, + "filesize": { + "type": "integer", + "description": "The file size of the attachment in bytes.", + "readOnly": true + }, + "hash": { + "type": "string", + "description": "The MD5 hash that was generated from the file contents.", + "readOnly": true + }, + "mime_type": { + "type": "string", + "description": "The mime type of the attachment.\nThe following mime types are supported: \nimage/gif, image/jpeg, image/png, image/tiff, image/bmp, application/pdf.", + "readOnly": true + }, + "uploaded_at": { + "type": "string", + "description": "The timestamp when the attachment was uploaded, in RFC 3339 format.", + "readOnly": true + } + } + }, + "InvoiceAutomaticPaymentSource": { + "type": "string", + "enum": [ + "NONE", + "CARD_ON_FILE", + "BANK_ON_FILE" + ], + "x-enum-elements": [ + { + "name": "NONE", + "description": "An automatic payment is not configured for the payment request." + }, + { + "name": "CARD_ON_FILE", + "description": "Use a card on file as the automatic payment method. On the due date, Square charges the card\nfor the amount of the payment request.\n\nFor `CARD_ON_FILE` payments, the invoice delivery method must be `EMAIL` and `card_id` must be\nspecified for the payment request before the invoice can be published." + }, + { + "name": "BANK_ON_FILE", + "description": "Use a bank account on file as the automatic payment method. On the due date, Square charges the bank\naccount for the amount of the payment request if the buyer has approved the payment. The buyer receives a\nrequest to approve the payment when the invoice is sent or the invoice is updated.\n\nThis payment method applies only to invoices that sellers create in the Seller Dashboard or other\nSquare product. The bank account is provided by the customer during the payment flow. \n\nYou cannot set `BANK_ON_FILE` as a payment method using the Invoices API, but you can change a `BANK_ON_FILE`\npayment method to `NONE` or `CARD_ON_FILE`. For `BANK_ON_FILE` payments, the invoice delivery method must be `EMAIL`." + } + ], + "description": "Indicates the automatic payment method for an [invoice payment request](entity:InvoicePaymentRequest).", + "x-release-status": "PUBLIC" + }, + "InvoiceCanceledEvent": { + "type": "object", + "description": "Published when an [Invoice](entity:Invoice) is canceled.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.canceled\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceCanceledEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "CANCELED", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 1 + } + }, + "type": "invoice" + }, + "event_id": "742ef00c-446b-4fca-b3d5-f177d816ee54", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.canceled" + }, + "x-webhook": { + "event": "invoice.canceled", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceCanceledEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoiceCanceledEventObject", + "description": "An object containing the canceled invoice.", + "nullable": true + } + } + }, + "InvoiceCanceledEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoiceCreatedEvent": { + "type": "object", + "description": "Published when an [Invoice](entity:Invoice) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T17:45:13Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T17:45:13Z", + "version": 0 + } + }, + "type": "invoice" + }, + "event_id": "012c1bfa-c239-4fc0-b16d-5809928b54fe", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.created" + }, + "x-webhook": { + "event": "invoice.created", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoiceCreatedEventObject", + "description": "An object containing the created invoice.", + "nullable": true + } + } + }, + "InvoiceCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoiceCustomField": { + "type": "object", + "description": "An additional seller-defined and customer-facing field to include on the invoice. For more information, \nsee [Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields).\n\nAdding custom fields to an invoice requires an \n[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription).", + "x-release-status": "PUBLIC", + "properties": { + "label": { + "type": "string", + "description": "The label or title of the custom field. This field is required for a custom field.", + "maxLength": 30, + "nullable": true + }, + "value": { + "type": "string", + "description": "The text of the custom field. If omitted, only the label is rendered.", + "maxLength": 2000, + "nullable": true + }, + "placement": { + "$ref": "#/components/schemas/InvoiceCustomFieldPlacement", + "description": "The location of the custom field on the invoice. This field is required for a custom field.\nSee [InvoiceCustomFieldPlacement](#type-invoicecustomfieldplacement) for possible values", + "nullable": true + } + } + }, + "InvoiceCustomFieldPlacement": { + "type": "string", + "enum": [ + "ABOVE_LINE_ITEMS", + "BELOW_LINE_ITEMS" + ], + "x-enum-elements": [ + { + "name": "ABOVE_LINE_ITEMS", + "description": "Render the custom field above the invoice line items." + }, + { + "name": "BELOW_LINE_ITEMS", + "description": "Render the custom field below the invoice line items." + } + ], + "description": "Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF \ncopies of the invoice.", + "x-release-status": "PUBLIC" + }, + "InvoiceDeletedEvent": { + "type": "object", + "description": "Published when a draft [Invoice](entity:Invoice) is deleted.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceDeletedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "deleted": true, + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "type": "invoice" + }, + "event_id": "742ef00c-446b-4fca-b3d5-f177d816ee54", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.deleted" + }, + "x-webhook": { + "event": "invoice.deleted", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceDeletedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "deleted": { + "type": "boolean", + "description": "Indicates that the invoice was deleted.", + "nullable": true + } + } + }, + "InvoiceDeliveryMethod": { + "type": "string", + "enum": [ + "EMAIL", + "SHARE_MANUALLY", + "SMS" + ], + "x-enum-elements": [ + { + "name": "EMAIL", + "description": "Directs Square to send invoices, reminders, and receipts to the customer using email." + }, + { + "name": "SHARE_MANUALLY", + "description": "Directs Square to take no action on the invoice. In this case, the seller\nor application developer follows up with the customer for payment. For example,\na seller might collect a payment in the Seller Dashboard or Point of Sale (POS) application.\nThe seller might also share the URL of the Square-hosted invoice page (`public_url`) with the customer to request payment." + }, + { + "name": "SMS", + "description": "Directs Square to send invoices and receipts to the customer using SMS (text message).\n\nYou cannot set `SMS` as a delivery method using the Invoices API, but you can change an `SMS` delivery method to `EMAIL` or `SHARE_MANUALLY`." + } + ], + "description": "Indicates how Square delivers the [invoice](entity:Invoice) to the customer.", + "x-release-status": "PUBLIC" + }, + "InvoiceFilter": { + "type": "object", + "description": "Describes query filters to apply.", + "x-release-status": "PUBLIC", + "required": [ + "location_ids" + ], + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Limits the search to the specified locations. A location is required. \nIn the current implementation, only one location can be specified." + }, + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Limits the search to the specified customers, within the specified locations. \nSpecifying a customer is optional. In the current implementation, \na maximum of one customer can be specified.", + "nullable": true + } + } + }, + "InvoicePaymentMadeEvent": { + "type": "object", + "description": "Published when a payment that is associated with an [invoice](entity:Invoice) is completed.\nFor more information about invoice payments, see [Pay an invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#pay-invoice).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.payment_made\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoicePaymentMadeEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "status": "PAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 3 + } + }, + "type": "invoice" + }, + "event_id": "891e3589-462f-4215-9b61-f6df2d4432b7", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.payment_made" + }, + "x-webhook": { + "event": "invoice.payment_made", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoicePaymentMadeEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoicePaymentMadeEventObject", + "description": "An object containing the invoice that was paid.", + "nullable": true + } + } + }, + "InvoicePaymentMadeEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoicePaymentReminder": { + "type": "object", + "description": "Describes a payment request reminder (automatic notification) that Square sends\nto the customer. You configure a reminder relative to the payment request\n`due_date`.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A Square-assigned ID that uniquely identifies the reminder within the\n`InvoicePaymentRequest`.", + "readOnly": true + }, + "relative_scheduled_days": { + "type": "integer", + "description": "The number of days before (a negative number) or after (a positive number)\nthe payment request `due_date` when the reminder is sent. For example, -3 indicates that\nthe reminder should be sent 3 days before the payment request `due_date`.", + "minimum": -32767, + "maximum": 32767, + "nullable": true + }, + "message": { + "type": "string", + "description": "The reminder message.", + "minLength": 1, + "maxLength": 1000, + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/InvoicePaymentReminderStatus", + "description": "The status of the reminder.\nSee [InvoicePaymentReminderStatus](#type-invoicepaymentreminderstatus) for possible values", + "readOnly": true + }, + "sent_at": { + "type": "string", + "description": "If sent, the timestamp when the reminder was sent, in RFC 3339 format.", + "readOnly": true + } + } + }, + "InvoicePaymentReminderStatus": { + "type": "string", + "enum": [ + "PENDING", + "NOT_APPLICABLE", + "SENT" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The reminder will be sent on the `relative_scheduled_date` (if the invoice is published)." + }, + { + "name": "NOT_APPLICABLE", + "description": "The reminder is not applicable and is not sent. The following are examples\nof when reminders are not applicable and are not sent:\n- You schedule a reminder to be sent before the invoice is published.\n- The invoice is configured with multiple payment requests and a payment request reminder\nis configured to be sent after the next payment request `due_date`.\n- Two reminders (for different payment requests) are configured to be sent on the\nsame date. Therefore, only one reminder is sent.\n- You configure a reminder to be sent on the date that the invoice is scheduled to be sent.\n- The payment request is already paid.\n- The invoice status is `CANCELED` or `FAILED`." + }, + { + "name": "SENT", + "description": "The reminder is sent." + } + ], + "description": "The status of a payment request reminder.", + "x-release-status": "PUBLIC" + }, + "InvoicePaymentRequest": { + "type": "object", + "description": "Represents a payment request for an [invoice](entity:Invoice). Invoices can specify a maximum\nof 13 payment requests, with up to 12 `INSTALLMENT` request types. For more information, \nsee [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests).\n\nAdding `INSTALLMENT` payment requests to an invoice requires an \n[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription).", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "The Square-generated ID of the payment request in an [invoice](entity:Invoice).", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "request_method": { + "$ref": "#/components/schemas/InvoiceRequestMethod", + "description": "Indicates how Square processes the payment request. DEPRECATED at version 2021-01-21. Replaced by the\n`Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields.\n\nOne of the following is required when creating an invoice:\n- (Recommended) The `delivery_method` field of the invoice. To configure an automatic payment, the\n`automatic_payment_source` field of the payment request is also required.\n- This `request_method` field. Note that `invoice` objects returned in responses do not include `request_method`.\nSee [InvoiceRequestMethod](#type-invoicerequestmethod) for possible values", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "request_type": { + "$ref": "#/components/schemas/InvoiceRequestType", + "description": "Identifies the payment request type. This type defines how the payment request amount is determined. \nThis field is required to create a payment request.\nSee [InvoiceRequestType](#type-invoicerequesttype) for possible values", + "nullable": true + }, + "due_date": { + "type": "string", + "description": "The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This field\nis required to create a payment request. If an `automatic_payment_source` is defined for the request, Square\ncharges the payment source on this date.\n\nAfter this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a `timezone`\nof America/Los\\_Angeles becomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC\ntimestamp of 2021-03-10T08:00:00Z).", + "nullable": true + }, + "fixed_amount_requested_money": { + "$ref": "#/components/schemas/Money", + "description": "If the payment request specifies `DEPOSIT` or `INSTALLMENT` as the `request_type`, \nthis indicates the request amount.\nYou cannot specify this when `request_type` is `BALANCE` or when the \npayment request includes the `percentage_requested` field.", + "nullable": true + }, + "percentage_requested": { + "type": "string", + "description": "Specifies the amount for the payment request in percentage:\n\n- When the payment `request_type` is `DEPOSIT`, it is the percentage of the order's total amount.\n- When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order's total less \nthe deposit, if requested. The sum of the `percentage_requested` in all installment \npayment requests must be equal to 100.\n\nYou cannot specify this when the payment `request_type` is `BALANCE` or when the \npayment request specifies the `fixed_amount_requested_money` field.", + "nullable": true + }, + "tipping_enabled": { + "type": "boolean", + "description": "If set to true, the Square-hosted invoice page (the `public_url` field of the invoice) \nprovides a place for the customer to pay a tip. \n\nThis field is allowed only on the final payment request \nand the payment `request_type` must be `BALANCE` or `INSTALLMENT`.", + "nullable": true + }, + "automatic_payment_source": { + "$ref": "#/components/schemas/InvoiceAutomaticPaymentSource", + "description": "The payment method for an automatic payment.\n\nThe default value is `NONE`.\nSee [InvoiceAutomaticPaymentSource](#type-invoiceautomaticpaymentsource) for possible values", + "nullable": true + }, + "card_id": { + "type": "string", + "description": "The ID of the credit or debit card on file to charge for the payment request. To get the cards on file for a customer,\ncall [ListCards](api-endpoint:Cards-ListCards) and include the `customer_id` of the invoice recipient.", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "reminders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InvoicePaymentReminder" + }, + "description": "A list of one or more reminders to send for the payment request.", + "nullable": true + }, + "computed_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of the payment request, computed using the order amount and information from the various payment\nrequest fields (`request_type`, `fixed_amount_requested_money`, and `percentage_requested`).", + "readOnly": true + }, + "total_completed_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money already paid for the specific payment request. \nThis amount might include a rounding adjustment if the most recent invoice payment \nwas in cash in a currency that rounds cash payments (such as, `CAD` or `AUD`).", + "readOnly": true + }, + "rounding_adjustment_included_money": { + "$ref": "#/components/schemas/Money", + "description": "If the most recent payment was a cash payment \nin a currency that rounds cash payments (such as, `CAD` or `AUD`) and the payment \nis rounded from `computed_amount_money` in the payment request, then this \nfield specifies the rounding adjustment applied. This amount \nmight be negative.", + "readOnly": true + } + } + }, + "InvoicePublishedEvent": { + "type": "object", + "description": "Published when an [Invoice](entity:Invoice) transitions from a draft to a non-draft status.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.published\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoicePublishedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "SCHEDULED", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 1 + } + }, + "type": "invoice" + }, + "event_id": "52246644-98ba-411a-874c-ba35ccdb831c", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.published" + }, + "x-webhook": { + "event": "invoice.published", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoicePublishedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoicePublishedEventObject", + "description": "An object containing the published invoice.", + "nullable": true + } + } + }, + "InvoicePublishedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoiceQuery": { + "type": "object", + "description": "Describes query criteria for searching invoices.", + "x-release-status": "PUBLIC", + "required": [ + "filter" + ], + "properties": { + "filter": { + "$ref": "#/components/schemas/InvoiceFilter", + "description": "Query filters to apply in searching invoices. \nFor more information, see [Search for invoices](https://developer.squareup.com/docs/invoices-api/retrieve-list-search-invoices#search-invoices)." + }, + "sort": { + "$ref": "#/components/schemas/InvoiceSort", + "description": "Describes the sort order for the search result.", + "nullable": true + } + } + }, + "InvoiceRecipient": { + "type": "object", + "description": "Represents a snapshot of customer data. This object stores customer data that is displayed on the invoice \nand that Square uses to deliver the invoice.\n\nWhen you provide a customer ID for a draft invoice, Square retrieves the associated customer profile and populates \nthe remaining `InvoiceRecipient` fields. You cannot update these fields after the invoice is published. \nSquare updates the customer ID in response to a merge operation, but does not update other fields.", + "x-release-status": "PUBLIC", + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the customer. This is the customer profile ID that \nyou provide when creating a draft invoice.", + "minLength": 1, + "maxLength": 255, + "nullable": true + }, + "given_name": { + "type": "string", + "description": "The recipient's given (that is, first) name.", + "readOnly": true + }, + "family_name": { + "type": "string", + "description": "The recipient's family (that is, last) name.", + "readOnly": true + }, + "email_address": { + "type": "string", + "description": "The recipient's email address.", + "readOnly": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The recipient's physical address.", + "readOnly": true + }, + "phone_number": { + "type": "string", + "description": "The recipient's phone number.", + "readOnly": true + }, + "company_name": { + "type": "string", + "description": "The name of the recipient's company.", + "readOnly": true + }, + "tax_ids": { + "$ref": "#/components/schemas/InvoiceRecipientTaxIds", + "description": "The recipient's tax IDs. The country of the seller account determines whether this field \nis available for the customer. For more information, see [Invoice recipient tax IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids).", + "readOnly": true + } + } + }, + "InvoiceRecipientTaxIds": { + "type": "object", + "description": "Represents the tax IDs for an invoice recipient. The country of the seller account determines \nwhether the corresponding `tax_ids` field is available for the customer. For more information, \nsee [Invoice recipient tax IDs](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids).", + "x-release-status": "PUBLIC", + "properties": { + "eu_vat": { + "type": "string", + "description": "The EU VAT identification number for the invoice recipient. For example, `IE3426675K`.", + "readOnly": true + } + } + }, + "InvoiceRefundedEvent": { + "type": "object", + "description": "Published when a refund is applied toward a payment of an [invoice](entity:Invoice). \nFor more information about invoice refunds, see [Refund an invoice](https://developer.squareup.com/docs/invoices-api/pay-refund-invoices#refund-invoice).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.refunded\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceRefundedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "status": "REFUNDED", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 4 + } + }, + "type": "invoice" + }, + "event_id": "aedeb1fb-6c7d-4484-8106-866d97652388", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.refunded" + }, + "x-webhook": { + "event": "invoice.refunded", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceRefundedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoiceRefundedEventObject", + "description": "An object containing the refunded invoice.", + "nullable": true + } + } + }, + "InvoiceRefundedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoiceRequestMethod": { + "type": "string", + "enum": [ + "EMAIL", + "CHARGE_CARD_ON_FILE", + "SHARE_MANUALLY", + "CHARGE_BANK_ON_FILE", + "SMS", + "SMS_CHARGE_CARD_ON_FILE", + "SMS_CHARGE_BANK_ON_FILE" + ], + "x-enum-elements": [ + { + "name": "EMAIL", + "description": "Directs Square to send invoices, reminders, and receipts to the customer using email.\nSquare sends the invoice after it is published (either immediately or at the `scheduled_at`\ntime, if specified in the [invoice](entity:Invoice))." + }, + { + "name": "CHARGE_CARD_ON_FILE", + "description": "Directs Square to charge the card on file on the `due_date` specified in the payment request\nand to use email to send invoices, reminders, and receipts." + }, + { + "name": "SHARE_MANUALLY", + "description": "Directs Square to take no specific action on the invoice. In this case, the seller \n(or the application developer) follows up with the customer for payment. For example, \na seller might collect a payment in the Seller Dashboard or use the Point of Sale (POS) application. \nThe seller might also share the URL of the Square-hosted invoice page (`public_url`) with the customer requesting payment." + }, + { + "name": "CHARGE_BANK_ON_FILE", + "description": "Directs Square to charge the customer's bank account on file and to use email to send invoices, reminders, and receipts.\nThe customer must approve the payment.\n\nThe bank on file payment method applies only to invoices that sellers create in the Seller Dashboard or other\nSquare product. The bank account is provided by the customer during the payment flow. You \ncannot set `CHARGE_BANK_ON_FILE` as a request method using the Invoices API." + }, + { + "name": "SMS", + "description": "Directs Square to send invoices and receipts to the customer using SMS (text message). Square sends the invoice\nafter it is published (either immediately or at the `scheduled_at` time, if specified in the [invoice](entity:Invoice)). \n\nYou cannot set `SMS` as a request method using the Invoices API." + }, + { + "name": "SMS_CHARGE_CARD_ON_FILE", + "description": "Directs Square to charge the card on file on the `due_date` specified in the payment request and to\nuse SMS (text message) to send invoices and receipts. \n\nYou cannot set `SMS_CHARGE_CARD_ON_FILE` as a request method using the Invoices API." + }, + { + "name": "SMS_CHARGE_BANK_ON_FILE", + "description": "Directs Square to charge the customer's bank account on file and to use SMS (text message) to send invoices and receipts.\nThe customer must approve the payment.\n\nThe bank on file payment method applies only to invoices that sellers create in the Seller Dashboard\nor other Square product. The bank account is provided by the customer during the payment flow. \nYou cannot set `SMS_CHARGE_BANK_ON_FILE` as a request method using the Invoices API." + } + ], + "description": "Specifies the action for Square to take for processing the invoice. For example, \nemail the invoice, charge a customer's card on file, or do nothing. DEPRECATED at\nversion 2021-01-21. The corresponding `request_method` field is replaced by the\n`Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields.", + "x-release-status": "DEPRECATED" + }, + "InvoiceRequestType": { + "type": "string", + "enum": [ + "BALANCE", + "DEPOSIT", + "INSTALLMENT" + ], + "x-enum-elements": [ + { + "name": "BALANCE", + "description": "A request for a balance payment. The balance amount is computed as follows: \n\n- If the invoice specifies only a balance payment request, the balance amount is the \ntotal amount of the associated order. \n- If the invoice also specifies a deposit request, the balance amount is the amount \nremaining after the deposit.\n\n`INSTALLMENT` and `BALANCE` payment requests are not allowed in the same invoice." + }, + { + "name": "DEPOSIT", + "description": "A request for a deposit payment. You have the option of specifying \nan exact amount or a percentage of the total order amount. If you request a deposit, \nit must be due before any other payment requests." + }, + { + "name": "INSTALLMENT", + "description": "A request for an installment payment. Installments allow buyers to pay the invoice over time. Installments can optionally be combined with a deposit. \n\nAdding `INSTALLMENT` payment requests to an invoice requires an \n[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription)." + } + ], + "description": "Indicates the type of the payment request. For more information, see \n[Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests).", + "x-release-status": "PUBLIC" + }, + "InvoiceScheduledChargeFailedEvent": { + "type": "object", + "description": "Published when an automatic scheduled payment for an [Invoice](entity:Invoice) has failed.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.scheduled_charge_failed\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceScheduledChargeFailedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "UNPAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 4 + } + }, + "type": "invoice" + }, + "event_id": "3cabb64e-16ba-40c2-b605-5c51a06ec794", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.scheduled_charge_failed" + }, + "x-webhook": { + "event": "invoice.scheduled_charge_failed", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceScheduledChargeFailedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoiceScheduledChargeFailedEventObject", + "description": "An object containing the invoice that experienced the failed scheduled charge.", + "nullable": true + } + } + }, + "InvoiceScheduledChargeFailedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "InvoiceSort": { + "type": "object", + "description": "Identifies the sort field and sort order.", + "x-release-status": "PUBLIC", + "required": [ + "field" + ], + "properties": { + "field": { + "$ref": "#/components/schemas/InvoiceSortField", + "description": "The field to use for sorting.\nSee [InvoiceSortField](#type-invoicesortfield) for possible values" + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order to use for sorting the results.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "InvoiceSortField": { + "type": "string", + "enum": [ + "INVOICE_SORT_DATE" + ], + "x-enum-elements": [ + { + "name": "INVOICE_SORT_DATE", + "description": "The field works as follows:\n\n- If the invoice is a draft, it uses the invoice `created_at` date.\n- If the invoice is scheduled for publication, it uses the `scheduled_at` date.\n- If the invoice is published, it uses the invoice publication date." + } + ], + "description": "The field to use for sorting.", + "x-release-status": "PUBLIC" + }, + "InvoiceStatus": { + "type": "string", + "enum": [ + "DRAFT", + "UNPAID", + "SCHEDULED", + "PARTIALLY_PAID", + "PAID", + "PARTIALLY_REFUNDED", + "REFUNDED", + "CANCELED", + "FAILED", + "PAYMENT_PENDING" + ], + "x-enum-elements": [ + { + "name": "DRAFT", + "description": "The invoice is a draft. You must publish a draft invoice before Square can process it.\nA draft invoice has no `public_url`, so it is not available to customers." + }, + { + "name": "UNPAID", + "description": "The invoice is published but not yet paid." + }, + { + "name": "SCHEDULED", + "description": "The invoice is scheduled to be processed. On the scheduled date,\nSquare sends the invoice, initiates an automatic payment, or takes no action, depending on\nthe delivery method and payment request settings. Square also sets the invoice status to the\nappropriate state: `UNPAID`, `PAID`, `PARTIALLY_PAID`, or `PAYMENT_PENDING`." + }, + { + "name": "PARTIALLY_PAID", + "description": "A partial payment is received for the invoice." + }, + { + "name": "PAID", + "description": "The customer paid the invoice in full." + }, + { + "name": "PARTIALLY_REFUNDED", + "description": "The invoice is paid (or partially paid) and some but not all the amount paid is\nrefunded." + }, + { + "name": "REFUNDED", + "description": "The full amount that the customer paid for the invoice is refunded." + }, + { + "name": "CANCELED", + "description": "The invoice is canceled. Square no longer requests payments from the customer.\nThe Square-hosted payment page is still accessible using the temporary `public_url`\nlink, but the invoice is shown as canceled and does not accept payment." + }, + { + "name": "FAILED", + "description": "Square canceled the invoice due to suspicious activity." + }, + { + "name": "PAYMENT_PENDING", + "description": "A payment on the invoice was initiated but has not yet been processed.\n\nWhen in this state, invoices cannot be updated and other payments cannot be initiated." + } + ], + "description": "Indicates the status of an [invoice](entity:Invoice).", + "x-release-status": "PUBLIC" + }, + "InvoiceUpdatedEvent": { + "type": "object", + "description": "Published when an [Invoice](entity:Invoice) is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"invoice.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/InvoiceUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-06-18T18:23:11Z", + "data": { + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "object": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "attachments": [ + { + "description": "Service contract", + "filename": "terms_and_agreements.pdf", + "filesize": 81839, + "hash": "273ee02cb6f5f8a3a8ca23604930dd53", + "id": "inva:0-ChBIMZJ99MugJFCUBjUVfdwY", + "mime_type": "application/pdf", + "uploaded_at": "2023-03-03T00:07:52Z" + } + ], + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "UNPAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 2 + } + }, + "type": "invoice" + }, + "event_id": "0312a8c5-af0f-49f4-ba29-291ef08dcd7e", + "location_id": "ES0RJRZYEC39A", + "merchant_id": "031FEV2Q6VMPK", + "type": "invoice.updated" + }, + "x-webhook": { + "event": "invoice.updated", + "scopes": [ + "INVOICES_READ" + ] + }, + "x-api": "#/components/x-apis/Invoices", + "x-since": "2020-07-22" + }, + "InvoiceUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"invoice\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected invoice." + }, + "object": { + "$ref": "#/components/schemas/InvoiceUpdatedEventObject", + "description": "An object containing the updated invoice.", + "nullable": true + } + } + }, + "InvoiceUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The related invoice.", + "nullable": true + } + } + }, + "ItemVariationLocationOverrides": { + "type": "object", + "description": "Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`.", + "x-release-status": "PUBLIC", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the `Location`. This can include locations that are deactivated.", + "nullable": true + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The price of the `CatalogItemVariation` at the given `Location`, or blank for variable pricing.", + "nullable": true + }, + "pricing_type": { + "$ref": "#/components/schemas/CatalogPricingType", + "description": "The pricing type (fixed or variable) for the `CatalogItemVariation` at the given `Location`.\nSee [CatalogPricingType](#type-catalogpricingtype) for possible values", + "nullable": true + }, + "track_inventory": { + "type": "boolean", + "description": "If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`.", + "nullable": true + }, + "inventory_alert_type": { + "$ref": "#/components/schemas/InventoryAlertType", + "description": "Indicates whether the `CatalogItemVariation` displays an alert when its inventory\nquantity is less than or equal to its `inventory_alert_threshold`.\nSee [InventoryAlertType](#type-inventoryalerttype) for possible values", + "nullable": true + }, + "inventory_alert_threshold": { + "type": "integer", + "description": "If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type`\nis `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard.\n\nThis value is always an integer.", + "format": "int64", + "nullable": true + }, + "sold_out": { + "type": "boolean", + "description": "Indicates whether the overridden item variation is sold out at the specified location.\n\nWhen inventory tracking is enabled on the item variation either globally or at the specified location,\nthe item variation is automatically marked as sold out when its inventory count reaches zero. The seller\ncan manually set the item variation as sold out even when the inventory count is greater than zero.\nAttempts by an application to set this attribute are ignored. Regardless how the sold-out status is set,\napplications should treat its inventory count as zero when this attribute value is `true`.", + "readOnly": true + }, + "sold_out_valid_until": { + "type": "string", + "description": "The seller-assigned timestamp, of the RFC 3339 format, to indicate when this sold-out variation\nbecomes available again at the specified location. Attempts by an application to set this attribute are ignored.\nWhen the current time is later than this attribute value, the affected item variation is no longer sold out.", + "readOnly": true + } + } + }, + "Job": { + "type": "object", + "description": "Represents a job that can be assigned to [team members](entity:TeamMember). This object defines the\njob's title and tip eligibility. Compensation is defined in a [job assignment](entity:JobAssignment)\nin a team member's wage setting.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "**Read only** The unique Square-assigned ID of the job. If you need a job ID for an API request,\ncall [ListJobs](api-endpoint:Team-ListJobs) or use the ID returned when you created the job.\nYou can also get job IDs from a team member's wage setting." + }, + "title": { + "type": "string", + "description": "The title of the job.", + "maxLength": 150, + "nullable": true + }, + "is_tip_eligible": { + "type": "boolean", + "description": "Indicates whether team members can earn tips for the job.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the job was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the job was last updated, in RFC 3339 format.", + "readOnly": true + }, + "version": { + "type": "integer", + "description": "**Read only** The current version of the job. Include this field in `UpdateJob` requests to enable\n[optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency)\ncontrol and avoid overwrites from concurrent requests. Requests fail if the provided version doesn't\nmatch the server version at the time of the request." + } + } + }, + "JobAssignment": { + "type": "object", + "description": "Represents a job assigned to a [team member](entity:TeamMember), including the compensation the team\nmember earns for the job. Job assignments are listed in the team member's [wage setting](entity:WageSetting).", + "x-release-status": "PUBLIC", + "required": [ + "pay_type" + ], + "properties": { + "job_title": { + "type": "string", + "description": "The title of the job.", + "nullable": true + }, + "pay_type": { + "$ref": "#/components/schemas/JobAssignmentPayType", + "description": "The current pay type for the job assignment used to\ncalculate the pay amount in a pay period.\nSee [JobAssignmentPayType](#type-jobassignmentpaytype) for possible values" + }, + "hourly_rate": { + "$ref": "#/components/schemas/Money", + "description": "The hourly pay rate of the job. For `SALARY` pay types, Square calculates the hourly rate based on\n`annual_rate` and `weekly_hours`.", + "nullable": true + }, + "annual_rate": { + "$ref": "#/components/schemas/Money", + "description": "The total pay amount for a 12-month period on the job. Set if the job `PayType` is `SALARY`.", + "nullable": true + }, + "weekly_hours": { + "type": "integer", + "description": "The planned hours per week for the job. Set if the job `PayType` is `SALARY`.", + "nullable": true + }, + "job_id": { + "type": "string", + "description": "The ID of the [job](entity:Job).", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "JobAssignmentPayType": { + "type": "string", + "enum": [ + "NONE", + "HOURLY", + "SALARY" + ], + "x-enum-elements": [ + { + "name": "NONE", + "description": "The job does not have a defined pay type." + }, + { + "name": "HOURLY", + "description": "The job pays an hourly rate." + }, + { + "name": "SALARY", + "description": "The job pays an annual salary." + } + ], + "description": "Enumerates the possible pay types that a job can be assigned.", + "x-release-status": "PUBLIC" + }, + "JobCreatedEvent": { + "type": "object", + "description": "Published when a Job is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"job.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/JobCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2024-12-20T01:16:04.253Z", + "data": { + "id": "9AMrnT51mWUa31uN4QziQZXF", + "object": { + "job": { + "created_at": "2024-12-20T01:15:55Z", + "id": "9AMrnT51mWUa31uN4QziQZXF", + "is_tip_eligible": true, + "title": "Cashier", + "updated_at": "2024-12-20T01:15:55Z", + "version": 1 + } + }, + "type": "job" + }, + "event_id": "91484f7e-63bc-4253-a86d-18e7ea0b0cfb", + "merchant_id": "0JV5BGNW4EG9R", + "type": "job.created" + }, + "x-webhook": { + "event": "job.created", + "scopes": [ + "EMPLOYEES_READ" + ] + }, + "x-api": "#/components/x-apis/Team", + "x-since": "2024-12-18" + }, + "JobCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"job\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the created job." + }, + "object": { + "$ref": "#/components/schemas/JobCreatedEventObject", + "description": "An object containing the created job.", + "nullable": true + } + } + }, + "JobCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The created job.", + "nullable": true + } + } + }, + "JobUpdatedEvent": { + "type": "object", + "description": "Published when a Job is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"job.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/JobUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2024-12-21T02:34:55.253Z", + "data": { + "id": "9AMrnT51mWUa31uN4QziQZXF", + "object": { + "job": { + "created_at": "2024-12-20T01:15:55Z", + "id": "9AMrnT51mWUa31uN4QziQZXF", + "is_tip_eligible": false, + "title": "Cashier", + "updated_at": "2024-12-21T02:34:14Z", + "version": 2 + } + }, + "type": "job" + }, + "event_id": "91484f7e-63bc-4253-a86d-18e7ea0b0cfb", + "merchant_id": "0JV5BGNW4EG9R", + "type": "job.updated" + }, + "x-webhook": { + "event": "job.updated", + "scopes": [ + "EMPLOYEES_READ" + ] + }, + "x-api": "#/components/x-apis/Team", + "x-since": "2024-12-18" + }, + "JobUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"job\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated job." + }, + "object": { + "$ref": "#/components/schemas/JobUpdatedEventObject", + "description": "An object containing the updated job.", + "nullable": true + } + } + }, + "JobUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The updated job.", + "nullable": true + } + } + }, + "LaborScheduledShiftCreatedEvent": { + "type": "object", + "description": "Published when a [ScheduledShift](entity:ScheduledShift) is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.scheduled_shift.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborScheduledShiftCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2025-02-11T18:02:00.084598063Z", + "data": { + "id": "509RM55G6R17F", + "object": { + "scheduled_shift": { + "created_at": "2025-02-11T18:02:00Z", + "draft_shift_details": { + "end_at": "2025-02-14T09:11:00-08:00", + "is_deleted": false, + "job_id": "ioeL1Mp7iZwCAWxeGMAT7ggB", + "location_id": "LR473RTW59VRY", + "notes": "Dont forget to prep the vegetables", + "start_at": "2025-02-13T23:11:00-08:00", + "team_member_id": "TMnsTAouYbvmp-8O", + "timezone": "America/Los_Angeles" + }, + "id": "509RM55G6R17F", + "updated_at": "2025-02-11T18:02:00Z", + "version": 1 + } + }, + "type": "scheduled_shift" + }, + "event_id": "d0fabe2e-791c-398e-a349-79f6ec7dfa69", + "merchant_id": "MLHZRVNSD91A1", + "type": "labor.scheduled_shift.created" + }, + "x-webhook": { + "event": "labor.scheduled_shift.created", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborScheduledShiftCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `scheduled_shift`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `ScheduledShift`.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/LaborScheduledShiftCreatedEventObject", + "description": "An object containing the affected `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborScheduledShiftCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "ScheduledShift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The new `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborScheduledShiftDeletedEvent": { + "type": "object", + "description": "Published when a [ScheduledShift](entity:ScheduledShift) is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.scheduled_shift.deleted`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborScheduledShiftDeletedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2025-02-11T18:03:12.879368768Z", + "data": { + "deleted": true, + "id": "509RM55G6R17F", + "type": "scheduled_shift" + }, + "event_id": "58d3897e-951c-337f-ac01-84c20ed6007d", + "merchant_id": "MLHZRVNSD91A1", + "type": "labor.scheduled_shift.deleted" + }, + "x-webhook": { + "event": "labor.scheduled_shift.deleted", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborScheduledShiftDeletedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `scheduled_shift`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `ScheduledShift`.", + "maxLength": 255 + }, + "deleted": { + "type": "boolean", + "description": "Is true if the affected object was deleted. Otherwise absent.", + "nullable": true + } + } + }, + "LaborScheduledShiftPublishedEvent": { + "type": "object", + "description": "Published when a [ScheduledShift](entity:ScheduledShift) is published.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.scheduled_shift.published`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborScheduledShiftPublishedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2025-02-11T18:54:08.044355293Z", + "data": { + "id": "WA09SDV3DNJ54", + "object": { + "scheduled_shift": { + "created_at": "2025-02-11T18:53:35Z", + "draft_shift_details": { + "end_at": "2025-02-14T09:11:00-08:00", + "is_deleted": false, + "job_id": "ioeL1Mp7iZwCAWxeGMAT7ggB", + "location_id": "LR473RTW59VRY", + "notes": "Dont forget to prep the vegetables", + "start_at": "2025-02-13T23:11:00-08:00", + "team_member_id": "TMnsTAouYbvmp-8O", + "timezone": "America/Los_Angeles" + }, + "id": "WA09SDV3DNJ54", + "published_shift_details": { + "end_at": "2025-02-14T09:11:00-08:00", + "is_deleted": false, + "job_id": "ioeL1Mp7iZwCAWxeGMAT7ggB", + "location_id": "LR473RTW59VRY", + "notes": "Dont forget to prep the vegetables", + "start_at": "2025-02-13T23:11:00-08:00", + "team_member_id": "TMnsTAouYbvmp-8O", + "timezone": "America/Los_Angeles" + }, + "updated_at": "2025-02-11T18:54:08Z", + "version": 2 + } + }, + "type": "scheduled_shift" + }, + "event_id": "4e31748e-1219-3f6f-a5c7-6fe3464705cd", + "merchant_id": "MLHZRVNSD91A1", + "type": "labor.scheduled_shift.published" + }, + "x-webhook": { + "event": "labor.scheduled_shift.published", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborScheduledShiftPublishedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `scheduled_shift`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `ScheduledShift`.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/LaborScheduledShiftPublishedEventObject", + "description": "An object containing the affected `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborScheduledShiftPublishedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "ScheduledShift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The published `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborScheduledShiftUpdatedEvent": { + "type": "object", + "description": "Published when a [ScheduledShift](entity:ScheduledShift) is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.scheduled_shift.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborScheduledShiftUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2025-02-11T18:54:08.044355293Z", + "data": { + "id": "WA09SDV3DNJ54", + "object": { + "scheduled_shift": { + "created_at": "2025-02-11T18:53:35Z", + "draft_shift_details": { + "end_at": "2025-02-14T09:11:00-08:00", + "is_deleted": false, + "job_id": "ioeL1Mp7iZwCAWxeGMAT7ggB", + "location_id": "LR473RTW59VRY", + "notes": "Dont forget to prep the vegetables", + "start_at": "2025-02-13T23:11:00-08:00", + "team_member_id": "TMnsTAouYbvmp-8O", + "timezone": "America/Los_Angeles" + }, + "id": "WA09SDV3DNJ54", + "published_shift_details": { + "end_at": "2025-02-14T09:11:00-08:00", + "is_deleted": false, + "job_id": "ioeL1Mp7iZwCAWxeGMAT7ggB", + "location_id": "LR473RTW59VRY", + "notes": "Dont forget to prep the vegetables", + "start_at": "2025-02-13T23:11:00-08:00", + "team_member_id": "TMnsTAouYbvmp-8O", + "timezone": "America/Los_Angeles" + }, + "updated_at": "2025-02-11T18:54:08Z", + "version": 2 + } + }, + "type": "scheduled_shift" + }, + "event_id": "d7052271-25e7-303f-9684-3f994dc9eaa3", + "merchant_id": "MLHZRVNSD91A1", + "type": "labor.scheduled_shift.updated" + }, + "x-webhook": { + "event": "labor.scheduled_shift.updated", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborScheduledShiftUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `scheduled_shift`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `ScheduledShift`.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/LaborScheduledShiftUpdatedEventObject", + "description": "An object containing the affected `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborScheduledShiftUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "ScheduledShift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The updated `ScheduledShift`.", + "nullable": true + } + } + }, + "LaborShiftCreatedEvent": { + "type": "object", + "description": "Published when a worker starts a [Shift](entity:Shift).\n\nDeprecated at Square API version 2025-05-21. Replaced by `labor.timecard.created`.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.shift.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborShiftCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "id": "PY4YSMVKXFY9E", + "object": { + "shift": { + "created_at": "2019-11-06T19:14:55Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "AnuhZhsN95oT8f-eCn9D", + "end_at": "2019-01-25T18:11:00Z", + "id": "PY4YSMVKXFY9E", + "location_id": "NAQ1FHV6ZJ8YV", + "start_at": "2019-01-25T08:11:00Z", + "status": "OPEN", + "team_member_id": "AnuhZhsN95oT8f-eCn9D", + "timezone": "Etc/UTC", + "updated_at": "2019-11-06T19:14:55Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + }, + "type": "shift" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.shift.created" + }, + "x-webhook": { + "event": "labor.shift.created", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2019-11-20" + }, + "LaborShiftCreatedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `shift`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `Shift`." + }, + "object": { + "$ref": "#/components/schemas/LaborShiftCreatedEventObject", + "description": "An object containing the affected `Shift`.", + "nullable": true + } + } + }, + "LaborShiftCreatedEventObject": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The new `Shift`.", + "nullable": true + } + } + }, + "LaborShiftDeletedEvent": { + "type": "object", + "description": "Published when a [Shift](entity:Shift) is deleted.\n\nDeprecated at Square API version 2025-05-21. Replaced by `labor.timecard.deleted`.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.shift.deleted`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborShiftDeletedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "deleted": true, + "id": "PY4YSMVKXFY9E", + "type": "labor" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.shift.deleted" + }, + "x-webhook": { + "event": "labor.shift.deleted", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2019-11-20" + }, + "LaborShiftDeletedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `shift`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `Shift`." + }, + "deleted": { + "type": "boolean", + "description": "Is true if the affected object was deleted. Otherwise absent.", + "nullable": true + } + } + }, + "LaborShiftUpdatedEvent": { + "type": "object", + "description": "Published when a [Shift](entity:Shift) is updated.\n\nDeprecated at Square API version 2025-05-21. Replaced by `labor.timecard.updated`.", + "x-release-status": "DEPRECATED", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.shift.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborShiftUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "id": "PY4YSMVKXFY9E", + "object": { + "shift": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T11:16:00Z", + "expected_duration": "PT5M", + "id": "0EGK74E8BJF62", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T11:11:00Z" + } + ], + "created_at": "2019-11-06T19:14:55Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "AnuhZhsN95oT8f-eCn9D", + "end_at": "2019-01-25T18:11:00Z", + "id": "PY4YSMVKXFY9E", + "location_id": "NAQ1FHV6ZJ8YV", + "start_at": "2019-01-25T08:11:00Z", + "status": "CLOSED", + "team_member_id": "AnuhZhsN95oT8f-eCn9D", + "timezone": "Etc/UTC", + "updated_at": "2019-11-06T19:14:55Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + }, + "type": "shift" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.shift.updated" + }, + "x-webhook": { + "event": "labor.shift.updated", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2019-11-20" + }, + "LaborShiftUpdatedEventData": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `shift`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected `Shift`." + }, + "object": { + "$ref": "#/components/schemas/LaborShiftUpdatedEventObject", + "description": "An object containing the affected `Shift`.", + "nullable": true + } + } + }, + "LaborShiftUpdatedEventObject": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The updated `Shift`.", + "nullable": true + } + } + }, + "LaborTimecardCreatedEvent": { + "type": "object", + "description": "Published when a worker starts a [Timecard](entity:Timecard).", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.timecard.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborTimecardCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "id": "PY4YSMVKXFY9E", + "object": { + "timecard": { + "created_at": "2019-11-06T19:14:55Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T18:11:00Z", + "id": "PY4YSMVKXFY9E", + "location_id": "NAQ1FHV6ZJ8YV", + "start_at": "2019-01-25T08:11:00Z", + "status": "OPEN", + "team_member_id": "AnuhZhsN95oT8f-eCn9D", + "timezone": "Etc/UTC", + "updated_at": "2019-11-06T19:14:55Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + }, + "type": "timecard" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.timecard.created" + }, + "x-webhook": { + "event": "labor.timecard.created", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborTimecardCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `timecard`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `Timecard`." + }, + "object": { + "$ref": "#/components/schemas/LaborTimecardCreatedEventObject", + "description": "An object containing the affected `Timecard`.", + "nullable": true + } + } + }, + "LaborTimecardCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The new `Timecard`.", + "nullable": true + } + } + }, + "LaborTimecardDeletedEvent": { + "type": "object", + "description": "Published when a [Timecard](entity:Timecard) is deleted.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.timecard.deleted`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborTimecardDeletedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "deleted": true, + "id": "PY4YSMVKXFY9E", + "type": "labor" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.timecard.deleted" + }, + "x-webhook": { + "event": "labor.timecard.deleted", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborTimecardDeletedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `timecard`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `Timecard`." + }, + "deleted": { + "type": "boolean", + "description": "Is true if the affected object was deleted. Otherwise absent.", + "nullable": true + } + } + }, + "LaborTimecardUpdatedEvent": { + "type": "object", + "description": "Published when a [Timecard](entity:Timecard) is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `labor.timecard.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LaborTimecardUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2019-10-29T17:26:16.808603647Z", + "data": { + "id": "PY4YSMVKXFY9E", + "object": { + "timecard": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T11:16:00Z", + "expected_duration": "PT5M", + "id": "0EGK74E8BJF62", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T11:11:00Z" + } + ], + "created_at": "2019-11-06T19:14:55Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T18:11:00Z", + "id": "PY4YSMVKXFY9E", + "location_id": "NAQ1FHV6ZJ8YV", + "start_at": "2019-01-25T08:11:00Z", + "status": "CLOSED", + "team_member_id": "AnuhZhsN95oT8f-eCn9D", + "timezone": "Etc/UTC", + "updated_at": "2019-11-06T19:14:55Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + } + }, + "type": "timecard" + }, + "event_id": "aeaaa5f6-c4fd-4e93-b688-71b50706266f", + "merchant_id": "6SSW7HV8K2ST5", + "type": "labor.timecard.updated" + }, + "x-webhook": { + "event": "labor.timecard.updated", + "scopes": [ + "TIMECARDS_READ" + ] + }, + "x-api": "#/components/x-apis/Labor", + "x-since": "2025-05-21" + }, + "LaborTimecardUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `timecard`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected `Timecard`." + }, + "object": { + "$ref": "#/components/schemas/LaborTimecardUpdatedEventObject", + "description": "An object containing the affected `Timecard`.", + "nullable": true + } + } + }, + "LaborTimecardUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The updated `Timecard`.", + "nullable": true + } + } + }, + "LinkCustomerToGiftCardRequest": { + "type": "object", + "description": "A request to link a customer to a gift card.", + "x-release-status": "PUBLIC", + "x-params-example": "?gift_card_id=gftc:71ea002277a34f8a945e284b04822edb", + "required": [ + "customer_id" + ], + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the customer to link to the gift card.", + "minLength": 1, + "maxLength": 191 + } + }, + "example": { + "customer_id": "GKY0FZ3V717AH8Q2D821PNT2ZW" + } + }, + "LinkCustomerToGiftCardResponse": { + "type": "object", + "description": "A response that contains the linked `GiftCard` object. If the request resulted in errors, \nthe response contains a set of `Error` objects.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card with the ID of the linked customer listed in the `customer_ids` field." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 2500, + "currency": "USD" + }, + "created_at": "2021-03-25T05:13:01Z", + "customer_ids": [ + "GKY0FZ3V717AH8Q2D821PNT2ZW" + ], + "gan": "7783320005440920", + "gan_source": "SQUARE", + "id": "gftc:71ea002277a34f8a945e284b04822edb", + "state": "ACTIVE", + "type": "DIGITAL" + } + } + }, + "ListBankAccountsResponse": { + "type": "object", + "description": "Response object returned by ListBankAccounts.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "bank_accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BankAccount" + }, + "description": "List of BankAccounts associated with this account." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can \nuse in a subsequent request to fetch next set of bank accounts.\nIf empty, this is the final response.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." + } + }, + "example": { + "bank_accounts": [ + { + "account_number_suffix": "971", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": false, + "currency": "USD", + "debitable": false, + "holder_name": "Jane Doe", + "id": "ao6iaQ9vhDiaQD7n3GB", + "location_id": "S8GWD5example", + "primary_bank_identification_number": "112200303", + "status": "VERIFICATION_IN_PROGRESS", + "version": 5 + }, + { + "account_number_suffix": "972", + "account_type": "CHECKING", + "bank_name": "Bank Name", + "country": "US", + "creditable": false, + "currency": "USD", + "debitable": false, + "holder_name": "Jane Doe", + "id": "4x7WXuaxrkQkVlka3GB", + "location_id": "S8GWD5example", + "primary_bank_identification_number": "112200303", + "status": "VERIFICATION_IN_PROGRESS", + "version": 5 + } + ] + } + }, + "ListBookingCustomAttributeDefinitionsResponse": { + "type": "object", + "description": "Represents a [ListBookingCustomAttributeDefinitions](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributeDefinitions) response.\nEither `custom_attribute_definitions`, an empty object, or `errors` is present in the response.\nIf additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definitions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeDefinition" + }, + "description": "The retrieved custom attribute definitions. If no custom attribute definitions are found,\nSquare returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of\nresults for your original request. This field is present only if the request succeeded and\nadditional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", + "custom_attribute_definitions": [ + { + "created_at": "2022-11-16T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoriteShampoo", + "name": "Favorite shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-16T15:39:38Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + { + "created_at": "2022-11-16T15:49:05Z", + "description": "Number of people in the party for dine-in", + "key": "partySize", + "name": "Party size", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-11-16T15:49:05Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + ], + "errors": [] + } + }, + "ListBookingCustomAttributesResponse": { + "type": "object", + "description": "Represents a [ListBookingCustomAttributes](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributes) response.\nEither `custom_attributes`, an empty object, or `errors` is present in the response. If additional\nresults are available, the `cursor` field is also present along with `custom_attributes`.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttribute" + }, + "description": "The retrieved custom attributes. If `with_definitions` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field of each custom attribute.\n\nIf no custom attributes are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to use in your next call to this endpoint to retrieve the next page of results\nfor your original request. This field is present only if the request succeeded and additional\nresults are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attributes": [ + { + "created_at": "2022-11-16T15:50:27Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T15:50:27Z", + "value": "Hydro-Cool", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + { + "created_at": "2022-11-16T15:51:53Z", + "key": "hasShoes", + "updated_at": "2022-11-16T15:51:53Z", + "value": false, + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + ], + "errors": [] + } + }, + "ListBookingsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "bookings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Booking" + }, + "description": "The list of targeted bookings." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set.", + "maxLength": 65536 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "bookings": [ + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "created_at": "2020-10-28T15:47:41Z", + "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + "customer_note": "", + "id": "zkras0xv0xwswx", + "location_id": "LEQHH0YY8B42M", + "seller_note": "", + "start_at": "2020-11-26T13:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-10-28T15:49:25Z", + "version": 1 + } + ], + "cursor": null, + "errors": [] + } + }, + "ListBreakTypesResponse": { + "type": "object", + "description": "The response to a request for a set of `BreakType` objects. The response contains\nthe requested `BreakType` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "break_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BreakType" + }, + "description": " A page of `BreakType` results." + }, + "cursor": { + "type": "string", + "description": "The value supplied in the subsequent request to fetch the next page\nof `BreakType` results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "break_types": [ + { + "break_name": "Coffee Break", + "created_at": "2019-01-22T20:47:37Z", + "expected_duration": "PT5M", + "id": "REGS1EQR1TPZ5", + "is_paid": false, + "location_id": "PAA1RJZZKXBFG", + "updated_at": "2019-01-22T20:47:37Z", + "version": 1 + }, + { + "break_name": "Lunch Break", + "created_at": "2019-01-25T19:26:30Z", + "expected_duration": "PT1H", + "id": "92EPDRQKJ5088", + "is_paid": true, + "location_id": "PAA1RJZZKXBFG", + "updated_at": "2019-01-25T19:26:30Z", + "version": 3 + } + ], + "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED" + } + }, + "ListCardsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListCards](api-endpoint:Cards-ListCards) endpoint.\n\nNote: if there are errors processing the request, the card field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "cards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Card" + }, + "description": "The requested list of `Card`s." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + } + }, + "example": { + "cards": [ + { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + } + ] + } + }, + "ListCashDrawerShiftEventsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "cursor": { + "type": "string", + "description": "Opaque cursor for fetching the next page. Cursor is not present in\nthe last page of results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "cash_drawer_shift_events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CashDrawerShiftEvent" + }, + "description": "All of the events (payments, refunds, etc.) for a cash drawer during\nthe shift." + } + }, + "example": { + "cash_drawer_shift_events": [ + { + "created_at": "2019-11-22T00:43:02.000Z", + "description": "", + "event_money": { + "amount": 100, + "currency": "USD" + }, + "event_type": "CASH_TENDER_PAYMENT", + "id": "9F07DB01-D85A-4B77-88C3-D5C64CEB5155", + "team_member_id": "" + }, + { + "created_at": "2019-11-22T00:43:12.000Z", + "description": "", + "event_money": { + "amount": 250, + "currency": "USD" + }, + "event_type": "CASH_TENDER_PAYMENT", + "id": "B2854CEA-A781-49B3-8F31-C64558231F48", + "team_member_id": "" + }, + { + "created_at": "2019-11-22T00:43:23.000Z", + "description": "", + "event_money": { + "amount": 250, + "currency": "USD" + }, + "event_type": "CASH_TENDER_CANCELLED_PAYMENT", + "id": "B5FB7F72-95CD-44A3-974D-26C41064D042", + "team_member_id": "" + }, + { + "created_at": "2019-11-22T00:43:46.000Z", + "description": "", + "event_money": { + "amount": 100, + "currency": "USD" + }, + "event_type": "CASH_TENDER_REFUND", + "id": "0B425480-8504-40B4-A867-37B23543931B", + "team_member_id": "" + }, + { + "created_at": "2019-11-22T00:44:18.000Z", + "description": "Transfer from another drawer", + "event_money": { + "amount": 10000, + "currency": "USD" + }, + "event_type": "PAID_IN", + "id": "8C66E60E-FDCF-4EEF-A98D-3B14B7ED5CBE", + "team_member_id": "" + }, + { + "created_at": "2019-11-22T00:44:29.000Z", + "description": "Transfer out to another drawer", + "event_money": { + "amount": 10000, + "currency": "USD" + }, + "event_type": "PAID_OUT", + "id": "D5ACA7FE-C64D-4ADA-8BC8-82118A2DAE4F", + "team_member_id": "" + } + ] + } + }, + "ListCashDrawerShiftsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "cursor": { + "type": "string", + "description": "Opaque cursor for fetching the next page of results. Cursor is not\npresent in the last page of results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "cash_drawer_shifts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CashDrawerShiftSummary" + }, + "description": "A collection of CashDrawerShiftSummary objects for shifts that match\nthe query." + } + }, + "example": { + "cash_drawer_shifts": [ + { + "closed_at": "2019-11-22T00:44:49.000Z", + "closed_cash_money": { + "amount": 9970, + "currency": "USD" + }, + "description": "Misplaced some change", + "ended_at": "2019-11-22T00:44:49.000Z", + "expected_cash_money": { + "amount": 10000, + "currency": "USD" + }, + "id": "DCC99978-09A6-4926-849F-300BE9C5793A", + "opened_at": "2019-11-22T00:42:54.000Z", + "opened_cash_money": { + "amount": 10000, + "currency": "USD" + }, + "state": "CLOSED" + } + ] + } + }, + "ListCatalogResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset, this is the final response.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + }, + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "The CatalogObjects returned." + } + }, + "example": { + "objects": [ + { + "category_data": { + "name": "Beverages" + }, + "id": "5ZYQZZ2IECPVJ2IJ5KQPRDC3", + "is_deleted": false, + "present_at_all_locations": true, + "type": "CATEGORY", + "updated_at": "2017-02-21T14:50:26.495Z", + "version": 1487688626495 + }, + { + "id": "L5R47DGBZOOVKCAFIXC56AEN", + "is_deleted": false, + "present_at_all_locations": true, + "tax_data": { + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX", + "updated_at": "2017-02-21T14:50:26.495Z", + "version": 1487688626495 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.csharp", + "java": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.java", + "javascript": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.javascript", + "php": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.php", + "python": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.python", + "ruby": "/sdk_samples/Catalog/ListCatalog/ListCatalogResponse.ruby" + } + }, + "ListChannelsRequestConstants": { + "type": "string", + "enum": [ + "MAX_PAGE_SIZE" + ], + "x-enum-elements": [ + { + "name": "MAX_PAGE_SIZE", + "description": "" + } + ], + "x-release-status": "BETA" + }, + "ListChannelsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "channels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Channel" + }, + "description": "List of requested Channel." + }, + "cursor": { + "type": "string", + "description": "The token required to retrieve the next page of results." + } + }, + "example": { + "channels": [ + { + "created_at": "2022-10-25T16:27:00Z", + "id": "CH_9C03D0B59", + "merchant_id": "ML64FACEA", + "name": "Contoso Fulfillment Application", + "reference": { + "id": "OA_9C03D0444", + "type": "OAUTH_APPLICATION" + }, + "status": "ACTIVE", + "updated_at": "2022-10-25T16:48:00Z", + "version": 1 + } + ] + } + }, + "ListCustomerCustomAttributeDefinitionsResponse": { + "type": "object", + "description": "Represents a [ListCustomerCustomAttributeDefinitions](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributeDefinitions) response.\nEither `custom_attribute_definitions`, an empty object, or `errors` is present in the response.\nIf additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definitions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeDefinition" + }, + "description": "The retrieved custom attribute definitions. If no custom attribute definitions are found,\nSquare returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of\nresults for your original request. This field is present only if the request succeeded and\nadditional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", + "custom_attribute_definitions": [ + { + "created_at": "2022-04-26T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T15:39:38Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + { + "created_at": "2022-04-26T15:49:05Z", + "description": "Customer owns movie.", + "key": "ownsmovie", + "name": "Owns Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-04-26T15:49:05Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + ] + } + }, + "ListCustomerCustomAttributesResponse": { + "type": "object", + "description": "Represents a [ListCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributes) response.\nEither `custom_attributes`, an empty object, or `errors` is present in the response. If additional\nresults are available, the `cursor` field is also present along with `custom_attributes`.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttribute" + }, + "description": "The retrieved custom attributes. If `with_definitions` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field of each custom attribute.\n\nIf no custom attributes are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to use in your next call to this endpoint to retrieve the next page of results\nfor your original request. This field is present only if the request succeeded and additional\nresults are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attributes": [ + { + "created_at": "2022-04-26T15:50:27Z", + "key": "favoritemovie", + "updated_at": "2022-04-26T15:50:27Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + { + "created_at": "2022-04-26T15:51:53Z", + "key": "ownsmovie", + "updated_at": "2022-04-26T15:51:53Z", + "value": false, + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + ] + } + }, + "ListCustomerGroupsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListCustomerGroups](api-endpoint:CustomerGroups-ListCustomerGroups) endpoint.\n\nEither `errors` or `groups` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerGroup" + }, + "description": "A list of customer groups belonging to the current seller." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor to retrieve the next set of results for your\noriginal query to the endpoint. This value is present only if the request\nsucceeded and additional results are available.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "groups": [ + { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + }, + { + "created_at": "2020-04-13T21:55:18.795Z", + "id": "4XMEHESXJBNE9S9JAKZD2FGB14", + "name": "Super Loyal Customers", + "updated_at": "2020-04-13T21:55:19Z" + } + ] + } + }, + "ListCustomerSegmentsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body for requests to the `ListCustomerSegments` endpoint.\n\nEither `errors` or `segments` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomerSegment" + }, + "description": "The list of customer segments belonging to the associated Square account." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor to be used in subsequent calls to `ListCustomerSegments`\nto retrieve the next set of query results. The cursor is only present if the request succeeded and\nadditional results are available.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "segments": [ + { + "created_at": "2020-01-09T19:33:24.469Z", + "id": "GMNXRZVEXNQDF.CHURN_RISK", + "name": "Lapsed", + "updated_at": "2020-04-13T21:47:04Z" + }, + { + "created_at": "2020-01-09T19:33:24.486Z", + "id": "GMNXRZVEXNQDF.LOYAL", + "name": "Regulars", + "updated_at": "2020-04-13T21:47:04Z" + }, + { + "created_at": "2020-01-09T19:33:21.813Z", + "id": "GMNXRZVEXNQDF.REACHABLE", + "name": "Reachable", + "updated_at": "2020-04-13T21:47:04Z" + }, + { + "created_at": "2020-01-09T19:33:25Z", + "id": "gv2:KF92J19VXN5FK30GX2E8HSGQ20", + "name": "Instant Profile", + "updated_at": "2020-04-13T23:01:03Z" + } + ] + } + }, + "ListCustomersResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `ListCustomers` endpoint.\n\nEither `errors` or `customers` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Customer" + }, + "description": "The customer profiles associated with the Square account or an empty object (`{}`) if none are found.\nOnly customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or\n`phone_number`) are included in the response." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor to retrieve the next set of results for the\noriginal query. A cursor is only present if the request succeeded and additional results\nare available.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "count": { + "type": "integer", + "description": "The total count of customers associated with the Square account. Only customer profiles with public information\n(`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is present\nonly if `count` is set to `true` in the request.", + "format": "int64" + } + }, + "example": { + "customers": [ + { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "group_ids": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ], + "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "segment_ids": [ + "1KB9JE5EGJXCW.REACHABLE" + ], + "updated_at": "2016-03-23T20:21:55Z", + "version": 1 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ListCustomers/ListCustomersResponse.csharp", + "java": "/sdk_samples/ListCustomers/ListCustomersResponse.java", + "javascript": "/sdk_samples/ListCustomers/ListCustomersResponse.javascript", + "php": "/sdk_samples/ListCustomers/ListCustomersResponse.php", + "python": "/sdk_samples/ListCustomers/ListCustomersResponse.python", + "ruby": "/sdk_samples/ListCustomers/ListCustomersResponse.ruby" + } + }, + "ListDeviceCodesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "device_codes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeviceCode" + }, + "description": "The queried DeviceCode." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor to retrieve the next set of results for your\noriginal query to the endpoint. This value is present only if the request\nsucceeded and additional results are available.\n\nSee [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information." + } + }, + "example": { + "device_codes": [ + { + "code": "EBCARJ", + "created_at": "2020-02-06T18:44:33.000Z", + "device_id": "907CS13101300122", + "id": "B3Z6NAMYQSMTM", + "location_id": "B5E4484SHHNYH", + "name": "Counter 1", + "pair_by": "2020-02-06T18:49:33.000Z", + "product_type": "TERMINAL_API", + "status": "PAIRED", + "status_changed_at": "2020-02-06T18:47:28.000Z" + }, + { + "code": "GVXNYN", + "created_at": "2020-02-07T19:55:04.000Z", + "id": "YKGMJMYK8H4PQ", + "location_id": "A6SYFRSV4WAFW", + "name": "Unused device code", + "pair_by": "2020-02-07T20:00:04.000Z", + "product_type": "TERMINAL_API", + "status": "UNPAIRED", + "status_changed_at": "2020-02-07T19:55:04.000Z" + } + ] + } + }, + "ListDevicesResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors that occurred during the request." + }, + "devices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Device" + }, + "description": "The requested list of `Device` objects." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + } + }, + "example": { + "cursor": "GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM", + "devices": [ + { + "attributes": { + "manufacturer": "Square", + "manufacturers_id": "995CS397A6475287", + "merchant_token": "MLCHNZCBWFDZB", + "model": "Square Terminal (1st Gen, v2)", + "name": "Square Terminal 5287", + "type": "TERMINAL", + "updated_at": "2025-08-19T13:04:56.335762883Z", + "version": "5.57.0067" + }, + "components": [ + { + "application_details": { + "application_type": "TERMINAL_API", + "session_location": "LMN2K7S3RTOU3", + "version": "6.77" + }, + "type": "APPLICATION" + }, + { + "card_reader_details": { + "version": "4.1.51" + }, + "type": "CARD_READER" + }, + { + "battery_details": { + "external_power": "AVAILABLE_CHARGING", + "visible_percent": 77 + }, + "type": "BATTERY" + }, + { + "type": "WIFI", + "wifi_details": { + "active": true, + "ip_address_v4": "10.0.0.7", + "secure_connection": "WPA/WPA2 PSK", + "signal_strength": { + "value": 2 + }, + "ssid": "Staff Network" + } + }, + { + "ethernet_details": { + "active": false + }, + "type": "ETHERNET" + } + ], + "id": "device:995CS397A6475287", + "status": { + "category": "AVAILABLE" + } + }, + { + "attributes": { + "manufacturer": "Square", + "manufacturers_id": "998WS21803L03559", + "merchant_token": "MLCHXZCBWFGDW", + "model": "Square Handheld (1st Gen, v1)", + "name": "Square Terminal 3559", + "type": "HANDHELD", + "updated_at": "2025-08-19T12:39:56.335742073Z", + "version": "7.21.0017" + }, + "components": [ + { + "application_details": { + "application_type": "TERMINAL_API", + "session_location": "LMN2K7S3RTOU3", + "version": "6.77" + }, + "type": "APPLICATION" + }, + { + "card_reader_details": { + "version": "4.5.58" + }, + "type": "CARD_READER" + }, + { + "battery_details": { + "external_power": "AVAILABLE_CHARGING", + "visible_percent": 22 + }, + "type": "BATTERY" + }, + { + "type": "WIFI", + "wifi_details": { + "active": true, + "ip_address_v4": "10.0.0.7", + "secure_connection": "WPA/WPA2 PSK", + "signal_strength": { + "value": 2 + }, + "ssid": "Staff Network" + } + }, + { + "ethernet_details": { + "active": false + }, + "type": "ETHERNET" + } + ], + "id": "device:998WS21803L03559", + "status": { + "category": "NEEDS_ATTENTION" + } + } + ] + } + }, + "ListDisputeEvidenceResponse": { + "type": "object", + "description": "Defines the fields in a `ListDisputeEvidence` response.", + "x-release-status": "PUBLIC", + "properties": { + "evidence": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DisputeEvidence" + }, + "description": "The list of evidence previously uploaded to the specified dispute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request.\nIf unset, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "evidence": [ + { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_file": { + "filename": "customer-interaction", + "filetype": "JPG" + }, + "evidence_type": "CARDHOLDER_COMMUNICATION", + "id": "CpfnkwGselCwS8QFvxN6", + "uploaded_at": "2022-05-10T15:57:13.802Z" + }, + { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_file": { + "filename": "", + "filetype": "" + }, + "evidence_type": "REBUTTAL_EXPLANATION", + "id": "TOomLInj6iWmP3N8qfCXrB", + "uploaded_at": "2022-05-18T16:01:10.000Z" + } + ] + } + }, + "ListDisputesResponse": { + "type": "object", + "description": "Defines fields in a `ListDisputes` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "disputes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Dispute" + }, + "description": "The list of disputes." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request.\nIf unset, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "cursor": "G1aSTRm48CLjJsg6Sg3hQN1b1OMaoVuG", + "disputes": [ + { + "amount_money": { + "amount": 2500, + "currency": "USD" + }, + "brand_dispute_id": "100000809947", + "card_brand": "VISA", + "created_at": "2022-06-29T18:45:22.265Z", + "disputed_payment": { + "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" + }, + "due_at": "2022-07-13T00:00:00.000Z", + "id": "XDgyFu7yo1E2S5lQGGpYn", + "location_id": "L1HN3ZMQK64X9", + "reason": "NO_KNOWLEDGE", + "reported_at": "2022-06-29T00:00:00.000Z", + "state": "ACCEPTED", + "updated_at": "2022-07-07T19:14:42.650Z", + "version": 2 + }, + { + "amount_money": { + "amount": 2209, + "currency": "USD" + }, + "brand_dispute_id": "r5Of6YaGT7AdeRaVoAGCJw", + "card_brand": "VISA", + "created_at": "2022-04-29T18:45:22.265Z", + "disputed_payment": { + "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" + }, + "due_at": "2022-05-13T00:00:00.000Z", + "id": "jLGg7aXC7lvKPr9PISt0T", + "location_id": "18YC4JDH91E1H", + "reason": "NOT_AS_DESCRIBED", + "reported_at": "2022-04-29T00:00:00.000Z", + "state": "EVIDENCE_REQUIRED", + "updated_at": "2022-04-29T18:45:22.265Z", + "version": 1 + } + ] + } + }, + "ListEmployeeWagesResponse": { + "type": "object", + "description": "The response to a request for a set of `EmployeeWage` objects. The response contains\na set of `EmployeeWage` objects.", + "x-release-status": "DEPRECATED", + "properties": { + "employee_wages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmployeeWage" + }, + "description": "A page of `EmployeeWage` results." + }, + "cursor": { + "type": "string", + "description": "The value supplied in the subsequent request to fetch the next page\nof `EmployeeWage` results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + "employee_wages": [ + { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 3250, + "currency": "USD" + }, + "id": "pXS3qCv7BERPnEGedM4S8mhm", + "title": "Manager" + }, + { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 2600, + "currency": "USD" + }, + "id": "rZduCkzYDUVL3ovh1sQgbue6", + "title": "Cook" + }, + { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 1600, + "currency": "USD" + }, + "id": "FxLbs5KpPUHa8wyt5ctjubDX", + "title": "Barista" + }, + { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 1700, + "currency": "USD" + }, + "id": "vD1wCgijMDR3cX5TPnu7VXto", + "title": "Cashier" + } + ] + } + }, + "ListEmployeesResponse": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "employees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Employee" + } + }, + "cursor": { + "type": "string", + "description": "The token to be used to retrieve the next page of results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + } + }, + "ListEventTypesResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListEventTypes](api-endpoint:Events-ListEventTypes) endpoint.\n\nNote: if there are errors processing the request, the event types field will not be\npresent.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "event_types": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of event types." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EventTypeMetadata" + }, + "description": "Contains the metadata of an event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata)." + } + }, + "example": { + "event_types": [ + "inventory.count.updated" + ], + "metadata": [ + { + "api_version_introduced": "2018-07-12", + "event_type": "inventory.count.updated", + "release_status": "PUBLIC" + } + ] + } + }, + "ListGiftCardActivitiesResponse": { + "type": "object", + "description": "A response that contains a list of `GiftCardActivity` objects. If the request resulted in errors, \nthe response contains a set of `Error` objects.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card_activities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCardActivity" + }, + "description": "The requested gift card activities or an empty object if none are found." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can use in a\nsubsequent request to retrieve the next set of activities. If a cursor is not present, this is\nthe final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." + } + }, + "example": { + "gift_card_activities": [ + { + "created_at": "2021-06-02T22:26:38.000Z", + "gift_card_balance_money": { + "amount": 700, + "currency": "USD" + }, + "gift_card_gan": "7783320002929081", + "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + "id": "gcact_897698f894b44b3db46c6147e26a0e19", + "location_id": "81FN9BNFZTKS4", + "payment_id": "dEv2eksNPy6GqdYiLe4ZBNk6HqXZY", + "redeem_activity_details": { + "amount_money": { + "amount": 300, + "currency": "USD" + } + }, + "status": "COMPLETED", + "type": "REDEEM" + }, + { + "activate_activity_details": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", + "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gift_card_balance_money": { + "amount": 1000, + "currency": "USD" + }, + "gift_card_gan": "7783320002929081", + "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + "id": "gcact_b968ebfc7d46437b945be7b9e09123b4", + "location_id": "81FN9BNFZTKS4", + "type": "ACTIVATE" + } + ] + } + }, + "ListGiftCardsResponse": { + "type": "object", + "description": "A response that contains a list of `GiftCard` objects. If the request resulted in errors, \nthe response contains a set of `Error` objects.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_cards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GiftCard" + }, + "description": "The requested gift cards or an empty object if none are found." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can use in a\nsubsequent request to retrieve the next set of gift cards. If a cursor is not present, this is\nthe final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." + } + }, + "example": { + "cursor": "JbFmyvUpaNKsfC1hoLSA4WlqkgkZXTWeKuStajR5BkP7OE0ETAbeWSi6U6u7sH", + "gift_cards": [ + { + "balance_money": { + "amount": 3900, + "currency": "USD" + }, + "created_at": "2021-06-09T22:26:54.000Z", + "gan": "7783320008524605", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "ACTIVE", + "type": "DIGITAL" + }, + { + "balance_money": { + "amount": 2000, + "currency": "USD" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gan": "7783320002692465", + "gan_source": "SQUARE", + "id": "gftc:00128a12725b41e58e0de1d20497a9dd", + "state": "ACTIVE", + "type": "DIGITAL" + } + ] + } + }, + "ListInvoicesResponse": { + "type": "object", + "description": "Describes a `ListInvoice` response.", + "x-release-status": "PUBLIC", + "properties": { + "invoices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Invoice" + }, + "description": "The invoices retrieved." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can use in a \nsubsequent request to retrieve the next set of invoices. If empty, this is the final \nresponse. \nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "cursor": "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", + "invoices": [ + { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "attachments": [ + { + "description": "Service contract", + "filename": "file.jpg", + "filesize": 102705, + "hash": "273ee02cb6f5f8a3a8ca23604930dd53", + "id": "inva:0-3bB9ZuDHiziThQhuC4fwWt", + "mime_type": "image/jpeg", + "uploaded_at": "2030-01-13T21:24:10Z" + } + ], + "created_at": "2030-01-13T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2030-01-13T21:24:10Z", + "version": 1 + }, + { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": true + }, + "created_at": "2021-01-23T15:29:12Z", + "delivery_method": "EMAIL", + "id": "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", + "invoice_number": "inv-455", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "order_id": "a65jnS8NXbfprvGJzY9F4fQTuaB", + "payment_requests": [ + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "due_date": "2021-01-23", + "percentage_requested": "25", + "request_type": "DEPOSIT", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "uid": "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176" + }, + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "due_date": "2021-06-15", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "120c5e18-4f80-4f6b-b159-774cb9bf8f99" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "public_url": "https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9", + "sale_or_service_date": "2030-01-24", + "status": "PARTIALLY_PAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "updated_at": "2021-01-23T15:29:56Z", + "version": 3 + } + ] + } + }, + "ListJobsResponse": { + "type": "object", + "description": "Represents a [ListJobs](api-endpoint:Team-ListJobs) response. Either `jobs` or `errors`\nis present in the response. If additional results are available, the `cursor` field is also present.", + "x-release-status": "BETA", + "properties": { + "jobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Job" + }, + "description": "The retrieved jobs. A single paged response contains up to 100 jobs." + }, + "cursor": { + "type": "string", + "description": "An opaque cursor used to retrieve the next page of results. This field is present only\nif the request succeeded and additional results are available. For more information, see\n[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "jobs": [ + { + "created_at": "2021-06-11T22:55:45Z", + "id": "VDNpRv8da51NU8qZFC5zDWpF", + "is_tip_eligible": true, + "title": "Cashier", + "updated_at": "2021-06-11T22:55:45Z", + "version": 2 + }, + { + "created_at": "2021-06-11T22:55:45Z", + "id": "FjS8x95cqHiMenw4f1NAUH4P", + "is_tip_eligible": false, + "title": "Chef", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + ] + } + }, + "ListLocationBookingProfilesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "location_booking_profiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationBookingProfile" + }, + "description": "The list of a seller's location booking profiles." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "errors": [], + "location_booking_profiles": [ + { + "booking_site_url": "https://squareup.com/book/LY6WNBPVM6VGV/testbusiness", + "location_id": "LY6WNBPVM6VGV", + "online_booking_enabled": true + }, + { + "location_id": "PYTRNBPVMJUPV", + "online_booking_enabled": false + } + ] + } + }, + "ListLocationCustomAttributeDefinitionsResponse": { + "type": "object", + "description": "Represents a [ListLocationCustomAttributeDefinitions](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributeDefinitions) response.\nEither `custom_attribute_definitions`, an empty object, or `errors` is present in the response.\nIf additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definitions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeDefinition" + }, + "description": "The retrieved custom attribute definitions. If no custom attribute definitions are found,\nSquare returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of\nresults for your original request. This field is present only if the request succeeded and\nadditional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", + "custom_attribute_definitions": [ + { + "created_at": "2022-12-02T19:50:21.832Z", + "description": "Location's phone number", + "key": "phone-number", + "name": "phone number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.PhoneNumber" + }, + "updated_at": "2022-12-02T19:50:21.832Z", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-12-03T10:17:52.341Z", + "version": 4, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + ] + } + }, + "ListLocationCustomAttributesResponse": { + "type": "object", + "description": "Represents a [ListLocationCustomAttributes](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributes) response.\nEither `custom_attributes`, an empty object, or `errors` is present in the response. If additional\nresults are available, the `cursor` field is also present along with `custom_attributes`.", + "x-release-status": "BETA", + "properties": { + "custom_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttribute" + }, + "description": "The retrieved custom attributes. If `with_definitions` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field of each custom attribute.\nIf no custom attributes are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to use in your next call to this endpoint to retrieve the next page of results\nfor your original request. This field is present only if the request succeeded and additional\nresults are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attributes": [ + { + "created_at": "2022-12-12T18:13:03.745Z", + "key": "phone-number", + "updated_at": "2022-12-12T18:13:03.745Z", + "value": "+12223334444", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + { + "created_at": "2022-12-12T19:27:57.975Z", + "key": "bestseller", + "updated_at": "2022-12-12T19:27:57.975Z", + "value": "hot cocoa", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + ] + } + }, + "ListLocationsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of a request\nto the [ListLocations](api-endpoint:Locations-ListLocations) endpoint.\n\nEither `errors` or `locations` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "locations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Location" + }, + "description": "The business locations." + } + }, + "example": { + "locations": [ + { + "address": { + "address_line_1": "123 Main St", + "administrative_district_level_1": "CA", + "country": "US", + "locality": "San Francisco", + "postal_code": "94114" + }, + "business_name": "Jet Fuel Coffee", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ], + "country": "US", + "created_at": "2016-09-19T17:33:12Z", + "currency": "USD", + "id": "18YC4JDH91E1H", + "language_code": "en-US", + "merchant_id": "3MYCJG5GVYQ8Q", + "name": "Grant Park", + "phone_number": "+1 650-354-7217", + "status": "ACTIVE", + "timezone": "America/Los_Angeles" + }, + { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309" + }, + "business_name": "Jet Fuel Coffee", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ], + "coordinates": { + "latitude": 33.7889, + "longitude": -84.3841 + }, + "country": "US", + "created_at": "2022-02-19T17:58:25Z", + "currency": "USD", + "description": "Midtown Atlanta store", + "id": "3Z4V4WHQK64X9", + "language_code": "en-US", + "mcc": "7299", + "merchant_id": "3MYCJG5GVYQ8Q", + "name": "Midtown", + "status": "ACTIVE", + "timezone": "America/New_York", + "type": "PHYSICAL" + } + ] + } + }, + "ListLoyaltyProgramsResponse": { + "type": "object", + "description": "A response that contains all loyalty programs.", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "programs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyProgram" + }, + "description": "A list of `LoyaltyProgram` for the merchant." + } + }, + "example": { + "programs": [ + { + "accrual_rules": [ + { + "accrual_type": "SPEND", + "points": 1, + "spend_data": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "excluded_category_ids": [ + "7ZERJKO5PVYXCVUHV2JCZ2UG", + "FQKAOJE5C4FIMF5A2URMLW6V" + ], + "excluded_item_variation_ids": [ + "CBZXBUVVTYUBZGQO44RHMR6B", + "EDILT24Z2NISEXDKGY6HP7XV" + ], + "tax_mode": "BEFORE_TAX" + } + } + ], + "created_at": "2020-04-20T16:55:11Z", + "id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "location_ids": [ + "P034NEENMD09F" + ], + "reward_tiers": [ + { + "created_at": "2020-04-20T16:55:11Z", + "id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "name": "10% off entire sale", + "points": 10, + "pricing_rule_reference": { + "catalog_version": "1605486402527", + "object_id": "74C4JSHESNLTB2A7ITO5HO6F" + } + } + ], + "status": "ACTIVE", + "terminology": { + "one": "Point", + "other": "Points" + }, + "updated_at": "2020-05-01T02:00:02Z" + } + ] + } + }, + "ListLoyaltyPromotionsResponse": { + "type": "object", + "description": "Represents a [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) response.\nOne of `loyalty_promotions`, an empty object, or `errors` is present in the response.\nIf additional results are available, the `cursor` field is also present along with `loyalty_promotions`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_promotions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyPromotion" + }, + "description": "The retrieved loyalty promotions." + }, + "cursor": { + "type": "string", + "description": "The cursor to use in your next call to this endpoint to retrieve the next page of results\nfor your original request. This field is present only if the request succeeded and additional\nresults are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "loyalty_promotions": [ + { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ] + }, + "created_at": "2022-08-16T08:38:54Z", + "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", + "incentive": { + "points_multiplier_data": { + "multiplier": "3.000", + "points_multiplier": 3 + }, + "type": "POINTS_MULTIPLIER" + }, + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "name": "Tuesday Happy Hour Promo", + "qualifying_item_variation_ids": [ + "CJ3RYL56ITAKMD4VRCM7XERS", + "AT3RYLR3TUA9C34VRCB7X5RR" + ], + "status": "ACTIVE", + "trigger_limit": { + "interval": "DAY", + "times": 1 + }, + "updated_at": "2022-08-16T08:38:54Z" + }, + { + "available_time": { + "end_date": "2022-08-01", + "start_date": "2022-07-01", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220704T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=MO\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220705T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220706T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=WE\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220707T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TH\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220701T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=FR\nEND:VEVENT" + ] + }, + "created_at": "2022-06-27T15:37:38Z", + "id": "loypromo_e696f057-2286-35ff-8108-132241328106", + "incentive": { + "points_multiplier_data": { + "multiplier": "2.000", + "points_multiplier": 2 + }, + "type": "POINTS_MULTIPLIER" + }, + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "July Special", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "status": "ENDED", + "trigger_limit": { + "interval": "ALL_TIME", + "times": 5 + }, + "updated_at": "2022-06-27T15:37:38Z" + } + ] + } + }, + "ListMerchantCustomAttributeDefinitionsResponse": { + "type": "object", + "description": "Represents a [ListMerchantCustomAttributeDefinitions](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributeDefinitions) response.\nEither `custom_attribute_definitions`, an empty object, or `errors` is present in the response.\nIf additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definitions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeDefinition" + }, + "description": "The retrieved custom attribute definitions. If no custom attribute definitions are found,\nSquare returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of\nresults for your original request. This field is present only if the request succeeded and\nadditional results are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", + "custom_attribute_definitions": [ + { + "created_at": "2023-05-05T16:50:21.832Z", + "description": "Whether the merchant has seen the tutorial screen for using the app.", + "key": "has_seen_tutorial", + "name": "NAME", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2023-05-05T16:50:21.832Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + { + "created_at": "2023-05-05T19:06:36.559Z", + "description": "This is the other name this merchant goes by.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2023-05-05T10:17:52.341Z", + "version": 4, + "visibility": "VISIBILITY_READ_ONLY" + } + ] + } + }, + "ListMerchantCustomAttributesResponse": { + "type": "object", + "description": "Represents a [ListMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributes) response.\nEither `custom_attributes`, an empty object, or `errors` is present in the response. If additional\nresults are available, the `cursor` field is also present along with `custom_attributes`.", + "x-release-status": "BETA", + "properties": { + "custom_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttribute" + }, + "description": "The retrieved custom attributes. If `with_definitions` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field of each custom attribute.\nIf no custom attributes are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to use in your next call to this endpoint to retrieve the next page of results\nfor your original request. This field is present only if the request succeeded and additional\nresults are available. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attributes": [ + { + "created_at": "2023-05-05T18:13:03.745Z", + "key": "has_seen_tutorial", + "updated_at": "2023-05-05T18:13:03.745Z", + "value": true, + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + { + "created_at": "2023-05-05T19:27:57.975Z", + "key": "alternative_seller_name", + "updated_at": "2023-05-05T19:27:57.975Z", + "value": "Ultimate Sneaker Store", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + } + ] + } + }, + "ListMerchantsResponse": { + "type": "object", + "description": "The response object returned by the [ListMerchant](api-endpoint:Merchants-ListMerchants) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "merchant": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Merchant" + }, + "description": "The requested `Merchant` entities." + }, + "cursor": { + "type": "integer", + "description": "If the response is truncated, the cursor to use in next request to fetch next set of objects." + } + }, + "example": { + "merchant": [ + { + "business_name": "Apple A Day", + "country": "US", + "created_at": "2021-12-10T19:25:52.484Z", + "currency": "USD", + "id": "DM7VKY8Q63GNP", + "language_code": "en-US", + "main_location_id": "9A65CGC72ZQG1", + "status": "ACTIVE" + } + ] + } + }, + "ListOrderCustomAttributeDefinitionsResponse": { + "type": "object", + "description": "Represents a response from listing order custom attribute definitions.", + "x-release-status": "BETA", + "required": [ + "custom_attribute_definitions" + ], + "properties": { + "custom_attribute_definitions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeDefinition" + }, + "description": "The retrieved custom attribute definitions. If no custom attribute definitions are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of results for your original request. \nThis field is present only if the request succeeded and additional results are available.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "minLength": 1 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definitions": [ + { + "created_at": "2022-11-16T18:03:44.051Z", + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-11-16T18:03:44.051Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + { + "created_at": "2022-11-16T18:04:32.059Z", + "description": "The identifier for a particular seat", + "key": "seat-number", + "name": "Seat number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-11-16T18:04:32.059Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + { + "created_at": "2022-11-16T18:04:21.912Z", + "description": "The identifier for a particular table", + "key": "table-number", + "name": "Table number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-11-16T18:04:21.912Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + ] + } + }, + "ListOrderCustomAttributesResponse": { + "type": "object", + "description": "Represents a response from listing order custom attributes.", + "x-release-status": "BETA", + "properties": { + "custom_attributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttribute" + }, + "description": "The retrieved custom attributes. If no custom attribute are found, Square returns an empty object (`{}`)." + }, + "cursor": { + "type": "string", + "description": "The cursor to provide in your next call to this endpoint to retrieve the next page of results for your original request. \nThis field is present only if the request succeeded and additional results are available.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "minLength": 1 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attributes": [ + { + "created_at": "2022-11-10T17:31:36.111Z", + "key": "wayne-test-15", + "updated_at": "2022-11-10T17:31:36.111Z", + "value": "TEST", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + ] + } + }, + "ListPaymentLinksResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + }, + "payment_links": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentLink" + }, + "description": "The list of payment links." + }, + "cursor": { + "type": "string", + "description": " When a response is truncated, it includes a cursor that you can use in a subsequent request\nto retrieve the next set of gift cards. If a cursor is not present, this is the final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "cursor": "MTY1NQ==", + "payment_links": [ + { + "checkout_options": { + "ask_for_shipping_address": true + }, + "created_at": "2022-04-26T00:15:15Z", + "id": "TN4BWEDJ9AI5MBIV", + "order_id": "Qqc6yppGvxVwc46Cch4zHTaJqc4F", + "payment_note": "test", + "updated_at": "2022-04-26T00:18:24Z", + "url": "https://square.link/u/EXAMPLE", + "version": 2 + }, + { + "created_at": "2022-04-11T23:14:59Z", + "description": "", + "id": "RY5UNCUMPJN5XKCT", + "order_id": "EmBmGt3zJD15QeO1dxzBTxMxtwfZY", + "url": "https://square.link/u/EXAMPLE", + "version": 1 + } + ] + } + }, + "ListPaymentRefundsRequestSortField": { + "type": "string", + "enum": [ + "CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "CREATED_AT", + "description": "" + }, + { + "name": "UPDATED_AT", + "description": "" + } + ], + "x-release-status": "PUBLIC" + }, + "ListPaymentRefundsResponse": { + "type": "object", + "description": "Defines the response returned by [ListPaymentRefunds](api-endpoint:Refunds-ListPaymentRefunds).\n\nEither `errors` or `refunds` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refunds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentRefund" + }, + "description": "The list of requested refunds." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "cursor": "5evquW1YswHoT4EoyUhzMmTsCnsSXBU9U0WJ4FU4623nrMQcocH0RGU6Up1YkwfiMcF59ood58EBTEGgzMTGHQJpocic7ExOL0NtrTXCeWcv0UJIJNk8eXb", + "refunds": [ + { + "amount_money": { + "amount": 555, + "currency": "USD" + }, + "created_at": "2021-10-13T19:59:05.342Z", + "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", + "location_id": "L88917AVBK2S5", + "order_id": "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", + "payment_id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "processing_fee": [ + { + "amount_money": { + "amount": -34, + "currency": "USD" + }, + "effective_at": "2021-10-13T21:34:35.000Z", + "type": "INITIAL" + } + ], + "reason": "Example Refund", + "status": "COMPLETED", + "updated_at": "2021-10-13T20:00:03.497Z" + } + ] + } + }, + "ListPaymentsRequestSortField": { + "type": "string", + "enum": [ + "CREATED_AT", + "OFFLINE_CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "CREATED_AT", + "description": "" + }, + { + "name": "OFFLINE_CREATED_AT", + "description": "" + }, + { + "name": "UPDATED_AT", + "description": "" + } + ], + "x-release-status": "PUBLIC" + }, + "ListPaymentsResponse": { + "type": "object", + "description": "Defines the response returned by [ListPayments](api-endpoint:Payments-ListPayments).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "payments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment" + }, + "description": "The requested list of payments." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "payments": [ + { + "amount_money": { + "amount": 555, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", + "square_product": "VIRTUAL_TERMINAL" + }, + "approved_money": { + "amount": 555, + "currency": "USD" + }, + "card_details": { + "auth_result_code": "2Nkw7q", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T19:34:33.680Z", + "captured_at": "2021-10-13T19:34:34.340Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "KEYED", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "CAPTURED" + }, + "created_at": "2021-10-13T19:34:33.524Z", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T19:34:33.524Z", + "employee_id": "TMoK_ogh6rH1o4dV", + "id": "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "location_id": "L88917AVBK2S5", + "note": "Test Note", + "order_id": "d7eKah653Z579f3gVtjlxpSlmUcZY", + "processing_fee": [ + { + "amount_money": { + "amount": 34, + "currency": "USD" + }, + "effective_at": "2021-10-13T21:34:35.000Z", + "type": "INITIAL" + } + ], + "receipt_number": "bP9m", + "receipt_url": "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + "source_type": "CARD", + "status": "COMPLETED", + "team_member_id": "TMoK_ogh6rH1o4dV", + "total_money": { + "amount": 555, + "currency": "USD" + }, + "updated_at": "2021-10-13T19:34:37.261Z", + "version_token": "vguW2km0KpVCdAXZcNTZ438qg5LlVPTP4HO5OpiHNfa6o" + } + ] + } + }, + "ListPayoutEntriesResponse": { + "type": "object", + "description": "The response to retrieve payout records entries.", + "x-release-status": "PUBLIC", + "properties": { + "payout_entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayoutEntry" + }, + "description": "The requested list of payout entries, ordered with the given or default sort order." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty, this is the final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "cursor": "TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO", + "payout_entries": [ + { + "effective_at": "2021-12-14T23:31:49Z", + "fee_amount_money": { + "amount": -2, + "currency_code": "USD" + }, + "gross_amount_money": { + "amount": -50, + "currency_code": "USD" + }, + "id": "poe_ZQWcw41d0SGJS6IWd4cSi8mKHk", + "net_amount_money": { + "amount": -48, + "currency_code": "USD" + }, + "payout_id": "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", + "type": "REFUND", + "type_refund_details": { + "payment_id": "HVdG62HeMlti8YYf94oxrN", + "refund_id": "HVdG62HeMlti8YYf94oxrN_dR8Nztxg7umf94oxrN12Ji5r2KW14FAY" + } + }, + { + "effective_at": "2021-12-14T23:31:49Z", + "fee_amount_money": { + "amount": 19, + "currency_code": "USD" + }, + "gross_amount_money": { + "amount": 100, + "currency_code": "USD" + }, + "id": "poe_EibbY9Ob1d0SGJS6IWd4cSiSi6wkaPk", + "net_amount_money": { + "amount": 81, + "currency_code": "USD" + }, + "payout_id": "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", + "type": "CHARGE", + "type_charge_details": { + "payment_id": "HVdG62H5K3291d0SGJS6IWd4cSi8YY" + } + } + ] + } + }, + "ListPayoutsResponse": { + "type": "object", + "description": "The response to retrieve payout records entries.", + "x-release-status": "PUBLIC", + "properties": { + "payouts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Payout" + }, + "description": "The requested list of payouts." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty, this is the final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "cursor": "EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU", + "payouts": [ + { + "amount_money": { + "amount": 6259, + "currency_code": "USD" + }, + "arrival_date": "2022-03-29", + "created_at": "2022-03-29T16:12:31Z", + "destination": { + "id": "ccof:ZPp3oedR3AeEUNd3z7", + "type": "CARD" + }, + "end_to_end_id": "L2100000005", + "id": "po_b345d2c7-90b3-4f0b-a2aa-df1def7f8afc", + "location_id": "L88917AVBK2S5", + "payout_fee": [ + { + "amount_money": { + "amount": 95, + "currency_code": "USD" + }, + "effective_at": "2022-03-29T16:12:31Z", + "type": "TRANSFER_FEE" + } + ], + "status": "PAID", + "type": "BATCH", + "updated_at": "2022-03-30T01:07:22.875Z", + "version": 2 + }, + { + "amount_money": { + "amount": -103, + "currency_code": "USD" + }, + "arrival_date": "2022-03-24", + "created_at": "2022-03-24T03:07:09Z", + "destination": { + "id": "bact:ZPp3oedR3AeEUNd3z7", + "type": "BANK_ACCOUNT" + }, + "end_to_end_id": "L2100000006", + "id": "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", + "location_id": "L88917AVBK2S5", + "status": "PAID", + "type": "BATCH", + "updated_at": "2022-03-24T03:07:09Z", + "version": 1 + } + ] + } + }, + "ListSitesResponse": { + "type": "object", + "description": "Represents a `ListSites` response. The response can include either `sites` or `errors`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "sites": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Site" + }, + "description": "The sites that belong to the seller." + } + }, + "example": { + "sites": [ + { + "created_at": "2020-10-28T13:22:51.000000Z", + "domain": "mysite2.square.site", + "id": "site_278075276488921835", + "is_published": false, + "site_title": "My Second Site", + "updated_at": "2020-10-28T13:22:51.000000Z" + }, + { + "created_at": "2020-06-18T17:45:13.000000Z", + "domain": "mysite1.square.site", + "id": "site_102725345836253849", + "is_published": true, + "site_title": "My First Site", + "updated_at": "2020-11-23T02:19:10.000000Z" + } + ] + } + }, + "ListSubscriptionEventsResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[ListSubscriptionEvents](api-endpoint:Subscriptions-ListSubscriptionEvents).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription_events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionEvent" + }, + "description": "The retrieved subscription events." + }, + "cursor": { + "type": "string", + "description": "When the total number of resulting subscription events exceeds the limit of a paged response, \nthe response includes a cursor for you to use in a subsequent request to fetch the next set of events.\nIf the cursor is unset, the response contains the last page of the results.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "subscription_events": [ + { + "effective_date": "2020-04-24", + "id": "06809161-3867-4598-8269-8aea5be4f9de", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "START_SUBSCRIPTION" + }, + { + "effective_date": "2020-05-01", + "id": "f2736603-cd2e-47ec-8675-f815fff54f88", + "info": { + "code": "CUSTOMER_NO_NAME", + "detail": "The customer with ID `V74BMG0GPS2KNCWJE1BTYJ37Y0` does not have a name on record." + }, + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "DEACTIVATE_SUBSCRIPTION" + }, + { + "effective_date": "2022-05-01", + "id": "b426fc85-6859-450b-b0d0-fe3a5d1b565f", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "RESUME_SUBSCRIPTION" + }, + { + "effective_date": "2022-09-01", + "id": "09f14de1-2f53-4dae-9091-49aa53f83d01", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "PAUSE_SUBSCRIPTION" + }, + { + "effective_date": "2022-12-01", + "id": "f28a73ac-1a1b-4b0f-8eeb-709a72945776", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "RESUME_SUBSCRIPTION" + }, + { + "effective_date": "2023-04-01", + "id": "1eee8790-472d-4efe-8c69-8ad84e9cefe0", + "plan_variation_id": "02CD53CFA4d1498AFAD42", + "subscription_event_type": "PLAN_CHANGE" + }, + { + "effective_date": "2023-06-21", + "id": "a0c08083-5db0-4800-85c7-d398de4fbb6e", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "STOP_SUBSCRIPTION" + } + ] + } + }, + "ListTeamMemberBookingProfilesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "team_member_booking_profiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TeamMemberBookingProfile" + }, + "description": "The list of team member booking profiles. The results are returned in the ascending order of the time\nwhen the team member booking profiles were last updated. Multiple booking profiles updated at the same time\nare further sorted in the ascending order of their IDs." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in the subsequent request to get the next page of the results. Stop retrieving the next page of the results when the cursor is not set.", + "maxLength": 65536 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "errors": [], + "team_member_booking_profiles": [ + { + "display_name": "Sandbox Seller", + "is_bookable": true, + "team_member_id": "TMXUrsBWWcHTt79t" + }, + { + "display_name": "Sandbox Staff", + "is_bookable": true, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ] + } + }, + "ListTeamMemberWagesResponse": { + "type": "object", + "description": "The response to a request for a set of `TeamMemberWage` objects. The response contains\na set of `TeamMemberWage` objects.", + "x-release-status": "PUBLIC", + "properties": { + "team_member_wages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TeamMemberWage" + }, + "description": "A page of `TeamMemberWage` results." + }, + "cursor": { + "type": "string", + "description": "The value supplied in the subsequent request to fetch the next page\nof `TeamMemberWage` results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + "team_member_wages": [ + { + "hourly_rate": { + "amount": 3250, + "currency": "USD" + }, + "id": "pXS3qCv7BERPnEGedM4S8mhm", + "job_id": "jxJNN6eCJsLrhg5UFJrDWDGE", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": false, + "title": "Manager" + }, + { + "hourly_rate": { + "amount": 2600, + "currency": "USD" + }, + "id": "rZduCkzYDUVL3ovh1sQgbue6", + "job_id": "gcbz15vKGnMKmaWJJ152kjim", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": true, + "title": "Cook" + }, + { + "hourly_rate": { + "amount": 1600, + "currency": "USD" + }, + "id": "FxLbs5KpPUHa8wyt5ctjubDX", + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": true, + "title": "Barista" + }, + { + "hourly_rate": { + "amount": 1700, + "currency": "USD" + }, + "id": "vD1wCgijMDR3cX5TPnu7VXto", + "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": true, + "title": "Cashier" + } + ] + } + }, + "ListTransactionsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListTransactions](api-endpoint:Transactions-ListTransactions) endpoint.\n\nOne of `errors` or `transactions` is present in a given response (never both).", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Transaction" + }, + "description": "An array of transactions that match your query." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor for retrieving the next set of results,\nif any remain. Provide this value as the `cursor` parameter in a subsequent\nrequest to this endpoint.\n\nSee [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information." + } + }, + "example": { + "transactions": [ + { + "created_at": "2016-01-20T22:57:56Z", + "id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "location_id": "18YC4JDH91E1H", + "product": "EXTERNAL_API", + "reference_id": "some optional reference id", + "refunds": [ + { + "additional_recipients": [ + { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "amount_money": { + "amount": 5000, + "currency": "USD" + }, + "created_at": "2016-01-20T22:59:20Z", + "id": "7a5RcVI0CxbOcJ2wMOkE", + "location_id": "18YC4JDH91E1H", + "processing_fee_money": { + "amount": 138, + "currency": "USD" + }, + "reason": "some reason why", + "status": "APPROVED", + "tender_id": "MtZRYYdDrYNQbOvV7nbuBvMF", + "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF" + } + ], + "tenders": [ + { + "additional_recipients": [ + { + "amount_money": { + "amount": 20, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "amount_money": { + "amount": 5000, + "currency": "USD" + }, + "card_details": { + "card": { + "card_brand": "VISA", + "last_4": "1111" + }, + "entry_method": "KEYED", + "status": "CAPTURED" + }, + "created_at": "2016-01-20T22:57:56Z", + "id": "MtZRYYdDrYNQbOvV7nbuBvMF", + "location_id": "18YC4JDH91E1H", + "note": "some optional note", + "processing_fee_money": { + "amount": 138, + "currency": "USD" + }, + "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "type": "CARD" + } + ] + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ListTransactions/ListTransactionsResponse.csharp", + "java": "/sdk_samples/ListTransactions/ListTransactionsResponse.java", + "javascript": "/sdk_samples/ListTransactions/ListTransactionsResponse.javascript", + "php": "/sdk_samples/ListTransactions/ListTransactionsResponse.php", + "python": "/sdk_samples/ListTransactions/ListTransactionsResponse.python", + "ruby": "/sdk_samples/ListTransactions/ListTransactionsResponse.ruby" + } + }, + "ListWebhookEventTypesResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListWebhookEventTypes](api-endpoint:WebhookSubscriptions-ListWebhookEventTypes) endpoint.\n\nNote: if there are errors processing the request, the event types field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "event_types": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of event types." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EventTypeMetadata" + }, + "description": "Contains the metadata of a webhook event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata)." + } + }, + "example": { + "event_types": [ + "inventory.count.updated" + ], + "metadata": [ + { + "api_version_introduced": "2018-07-12", + "event_type": "inventory.count.updated", + "release_status": "PUBLIC" + } + ] + } + }, + "ListWebhookSubscriptionsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [ListWebhookSubscriptions](api-endpoint:WebhookSubscriptions-ListWebhookSubscriptions) endpoint.\n\nNote: if there are errors processing the request, the subscriptions field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "subscriptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebhookSubscription" + }, + "description": "The requested list of [Subscription](entity:WebhookSubscription)s." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "subscriptions": [ + { + "api_version": "2021-12-15", + "created_at": "2022-01-10 23:29:48 +0000 UTC", + "enabled": true, + "event_types": [ + "payment.created", + "payment.updated" + ], + "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", + "name": "Example Webhook Subscription", + "notification_url": "https://example-webhook-url.com", + "updated_at": "2022-01-10 23:29:48 +0000 UTC" + } + ] + } + }, + "ListWorkweekConfigsResponse": { + "type": "object", + "description": "The response to a request for a set of `WorkweekConfig` objects. The response contains\nthe requested `WorkweekConfig` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "workweek_configs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorkweekConfig" + }, + "description": "A page of `WorkweekConfig` results." + }, + "cursor": { + "type": "string", + "description": "The value supplied in the subsequent request to fetch the next page of\n`WorkweekConfig` results." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + "workweek_configs": [ + { + "created_at": "2016-02-04T00:58:24Z", + "id": "FY4VCAQN700GM", + "start_of_day_local_time": "10:00", + "start_of_week": "MON", + "updated_at": "2019-02-28T01:04:35Z", + "version": 11 + } + ] + } + }, + "Location": { + "type": "object", + "description": "Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A short generated string of letters and numbers that uniquely identifies this location instance.", + "maxLength": 32, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the location.\nThis information appears in the Seller Dashboard as the nickname.\nA location name must be unique within a seller account.", + "maxLength": 255, + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address of the location.", + "nullable": true + }, + "timezone": { + "type": "string", + "description": "The [IANA time zone](https://www.iana.org/time-zones) identifier for\nthe time zone of the location. For example, `America/Los_Angeles`.", + "maxLength": 30, + "nullable": true + }, + "capabilities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LocationCapability" + }, + "description": "The Square features that are enabled for the location.\nSee [LocationCapability](entity:LocationCapability) for possible values.\nSee [LocationCapability](#type-locationcapability) for possible values", + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/LocationStatus", + "description": "The status of the location.\nSee [LocationStatus](#type-locationstatus) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the location was created, in RFC 3339 format.\nFor more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates).", + "minLength": 20, + "maxLength": 25, + "readOnly": true + }, + "merchant_id": { + "type": "string", + "description": "The ID of the merchant that owns the location.", + "maxLength": 32, + "readOnly": true + }, + "country": { + "$ref": "#/components/schemas/Country", + "description": "The country of the location, in the two-letter format of ISO 3166. For example, `US` or `JP`.\n\nSee [Country](entity:Country) for possible values.\nSee [Country](#type-country) for possible values", + "readOnly": true + }, + "language_code": { + "type": "string", + "description": "The language associated with the location, in\n[BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A).\nFor more information, see [Language Preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences).", + "minLength": 2, + "maxLength": 5, + "nullable": true + }, + "currency": { + "$ref": "#/components/schemas/Currency", + "description": "The currency used for all transactions at this location,\nin ISO 4217 format. For example, the currency code for US dollars is `USD`.\nSee [Currency](entity:Currency) for possible values.\nSee [Currency](#type-currency) for possible values", + "readOnly": true + }, + "phone_number": { + "type": "string", + "description": "The phone number of the location. For example, `+1 855-700-6000`.", + "maxLength": 17, + "nullable": true + }, + "business_name": { + "type": "string", + "description": "The name of the location's overall business. This name is present on receipts and other customer-facing branding, and can be changed no more than three times in a twelve-month period.", + "maxLength": 255, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/LocationType", + "description": "The type of the location.\nSee [LocationType](#type-locationtype) for possible values", + "nullable": true + }, + "website_url": { + "type": "string", + "description": "The website URL of the location. For example, `https://squareup.com`.", + "maxLength": 255, + "nullable": true + }, + "business_hours": { + "$ref": "#/components/schemas/BusinessHours", + "description": "The hours of operation for the location.", + "nullable": true + }, + "business_email": { + "type": "string", + "description": "The email address of the location. This can be unique to the location and is not always the email address for the business owner or administrator.", + "maxLength": 255, + "nullable": true + }, + "description": { + "type": "string", + "description": "The description of the location. For example, `Main Street location`.", + "maxLength": 1024, + "nullable": true + }, + "twitter_username": { + "type": "string", + "description": "The Twitter username of the location without the '@' symbol. For example, `Square`.", + "minLength": 1, + "maxLength": 15, + "nullable": true + }, + "instagram_username": { + "type": "string", + "description": "The Instagram username of the location without the '@' symbol. For example, `square`.", + "minLength": 1, + "maxLength": 30, + "nullable": true + }, + "facebook_url": { + "type": "string", + "description": "The Facebook profile URL of the location. The URL should begin with 'facebook.com/'. For example, `https://www.facebook.com/square`.", + "maxLength": 255, + "nullable": true + }, + "coordinates": { + "$ref": "#/components/schemas/Coordinates", + "description": "The physical coordinates (latitude and longitude) of the location.", + "nullable": true + }, + "logo_url": { + "type": "string", + "description": "The URL of the logo image for the location. When configured in the Seller\nDashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that Square generates on behalf of the seller.\nThis image should have a roughly square (1:1) aspect ratio and should be at least 200x200 pixels.", + "maxLength": 255, + "readOnly": true + }, + "pos_background_url": { + "type": "string", + "description": "The URL of the Point of Sale background image for the location.", + "maxLength": 255, + "readOnly": true + }, + "mcc": { + "type": "string", + "description": "A four-digit number that describes the kind of goods or services sold at the location.\nThe [merchant category code (MCC)](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) of the location as standardized by ISO 18245.\nFor example, `5045`, for a location that sells computer goods and software.", + "minLength": 4, + "maxLength": 4, + "x-release-status": "BETA", + "nullable": true + }, + "full_format_logo_url": { + "type": "string", + "description": "The URL of a full-format logo image for the location. When configured in the Seller\nDashboard (Receipts section), the logo appears on transactions (such as receipts and invoices) that Square generates on behalf of the seller.\nThis image can be wider than it is tall and should be at least 1280x648 pixels.", + "readOnly": true + }, + "tax_ids": { + "$ref": "#/components/schemas/TaxIds", + "description": "The tax IDs for this location.", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "LocationBookingProfile": { + "type": "object", + "description": "The booking profile of a seller's location, including the location's ID and whether the location is enabled for online booking.", + "x-release-status": "PUBLIC", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location).", + "nullable": true + }, + "booking_site_url": { + "type": "string", + "description": "Url for the online booking site for this location.", + "nullable": true + }, + "online_booking_enabled": { + "type": "boolean", + "description": "Indicates whether the location is enabled for online booking.", + "nullable": true + } + } + }, + "LocationCapability": { + "type": "string", + "enum": [ + "CREDIT_CARD_PROCESSING", + "AUTOMATIC_TRANSFERS", + "UNLINKED_REFUNDS" + ], + "x-enum-elements": [ + { + "name": "CREDIT_CARD_PROCESSING", + "description": "The capability to process credit card transactions with Square." + }, + { + "name": "AUTOMATIC_TRANSFERS", + "description": "The capability to receive automatic transfers from Square." + }, + { + "name": "UNLINKED_REFUNDS", + "description": "The capability to process unlinked refunds with Square." + } + ], + "description": "The capabilities a location might have.", + "x-release-status": "PUBLIC" + }, + "LocationCreatedEvent": { + "type": "object", + "description": "Published when a [Location](entity:Location) is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the [Location](entity:Location) associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"location.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LocationCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T21:27:34.308Z", + "data": { + "id": "S8GWD5DBJ3HF3", + "type": "Location" + }, + "event_id": "de45d351-8ad2-400a-97af-e9f89da3d19d", + "location_id": "S8GWD5DBJ3HF3", + "merchant_id": "6SSW7HV8K2ST5", + "type": "location.created" + }, + "x-webhook": { + "event": "location.created", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/Locations", + "x-since": "2020-10-28" + }, + "LocationCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"location\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated [Location](entity:Location)." + } + } + }, + "LocationCustomAttributeDefinitionOwnedCreatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition)\nis created by the subscribing application.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.owned.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T21:40:49.943Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "object": { + "created_at": "2022-11-26T21:40:49Z", + "description": "What region the location is in.", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "name": "Region Location", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-26T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "347ab320-c0ba-48f5-959a-4e147b9aefcf", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.owned.created" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.owned.created", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeDefinitionOwnedDeletedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition) \ncreated by the subscribing application is deleted. A custom attribute definition can only be deleted by \nthe application that created it.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-27T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "object": { + "created_at": "2022-11-26T21:40:49Z", + "description": "What region the location is in.", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "name": "Region Location", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "49363646-7ae7-49b5-aaa0-296610883c61", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.owned.deleted" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.owned.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeDefinitionOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition) \ncreated by the subscribing application is updated. A custom attribute definition can only be updated \nby the application that created it.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T01:22:29Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "object": { + "created_at": "2022-11-26T21:57:39Z", + "description": "What region the location is in.", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "name": "Operating Region", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "d914e6ef-9e37-4bca-a663-ecc55f5d98d3", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.owned.updated" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.owned.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeDefinitionVisibleCreatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is created. A notification is sent when your application \ncreates a custom attribute definition or another application creates a custom attribute definition whose\n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.visible.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-21T21:40:49.943Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "Square footage of the facility.", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "name": "Square Footage", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "f679dc4f-3619-4764-a4de-94a54735cd32", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.visible.created" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.visible.created", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeDefinitionVisibleDeletedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition) \nthat is visible to the subscribing application is deleted. A custom attribute definition can only \nbe deleted by the application that created it. A notification is sent when your application deletes \na custom attribute definition or when another application deletes a custom attribute definition whose \n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "object": { + "created_at": "2022-04-21T21:40:49Z", + "description": "Square footage of the facility.", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "name": "Facility Square Footage", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "81c10a07-c329-4943-af20-7d70a300c7e6", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.visible.deleted" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.visible.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeDefinitionVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute definition](entity:CustomAttributeDefinition) \nthat is visible to the subscribing application is updated. A custom attribute definition can only be updated\nby the application that created it. A notification is sent when your application updates a custom attribute \ndefinition or when another application updates a custom attribute definition whose `visibility` is \n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute_definition.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-04-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "object": { + "created_at": "2022-04-21T21:57:39Z", + "description": "Square footage of the facility.", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "name": "Facility Square Footage", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-04-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "ae376c21-d360-4694-96c7-1b27830f07d7", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute_definition.visible.updated" + }, + "x-webhook": { + "event": "location.custom_attribute_definition.visible.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeOwnedDeletedEvent": { + "type": "object", + "description": "Published when a location [custom attribute](entity:CustomAttribute) \nowned by the subscribing application is deleted. Custom attributes are owned by the\napplication that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).\nCustom attributes whose `visibility` is `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T21:40:54Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo:LOCATION:0V3BVT5RHZ835", + "object": { + "created_at": "2022-11-26T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "updated_at": "2022-11-27T12:40:54Z", + "value": "PNW", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "473795bf-6ce4-4595-88ae-a5e7cc690c02", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute.owned.deleted" + }, + "x-webhook": { + "event": "location.custom_attribute.owned.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute](entity:CustomAttribute) owned by the\nsubscribing application is created or updated. Custom attributes are owned by the application that created\nthe corresponding [custom attribute definition](entity:CustomAttributeDefinition). Custom attributes whose\n`visibility` is `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T21:40:54Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:favorite-shampoo:LOCATION:0V3BVT5RHZ835", + "object": { + "created_at": "2022-11-26T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:region-located", + "updated_at": "2022-11-26T21:40:54Z", + "value": "PNW", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "e26ca6f2-97f8-426a-b4bf-873044617e94", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute.owned.updated" + }, + "x-webhook": { + "event": "location.custom_attribute.owned.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeVisibleDeletedEvent": { + "type": "object", + "description": "Published when a location [custom attribute](entity:CustomAttribute) that is visible to the\nsubscribing application is deleted. A notification is sent when:\n- Your application deletes a custom attribute owned by your application, regardless of the `visibility` setting.\n- Any application deletes a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`\nor `VISIBILITY_READ_WRITE_VALUES`.\n\nCustom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be deleted by any application, but those set to\n`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be deleted by the owner. Custom attributes are owned\nby the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft:LOCATION:0V3BVT5RHZ835", + "object": { + "created_at": "2022-11-21T21:58:59Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "updated_at": "2022-11-27T11:31:29Z", + "value": "2718", + "version": 3, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "18ef5adc-2efc-4ad9-9b1a-b274a607da3e", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute.visible.deleted" + }, + "x-webhook": { + "event": "location.custom_attribute.visible.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationCustomAttributeVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a location [custom attribute](entity:CustomAttribute) that is visible\nto the subscribing application is created or updated. A notification is sent when:\n- Your application creates or updates a custom attribute owned by your application, regardless of the `visibility` setting.\n- Any application creates or updates a custom attribute whose `visibility` is `VISIBILITY_READ_ONLY`\nor `VISIBILITY_READ_WRITE_VALUES`.\n\nCustom attributes set to `VISIBILITY_READ_WRITE_VALUES` can be created or updated by any application, but those set to\n`VISIBILITY_READ_ONLY` or `VISIBILITY_HIDDEN` can only be created or updated by the owner. Custom attributes are owned\nby the application that created the corresponding [custom attribute definition](entity:CustomAttributeDefinition).", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"location.custom_attribute.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft:LOCATION:0V3BVT5RHZ835", + "object": { + "created_at": "2022-11-21T21:40:54Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:square-ft", + "updated_at": "2022-11-26T01:22:29Z", + "value": "2718", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "1cc2925c-f6e2-4fb6-a597-07c198de59e1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "location.custom_attribute.visible.updated" + }, + "x-webhook": { + "event": "location.custom_attribute.visible.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/LocationCustomAttributes", + "x-since": "2023-01-19" + }, + "LocationSettingsUpdatedEvent": { + "type": "object", + "description": "Published when online checkout location settings are updated", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"online_checkout.location_settings.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LocationSettingsUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2023-11-09T18:05:02.078121868Z", + "data": { + "id": "LJSYDQDQMDFNQ", + "object": { + "location_settings": { + "branding": { + "button_color": "#006aff", + "button_shape": "SQUARED", + "header_type": "FULL_WIDTH_LOGO" + }, + "coupons": { + "enabled": true + }, + "customer_notes_enabled": true, + "location_id": "LJSYDQDQMDFNQ", + "tipping": { + "default_percent": 15, + "default_smart_tip": { + "amount": 100, + "currency": "USD" + }, + "percentages": [ + 15, + 20, + 25 + ], + "smart_tipping_enabled": true, + "smart_tips": [ + { + "amount": 100, + "currency": "USD" + }, + { + "amount": 200, + "currency": "USD" + }, + { + "amount": 300, + "currency": "USD" + } + ] + }, + "updated_at": "2023-11-09 18:05:02 +0000 UTC" + } + }, + "type": "location_settings" + }, + "event_id": "eda83745-f27e-3812-a368-b61665e466f5", + "merchant_id": "MLX0WMXAER48M", + "type": "online_checkout.location_settings.updated" + }, + "x-webhook": { + "event": "online_checkout.location_settings.updated", + "scopes": [ + "MERCHANT_PROFILE_WRITE", + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/Checkout", + "x-since": "2023-12-13" + }, + "LocationSettingsUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the updated object’s type, `\"online_checkout.location_settings\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated location settings." + }, + "object": { + "$ref": "#/components/schemas/LocationSettingsUpdatedEventObject", + "description": "An object containing the updated location settings.", + "nullable": true + } + } + }, + "LocationSettingsUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "location_settings": { + "$ref": "#/components/schemas/CheckoutLocationSettings", + "description": "The updated location settings.", + "nullable": true + } + } + }, + "LocationStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "A location that is active for business." + }, + { + "name": "INACTIVE", + "description": "A location that is not active for business. Inactive locations provide historical\ninformation. Hide inactive locations unless the user has requested to see them." + } + ], + "description": "A location's status.", + "x-release-status": "PUBLIC" + }, + "LocationType": { + "type": "string", + "enum": [ + "PHYSICAL", + "MOBILE" + ], + "x-enum-elements": [ + { + "name": "PHYSICAL", + "description": "A place of business with a physical location." + }, + { + "name": "MOBILE", + "description": "A place of business that is mobile, such as a food truck or online store." + } + ], + "description": "A location's type.", + "x-release-status": "PUBLIC" + }, + "LocationUpdatedEvent": { + "type": "object", + "description": "Published when a [Location](entity:Location) is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the [Location](entity:Location) associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"location.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LocationUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T21:27:34.308Z", + "data": { + "id": "S8GWD5DBJ3HF3", + "type": "Location" + }, + "event_id": "de45d351-8ad2-400a-97af-e9f89da3d19d", + "location_id": "S8GWD5DBJ3HF3", + "merchant_id": "6SSW7HV8K2ST5", + "type": "location.updated" + }, + "x-webhook": { + "event": "location.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/Locations", + "x-since": "2020-10-28" + }, + "LocationUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"location\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated [Location](entity:Location)." + } + } + }, + "LoyaltyAccount": { + "type": "object", + "description": "Describes a loyalty account in a [loyalty program](entity:LoyaltyProgram). For more information, see\n[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts).", + "x-release-status": "PUBLIC", + "required": [ + "program_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the loyalty account.", + "maxLength": 36, + "readOnly": true + }, + "program_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram) to which the account belongs.", + "minLength": 1, + "maxLength": 36 + }, + "balance": { + "type": "integer", + "description": "The available point balance in the loyalty account. If points are scheduled to expire, they are listed in the `expiring_point_deadlines` field.\n\nYour application should be able to handle loyalty accounts that have a negative point balance (`balance` is less than 0). This might occur if a seller makes a manual adjustment or as a result of a refund or exchange.", + "readOnly": true + }, + "lifetime_points": { + "type": "integer", + "description": "The total points accrued during the lifetime of the account.", + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "The Square-assigned ID of the [customer](entity:Customer) that is associated with the account.", + "nullable": true + }, + "enrolled_at": { + "type": "string", + "description": "The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the **Enrolled On** or **Member Since** date in first-party Square products.\n\nIf this field is not set in a `CreateLoyaltyAccount` request, Square populates it after the buyer's first action on their account \n(when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service on Square Point of Sale. \n\nIf this field is set in a `CreateLoyaltyAccount` request, it is meant to be used when there is a loyalty migration from another system and into Square.\nIn that case, the timestamp can reflect when the buyer originally enrolled in the previous system. It may represent a current or past date, but cannot be set in the future.\nNote: Setting this field in this scenario does not, by itself, impact the first-party enrollment flow on Square Point of Sale.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the loyalty account was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the loyalty account was last updated, in RFC 3339 format.", + "readOnly": true + }, + "mapping": { + "$ref": "#/components/schemas/LoyaltyAccountMapping", + "description": "The mapping that associates the loyalty account with a buyer. Currently,\na loyalty account can only be mapped to a buyer by phone number.\n\nTo create a loyalty account, you must specify the `mapping` field, with the buyer's phone number\nin the `phone_number` field.", + "nullable": true + }, + "expiring_point_deadlines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyAccountExpiringPointDeadline" + }, + "description": "The schedule for when points expire in the loyalty account balance. This field is present only if the account has points that are scheduled to expire. \n\nThe total number of points in this field equals the number of points in the `balance` field.", + "nullable": true + } + } + }, + "LoyaltyAccountCreatedEvent": { + "type": "object", + "description": "Published when a [loyalty account](entity:LoyaltyAccount) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.account.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyAccountCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:41:35.157Z", + "data": { + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "object": { + "loyalty_account": { + "balance": 0, + "created_at": "2020-05-13T01:41:34Z", + "customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "enrolled_at": "2020-05-13T01:41:34Z", + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "lifetime_points": 0, + "mapping": { + "created_at": "2020-05-13T01:41:34Z", + "id": "664c22ba-9460-45a5-8917-381ae72dcfdc", + "phone_number": "+14155551234" + }, + "program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "updated_at": "2020-05-13T01:41:34Z" + } + }, + "type": "loyalty_account" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.account.created" + }, + "x-webhook": { + "event": "loyalty.account.created", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2020-05-28" + }, + "LoyaltyAccountCreatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.account.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_account`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty account." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyAccountCreatedEventObject", + "description": "An object that contains the new loyalty account.", + "nullable": true + } + } + }, + "LoyaltyAccountCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The loyalty account that was created.", + "nullable": true + } + } + }, + "LoyaltyAccountDeletedEvent": { + "type": "object", + "description": "Published when a [loyalty account](entity:LoyaltyAccount) is deleted.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.account.deleted`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyAccountDeletedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:50:45.656Z", + "data": { + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "object": { + "loyalty_account": { + "balance": 10, + "created_at": "2020-05-13T01:41:34Z", + "customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "enrolled_at": "2020-05-13T01:41:34Z", + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "lifetime_points": 10, + "mapping": { + "created_at": "2020-05-13T01:41:34Z", + "id": "664c22ba-9460-45a5-8917-381ae72dcfdc", + "phone_number": "+14155551234" + }, + "program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "updated_at": "2020-05-13T01:41:34Z" + } + }, + "type": "loyalty_account" + }, + "event_id": "7c365846-a64b-40ba-a406-8a0354a63d79", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.account.deleted" + }, + "x-webhook": { + "event": "loyalty.account.deleted", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2020-05-28" + }, + "LoyaltyAccountDeletedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.account.deleted` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_account`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty account." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyAccountDeletedEventObject", + "description": "An object that contains the loyalty account that was deleted.", + "nullable": true + } + } + }, + "LoyaltyAccountDeletedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The loyalty account that was deleted.", + "nullable": true + } + } + }, + "LoyaltyAccountExpiringPointDeadline": { + "type": "object", + "description": "Represents a set of points for a loyalty account that are scheduled to expire on a specific date.", + "x-release-status": "PUBLIC", + "required": [ + "points", + "expires_at" + ], + "properties": { + "points": { + "type": "integer", + "description": "The number of points scheduled to expire at the `expires_at` timestamp." + }, + "expires_at": { + "type": "string", + "description": "The timestamp of when the points are scheduled to expire, in RFC 3339 format.", + "minLength": 1 + } + } + }, + "LoyaltyAccountMapping": { + "type": "object", + "description": "Represents the mapping that associates a loyalty account with a buyer. \n\nCurrently, a loyalty account can only be mapped to a buyer by phone number. For more information, see \n[Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the mapping.", + "maxLength": 36, + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the mapping was created, in RFC 3339 format.", + "readOnly": true + }, + "phone_number": { + "type": "string", + "description": "The phone number of the buyer, in E.164 format. For example, \"+14155551111\".", + "nullable": true + } + } + }, + "LoyaltyAccountMappingType": { + "type": "string", + "enum": [ + "PHONE" + ], + "x-enum-elements": [ + { + "name": "PHONE", + "description": "The loyalty account is mapped by phone." + } + ], + "description": "The type of mapping.", + "x-release-status": "PUBLIC" + }, + "LoyaltyAccountUpdatedEvent": { + "type": "object", + "description": "Published when a [loyalty account](entity:LoyaltyAccount) is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.account.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyAccountUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:46:58.794Z", + "data": { + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "object": { + "loyalty_account": { + "balance": 10, + "created_at": "2020-05-13T01:41:34Z", + "customer_id": "QPTXM8PQNX3Q726ZYHPMNP46XC", + "enrolled_at": "2020-05-13T01:41:34Z", + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "lifetime_points": 10, + "mapping": { + "created_at": "2020-05-13T01:41:34Z", + "id": "664c22ba-9460-45a5-8917-381ae72dcfdc", + "phone_number": "+14155551234" + }, + "program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "updated_at": "2020-05-13T01:41:34Z" + } + }, + "type": "loyalty_account" + }, + "event_id": "3ca83966-230e-4a61-8484-22ea749ea765", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.account.updated" + }, + "x-webhook": { + "event": "loyalty.account.updated", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2020-05-28" + }, + "LoyaltyAccountUpdatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.account.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_account`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty account." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyAccountUpdatedEventObject", + "description": "An object that contains the loyalty account that was updated.", + "nullable": true + } + } + }, + "LoyaltyAccountUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The loyalty account that was updated.", + "nullable": true + } + } + }, + "LoyaltyEvent": { + "type": "object", + "description": "Provides information about a loyalty event. \nFor more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events).", + "x-release-status": "PUBLIC", + "required": [ + "id", + "type", + "created_at", + "loyalty_account_id", + "source" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the loyalty event.", + "minLength": 1, + "readOnly": true + }, + "type": { + "$ref": "#/components/schemas/LoyaltyEventType", + "description": "The type of the loyalty event.\nSee [LoyaltyEventType](#type-loyaltyeventtype) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the event was created, in RFC 3339 format.", + "minLength": 1, + "readOnly": true + }, + "accumulate_points": { + "$ref": "#/components/schemas/LoyaltyEventAccumulatePoints", + "description": "Provides metadata when the event `type` is `ACCUMULATE_POINTS`.", + "readOnly": true + }, + "create_reward": { + "$ref": "#/components/schemas/LoyaltyEventCreateReward", + "description": "Provides metadata when the event `type` is `CREATE_REWARD`.", + "readOnly": true + }, + "redeem_reward": { + "$ref": "#/components/schemas/LoyaltyEventRedeemReward", + "description": "Provides metadata when the event `type` is `REDEEM_REWARD`.", + "readOnly": true + }, + "delete_reward": { + "$ref": "#/components/schemas/LoyaltyEventDeleteReward", + "description": "Provides metadata when the event `type` is `DELETE_REWARD`.", + "readOnly": true + }, + "adjust_points": { + "$ref": "#/components/schemas/LoyaltyEventAdjustPoints", + "description": "Provides metadata when the event `type` is `ADJUST_POINTS`.", + "readOnly": true + }, + "loyalty_account_id": { + "type": "string", + "description": "The ID of the [loyalty account](entity:LoyaltyAccount) associated with the event.", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location) where the event occurred.", + "readOnly": true + }, + "source": { + "$ref": "#/components/schemas/LoyaltyEventSource", + "description": "Defines whether the event was generated by the Square Point of Sale.\nSee [LoyaltyEventSource](#type-loyaltyeventsource) for possible values", + "readOnly": true + }, + "expire_points": { + "$ref": "#/components/schemas/LoyaltyEventExpirePoints", + "description": "Provides metadata when the event `type` is `EXPIRE_POINTS`.", + "readOnly": true + }, + "other_event": { + "$ref": "#/components/schemas/LoyaltyEventOther", + "description": "Provides metadata when the event `type` is `OTHER`.", + "readOnly": true + }, + "accumulate_promotion_points": { + "$ref": "#/components/schemas/LoyaltyEventAccumulatePromotionPoints", + "description": "Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`.", + "readOnly": true + } + } + }, + "LoyaltyEventAccumulatePoints": { + "type": "object", + "description": "Provides metadata when the event `type` is `ACCUMULATE_POINTS`.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram).", + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points accumulated by the event.", + "minimum": 1, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) for which the buyer accumulated the points.\nThis field is returned only if the Orders API is used to process orders.", + "nullable": true + } + } + }, + "LoyaltyEventAccumulatePromotionPoints": { + "type": "object", + "description": "Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`.", + "x-release-status": "PUBLIC", + "required": [ + "points", + "order_id" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).", + "maxLength": 36, + "readOnly": true + }, + "loyalty_promotion_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty promotion](entity:LoyaltyPromotion).", + "minLength": 1, + "maxLength": 255, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points earned by the event.", + "readOnly": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) for which the buyer earned the promotion points.\nOnly applications that use the Orders API to process orders can trigger this event.", + "minLength": 1, + "readOnly": true + } + } + }, + "LoyaltyEventAdjustPoints": { + "type": "object", + "description": "Provides metadata when the event `type` is `ADJUST_POINTS`.", + "x-release-status": "PUBLIC", + "required": [ + "points" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).", + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points added or removed." + }, + "reason": { + "type": "string", + "description": "The reason for the adjustment of points.", + "maxLength": 3500, + "nullable": true + } + } + }, + "LoyaltyEventCreateReward": { + "type": "object", + "description": "Provides metadata when the event `type` is `CREATE_REWARD`.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_program_id", + "points" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram).", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "reward_id": { + "type": "string", + "description": "The Square-assigned ID of the created [loyalty reward](entity:LoyaltyReward).\nThis field is returned only if the event source is `LOYALTY_API`.", + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The loyalty points used to create the reward.", + "readOnly": true + } + } + }, + "LoyaltyEventCreatedEvent": { + "type": "object", + "description": "Published when a [loyalty event](entity:LoyaltyEvent) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.event.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyEventCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:46:58.783Z", + "data": { + "id": "iirpaae81f66e-a7ea-4fcf-a04f-f0d29fdc60e6", + "object": { + "loyalty_event": { + "adjust_points": { + "loyalty_program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "points": 10 + }, + "created_at": "2020-05-13T01:46:58Z", + "id": "d0bd89a5-3d04-389e-a54b-4e509658fe41", + "location_id": "2Z3BMKQB939X0", + "loyalty_account_id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "source": "SQUARE", + "type": "ADJUST_POINTS" + } + }, + "type": "loyalty_event" + }, + "event_id": "f151e2c6-9340-4cca-9d37-1bcd1c2d6a0d", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.event.created" + }, + "x-webhook": { + "event": "loyalty.event.created", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2020-05-28" + }, + "LoyaltyEventCreatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.event.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_event`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected loyalty event." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyEventCreatedEventObject", + "description": "An object that contains the new loyalty event.", + "nullable": true + } + } + }, + "LoyaltyEventCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_event": { + "$ref": "#/components/schemas/LoyaltyEvent", + "description": "The loyalty event that was created.", + "nullable": true + } + } + }, + "LoyaltyEventDateTimeFilter": { + "type": "object", + "description": "Filter events by date time range.", + "x-release-status": "PUBLIC", + "required": [ + "created_at" + ], + "properties": { + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The `created_at` date time range used to filter the result." + } + } + }, + "LoyaltyEventDeleteReward": { + "type": "object", + "description": "Provides metadata when the event `type` is `DELETE_REWARD`.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_program_id", + "points" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram).", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "reward_id": { + "type": "string", + "description": "The ID of the deleted [loyalty reward](entity:LoyaltyReward).\nThis field is returned only if the event source is `LOYALTY_API`.", + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points returned to the loyalty account.", + "readOnly": true + } + } + }, + "LoyaltyEventExpirePoints": { + "type": "object", + "description": "Provides metadata when the event `type` is `EXPIRE_POINTS`.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_program_id", + "points" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points expired." + } + } + }, + "LoyaltyEventFilter": { + "type": "object", + "description": "The filtering criteria. If the request specifies multiple filters, \nthe endpoint uses a logical AND to evaluate them.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_account_filter": { + "$ref": "#/components/schemas/LoyaltyEventLoyaltyAccountFilter", + "description": "Filter events by loyalty account.", + "nullable": true + }, + "type_filter": { + "$ref": "#/components/schemas/LoyaltyEventTypeFilter", + "description": "Filter events by event type.", + "nullable": true + }, + "date_time_filter": { + "$ref": "#/components/schemas/LoyaltyEventDateTimeFilter", + "description": "Filter events by date time range. \nFor each range, the start time is inclusive and the end time \nis exclusive.", + "nullable": true + }, + "location_filter": { + "$ref": "#/components/schemas/LoyaltyEventLocationFilter", + "description": "Filter events by location.", + "nullable": true + }, + "order_filter": { + "$ref": "#/components/schemas/LoyaltyEventOrderFilter", + "description": "Filter events by the order associated with the event.", + "nullable": true + } + } + }, + "LoyaltyEventLocationFilter": { + "type": "object", + "description": "Filter events by location.", + "x-release-status": "PUBLIC", + "required": [ + "location_ids" + ], + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The [location](entity:Location) IDs for loyalty events to query.\nIf multiple values are specified, the endpoint uses \na logical OR to combine them." + } + } + }, + "LoyaltyEventLoyaltyAccountFilter": { + "type": "object", + "description": "Filter events by loyalty account.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_account_id" + ], + "properties": { + "loyalty_account_id": { + "type": "string", + "description": "The ID of the [loyalty account](entity:LoyaltyAccount) associated with loyalty events.", + "minLength": 1 + } + } + }, + "LoyaltyEventOrderFilter": { + "type": "object", + "description": "Filter events by the order associated with the event.", + "x-release-status": "PUBLIC", + "required": [ + "order_id" + ], + "properties": { + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) associated with the event.", + "minLength": 1 + } + } + }, + "LoyaltyEventOther": { + "type": "object", + "description": "Provides metadata when the event `type` is `OTHER`.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_program_id", + "points" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The number of points added or removed." + } + } + }, + "LoyaltyEventQuery": { + "type": "object", + "description": "Represents a query used to search for loyalty events.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/LoyaltyEventFilter", + "description": "The query filter criteria.", + "nullable": true + } + } + }, + "LoyaltyEventRedeemReward": { + "type": "object", + "description": "Provides metadata when the event `type` is `REDEEM_REWARD`.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_program_id" + ], + "properties": { + "loyalty_program_id": { + "type": "string", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram).", + "minLength": 1, + "maxLength": 36, + "readOnly": true + }, + "reward_id": { + "type": "string", + "description": "The ID of the redeemed [loyalty reward](entity:LoyaltyReward).\nThis field is returned only if the event source is `LOYALTY_API`.", + "maxLength": 36, + "readOnly": true + }, + "order_id": { + "type": "string", + "description": "The ID of the [order](entity:Order) that redeemed the reward.\nThis field is returned only if the Orders API is used to process orders.", + "readOnly": true + } + } + }, + "LoyaltyEventSource": { + "type": "string", + "enum": [ + "SQUARE", + "LOYALTY_API" + ], + "x-enum-elements": [ + { + "name": "SQUARE", + "description": "The event is generated by the Square Point of Sale (POS)." + }, + { + "name": "LOYALTY_API", + "description": "The event is generated by something other than the Square Point of Sale that used the Loyalty API." + } + ], + "description": "Defines whether the event was generated by the Square Point of Sale.", + "x-release-status": "PUBLIC" + }, + "LoyaltyEventType": { + "type": "string", + "enum": [ + "ACCUMULATE_POINTS", + "CREATE_REWARD", + "REDEEM_REWARD", + "DELETE_REWARD", + "ADJUST_POINTS", + "EXPIRE_POINTS", + "OTHER", + "ACCUMULATE_PROMOTION_POINTS" + ], + "x-enum-elements": [ + { + "name": "ACCUMULATE_POINTS", + "description": "Points are added to a loyalty account for a purchase that\nqualified for points based on an [accrual rule](entity:LoyaltyProgramAccrualRule)." + }, + { + "name": "CREATE_REWARD", + "description": "A [loyalty reward](entity:LoyaltyReward) is created." + }, + { + "name": "REDEEM_REWARD", + "description": "A loyalty reward is redeemed." + }, + { + "name": "DELETE_REWARD", + "description": "A loyalty reward is deleted." + }, + { + "name": "ADJUST_POINTS", + "description": "Loyalty points are manually adjusted." + }, + { + "name": "EXPIRE_POINTS", + "description": "Loyalty points are expired according to the \nexpiration policy of the loyalty program." + }, + { + "name": "OTHER", + "description": "Some other loyalty event occurred." + }, + { + "name": "ACCUMULATE_PROMOTION_POINTS", + "description": " Points are added to a loyalty account for a purchase that\nqualified for a [loyalty promotion](entity:LoyaltyPromotion)." + } + ], + "description": "The type of the loyalty event.", + "x-release-status": "PUBLIC" + }, + "LoyaltyEventTypeFilter": { + "type": "object", + "description": "Filter events by event type.", + "x-release-status": "PUBLIC", + "required": [ + "types" + ], + "properties": { + "types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyEventType" + }, + "description": "The loyalty event types used to filter the result.\nIf multiple values are specified, the endpoint uses a \nlogical OR to combine them.\nSee [LoyaltyEventType](#type-loyaltyeventtype) for possible values" + } + } + }, + "LoyaltyProgram": { + "type": "object", + "description": "Represents a Square loyalty program. Loyalty programs define how buyers can earn points and redeem points for rewards. \nSquare sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. \nFor more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the loyalty program. Updates to \nthe loyalty program do not modify the identifier.", + "maxLength": 36, + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/LoyaltyProgramStatus", + "description": "Whether the program is currently active.\nSee [LoyaltyProgramStatus](#type-loyaltyprogramstatus) for possible values", + "nullable": true + }, + "reward_tiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyProgramRewardTier" + }, + "description": "The list of rewards for buyers, sorted by ascending points.", + "nullable": true + }, + "expiration_policy": { + "$ref": "#/components/schemas/LoyaltyProgramExpirationPolicy", + "description": "If present, details for how points expire.", + "nullable": true + }, + "terminology": { + "$ref": "#/components/schemas/LoyaltyProgramTerminology", + "description": "A cosmetic name for the “points” currency.", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The [locations](entity:Location) at which the program is active.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the program was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the reward was last updated, in RFC 3339 format.", + "readOnly": true + }, + "accrual_rules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRule" + }, + "description": "Defines how buyers can earn loyalty points from the base loyalty program.\nTo check for associated [loyalty promotions](entity:LoyaltyPromotion) that enable\nbuyers to earn extra points, call [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions).", + "nullable": true + } + } + }, + "LoyaltyProgramAccrualRule": { + "type": "object", + "description": "Represents an accrual rule, which defines how buyers can earn points from the base [loyalty program](entity:LoyaltyProgram).", + "x-release-status": "PUBLIC", + "required": [ + "accrual_type" + ], + "properties": { + "accrual_type": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleType", + "description": "The type of the accrual rule that defines how buyers can earn points.\nSee [LoyaltyProgramAccrualRuleType](#type-loyaltyprogramaccrualruletype) for possible values" + }, + "points": { + "type": "integer", + "description": "The number of points that \nbuyers earn based on the `accrual_type`.", + "minimum": 1, + "nullable": true + }, + "visit_data": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleVisitData", + "description": "Additional data for rules with the `VISIT` accrual type.", + "nullable": true + }, + "spend_data": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleSpendData", + "description": "Additional data for rules with the `SPEND` accrual type.", + "nullable": true + }, + "item_variation_data": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleItemVariationData", + "description": "Additional data for rules with the `ITEM_VARIATION` accrual type.", + "nullable": true + }, + "category_data": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleCategoryData", + "description": "Additional data for rules with the `CATEGORY` accrual type.", + "nullable": true + } + } + }, + "LoyaltyProgramAccrualRuleCategoryData": { + "type": "object", + "description": "Represents additional data for rules with the `CATEGORY` accrual type.", + "x-release-status": "PUBLIC", + "required": [ + "category_id" + ], + "properties": { + "category_id": { + "type": "string", + "description": "The ID of the `CATEGORY` [catalog object](entity:CatalogObject) that buyers can purchase to earn\npoints.", + "minLength": 1 + } + } + }, + "LoyaltyProgramAccrualRuleItemVariationData": { + "type": "object", + "description": "Represents additional data for rules with the `ITEM_VARIATION` accrual type.", + "x-release-status": "PUBLIC", + "required": [ + "item_variation_id" + ], + "properties": { + "item_variation_id": { + "type": "string", + "description": "The ID of the `ITEM_VARIATION` [catalog object](entity:CatalogObject) that buyers can purchase to earn\npoints.", + "minLength": 1 + } + } + }, + "LoyaltyProgramAccrualRuleSpendData": { + "type": "object", + "description": "Represents additional data for rules with the `SPEND` accrual type.", + "x-release-status": "PUBLIC", + "required": [ + "amount_money", + "tax_mode" + ], + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount that buyers must spend to earn points. \nFor example, given an \"Earn 1 point for every $10 spent\" accrual rule, a buyer who spends $105 earns 10 points." + }, + "excluded_category_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of any `CATEGORY` catalog objects that are excluded from points accrual.\n\nYou can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects)\nendpoint to retrieve information about the excluded categories.", + "nullable": true + }, + "excluded_item_variation_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of any `ITEM_VARIATION` catalog objects that are excluded from points accrual.\n\nYou can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects)\nendpoint to retrieve information about the excluded item variations.", + "nullable": true + }, + "tax_mode": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleTaxMode", + "description": "Indicates how taxes should be treated when calculating the purchase amount used for points accrual.\nSee [LoyaltyProgramAccrualRuleTaxMode](#type-loyaltyprogramaccrualruletaxmode) for possible values" + } + } + }, + "LoyaltyProgramAccrualRuleTaxMode": { + "type": "string", + "enum": [ + "BEFORE_TAX", + "AFTER_TAX" + ], + "x-enum-elements": [ + { + "name": "BEFORE_TAX", + "description": "Exclude taxes from the purchase amount used for loyalty points accrual." + }, + { + "name": "AFTER_TAX", + "description": "Include taxes in the purchase amount used for loyalty points accrual." + } + ], + "description": "Indicates how taxes should be treated when calculating the purchase amount used for loyalty points accrual. \nThis setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum spend requirement.", + "x-release-status": "PUBLIC" + }, + "LoyaltyProgramAccrualRuleType": { + "type": "string", + "enum": [ + "VISIT", + "SPEND", + "ITEM_VARIATION", + "CATEGORY" + ], + "x-enum-elements": [ + { + "name": "VISIT", + "description": "A visit-based accrual rule. A buyer earns points for each visit. \nYou can specify the minimum purchase required." + }, + { + "name": "SPEND", + "description": "A spend-based accrual rule. A buyer earns points based on the amount \nspent." + }, + { + "name": "ITEM_VARIATION", + "description": "An accrual rule based on an item variation. For example, accrue \npoints for purchasing a coffee." + }, + { + "name": "CATEGORY", + "description": "An accrual rule based on an item category. For example, accrue points \nfor purchasing any item in the \"hot drink\" category: coffee, tea, or hot cocoa." + } + ], + "description": "The type of the accrual rule that defines how buyers can earn points.", + "x-release-status": "PUBLIC" + }, + "LoyaltyProgramAccrualRuleVisitData": { + "type": "object", + "description": "Represents additional data for rules with the `VISIT` accrual type.", + "x-release-status": "PUBLIC", + "required": [ + "tax_mode" + ], + "properties": { + "minimum_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The minimum purchase required during the visit to quality for points.", + "nullable": true + }, + "tax_mode": { + "$ref": "#/components/schemas/LoyaltyProgramAccrualRuleTaxMode", + "description": "Indicates how taxes should be treated when calculating the purchase amount to determine whether the visit qualifies for points. \nThis setting applies only if `minimum_amount_money` is specified.\nSee [LoyaltyProgramAccrualRuleTaxMode](#type-loyaltyprogramaccrualruletaxmode) for possible values" + } + } + }, + "LoyaltyProgramCreatedEvent": { + "type": "object", + "description": "Published when a [loyalty program](entity:LoyaltyProgram) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.program.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyProgramCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:38:42.785Z", + "data": { + "id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "object": { + "loyalty_program": { + "accrual_rules": [ + { + "accrual_type": "SPEND", + "points": 1, + "spend_data": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "tax_mode": "BEFORE_TAX" + } + } + ], + "created_at": "2019-08-19T18:22:46Z", + "id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "location_ids": [ + "2Z3BMKQB939X0" + ], + "reward_tiers": [ + { + "created_at": "2019-08-19T18:22:45Z", + "id": "927cab58-09cd-410f-aa68-a44015d8bbbb", + "name": "5% off entire sale", + "points": 5, + "pricing_rule_reference": { + "catalog_version": "1603960067138", + "object_id": "ZKFKBH5IINTZLY3VA2OWIFX3" + } + }, + { + "created_at": "2020-05-13T01:38:40Z", + "id": "aa5373ef-191d-4cb5-b122-8e8de41ab32f", + "name": "20% off entire sale", + "points": 15, + "pricing_rule_reference": { + "catalog_version": "1605486402527", + "object_id": "74C4JSHESNLTB2A7ITO5HO6F" + } + } + ], + "status": "ACTIVE", + "terminology": { + "one": "Point", + "other": "Points" + }, + "updated_at": "2020-05-13T01:38:40Z" + } + }, + "type": "loyalty_program" + }, + "event_id": "b10404b2-08c4-4c66-9299-c11feceb43dd", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.program.created" + }, + "x-webhook": { + "event": "loyalty.program.created", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2021-04-21" + }, + "LoyaltyProgramCreatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.program.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_program`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the created loyalty program." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyProgramCreatedEventObject", + "description": "An object that contains the loyalty program that was created.", + "nullable": true + } + } + }, + "LoyaltyProgramCreatedEventObject": { + "type": "object", + "description": "An object that contains the loyalty program associated with a `loyalty.program.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_program": { + "$ref": "#/components/schemas/LoyaltyProgram", + "description": "The loyalty program that was created.", + "nullable": true + } + } + }, + "LoyaltyProgramExpirationPolicy": { + "type": "object", + "description": "Describes when the loyalty program expires.", + "x-release-status": "PUBLIC", + "required": [ + "expiration_duration" + ], + "properties": { + "expiration_duration": { + "type": "string", + "description": "The number of months before points expire, in `P[n]M` RFC 3339 duration format. For example, a value of `P12M` represents a duration of 12 months. \nPoints are valid through the last day of the month in which they are scheduled to expire. For example, with a `P12M` duration, points earned on July 6, 2020 expire on August 1, 2021.", + "minLength": 1 + } + } + }, + "LoyaltyProgramRewardTier": { + "type": "object", + "description": "Represents a reward tier in a loyalty program. A reward tier defines how buyers can redeem points for a reward, such as the number of points required and the value and scope of the discount. A loyalty program can offer multiple reward tiers.", + "x-release-status": "PUBLIC", + "required": [ + "points", + "pricing_rule_reference" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the reward tier.", + "maxLength": 36, + "readOnly": true + }, + "points": { + "type": "integer", + "description": "The points exchanged for the reward tier.", + "minimum": 1 + }, + "name": { + "type": "string", + "description": "The name of the reward tier.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the reward tier was created, in RFC 3339 format.", + "readOnly": true + }, + "pricing_rule_reference": { + "$ref": "#/components/schemas/CatalogObjectReference", + "description": "A reference to the specific version of a `PRICING_RULE` catalog object that contains information about the reward tier discount.\n\nUse `object_id` and `catalog_version` with the [RetrieveCatalogObject](api-endpoint:Catalog-RetrieveCatalogObject) endpoint\nto get discount details. Make sure to set `include_related_objects` to true in the request to retrieve all catalog objects\nthat define the discount. For more information, see [Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details)." + } + } + }, + "LoyaltyProgramStatus": { + "type": "string", + "enum": [ + "INACTIVE", + "ACTIVE" + ], + "x-enum-elements": [ + { + "name": "INACTIVE", + "description": "The loyalty program does not have an active subscription. \nLoyalty API requests fail." + }, + { + "name": "ACTIVE", + "description": "The program is fully functional. The program has an active subscription." + } + ], + "description": "Indicates whether the program is currently active.", + "x-release-status": "PUBLIC" + }, + "LoyaltyProgramTerminology": { + "type": "object", + "description": "Represents the naming used for loyalty points.", + "x-release-status": "PUBLIC", + "required": [ + "one", + "other" + ], + "properties": { + "one": { + "type": "string", + "description": "A singular unit for a point (for example, 1 point is called 1 star).", + "minLength": 1 + }, + "other": { + "type": "string", + "description": "A plural unit for point (for example, 10 points is called 10 stars).", + "minLength": 1 + } + } + }, + "LoyaltyProgramUpdatedEvent": { + "type": "object", + "description": "Published when a [loyalty program](entity:LoyaltyProgram) is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.program.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyProgramUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-05-13T01:38:42.785Z", + "data": { + "id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "object": { + "loyalty_program": { + "accrual_rules": [ + { + "accrual_type": "SPEND", + "points": 1, + "spend_data": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "tax_mode": "BEFORE_TAX" + } + } + ], + "created_at": "2019-08-19T18:22:46Z", + "id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "location_ids": [ + "2Z3BMKQB939X0" + ], + "reward_tiers": [ + { + "created_at": "2019-08-19T18:22:45Z", + "id": "927cab58-09cd-410f-aa68-a44015d8bbbb", + "name": "5% off entire sale", + "points": 5, + "pricing_rule_reference": { + "catalog_version": "1603960067138", + "object_id": "ZKFKBH5IINTZLY3VA2OWIFX3" + } + }, + { + "created_at": "2020-05-13T01:38:40Z", + "id": "aa5373ef-191d-4cb5-b122-8e8de41ab32f", + "name": "20% off entire sale", + "points": 15, + "pricing_rule_reference": { + "catalog_version": "1605486402527", + "object_id": "74C4JSHESNLTB2A7ITO5HO6F" + } + } + ], + "status": "ACTIVE", + "terminology": { + "one": "Point", + "other": "Points" + }, + "updated_at": "2020-05-13T01:38:40Z" + } + }, + "type": "loyalty_program" + }, + "event_id": "b10404b2-08c4-4c66-9299-c11feceb43dd", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.program.updated" + }, + "x-webhook": { + "event": "loyalty.program.updated", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2020-05-28" + }, + "LoyaltyProgramUpdatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.program.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_program`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty program." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyProgramUpdatedEventObject", + "description": "An object that contains the loyalty program that was updated.", + "nullable": true + } + } + }, + "LoyaltyProgramUpdatedEventObject": { + "type": "object", + "description": "An object that contains the loyalty program associated with a `loyalty.program.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_program": { + "$ref": "#/components/schemas/LoyaltyProgram", + "description": "The loyalty program that was updated.", + "nullable": true + } + } + }, + "LoyaltyPromotion": { + "type": "object", + "description": "Represents a promotion for a [loyalty program](entity:LoyaltyProgram). Loyalty promotions enable buyers\nto earn extra points on top of those earned from the base program.\n\nA loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status.", + "x-release-status": "PUBLIC", + "required": [ + "name", + "incentive", + "available_time" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the promotion.", + "minLength": 1, + "maxLength": 255, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the promotion.", + "minLength": 1, + "maxLength": 70 + }, + "incentive": { + "$ref": "#/components/schemas/LoyaltyPromotionIncentive", + "description": "The points incentive for the promotion. This field defines whether promotion points\nare earned by multiplying base program points or by adding a specified number of points." + }, + "available_time": { + "$ref": "#/components/schemas/LoyaltyPromotionAvailableTimeData", + "description": "The scheduling information that defines when purchases can qualify to earn points from an `ACTIVE` promotion." + }, + "trigger_limit": { + "$ref": "#/components/schemas/LoyaltyPromotionTriggerLimit", + "description": "The number of times a buyer can earn promotion points during a specified interval.\nIf not specified, buyers can trigger the promotion an unlimited number of times.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/LoyaltyPromotionStatus", + "description": "The current status of the promotion.\nSee [LoyaltyPromotionStatus](#type-loyaltypromotionstatus) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the promotion was created, in RFC 3339 format.", + "readOnly": true + }, + "canceled_at": { + "type": "string", + "description": "The timestamp of when the promotion was canceled, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the promotion was last updated, in RFC 3339 format.", + "readOnly": true + }, + "loyalty_program_id": { + "type": "string", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram) associated with the promotion.", + "readOnly": true + }, + "minimum_spend_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The minimum purchase amount required to earn promotion points. If specified, this amount is positive.", + "nullable": true + }, + "qualifying_item_variation_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of any qualifying `ITEM_VARIATION` [catalog objects](entity:CatalogObject). If specified,\nthe purchase must include at least one of these items to qualify for the promotion.\n\nThis option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule.\nWith `SPEND` accrual rules, make sure that qualifying promotional items are not excluded.\n\nYou can specify `qualifying_item_variation_ids` or `qualifying_category_ids` for a given promotion, but not both.", + "nullable": true + }, + "qualifying_category_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of any qualifying `CATEGORY` [catalog objects](entity:CatalogObject). If specified,\nthe purchase must include at least one item from one of these categories to qualify for the promotion.\n\nThis option is valid only if the base loyalty program uses a `VISIT` or `SPEND` accrual rule.\nWith `SPEND` accrual rules, make sure that qualifying promotional items are not excluded.\n\nYou can specify `qualifying_category_ids` or `qualifying_item_variation_ids` for a promotion, but not both.", + "nullable": true + } + } + }, + "LoyaltyPromotionAvailableTimeData": { + "type": "object", + "description": "Represents scheduling information that determines when purchases can qualify to earn points\nfrom a [loyalty promotion](entity:LoyaltyPromotion).", + "x-release-status": "PUBLIC", + "required": [ + "time_periods" + ], + "properties": { + "start_date": { + "type": "string", + "description": "The date that the promotion starts, in `YYYY-MM-DD` format. Square populates this field\nbased on the provided `time_periods`.", + "readOnly": true + }, + "end_date": { + "type": "string", + "description": "The date that the promotion ends, in `YYYY-MM-DD` format. Square populates this field\nbased on the provided `time_periods`. If an end date is not specified, an `ACTIVE` promotion\nremains available until it is canceled.", + "readOnly": true + }, + "time_periods": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of [iCalendar (RFC 5545) events](https://tools.ietf.org/html/rfc5545#section-3.6.1)\n(`VEVENT`). Each event represents an available time period per day or days of the week. \nA day can have a maximum of one available time period.\n\nOnly `DTSTART`, `DURATION`, and `RRULE` are supported. `DTSTART` and `DURATION` are required and\ntimestamps must be in local (unzoned) time format. Include `RRULE` to specify recurring promotions,\nan end date (using the `UNTIL` keyword), or both. For more information, see\n[Available time](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#available-time).\n\nNote that `BEGIN:VEVENT` and `END:VEVENT` are optional in a `CreateLoyaltyPromotion` request\nbut are always included in the response." + } + } + }, + "LoyaltyPromotionCreatedEvent": { + "type": "object", + "description": "Published when a [loyalty promotion](entity:LoyaltyPromotion) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.promotion.created`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyPromotionCreatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-06-03T01:41:34Z", + "data": { + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "object": { + "loyalty_promotion": { + "available_time": { + "start_date": "2022-06-06", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220612T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=SU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220606T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=MO\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220607T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220608T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=WE\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220609T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=TH\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220610T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=FR\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220611T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=SA\nEND:VEVENT" + ] + }, + "created_at": "2022-06-03T01:41:34Z", + "id": "loypromo_ba2f8ab6-e131-46d9-9882-17714404eb49", + "incentive": { + "points_addition_data": { + "points_addition": 5 + }, + "type": "POINTS_ADDITION" + }, + "loyalty_program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Happy Hour", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "status": "SCHEDULED", + "updated_at": "2022-06-03T01:41:34Z" + } + }, + "type": "loyalty_promotion" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.promotion.created" + }, + "x-webhook": { + "event": "loyalty.promotion.created", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2022-08-17" + }, + "LoyaltyPromotionCreatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.promotion.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_promotion`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty promotion." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyPromotionCreatedEventObject", + "description": "An object that contains the loyalty promotion that was created.", + "nullable": true + } + } + }, + "LoyaltyPromotionCreatedEventObject": { + "type": "object", + "description": "An object that contains the loyalty promotion associated with a `loyalty.promotion.created` event.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The loyalty promotion that was created.", + "nullable": true + } + } + }, + "LoyaltyPromotionIncentive": { + "type": "object", + "description": "Represents how points for a [loyalty promotion](entity:LoyaltyPromotion) are calculated,\neither by multiplying the points earned from the base program or by adding a specified number\nof points to the points earned from the base program.", + "x-release-status": "PUBLIC", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/LoyaltyPromotionIncentiveType", + "description": "The type of points incentive.\nSee [LoyaltyPromotionIncentiveType](#type-loyaltypromotionincentivetype) for possible values" + }, + "points_multiplier_data": { + "$ref": "#/components/schemas/LoyaltyPromotionIncentivePointsMultiplierData", + "description": "Additional data for a `POINTS_MULTIPLIER` incentive type.", + "nullable": true + }, + "points_addition_data": { + "$ref": "#/components/schemas/LoyaltyPromotionIncentivePointsAdditionData", + "description": "Additional data for a `POINTS_ADDITION` incentive type.", + "nullable": true + } + } + }, + "LoyaltyPromotionIncentivePointsAdditionData": { + "type": "object", + "description": "Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive).", + "x-release-status": "PUBLIC", + "required": [ + "points_addition" + ], + "properties": { + "points_addition": { + "type": "integer", + "description": "The number of additional points to earn each time the promotion is triggered. For example,\nsuppose a purchase qualifies for 5 points from the base loyalty program. If the purchase also\nqualifies for a `POINTS_ADDITION` promotion incentive with a `points_addition` of 3, the buyer\nearns a total of 8 points (5 program points + 3 promotion points = 8 points).", + "minimum": 1 + } + } + }, + "LoyaltyPromotionIncentivePointsMultiplierData": { + "type": "object", + "description": "Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive).", + "x-release-status": "PUBLIC", + "properties": { + "points_multiplier": { + "type": "integer", + "description": "The multiplier used to calculate the number of points earned each time the promotion\nis triggered. For example, suppose a purchase qualifies for 5 points from the base loyalty program.\nIf the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive with a `points_multiplier`\nof 3, the buyer earns a total of 15 points (5 program points x 3 promotion multiplier = 15 points).\n\nDEPRECATED at version 2023-08-16. Replaced by the `multiplier` field.\n\nOne of the following is required when specifying a points multiplier:\n- (Recommended) The `multiplier` field.\n- This deprecated `points_multiplier` field. If provided in the request, Square also returns `multiplier`\nwith the equivalent value.", + "minimum": 2, + "maximum": 10, + "x-release-status": "DEPRECATED", + "nullable": true + }, + "multiplier": { + "type": "string", + "description": "The multiplier used to calculate the number of points earned each time the promotion is triggered,\nspecified as a string representation of a decimal. Square supports multipliers up to 10x, with three\npoint precision for decimal multipliers. For example, suppose a purchase qualifies for 4 points from the\nbase loyalty program. If the purchase also qualifies for a `POINTS_MULTIPLIER` promotion incentive with a\n`multiplier` of \"1.5\", the buyer earns a total of 6 points (4 program points x 1.5 promotion multiplier = 6 points).\nFractional points are dropped.\n\nOne of the following is required when specifying a points multiplier:\n- (Recommended) This `multiplier` field.\n- The deprecated `points_multiplier` field. If provided in the request, Square also returns `multiplier`\nwith the equivalent value.", + "maxLength": 5, + "nullable": true + } + } + }, + "LoyaltyPromotionIncentiveType": { + "type": "string", + "enum": [ + "POINTS_MULTIPLIER", + "POINTS_ADDITION" + ], + "x-enum-elements": [ + { + "name": "POINTS_MULTIPLIER", + "description": "Multiply the number of points earned from the base loyalty program.\nFor example, \"Earn double points.\"" + }, + { + "name": "POINTS_ADDITION", + "description": "Add a specified number of points to those earned from the base loyalty program.\nFor example, \"Earn 10 additional points.\"" + } + ], + "description": "Indicates the type of points incentive for a [loyalty promotion](entity:LoyaltyPromotion),\nwhich is used to determine how buyers can earn points from the promotion.", + "x-release-status": "PUBLIC" + }, + "LoyaltyPromotionStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "ENDED", + "CANCELED", + "SCHEDULED" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "The loyalty promotion is currently active. Buyers can earn points for purchases\nthat meet the promotion conditions, such as the promotion's `available_time`." + }, + { + "name": "ENDED", + "description": "The loyalty promotion has ended because the specified `end_date` was reached.\n`ENDED` is a terminal status." + }, + { + "name": "CANCELED", + "description": "The loyalty promotion was canceled. `CANCELED` is a terminal status." + }, + { + "name": "SCHEDULED", + "description": "The loyalty promotion is scheduled to start in the future. Square changes the\npromotion status to `ACTIVE` when the `start_date` is reached." + } + ], + "description": "Indicates the status of a [loyalty promotion](entity:LoyaltyPromotion).", + "x-release-status": "PUBLIC" + }, + "LoyaltyPromotionTriggerLimit": { + "type": "object", + "description": "Represents the number of times a buyer can earn points during a [loyalty promotion](entity:LoyaltyPromotion).\nIf this field is not set, buyers can trigger the promotion an unlimited number of times to earn points during\nthe time that the promotion is available.\n\nA purchase that is disqualified from earning points because of this limit might qualify for another active promotion.", + "x-release-status": "PUBLIC", + "required": [ + "times" + ], + "properties": { + "times": { + "type": "integer", + "description": "The maximum number of times a buyer can trigger the promotion during the specified `interval`.", + "minimum": 1, + "maximum": 30 + }, + "interval": { + "$ref": "#/components/schemas/LoyaltyPromotionTriggerLimitInterval", + "description": "The time period the limit applies to.\nSee [LoyaltyPromotionTriggerLimitInterval](#type-loyaltypromotiontriggerlimitinterval) for possible values", + "nullable": true + } + } + }, + "LoyaltyPromotionTriggerLimitInterval": { + "type": "string", + "enum": [ + "ALL_TIME", + "DAY" + ], + "x-enum-elements": [ + { + "name": "ALL_TIME", + "description": "The limit applies to the entire time that the promotion is active. For example, if `times`\nis set to 1 and `time_period` is set to `ALL_TIME`, a buyer can earn promotion points a maximum\nof one time during the promotion." + }, + { + "name": "DAY", + "description": "The limit applies per day, according to the `available_time` schedule specified for the promotion.\nFor example, if the `times` field of the trigger limit is set to 1, a buyer can trigger the promotion\na maximum of once per day." + } + ], + "description": "Indicates the time period that the [trigger limit](entity:LoyaltyPromotionTriggerLimit) applies to,\nwhich is used to determine the number of times a buyer can earn points for a [loyalty promotion](entity:LoyaltyPromotion).", + "x-release-status": "PUBLIC" + }, + "LoyaltyPromotionUpdatedEvent": { + "type": "object", + "description": "Published when a [loyalty promotion](entity:LoyaltyPromotion) is updated. This event is\ninvoked only when a loyalty promotion is canceled.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the Square seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event. For this event, the value is `loyalty.promotion.updated`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "The unique ID for the event, which is used for\n[idempotency support](https://developer.squareup.com/docs/webhooks/step4manage#webhooks-best-practices).", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/LoyaltyPromotionUpdatedEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-07-14T01:23:45Z", + "data": { + "id": "ba2f8ab6-e131-46d9-9882-17714404eb49", + "object": { + "loyalty_promotion": { + "available_time": { + "start_date": "2022-06-06", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220612T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=SU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220606T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=MO\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220607T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220608T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=WE\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220609T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=TH\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220610T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=FR\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220611T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;BYDAY=SA\nEND:VEVENT" + ] + }, + "canceled_at": "2022-07-14T01:23:45Z", + "created_at": "2022-06-03T01:41:34Z", + "id": "loypromo_ba2f8ab6-e131-46d9-9882-17714404eb49", + "incentive": { + "points_addition_data": { + "points_addition": 5 + }, + "type": "POINTS_ADDITION" + }, + "loyalty_program_id": "5216e8b2-d43e-41e2-9ed8-eccf3e892aef", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Happy Hour", + "qualifying_item_variation_ids": [ + "CJ3RYL56ITAKMD4VRCM7XERS", + "AT3RYLR3TUA9C34VRCB7X5RR" + ], + "status": "CANCELED", + "updated_at": "2022-07-14T01:23:45Z" + } + }, + "type": "loyalty_promotion" + }, + "event_id": "875f2038-6015-492e-9f29-d040b3809e49", + "merchant_id": "C337NFWQT2A6W", + "type": "loyalty.promotion.updated" + }, + "x-webhook": { + "event": "loyalty.promotion.updated", + "scopes": [ + "LOYALTY_READ" + ] + }, + "x-api": "#/components/x-apis/Loyalty", + "x-since": "2022-08-17" + }, + "LoyaltyPromotionUpdatedEventData": { + "type": "object", + "description": "The data associated with a `loyalty.promotion.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The type of object affected by the event. For this event, the value is `loyalty_promotion`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the affected loyalty promotion." + }, + "object": { + "$ref": "#/components/schemas/LoyaltyPromotionUpdatedEventObject", + "description": "An object that contains the loyalty promotion that was updated.", + "nullable": true + } + } + }, + "LoyaltyPromotionUpdatedEventObject": { + "type": "object", + "description": "An object that contains the loyalty promotion associated with a `loyalty.promotion.updated` event.", + "x-release-status": "PUBLIC", + "properties": { + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The loyalty promotion that was updated.", + "nullable": true + } + } + }, + "LoyaltyReward": { + "type": "object", + "description": "Represents a contract to redeem loyalty points for a [reward tier](entity:LoyaltyProgramRewardTier) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. \nFor more information, see [Manage loyalty rewards](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards).", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_account_id", + "reward_tier_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the loyalty reward.", + "maxLength": 36, + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/LoyaltyRewardStatus", + "description": "The status of a loyalty reward.\nSee [LoyaltyRewardStatus](#type-loyaltyrewardstatus) for possible values", + "readOnly": true + }, + "loyalty_account_id": { + "type": "string", + "description": "The Square-assigned ID of the [loyalty account](entity:LoyaltyAccount) to which the reward belongs.", + "minLength": 1, + "maxLength": 36 + }, + "reward_tier_id": { + "type": "string", + "description": "The Square-assigned ID of the [reward tier](entity:LoyaltyProgramRewardTier) used to create the reward.", + "minLength": 1, + "maxLength": 36 + }, + "points": { + "type": "integer", + "description": "The number of loyalty points used for the reward.", + "minimum": 1, + "readOnly": true + }, + "order_id": { + "type": "string", + "description": "The Square-assigned ID of the [order](entity:Order) to which the reward is attached.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the reward was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the reward was last updated, in RFC 3339 format.", + "readOnly": true + }, + "redeemed_at": { + "type": "string", + "description": "The timestamp when the reward was redeemed, in RFC 3339 format.", + "readOnly": true + } + } + }, + "LoyaltyRewardStatus": { + "type": "string", + "enum": [ + "ISSUED", + "REDEEMED", + "DELETED" + ], + "x-enum-elements": [ + { + "name": "ISSUED", + "description": "The reward is issued." + }, + { + "name": "REDEEMED", + "description": "The reward is redeemed." + }, + { + "name": "DELETED", + "description": "The reward is deleted." + } + ], + "description": "The status of the loyalty reward.", + "x-release-status": "PUBLIC" + }, + "MeasurementUnit": { + "type": "object", + "description": "Represents a unit of measurement to use with a quantity, such as ounces\nor inches. Exactly one of the following fields are required: `custom_unit`,\n`area_unit`, `length_unit`, `volume_unit`, and `weight_unit`.", + "x-release-status": "PUBLIC", + "properties": { + "custom_unit": { + "$ref": "#/components/schemas/MeasurementUnitCustom", + "description": "A custom unit of measurement defined by the seller using the Point of Sale\napp or ad-hoc as an order line item.", + "nullable": true + }, + "area_unit": { + "$ref": "#/components/schemas/MeasurementUnitArea", + "description": "Represents a standard area unit.\nSee [MeasurementUnitArea](#type-measurementunitarea) for possible values", + "nullable": true + }, + "length_unit": { + "$ref": "#/components/schemas/MeasurementUnitLength", + "description": "Represents a standard length unit.\nSee [MeasurementUnitLength](#type-measurementunitlength) for possible values", + "nullable": true + }, + "volume_unit": { + "$ref": "#/components/schemas/MeasurementUnitVolume", + "description": "Represents a standard volume unit.\nSee [MeasurementUnitVolume](#type-measurementunitvolume) for possible values", + "nullable": true + }, + "weight_unit": { + "$ref": "#/components/schemas/MeasurementUnitWeight", + "description": "Represents a standard unit of weight or mass.\nSee [MeasurementUnitWeight](#type-measurementunitweight) for possible values", + "nullable": true + }, + "generic_unit": { + "$ref": "#/components/schemas/MeasurementUnitGeneric", + "description": "Reserved for API integrations that lack the ability to specify a real measurement unit\nSee [MeasurementUnitGeneric](#type-measurementunitgeneric) for possible values", + "nullable": true + }, + "time_unit": { + "$ref": "#/components/schemas/MeasurementUnitTime", + "description": "Represents a standard unit of time.\nSee [MeasurementUnitTime](#type-measurementunittime) for possible values", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/MeasurementUnitUnitType", + "description": "Represents the type of the measurement unit.\nSee [MeasurementUnitUnitType](#type-measurementunitunittype) for possible values", + "nullable": true + } + } + }, + "MeasurementUnitArea": { + "type": "string", + "enum": [ + "IMPERIAL_ACRE", + "IMPERIAL_SQUARE_INCH", + "IMPERIAL_SQUARE_FOOT", + "IMPERIAL_SQUARE_YARD", + "IMPERIAL_SQUARE_MILE", + "METRIC_SQUARE_CENTIMETER", + "METRIC_SQUARE_METER", + "METRIC_SQUARE_KILOMETER" + ], + "x-enum-elements": [ + { + "name": "IMPERIAL_ACRE", + "description": "The area is measured in acres." + }, + { + "name": "IMPERIAL_SQUARE_INCH", + "description": "The area is measured in square inches." + }, + { + "name": "IMPERIAL_SQUARE_FOOT", + "description": "The area is measured in square feet." + }, + { + "name": "IMPERIAL_SQUARE_YARD", + "description": "The area is measured in square yards." + }, + { + "name": "IMPERIAL_SQUARE_MILE", + "description": "The area is measured in square miles." + }, + { + "name": "METRIC_SQUARE_CENTIMETER", + "description": "The area is measured in square centimeters." + }, + { + "name": "METRIC_SQUARE_METER", + "description": "The area is measured in square meters." + }, + { + "name": "METRIC_SQUARE_KILOMETER", + "description": "The area is measured in square kilometers." + } + ], + "description": "Unit of area used to measure a quantity.", + "x-release-status": "PUBLIC" + }, + "MeasurementUnitCustom": { + "type": "object", + "description": "The information needed to define a custom unit, provided by the seller.", + "x-release-status": "PUBLIC", + "required": [ + "name", + "abbreviation" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the custom unit, for example \"bushel\"." + }, + "abbreviation": { + "type": "string", + "description": "The abbreviation of the custom unit, such as \"bsh\" (bushel). This appears\nin the cart for the Point of Sale app, and in reports." + } + } + }, + "MeasurementUnitGeneric": { + "type": "string", + "enum": [ + "UNIT" + ], + "x-enum-elements": [ + { + "name": "UNIT", + "description": "The generic unit." + } + ], + "x-release-status": "PUBLIC" + }, + "MeasurementUnitLength": { + "type": "string", + "enum": [ + "IMPERIAL_INCH", + "IMPERIAL_FOOT", + "IMPERIAL_YARD", + "IMPERIAL_MILE", + "METRIC_MILLIMETER", + "METRIC_CENTIMETER", + "METRIC_METER", + "METRIC_KILOMETER" + ], + "x-enum-elements": [ + { + "name": "IMPERIAL_INCH", + "description": "The length is measured in inches." + }, + { + "name": "IMPERIAL_FOOT", + "description": "The length is measured in feet." + }, + { + "name": "IMPERIAL_YARD", + "description": "The length is measured in yards." + }, + { + "name": "IMPERIAL_MILE", + "description": "The length is measured in miles." + }, + { + "name": "METRIC_MILLIMETER", + "description": "The length is measured in millimeters." + }, + { + "name": "METRIC_CENTIMETER", + "description": "The length is measured in centimeters." + }, + { + "name": "METRIC_METER", + "description": "The length is measured in meters." + }, + { + "name": "METRIC_KILOMETER", + "description": "The length is measured in kilometers." + } + ], + "description": "The unit of length used to measure a quantity.", + "x-release-status": "PUBLIC" + }, + "MeasurementUnitTime": { + "type": "string", + "enum": [ + "GENERIC_MILLISECOND", + "GENERIC_SECOND", + "GENERIC_MINUTE", + "GENERIC_HOUR", + "GENERIC_DAY" + ], + "x-enum-elements": [ + { + "name": "GENERIC_MILLISECOND", + "description": "The time is measured in milliseconds." + }, + { + "name": "GENERIC_SECOND", + "description": "The time is measured in seconds." + }, + { + "name": "GENERIC_MINUTE", + "description": "The time is measured in minutes." + }, + { + "name": "GENERIC_HOUR", + "description": "The time is measured in hours." + }, + { + "name": "GENERIC_DAY", + "description": "The time is measured in days." + } + ], + "description": "Unit of time used to measure a quantity (a duration).", + "x-release-status": "PUBLIC" + }, + "MeasurementUnitUnitType": { + "type": "string", + "enum": [ + "TYPE_CUSTOM", + "TYPE_AREA", + "TYPE_LENGTH", + "TYPE_VOLUME", + "TYPE_WEIGHT", + "TYPE_GENERIC" + ], + "x-enum-elements": [ + { + "name": "TYPE_CUSTOM", + "description": "The unit details are contained in the custom_unit field." + }, + { + "name": "TYPE_AREA", + "description": "The unit details are contained in the area_unit field." + }, + { + "name": "TYPE_LENGTH", + "description": "The unit details are contained in the length_unit field." + }, + { + "name": "TYPE_VOLUME", + "description": "The unit details are contained in the volume_unit field." + }, + { + "name": "TYPE_WEIGHT", + "description": "The unit details are contained in the weight_unit field." + }, + { + "name": "TYPE_GENERIC", + "description": "The unit details are contained in the generic_unit field." + } + ], + "description": "Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum.", + "x-release-status": "PUBLIC" + }, + "MeasurementUnitVolume": { + "type": "string", + "enum": [ + "GENERIC_FLUID_OUNCE", + "GENERIC_SHOT", + "GENERIC_CUP", + "GENERIC_PINT", + "GENERIC_QUART", + "GENERIC_GALLON", + "IMPERIAL_CUBIC_INCH", + "IMPERIAL_CUBIC_FOOT", + "IMPERIAL_CUBIC_YARD", + "METRIC_MILLILITER", + "METRIC_LITER" + ], + "x-enum-elements": [ + { + "name": "GENERIC_FLUID_OUNCE", + "description": "The volume is measured in ounces." + }, + { + "name": "GENERIC_SHOT", + "description": "The volume is measured in shots." + }, + { + "name": "GENERIC_CUP", + "description": "The volume is measured in cups." + }, + { + "name": "GENERIC_PINT", + "description": "The volume is measured in pints." + }, + { + "name": "GENERIC_QUART", + "description": "The volume is measured in quarts." + }, + { + "name": "GENERIC_GALLON", + "description": "The volume is measured in gallons." + }, + { + "name": "IMPERIAL_CUBIC_INCH", + "description": "The volume is measured in cubic inches." + }, + { + "name": "IMPERIAL_CUBIC_FOOT", + "description": "The volume is measured in cubic feet." + }, + { + "name": "IMPERIAL_CUBIC_YARD", + "description": "The volume is measured in cubic yards." + }, + { + "name": "METRIC_MILLILITER", + "description": "The volume is measured in metric milliliters." + }, + { + "name": "METRIC_LITER", + "description": "The volume is measured in metric liters." + } + ], + "description": "The unit of volume used to measure a quantity.", + "x-release-status": "PUBLIC" + }, + "MeasurementUnitWeight": { + "type": "string", + "enum": [ + "IMPERIAL_WEIGHT_OUNCE", + "IMPERIAL_POUND", + "IMPERIAL_STONE", + "METRIC_MILLIGRAM", + "METRIC_GRAM", + "METRIC_KILOGRAM" + ], + "x-enum-elements": [ + { + "name": "IMPERIAL_WEIGHT_OUNCE", + "description": "The weight is measured in ounces." + }, + { + "name": "IMPERIAL_POUND", + "description": "The weight is measured in pounds." + }, + { + "name": "IMPERIAL_STONE", + "description": "The weight is measured in stones." + }, + { + "name": "METRIC_MILLIGRAM", + "description": "The weight is measured in milligrams." + }, + { + "name": "METRIC_GRAM", + "description": "The weight is measured in grams." + }, + { + "name": "METRIC_KILOGRAM", + "description": "The weight is measured in kilograms." + } + ], + "description": "Unit of weight used to measure a quantity.", + "x-release-status": "PUBLIC" + }, + "Merchant": { + "type": "object", + "description": "Represents a business that sells with Square.", + "x-release-status": "PUBLIC", + "required": [ + "country" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-issued ID of the merchant." + }, + "business_name": { + "type": "string", + "description": "The name of the merchant's overall business.", + "nullable": true + }, + "country": { + "$ref": "#/components/schemas/Country", + "description": "The country code associated with the merchant, in the two-letter format of ISO 3166. For example, `US` or `JP`.\nSee [Country](#type-country) for possible values" + }, + "language_code": { + "type": "string", + "description": "The code indicating the [language preferences](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences) of the merchant, in [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). For example, `en-US` or `fr-CA`.", + "nullable": true + }, + "currency": { + "$ref": "#/components/schemas/Currency", + "description": "The currency associated with the merchant, in ISO 4217 format. For example, the currency code for US dollars is `USD`.\nSee [Currency](#type-currency) for possible values", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/MerchantStatus", + "description": "The merchant's status.\nSee [MerchantStatus](#type-merchantstatus) for possible values", + "nullable": true + }, + "main_location_id": { + "type": "string", + "description": "The ID of the [main `Location`](https://developer.squareup.com/docs/locations-api#about-the-main-location) for this merchant.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the merchant was created, in RFC 3339 format.\n For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates).", + "readOnly": true + } + } + }, + "MerchantCustomAttributeDefinitionOwnedCreatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nis created by the subscribing application. Subscribe to this event to be notified\nwhen your application creates a merchant custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.owned.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T21:40:49.943Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "object": { + "created_at": "2023-126T21:40:49Z", + "description": "Whether the merchant has seen the tutorial screen for using the app.", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "name": "Seen tutorial Screen", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-01-26T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + }, + "type": "custom_attribute_definition" + }, + "event_id": "347ab320-c0ba-48f5-959a-4e147b9aefcf", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.owned.created" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.owned.created", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeDefinitionOwnedDeletedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nis deleted by the subscribing application. Subscribe to this event to be notified\nwhen your application deletes a merchant custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-27T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "object": { + "created_at": "2022-126T21:40:49Z", + "description": "Has seen the merchant seen the tutorial screen for using the app?", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "name": "Seen tutorial screen", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-01-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_HIDDEN" + }, + "type": "custom_attribute_definition" + }, + "event_id": "49363646-7ae7-49b5-aaa0-296610883c61", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.owned.deleted" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.owned.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeDefinitionOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nis updated by the subscribing application. Subscribe to this event to be notified\nwhen your application updates a merchant custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T01:22:29Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "object": { + "created_at": "2022-1-26T21:57:39Z", + "description": "Has seen the merchant seen the tutorial screen for using the app?", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "name": "Seen tutorial screen", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-01-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_HIDDEN" + }, + "type": "custom_attribute_definition" + }, + "event_id": "d914e6ef-9e37-4bca-a663-ecc55f5d98d3", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.owned.updated" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.owned.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeDefinitionVisibleCreatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is created. A notification is sent when your application\ncreates a custom attribute definition or another application creates a custom attribute definition whose\n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.visible.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-02-21T21:40:49.943Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "object": { + "created_at": "2022-02-21T21:40:49Z", + "description": "Can this seller provide 2 day shipping?", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "name": "Ships Quickly", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-02-21T21:40:49Z", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "f679dc4f-3619-4764-a4de-94a54735cd32", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.visible.created" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.visible.created", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeDefinitionVisibleDeletedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is deleted. A notification is sent when your application\ndeletes a custom attribute definition or another application deletes a custom attribute definition whose\n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-02-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "object": { + "created_at": "2022-02-21T21:40:49Z", + "description": "Can this seller provide 2 day shipping?", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "name": "Provides 2 day shipping", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-02-27T11:31:29Z", + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "81c10a07-c329-4943-af20-7d70a300c7e6", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.visible.deleted" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.visible.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeDefinitionVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition)\nthat is visible to the subscribing application is updated. A notification is sent when your application\nupdates a custom attribute definition or another application updates a custom attribute definition whose\n`visibility` is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute_definition.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-02-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "object": { + "created_at": "2022-02-21T21:57:39Z", + "description": "Can this seller provide 2 day shipping?", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "name": "Provides 2 day shipping", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean" + }, + "updated_at": "2022-02-26T01:22:29Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute_definition" + }, + "event_id": "ae376c21-d360-4694-96c7-1b27830f07d7", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute_definition.visible.updated" + }, + "x-webhook": { + "event": "merchant.custom_attribute_definition.visible.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeOwnedDeletedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute](entity:CustomAttribute)\nassociated with a [custom attribute definition](entity:CustomAttributeDefinition) that is\nowned by the subscribing application is deleted. Subscribe to this event to be notified\nwhen your application deletes a merchant custom attribute.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T21:40:54Z", + "data": { + "deleted": true, + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial:MERCHANT:DM7VKY8Q63GNP", + "object": { + "created_at": "2022-1-26T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "updated_at": "2022-01-27T12:40:54Z", + "value": true, + "version": 2, + "visibility": "VISIBILITY_HIDDEN" + }, + "type": "custom_attribute" + }, + "event_id": "473795bf-6ce4-4595-88ae-a5e7cc690c02", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute.owned.deleted" + }, + "x-webhook": { + "event": "merchant.custom_attribute.owned.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeOwnedUpdatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute](entity:CustomAttribute)\nassociated with a [custom attribute definition](entity:CustomAttributeDefinition) that is\nowned by the subscribing application is updated. Subscribe to this event to be notified\nwhen your application updates a merchant custom attribute.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T21:40:54Z", + "data": { + "id": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial:MERCHANT:DM7VKY8Q63GNP", + "object": { + "created_at": "2022-1-26T21:40:54Z", + "key": "sq0idp-LJ1Kr4Iim0hGDvAwrv8HIB:has_seen_tutorial", + "updated_at": "2022-01-26T21:40:54Z", + "value": true, + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + }, + "type": "custom_attribute" + }, + "event_id": "e26ca6f2-97f8-426a-b4bf-873024617e94", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute.owned.updated" + }, + "x-webhook": { + "event": "merchant.custom_attribute.owned.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeVisibleDeletedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute](entity:CustomAttribute) with\nthe `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is deleted.\nAn application that subscribes to this event is notified when a merchant custom attribute is deleted\nby any application for which the subscribing application has read access to the merchant custom attribute.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T01:22:29Z", + "data": { + "deleted": true, + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled:MERCHANT:DM7VKY8Q63GNP", + "object": { + "created_at": "2022-1-21T21:58:59Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "updated_at": "2022-01-27T11:31:29Z", + "value": false, + "version": 3, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "18ef5adc-2efc-4ad9-9b1a-b274a607da3e", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute.visible.deleted" + }, + "x-webhook": { + "event": "merchant.custom_attribute.visible.deleted", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantCustomAttributeVisibleUpdatedEvent": { + "type": "object", + "description": "Published when a merchant [custom attribute](entity:CustomAttribute) with\nthe `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` is updated.\nAn application that subscribes to this event is notified when a merchant custom attribute is updated\nby any application for which the subscribing application has read access to the merchant custom attribute.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the seller associated with the event that triggered the event notification.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"merchant.custom_attribute.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event notification.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp that indicates when the event notification was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event that triggered the event notification.", + "nullable": true + } + }, + "example": { + "created_at": "2022-01-26T01:22:29Z", + "data": { + "id": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled:MERCHANT:DM7VKY8Q63GNP", + "object": { + "created_at": "2022-1-21T21:40:54Z", + "key": "sq0idp-BushoY39o1X-GPxRRUWc0A:express_shipping_enabled", + "updated_at": "2022-01-26T01:22:29Z", + "value": false, + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "type": "custom_attribute" + }, + "event_id": "1cc2925c-f6e2-4fb6-a597-07c198de59e1", + "merchant_id": "DM7VKY8Q63GNP", + "type": "merchant.custom_attribute.visible.updated" + }, + "x-webhook": { + "event": "merchant.custom_attribute.visible.updated", + "scopes": [ + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/MerchantCustomAttributes", + "x-since": "2023-05-17" + }, + "MerchantSettingsUpdatedEvent": { + "type": "object", + "description": "Published when online checkout merchant settings are updated", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"online_checkout.merchant_settings.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/MerchantSettingsUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2023-11-09T18:04:58.856036784Z", + "data": { + "id": "MLX0WMXAER48M", + "object": { + "merchant_settings": { + "payment_methods": { + "afterpay_clearpay": { + "enabled": true, + "item_eligibility_range": { + "max": { + "amount": 200000, + "currency": "USD" + }, + "min": { + "amount": 200, + "currency": "USD" + } + }, + "order_eligibility_range": { + "max": { + "amount": 200000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + } + }, + "apple_pay": { + "enabled": false + }, + "cash_app": { + "enabled": true + }, + "google_pay": { + "enabled": true + } + }, + "updated_at": "2023-11-09 18:04:58 +0000 UTC" + } + }, + "type": "merchant_settings" + }, + "event_id": "8bfc6b46-b274-376f-b5e7-0575827f6f29", + "merchant_id": "MLX0WMXAER48M", + "type": "online_checkout.merchant_settings.updated" + }, + "x-webhook": { + "event": "online_checkout.merchant_settings.updated", + "scopes": [ + "MERCHANT_PROFILE_WRITE", + "MERCHANT_PROFILE_READ" + ] + }, + "x-api": "#/components/x-apis/Checkout", + "x-since": "2023-12-13" + }, + "MerchantSettingsUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the updated object’s type, `\"online_checkout.merchant_settings\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated merchant settings." + }, + "object": { + "$ref": "#/components/schemas/MerchantSettingsUpdatedEventObject", + "description": "An object containing the updated merchant settings.", + "nullable": true + } + } + }, + "MerchantSettingsUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "merchant_settings": { + "$ref": "#/components/schemas/CheckoutMerchantSettings", + "description": "The updated merchant settings.", + "nullable": true + } + } + }, + "MerchantStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "A fully operational merchant account. The merchant can interact with Square products and APIs." + }, + { + "name": "INACTIVE", + "description": "A functionally limited merchant account. The merchant can only have limited interaction\nvia Square APIs. The merchant cannot log in or access the seller dashboard." + } + ], + "x-release-status": "PUBLIC" + }, + "ModifierLocationOverrides": { + "type": "object", + "description": "Location-specific overrides for specified properties of a `CatalogModifier` object.", + "x-release-status": "PUBLIC", + "properties": { + "location_id": { + "type": "string", + "description": "The ID of the `Location` object representing the location. This can include a deactivated location.", + "nullable": true + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The overridden price at the specified location. If this is unspecified, the modifier price is not overridden.\nThe modifier becomes free of charge at the specified location, when this `price_money` field is set to 0.", + "nullable": true + }, + "sold_out": { + "type": "boolean", + "description": "Indicates whether the modifier is sold out at the specified location or not. As an example, for cheese (modifier) burger (item), when the modifier is sold out, it is the cheese, but not the burger, that is sold out.\nThe seller can manually set this sold out status. Attempts by an application to set this attribute are ignored.", + "readOnly": true + } + } + }, + "Money": { + "type": "object", + "description": "Represents an amount of money. `Money` fields can be signed or unsigned.\nFields that do not explicitly define whether they are signed or unsigned are\nconsidered unsigned and can only hold positive amounts. For signed fields, the\nsign of the value indicates the purpose of the money transfer. See\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)\nfor more information.", + "x-release-status": "PUBLIC", + "properties": { + "amount": { + "type": "integer", + "description": "The amount of money, in the smallest denomination of the currency\nindicated by `currency`. For example, when `currency` is `USD`, `amount` is\nin cents. Monetary amounts can be positive or negative. See the specific\nfield description to determine the meaning of the sign in a particular case.", + "format": "int64", + "nullable": true + }, + "currency": { + "$ref": "#/components/schemas/Currency", + "description": "The type of currency, in __ISO 4217 format__. For example, the currency\ncode for US dollars is `USD`.\n\nSee [Currency](entity:Currency) for possible values.\nSee [Currency](#type-currency) for possible values", + "nullable": true + } + } + }, + "OauthAuthorizationRevokedEvent": { + "type": "object", + "description": "Published when a merchant/application revokes all access tokens and refresh tokens granted to an application.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"oauth.authorization.revoked\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/OauthAuthorizationRevokedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-08-14T15:51:04.246373287Z", + "data": { + "id": "415641cf-eba2-4dfa-88cc-c4be1301fdc6", + "object": { + "revocation": { + "revoked_at": "2020-08-14T15:51:00.246373287Z", + "revoker_type": "MERCHANT" + } + }, + "type": "revocation" + }, + "event_id": "e1d6ae37-5aa9-45a5-b525-b12caf819fdb", + "merchant_id": "J9Z30SF99NPFJ", + "type": "oauth.authorization.revoked" + }, + "x-webhook": { + "event": "oauth.authorization.revoked", + "scopes": null + }, + "x-api": "#/components/x-apis/OAuth", + "x-since": "2020-08-26" + }, + "OauthAuthorizationRevokedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"revocation\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "Not applicable, revocation is not an object" + }, + "object": { + "$ref": "#/components/schemas/OauthAuthorizationRevokedEventObject", + "description": "An object containing information about revocation event.", + "nullable": true + } + } + }, + "OauthAuthorizationRevokedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "revocation": { + "$ref": "#/components/schemas/OauthAuthorizationRevokedEventRevocationObject", + "description": "The revocation event.", + "nullable": true + } + } + }, + "OauthAuthorizationRevokedEventRevocationObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "revoked_at": { + "type": "string", + "description": "Timestamp of when the revocation event occurred, in RFC 3339 format.", + "nullable": true + }, + "revoker_type": { + "$ref": "#/components/schemas/OauthAuthorizationRevokedEventRevokerType", + "description": "Type of client that performed the revocation, either APPLICATION, MERCHANT, or SQUARE.\nSee [OauthAuthorizationRevokedEventRevokerType](#type-oauthauthorizationrevokedeventrevokertype) for possible values", + "nullable": true + } + } + }, + "OauthAuthorizationRevokedEventRevokerType": { + "type": "string", + "enum": [ + "APPLICATION", + "MERCHANT", + "SQUARE" + ], + "x-enum-elements": [ + { + "name": "APPLICATION", + "description": "The application that requested access to a merchant's data." + }, + { + "name": "MERCHANT", + "description": "The admin for the merchant." + }, + { + "name": "SQUARE", + "description": "An internal Square employee." + } + ], + "description": "Defines the possible types for the revoking client.", + "x-release-status": "PUBLIC" + }, + "ObtainTokenRequest": { + "type": "object", + "description": "Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) request.", + "x-release-status": "PUBLIC", + "required": [ + "client_id", + "grant_type" + ], + "properties": { + "client_id": { + "type": "string", + "description": "The Square-issued ID of your application, which is available as the **Application ID**\non the **OAuth** page in the [Developer Console](https://developer.squareup.com/apps).\n\nRequired for the code flow and PKCE flow for any grant type.", + "maxLength": 191 + }, + "client_secret": { + "type": "string", + "description": "The secret key for your application, which is available as the **Application secret**\non the **OAuth** page in the [Developer Console](https://developer.squareup.com/apps).\n\nRequired for the code flow for any grant type. Don't confuse your client secret with your\npersonal access token.", + "minLength": 2, + "maxLength": 1024, + "nullable": true + }, + "code": { + "type": "string", + "description": "The authorization code to exchange for an OAuth access token. This is the `code`\nvalue that Square sent to your redirect URL in the authorization response.\n\nRequired for the code flow and PKCE flow if `grant_type` is `authorization_code`.", + "maxLength": 191, + "nullable": true + }, + "redirect_uri": { + "type": "string", + "description": "The redirect URL for your application, which you registered as the **Redirect URL**\non the **OAuth** page in the [Developer Console](https://developer.squareup.com/apps).\n\nRequired for the code flow and PKCE flow if `grant_type` is `authorization_code` and\nyou provided the `redirect_uri` parameter in your authorization URL.", + "maxLength": 2048, + "nullable": true + }, + "grant_type": { + "type": "string", + "description": "The method used to obtain an OAuth access token. The request must include the\ncredential that corresponds to the specified grant type. Valid values are:\n- `authorization_code` - Requires the `code` field.\n- `refresh_token` - Requires the `refresh_token` field.\n- `migration_token` - LEGACY for access tokens obtained using a Square API version prior\nto 2019-03-13. Requires the `migration_token` field.", + "minLength": 10, + "maxLength": 20 + }, + "refresh_token": { + "type": "string", + "description": "A valid refresh token used to generate a new OAuth access token. This is a\nrefresh token that was returned in a previous `ObtainToken` response.\n\nRequired for the code flow and PKCE flow if `grant_type` is `refresh_token`.", + "minLength": 2, + "maxLength": 1024, + "nullable": true + }, + "migration_token": { + "type": "string", + "description": "__LEGACY__ A valid access token (obtained using a Square API version prior to 2019-03-13)\nused to generate a new OAuth access token.\n\nRequired if `grant_type` is `migration_token`. For more information, see\n[Migrate to Using Refresh Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens).", + "minLength": 2, + "maxLength": 1024, + "nullable": true + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of permissions that are explicitly requested for the access token.\nFor example, [\"MERCHANT_PROFILE_READ\",\"PAYMENTS_READ\",\"BANK_ACCOUNTS_READ\"].\n\nThe returned access token is limited to the permissions that are the intersection\nof these requested permissions and those authorized by the provided `refresh_token`.\n\nOptional for the code flow and PKCE flow if `grant_type` is `refresh_token`.", + "nullable": true + }, + "short_lived": { + "type": "boolean", + "description": "Indicates whether the returned access token should expire in 24 hours.\n\nOptional for the code flow and PKCE flow for any grant type. The default value is `false`.", + "nullable": true + }, + "code_verifier": { + "type": "string", + "description": "The secret your application generated for the authorization request used to\nobtain the authorization code. This is the source of the `code_challenge` hash you\nprovided in your authorization URL.\n\nRequired for the PKCE flow if `grant_type` is `authorization_code`.", + "nullable": true + } + }, + "example": { + "client_id": "sq0idp-uaPHILoPzWZk3tlJqlML0g", + "client_secret": "sq0csp-30a-4C_tVOnTh14Piza2BfTPBXyLafLPWSzY1qAjeBfM", + "code": "sq0cgb-l0SBqxs4uwxErTVyYOdemg", + "grant_type": "authorization_code" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ObtainToken/ObtainTokenRequest.csharp", + "java": "/sdk_samples/ObtainToken/ObtainTokenRequest.java", + "javascript": "/sdk_samples/ObtainToken/ObtainTokenRequest.javascript", + "php": "/sdk_samples/ObtainToken/ObtainTokenRequest.php", + "python": "/sdk_samples/ObtainToken/ObtainTokenRequest.python", + "ruby": "/sdk_samples/ObtainToken/ObtainTokenRequest.ruby" + } + }, + "ObtainTokenResponse": { + "type": "object", + "description": "Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) response.", + "x-release-status": "PUBLIC", + "properties": { + "access_token": { + "type": "string", + "description": "An OAuth access token used to authorize Square API requests on behalf of the seller.\nInclude this token as a bearer token in the `Authorization` header of your API requests.\n\nOAuth access tokens expire in 30 days (except `short_lived` access tokens). You should call\n`ObtainToken` and provide the returned `refresh_token` to get a new access token well before\nthe current one expires. For more information, see [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough).", + "minLength": 2, + "maxLength": 1024 + }, + "token_type": { + "type": "string", + "description": "The type of access token. This value is always `bearer`.", + "minLength": 2, + "maxLength": 10 + }, + "expires_at": { + "type": "string", + "description": "The timestamp of when the `access_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.", + "minLength": 20, + "maxLength": 48 + }, + "merchant_id": { + "type": "string", + "description": "The ID of the authorizing [merchant](entity:Merchant) (seller), which represents a business.", + "minLength": 8, + "maxLength": 191 + }, + "subscription_id": { + "type": "string", + "description": "__LEGACY__ The ID of merchant's subscription.\nThe ID is only present if the merchant signed up for a subscription plan during authorization." + }, + "plan_id": { + "type": "string", + "description": "__LEGACY__ The ID of the subscription plan the merchant signed\nup for. The ID is only present if the merchant signed up for a subscription plan during\nauthorization." + }, + "id_token": { + "type": "string", + "description": "The OpenID token that belongs to this person. This token is only present if the\n`OPENID` scope is included in the authorization request.\n\nDeprecated at version 2021-09-15. Square doesn't support OpenID or other single sign-on (SSO)\nprotocols on top of OAuth.", + "x-release-status": "DEPRECATED" + }, + "refresh_token": { + "type": "string", + "description": "A refresh token that can be used in an `ObtainToken` request to generate a new access token.\n\nWith the code flow:\n- For the `authorization_code` grant type, the refresh token is multi-use and never expires.\n- For the `refresh_token` grant type, the response returns the same refresh token.\n\nWith the PKCE flow:\n- For the `authorization_code` grant type, the refresh token is single-use and expires in 90 days.\n- For the `refresh_token` grant type, the refresh token is a new single-use refresh token that expires in 90 days.\n\nFor more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope).", + "minLength": 2, + "maxLength": 1024 + }, + "short_lived": { + "type": "boolean", + "description": "Indicates whether the access_token is short lived. If `true`, the access token expires\nin 24 hours. If `false`, the access token expires in 30 days." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "refresh_token_expires_at": { + "type": "string", + "description": "The timestamp of when the `refresh_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm)\nformat.\n\nThis field is only returned for the PKCE flow.", + "minLength": 20, + "maxLength": 48 + } + }, + "example": { + "access_token": "EAAl3ikZIe18J-2-cHlV2bL4-EaZHGoJUhtEBT7QA6-7AgwIHw8Xe1IoUvGsNxA", + "expires_at": "2025-04-03T18:31:06Z", + "merchant_id": "MLQW2MYBY81PZ", + "refresh_token": "EQAAl0OcByu3IYJYScGGg-8E5YNf0r0b6jCTCMy5nOcRZ4ok0wbWAL8vY3tZWNcc", + "short_lived": false, + "token_type": "bearer" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ObtainToken/ObtainTokenResponse.csharp", + "java": "/sdk_samples/ObtainToken/ObtainTokenResponse.java", + "javascript": "/sdk_samples/ObtainToken/ObtainTokenResponse.javascript", + "php": "/sdk_samples/ObtainToken/ObtainTokenResponse.php", + "python": "/sdk_samples/ObtainToken/ObtainTokenResponse.python", + "ruby": "/sdk_samples/ObtainToken/ObtainTokenResponse.ruby" + } + }, + "OfflinePaymentDetails": { + "type": "object", + "description": "Details specific to offline payments.", + "x-release-status": "DEPRECATED", + "properties": { + "client_created_at": { + "type": "string", + "description": "The client-side timestamp of when the offline payment was created, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + } + } + }, + "Order": { + "type": "object", + "description": "Contains all information related to a single order to process with Square,\nincluding line items that specify the products to purchase. `Order` objects also\ninclude information about any associated tenders, refunds, and returns.\n\nAll Connect V2 Transactions have all been converted to Orders including all associated\nitemization data.", + "x-release-status": "PUBLIC", + "required": [ + "location_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The order's unique ID.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the seller location that this order is associated with.", + "minLength": 1 + }, + "reference_id": { + "type": "string", + "description": "A client-specified ID to associate an entity in another system\nwith this order.", + "maxLength": 40, + "nullable": true + }, + "source": { + "$ref": "#/components/schemas/OrderSource", + "description": "The origination details of the order.", + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "The ID of the [customer](entity:Customer) associated with the order.\n\nYou should specify a `customer_id` on the order (or the payment) to ensure that transactions\nare reliably linked to customers. Omitting this field might result in the creation of new\n[instant profiles](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles).", + "maxLength": 191, + "x-release-status": "BETA", + "nullable": true + }, + "line_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItem" + }, + "description": "The line items included in the order.", + "nullable": true + }, + "taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemTax" + }, + "description": "The list of all taxes associated with the order.\n\nTaxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with `LINE_ITEM` scope, an\n`OrderLineItemAppliedTax` must be added to each line item that the tax applies to. For taxes\nwith `ORDER` scope, the server generates an `OrderLineItemAppliedTax` for every line item.\n\nOn reads, each tax in the list includes the total amount of that tax applied to the order.\n\n__IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated\n`line_items.taxes` field results in an error. Use `line_items.applied_taxes`\ninstead.", + "nullable": true + }, + "discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemDiscount" + }, + "description": "The list of all discounts associated with the order.\n\nDiscounts can be scoped to either `ORDER` or `LINE_ITEM`. For discounts scoped to `LINE_ITEM`,\nan `OrderLineItemAppliedDiscount` must be added to each line item that the discount applies to.\nFor discounts with `ORDER` scope, the server generates an `OrderLineItemAppliedDiscount`\nfor every line item.\n\n__IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated\n`line_items.discounts` field results in an error. Use `line_items.applied_discounts`\ninstead.", + "nullable": true + }, + "service_charges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderServiceCharge" + }, + "description": "A list of service charges applied to the order.", + "nullable": true + }, + "fulfillments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Fulfillment" + }, + "description": "Details about order fulfillment.\n\nOrders can only be created with at most one fulfillment. However, orders returned\nby the API might contain multiple fulfillments.", + "nullable": true + }, + "returns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturn" + }, + "description": "A collection of items from sale orders being returned in this one. Normally part of an\nitemized return or exchange. There is exactly one `Return` object per sale `Order` being\nreferenced.", + "readOnly": true, + "x-release-status": "BETA" + }, + "return_amounts": { + "$ref": "#/components/schemas/OrderMoneyAmounts", + "description": "The rollup of the returned money amounts.", + "readOnly": true, + "x-release-status": "BETA" + }, + "net_amounts": { + "$ref": "#/components/schemas/OrderMoneyAmounts", + "description": "The net money amounts (sale money - return money).", + "readOnly": true, + "x-release-status": "BETA" + }, + "rounding_adjustment": { + "$ref": "#/components/schemas/OrderRoundingAdjustment", + "description": "A positive rounding adjustment to the total of the order. This adjustment is commonly\nused to apply cash rounding when the minimum unit of account is smaller than the lowest physical\ndenomination of the currency.", + "readOnly": true, + "x-release-status": "BETA" + }, + "tenders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tender" + }, + "description": "The tenders that were used to pay for the order.", + "readOnly": true, + "x-release-status": "BETA" + }, + "refunds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Refund" + }, + "description": "The refunds that are part of this order.", + "readOnly": true, + "x-release-status": "BETA" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this order. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the order was created, at server side, in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp for when the order was last updated, at server side, in RFC 3339 format (for example, \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "closed_at": { + "type": "string", + "description": "The timestamp for when the order reached a terminal [state](entity:OrderState), in RFC 3339 format (for example \"2016-09-04T23:59:33.123Z\").", + "readOnly": true + }, + "state": { + "$ref": "#/components/schemas/OrderState", + "description": "The current state of the order.\nSee [OrderState](#type-orderstate) for possible values", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is committed to the order.\nOrders not created through the API do not include a version number and\ntherefore cannot be updated.\n\n[Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders).", + "x-release-status": "BETA" + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money to collect for the order.", + "readOnly": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tax money to collect for the order.", + "readOnly": true + }, + "total_discount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of discount money to collect for the order.", + "readOnly": true + }, + "total_tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tip money to collect for the order.", + "readOnly": true + }, + "total_service_charge_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money collected in service charges for the order.\n\nNote: `total_service_charge_money` is the sum of `applied_money` fields for each individual\nservice charge. Therefore, `total_service_charge_money` only includes inclusive tax amounts,\nnot additive tax amounts.", + "readOnly": true + }, + "ticket_name": { + "type": "string", + "description": "A short-term identifier for the order (such as a customer first name,\ntable number, or auto-generated order number that resets daily).", + "maxLength": 30, + "x-release-status": "BETA", + "nullable": true + }, + "pricing_options": { + "$ref": "#/components/schemas/OrderPricingOptions", + "description": "Pricing options for an order. The options affect how the order's price is calculated.\nThey can be used, for example, to apply automatic price adjustments that are based on\npreconfigured [pricing rules](entity:CatalogPricingRule).", + "nullable": true + }, + "rewards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReward" + }, + "description": "A set-like list of Rewards that have been added to the Order.", + "readOnly": true, + "x-release-status": "BETA" + }, + "net_amount_due_money": { + "$ref": "#/components/schemas/Money", + "description": "The net amount of money due on the order.", + "readOnly": true + } + } + }, + "OrderCreated": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_id": { + "type": "string", + "description": "The order's unique ID.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is committed to the order.\nOrders that were not created through the API do not include a version number and\ntherefore cannot be updated.\n\n[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)" + }, + "location_id": { + "type": "string", + "description": "The ID of the seller location that this order is associated with.", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/OrderState", + "description": "The state of the order.\nSee [OrderState](#type-orderstate) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the order was created, in RFC 3339 format.", + "readOnly": true + } + } + }, + "OrderCreatedEvent": { + "type": "object", + "description": "Published when an [Order](entity:Order) is created. This event is\ntriggered only by the [CreateOrder](api-endpoint:Orders-CreateOrder) endpoint call.\n\nCreating an order in the Point of Sale app will **not** publish this event.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"order.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/OrderCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-16T23:14:26.129Z", + "data": { + "id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "object": { + "order_created": { + "created_at": "2020-04-16T23:14:26.129Z", + "location_id": "FPYCBCHYMXFK1", + "order_id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "state": "OPEN", + "version": 1 + } + }, + "type": "order_created" + }, + "event_id": "116038d3-2948-439f-8679-fc86dbf80f69", + "merchant_id": "5S9MXCS9Y99KK", + "type": "order.created" + }, + "x-webhook": { + "event": "order.created", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/Orders", + "x-since": "2020-04-22" + }, + "OrderCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"order_created\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected order." + }, + "object": { + "$ref": "#/components/schemas/OrderCreatedObject", + "description": "An object containing information about the created Order.", + "nullable": true + } + } + }, + "OrderCreatedObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_created": { + "$ref": "#/components/schemas/OrderCreated", + "description": "Information about the created order.", + "nullable": true + } + } + }, + "OrderCustomAttributeDefinitionOwnedCreatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.owned.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T20:59:17.185Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T20:59:17.185Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T20:59:17.185Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "11d7bdf0-773a-3e9e-9d59-d91fe31110db", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.owned.created" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.owned.created", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeDefinitionOwnedDeletedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:04:52Z", + "data": { + "deleted": true, + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T20:56:14.351Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T20:56:14.351Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "4cadb90e-8dac-38c0-8f50-521f477cf4a7", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.owned.deleted" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.owned.deleted", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeDefinitionOwnedUpdatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:25:45.592Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T21:25:28.693Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T21:25:45.592Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "39b6f636-7fcb-38f0-acbf-7e221e829496", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.owned.updated" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.owned.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeDefinitionVisibleCreatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.visible.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T20:59:17.185Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T20:59:17.185Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T20:59:17.185Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "32515c08-b0c3-3835-9606-f43f613e4635", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.visible.created" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.visible.created", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeDefinitionVisibleDeletedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:04:52Z", + "data": { + "deleted": true, + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T20:56:14.351Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T20:56:14.351Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "536e094e-d704-3962-9caa-a981240f13f1", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.visible.deleted" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.visible.deleted", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeDefinitionVisibleUpdatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute_definition.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeDefinitionEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:25:45.592Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "object": { + "created_at": "2022-11-09T21:25:28.693Z", + "description": "Table number at a location", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "name": "Table Number", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-09T21:25:45.592Z", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute_definition" + }, + "event_id": "b0262c17-dea7-3a7e-aeb2-52bfb962959b", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute_definition.visible.updated" + }, + "x-webhook": { + "event": "order.custom_attribute_definition.visible.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeOwnedDeletedEvent": { + "type": "object", + "description": "Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute.owned.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:36:17Z", + "data": { + "deleted": true, + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number:ORDER:VilxhxZHuWEqDC6GQNgiLNshRMYZY", + "object": { + "created_at": "2022-11-09T21:30:17.093Z", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "updated_at": "2022-11-09T21:34:20.906Z", + "value": "TEST", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "0026e02d-de6f-32b3-ba9f-d353d46544eb", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute.owned.deleted" + }, + "x-webhook": { + "event": "order.custom_attribute.owned.deleted", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeOwnedUpdatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute.owned.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:30:17.093Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number:ORDER:VilxhxZHuWEqDC6GQNgiLNshRMYZY", + "object": { + "created_at": "2022-11-09T21:30:17.093Z", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "updated_at": "2022-11-09T21:30:17.093Z", + "value": "Table-WK", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "92322a74-fd56-304e-aba7-4c4a7b82c003", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute.owned.updated" + }, + "x-webhook": { + "event": "order.custom_attribute.owned.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeVisibleDeletedEvent": { + "type": "object", + "description": "Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute.visible.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:36:17Z", + "data": { + "deleted": true, + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number:ORDER:VilxhxZHuWEqDC6GQNgiLNshRMYZY", + "object": { + "created_at": "2022-11-09T21:30:17.093Z", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "updated_at": "2022-11-09T21:34:20.906Z", + "value": "Table-WK", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "0a847808-3985-361d-b31f-b6060ccfea43", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute.visible.deleted" + }, + "x-webhook": { + "event": "order.custom_attribute.visible.deleted", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderCustomAttributeVisibleUpdatedEvent": { + "type": "object", + "description": "Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target seller associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"order.custom_attribute.visible.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/CustomAttributeEventData", + "description": "The data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-11-09T21:30:17.093Z", + "data": { + "id": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number:ORDER:VilxhxZHuWEqDC6GQNgiLNshRMYZY", + "object": { + "created_at": "2022-11-09T21:30:17.093Z", + "key": "sq0ids-tr5sCkWm3b9X9MkpAvJ42A:table-number", + "updated_at": "2022-11-09T21:30:17.093Z", + "value": "Table-WK", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "type": "custom_attribute" + }, + "event_id": "ff7b8470-95fc-3f29-8939-2a6cc23aca95", + "merchant_id": "MLABZFS5JTW5B", + "type": "order.custom_attribute.visible.updated" + }, + "x-webhook": { + "event": "order.custom_attribute.visible.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/OrderCustomAttributes", + "x-since": "2022-11-16" + }, + "OrderEntry": { + "type": "object", + "description": "A lightweight description of an [order](entity:Order) that is returned when\n`returned_entries` is `true` on a [SearchOrdersRequest](api-endpoint:Orders-SearchOrders).", + "x-release-status": "PUBLIC", + "properties": { + "order_id": { + "type": "string", + "description": "The ID of the order.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is committed to the order.\nOrders that were not created through the API do not include a version number and\ntherefore cannot be updated.\n\n[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)", + "readOnly": true, + "x-release-status": "BETA" + }, + "location_id": { + "type": "string", + "description": "The location ID the order belongs to.", + "nullable": true + } + } + }, + "OrderFulfillmentDeliveryDetailsScheduleType": { + "type": "string", + "enum": [ + "SCHEDULED", + "ASAP" + ], + "x-enum-elements": [ + { + "name": "SCHEDULED", + "description": "Indicates the fulfillment to deliver at a scheduled deliver time." + }, + { + "name": "ASAP", + "description": "Indicates that the fulfillment to deliver as soon as possible and should be prepared\nimmediately." + } + ], + "description": "The schedule type of the delivery fulfillment.", + "x-release-status": "BETA" + }, + "OrderFulfillmentFulfillmentLineItemApplication": { + "type": "string", + "enum": [ + "ALL", + "ENTRY_LIST" + ], + "x-enum-elements": [ + { + "name": "ALL", + "description": "If `ALL`, `entries` must be unset." + }, + { + "name": "ENTRY_LIST", + "description": "If `ENTRY_LIST`, supply a list of `entries`." + } + ], + "description": "The `line_item_application` describes what order line items this fulfillment applies\nto. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries.", + "x-release-status": "BETA" + }, + "OrderFulfillmentPickupDetailsScheduleType": { + "type": "string", + "enum": [ + "SCHEDULED", + "ASAP" + ], + "x-enum-elements": [ + { + "name": "SCHEDULED", + "description": "Indicates that the fulfillment will be picked up at a scheduled pickup time." + }, + { + "name": "ASAP", + "description": "Indicates that the fulfillment will be picked up as soon as possible and\nshould be prepared immediately." + } + ], + "description": "The schedule type of the pickup fulfillment.", + "x-release-status": "PUBLIC" + }, + "OrderFulfillmentState": { + "type": "string", + "enum": [ + "PROPOSED", + "RESERVED", + "PREPARED", + "COMPLETED", + "CANCELED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "PROPOSED", + "description": "Indicates that the fulfillment has been proposed." + }, + { + "name": "RESERVED", + "description": "Indicates that the fulfillment has been reserved." + }, + { + "name": "PREPARED", + "description": "Indicates that the fulfillment has been prepared." + }, + { + "name": "COMPLETED", + "description": "Indicates that the fulfillment was successfully completed." + }, + { + "name": "CANCELED", + "description": "Indicates that the fulfillment was canceled." + }, + { + "name": "FAILED", + "description": "Indicates that the fulfillment failed to be completed, but was not explicitly\ncanceled." + } + ], + "description": "The current state of this fulfillment.", + "x-release-status": "PUBLIC" + }, + "OrderFulfillmentType": { + "type": "string", + "enum": [ + "PICKUP", + "SHIPMENT", + "DELIVERY" + ], + "x-enum-elements": [ + { + "name": "PICKUP", + "description": "A recipient to pick up the fulfillment from a physical [location](entity:Location)." + }, + { + "name": "SHIPMENT", + "description": "A shipping carrier to ship the fulfillment." + }, + { + "name": "DELIVERY", + "description": "A courier to deliver the fulfillment." + } + ], + "description": "The type of fulfillment.", + "x-release-status": "PUBLIC" + }, + "OrderFulfillmentUpdated": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_id": { + "type": "string", + "description": "The order's unique ID.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is committed to the order.\nOrders that were not created through the API do not include a version number and\ntherefore cannot be updated.\n\n[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)" + }, + "location_id": { + "type": "string", + "description": "The ID of the seller location that this order is associated with.", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/OrderState", + "description": "The state of the order.\nSee [OrderState](#type-orderstate) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the order was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp for when the order was last updated, in RFC 3339 format.", + "readOnly": true + }, + "fulfillment_update": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderFulfillmentUpdatedUpdate" + }, + "description": "The fulfillments that were updated with this version change.", + "nullable": true + } + } + }, + "OrderFulfillmentUpdatedEvent": { + "type": "object", + "description": "Published when an [OrderFulfillment](entity:OrderFulfillment)\nis created or updated. This event is triggered only by the\n[UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint call.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"order.fulfillment.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/OrderFulfillmentUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-16T23:16:30.789Z", + "data": { + "id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "object": { + "order_fulfillment_updated": { + "created_at": "2020-04-16T23:14:26.129Z", + "fulfillment_update": [ + { + "fulfillment_uid": "VWJ1N9leLqjSDLvF2hvYjD", + "new_state": "RESERVED", + "old_state": "PROPOSED" + } + ], + "location_id": "FPYCBCHYMXFK1", + "order_id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "state": "OPEN", + "updated_at": "2020-04-16T23:16:30.789Z", + "version": 6 + } + }, + "type": "order_fulfillment_updated" + }, + "event_id": "b3adf364-4937-436e-a833-49c72b4baee8", + "merchant_id": "5S9MXCS9Y99KK", + "type": "order.fulfillment.updated" + }, + "x-webhook": { + "event": "order.fulfillment.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/Orders", + "x-since": "2020-04-22" + }, + "OrderFulfillmentUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"order_fulfillment_updated\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected order." + }, + "object": { + "$ref": "#/components/schemas/OrderFulfillmentUpdatedObject", + "description": "An object containing information about the updated Order.", + "nullable": true + } + } + }, + "OrderFulfillmentUpdatedObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_fulfillment_updated": { + "$ref": "#/components/schemas/OrderFulfillmentUpdated", + "description": "Information about the updated order fulfillment.", + "nullable": true + } + } + }, + "OrderFulfillmentUpdatedUpdate": { + "type": "object", + "description": "Information about fulfillment updates.", + "x-release-status": "BETA", + "properties": { + "fulfillment_uid": { + "type": "string", + "description": "A unique ID that identifies the fulfillment only within this order.", + "nullable": true + }, + "old_state": { + "$ref": "#/components/schemas/FulfillmentState", + "description": "The state of the fulfillment before the change.\nThe state is not populated if the fulfillment is created with this new `Order` version.", + "nullable": true + }, + "new_state": { + "$ref": "#/components/schemas/FulfillmentState", + "description": "The state of the fulfillment after the change. The state might be equal to `old_state` if a non-state\nfield was changed on the fulfillment (such as the tracking number).", + "nullable": true + } + } + }, + "OrderLineItem": { + "type": "object", + "description": "Represents a line item in an order. Each line item describes a different\nproduct to purchase, with its own quantity and price details.", + "x-release-status": "PUBLIC", + "required": [ + "quantity" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the line item only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the line item.", + "maxLength": 512, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The count, or measurement, of a line item being purchased:\n\nIf `quantity` is a whole number, and `quantity_unit` is not specified, then `quantity` denotes an item count. For example: `3` apples.\n\nIf `quantity` is a whole or decimal number, and `quantity_unit` is also specified, then `quantity` denotes a measurement. For example: `2.25` pounds of broccoli.\n\nFor more information, see [Specify item quantity and measurement unit](https://developer.squareup.com/docs/orders-api/create-orders#specify-item-quantity-and-measurement-unit).\n\nLine items with a quantity of `0` are automatically removed\nwhen paying for or otherwise completing the order.", + "minLength": 1, + "maxLength": 12 + }, + "quantity_unit": { + "$ref": "#/components/schemas/OrderQuantityUnit", + "description": "The measurement unit and decimal precision that this line item's quantity is measured in.", + "nullable": true + }, + "note": { + "type": "string", + "description": "An optional note associated with the line item.", + "maxLength": 2000, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this line item.", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this line item references.", + "format": "int64", + "nullable": true + }, + "variation_name": { + "type": "string", + "description": "The name of the variation applied to this line item.", + "maxLength": 400, + "nullable": true + }, + "item_type": { + "$ref": "#/components/schemas/OrderLineItemItemType", + "description": "The type of line item: an itemized sale, a non-itemized sale (custom amount), or the\nactivation or reloading of a gift card.\nSee [OrderLineItemItemType](#type-orderlineitemitemtype) for possible values", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this line item. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "modifiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemModifier" + }, + "description": "The [CatalogModifier](entity:CatalogModifier)s applied to this line item.", + "nullable": true + }, + "applied_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedTax" + }, + "description": "The list of references to taxes applied to this line item. Each\n`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a\ntop-level `OrderLineItemTax` applied to the line item. On reads, the\namount applied is populated.\n\nAn `OrderLineItemAppliedTax` is automatically created on every line\nitem for all `ORDER` scoped taxes added to the order. `OrderLineItemAppliedTax`\nrecords for `LINE_ITEM` scoped taxes must be added in requests for the tax\nto apply to any line items.\n\nTo change the amount of a tax, modify the referenced top-level tax.", + "x-release-status": "BETA", + "nullable": true + }, + "applied_discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedDiscount" + }, + "description": "The list of references to discounts applied to this line item. Each\n`OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level\n`OrderLineItemDiscounts` applied to the line item. On reads, the amount\napplied is populated.\n\nAn `OrderLineItemAppliedDiscount` is automatically created on every line item for all\n`ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` records\nfor `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any\nline items.\n\nTo change the amount of a discount, modify the referenced top-level discount.", + "x-release-status": "BETA", + "nullable": true + }, + "applied_service_charges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedServiceCharge" + }, + "description": "The list of references to service charges applied to this line item. Each\n`OrderLineItemAppliedServiceCharge` has a `service_charge_id` that references the `uid` of a\ntop-level `OrderServiceCharge` applied to the line item. On reads, the amount applied is\npopulated.\n\nTo change the amount of a service charge, modify the referenced top-level service charge.", + "x-release-status": "BETA", + "nullable": true + }, + "base_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The base price for a single unit of the line item.", + "nullable": true + }, + "variation_total_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The total price of all item variations sold in this line item.\nThe price is calculated as `base_price_money` multiplied by `quantity`.\nIt does not include modifiers.", + "readOnly": true + }, + "gross_sales_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money made in gross sales for this line item.\nThe amount is calculated as the sum of the variation's total price and each modifier's total price.\nFor inclusive tax items in the US, Canada, and Japan, tax is deducted from `gross_sales_money`. For Europe and\nAustralia, inclusive tax remains as part of the gross sale calculation.", + "readOnly": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tax money to collect for the line item.", + "readOnly": true + }, + "total_discount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of discount money to collect for the line item.", + "readOnly": true + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money to collect for this line item.", + "readOnly": true + }, + "pricing_blocklists": { + "$ref": "#/components/schemas/OrderLineItemPricingBlocklists", + "description": "Describes pricing adjustments that are blocked from automatic\napplication to a line item. For more information, see\n[Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts).", + "x-release-status": "BETA", + "nullable": true + }, + "total_service_charge_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of apportioned service charge money to collect for the line item.", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "OrderLineItemAppliedDiscount": { + "type": "object", + "description": "Represents an applied portion of a discount to a line item in an order.\n\nOrder scoped discounts have automatically applied discounts present for each line item.\nLine-item scoped discounts must have applied discounts added manually for any applicable line\nitems. The corresponding applied money is automatically computed based on participating\nline items.", + "x-release-status": "BETA", + "required": [ + "discount_uid" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the applied discount only within this order.", + "maxLength": 60, + "nullable": true + }, + "discount_uid": { + "type": "string", + "description": "The `uid` of the discount that the applied discount represents. It must\nreference a discount present in the `order.discounts` field.\n\nThis field is immutable. To change which discounts apply to a line item,\nyou must delete the discount and re-add it as a new `OrderLineItemAppliedDiscount`.", + "minLength": 1, + "maxLength": 60 + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied by the discount to the line item.", + "readOnly": true + } + } + }, + "OrderLineItemAppliedServiceCharge": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "service_charge_uid" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the applied service charge only within this order.", + "maxLength": 60, + "nullable": true + }, + "service_charge_uid": { + "type": "string", + "description": "The `uid` of the service charge that the applied service charge represents. It must\nreference a service charge present in the `order.service_charges` field.\n\nThis field is immutable. To change which service charges apply to a line item,\ndelete and add a new `OrderLineItemAppliedServiceCharge`.", + "minLength": 1, + "maxLength": 60 + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied by the service charge to the line item.", + "readOnly": true + } + } + }, + "OrderLineItemAppliedTax": { + "type": "object", + "description": "Represents an applied portion of a tax to a line item in an order.\n\nOrder-scoped taxes automatically include the applied taxes in each line item.\nLine item taxes must be referenced from any applicable line items.\nThe corresponding applied money is automatically computed, based on the\nset of participating line items.", + "x-release-status": "BETA", + "required": [ + "tax_uid" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the applied tax only within this order.", + "maxLength": 60, + "nullable": true + }, + "tax_uid": { + "type": "string", + "description": "The `uid` of the tax for which this applied tax represents. It must reference\na tax present in the `order.taxes` field.\n\nThis field is immutable. To change which taxes apply to a line item, delete and add a new\n`OrderLineItemAppliedTax`.", + "minLength": 1, + "maxLength": 60 + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied by the tax to the line item.", + "readOnly": true + } + } + }, + "OrderLineItemDiscount": { + "type": "object", + "description": "Represents a discount that applies to one or more line items in an\norder.\n\nFixed-amount, order-scoped discounts are distributed across all non-zero line item totals.\nThe amount distributed to each line item is relative to the\namount contributed by the item to the order subtotal.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the discount only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this discount references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The discount's name.", + "maxLength": 255, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/OrderLineItemDiscountType", + "description": "The type of the discount.\n\nDiscounts that do not reference a catalog object ID must have a type of\n`FIXED_PERCENTAGE` or `FIXED_AMOUNT`.\nSee [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the discount, as a string representation of a decimal number.\nA value of `7.25` corresponds to a percentage of 7.25%.\n\n`percentage` is not set for amount-based discounts.", + "maxLength": 10, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total declared monetary amount of the discount.\n\n`amount_money` is not set for percentage-based discounts.", + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of discount actually applied to the line item.\n\nThe amount represents the amount of money applied as a line-item scoped discount.\nWhen an amount-based discount is scoped to the entire order, the value\nof `applied_money` is different than `amount_money` because the total\namount of the discount is distributed across all line items.", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this discount. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "scope": { + "$ref": "#/components/schemas/OrderLineItemDiscountScope", + "description": "Indicates the level at which the discount applies. For `ORDER` scoped discounts,\nSquare generates references in `applied_discounts` on all order line items that do\nnot have them. For `LINE_ITEM` scoped discounts, the discount only applies to line items\nwith a discount reference in their `applied_discounts` field.\n\nThis field is immutable. To change the scope of a discount, you must delete\nthe discount and re-add it as a new discount.\nSee [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values", + "nullable": true + }, + "reward_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The reward IDs corresponding to this discount. The application and\nspecification of discounts that have `reward_ids` are completely controlled by the backing\ncriteria corresponding to the reward tiers of the rewards that are added to the order\nthrough the Loyalty API. To manually unapply discounts that are the result of added rewards,\nthe rewards must be removed from the order through the Loyalty API.", + "readOnly": true, + "x-release-status": "BETA" + }, + "pricing_rule_id": { + "type": "string", + "description": "The object ID of a [pricing rule](entity:CatalogPricingRule) to be applied\nautomatically to this discount. The specification and application of the discounts, to\nwhich a `pricing_rule_id` is assigned, are completely controlled by the corresponding\npricing rule.", + "readOnly": true + } + } + }, + "OrderLineItemDiscountScope": { + "type": "string", + "enum": [ + "OTHER_DISCOUNT_SCOPE", + "LINE_ITEM", + "ORDER" + ], + "x-enum-elements": [ + { + "name": "OTHER_DISCOUNT_SCOPE", + "description": "Used for reporting only.\nThe original transaction discount scope is currently not supported by the API." + }, + { + "name": "LINE_ITEM", + "description": "The discount should be applied to only line items specified by\n`OrderLineItemAppliedDiscount` reference records." + }, + { + "name": "ORDER", + "description": "The discount should be applied to the entire order." + } + ], + "description": "Indicates whether this is a line-item or order-level discount.", + "x-release-status": "PUBLIC" + }, + "OrderLineItemDiscountType": { + "type": "string", + "enum": [ + "UNKNOWN_DISCOUNT", + "FIXED_PERCENTAGE", + "FIXED_AMOUNT", + "VARIABLE_PERCENTAGE", + "VARIABLE_AMOUNT" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_DISCOUNT", + "description": "Used for reporting only.\nThe original transaction discount type is currently not supported by the API." + }, + { + "name": "FIXED_PERCENTAGE", + "description": "Apply the discount as a fixed percentage (such as 5%) off the item price." + }, + { + "name": "FIXED_AMOUNT", + "description": "Apply the discount as a fixed monetary value (such as $1.00) off the item price." + }, + { + "name": "VARIABLE_PERCENTAGE", + "description": "Apply the discount as a variable percentage based on the item\nprice.\n\nThe specific discount percentage of a `VARIABLE_PERCENTAGE` discount\nis assigned at the time of the purchase." + }, + { + "name": "VARIABLE_AMOUNT", + "description": "Apply the discount as a variable amount based on the item price.\n\nThe specific discount amount of a `VARIABLE_AMOUNT` discount\nis assigned at the time of the purchase." + } + ], + "description": "Indicates how the discount is applied to the associated line item or order.", + "x-release-status": "PUBLIC" + }, + "OrderLineItemItemType": { + "type": "string", + "enum": [ + "ITEM", + "CUSTOM_AMOUNT", + "GIFT_CARD" + ], + "x-enum-elements": [ + { + "name": "ITEM", + "description": "Indicates that the line item is an itemized sale." + }, + { + "name": "CUSTOM_AMOUNT", + "description": "Indicates that the line item is a non-itemized sale." + }, + { + "name": "GIFT_CARD", + "description": "Indicates that the line item is a gift card sale. Gift cards sold through\nthe Orders API are sold in an unactivated state and can be activated through the\nGift Cards API using the line item `uid`." + } + ], + "description": "Represents the line item type.", + "x-release-status": "BETA" + }, + "OrderLineItemModifier": { + "type": "object", + "description": "A [CatalogModifier](entity:CatalogModifier).", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the modifier only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogModifier](entity:CatalogModifier).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this modifier references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the item modifier.", + "maxLength": 255, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The quantity of the line item modifier. The modifier quantity can be 0 or more.\nFor example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders\nthis item, the restaurant records the purchase by creating an `Order` object with a line item\nfor a burger. The line item includes a line item modifier: the name is cheese and the quantity\nis 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses\nthe extra cheese option, the modifier quantity increases to 2. If the buyer does not want\nany cheese, the modifier quantity is set to 0.", + "nullable": true + }, + "base_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The base price for the modifier.\n\n`base_price_money` is required for ad hoc modifiers.\nIf both `catalog_object_id` and `base_price_money` are set, `base_price_money` will\noverride the predefined [CatalogModifier](entity:CatalogModifier) price.", + "nullable": true + }, + "total_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The total price of the item modifier for its line item.\nThis is the modifier's `base_price_money` multiplied by the line item's quantity.", + "readOnly": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this order. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "OrderLineItemPricingBlocklists": { + "type": "object", + "description": "Describes pricing adjustments that are blocked from automatic\napplication to a line item. For more information, see\n[Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts).", + "x-release-status": "BETA", + "properties": { + "blocked_discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemPricingBlocklistsBlockedDiscount" + }, + "description": "A list of discounts blocked from applying to the line item.\nDiscounts can be blocked by the `discount_uid` (for ad hoc discounts) or\nthe `discount_catalog_object_id` (for catalog discounts).", + "nullable": true + }, + "blocked_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemPricingBlocklistsBlockedTax" + }, + "description": "A list of taxes blocked from applying to the line item.\nTaxes can be blocked by the `tax_uid` (for ad hoc taxes) or\nthe `tax_catalog_object_id` (for catalog taxes).", + "nullable": true + } + } + }, + "OrderLineItemPricingBlocklistsBlockedDiscount": { + "type": "object", + "description": "A discount to block from applying to a line item. The discount must be\nidentified by either `discount_uid` or `discount_catalog_object_id`, but not both.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID of the `BlockedDiscount` within the order.", + "maxLength": 60, + "nullable": true + }, + "discount_uid": { + "type": "string", + "description": "The `uid` of the discount that should be blocked. Use this field to block\nad hoc discounts. For catalog discounts, use the `discount_catalog_object_id` field.", + "maxLength": 60, + "nullable": true + }, + "discount_catalog_object_id": { + "type": "string", + "description": "The `catalog_object_id` of the discount that should be blocked.\nUse this field to block catalog discounts. For ad hoc discounts, use the\n`discount_uid` field.", + "maxLength": 192, + "nullable": true + } + } + }, + "OrderLineItemPricingBlocklistsBlockedTax": { + "type": "object", + "description": "A tax to block from applying to a line item. The tax must be\nidentified by either `tax_uid` or `tax_catalog_object_id`, but not both.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID of the `BlockedTax` within the order.", + "maxLength": 60, + "nullable": true + }, + "tax_uid": { + "type": "string", + "description": "The `uid` of the tax that should be blocked. Use this field to block\nad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` field.", + "maxLength": 60, + "nullable": true + }, + "tax_catalog_object_id": { + "type": "string", + "description": "The `catalog_object_id` of the tax that should be blocked.\nUse this field to block catalog taxes. For ad hoc taxes, use the\n`tax_uid` field.", + "maxLength": 192, + "nullable": true + } + } + }, + "OrderLineItemTax": { + "type": "object", + "description": "Represents a tax that applies to one or more line item in the order.\n\nFixed-amount, order-scoped taxes are distributed across all non-zero line item totals.\nThe amount distributed to each line item is relative to the amount the item\ncontributes to the order subtotal.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the tax only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogTax](entity:CatalogTax).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this tax references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The tax's name.", + "maxLength": 255, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/OrderLineItemTaxType", + "description": "Indicates the calculation method used to apply the tax.\nSee [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the tax, as a string representation of a decimal\nnumber. For example, a value of `\"7.25\"` corresponds to a percentage of\n7.25%.", + "maxLength": 10, + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this tax. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied to the order by the tax.\n\n- For percentage-based taxes, `applied_money` is the money\ncalculated using the percentage.", + "nullable": true + }, + "scope": { + "$ref": "#/components/schemas/OrderLineItemTaxScope", + "description": "Indicates the level at which the tax applies. For `ORDER` scoped taxes,\nSquare generates references in `applied_taxes` on all order line items that do\nnot have them. For `LINE_ITEM` scoped taxes, the tax only applies to line items\nwith references in their `applied_taxes` field.\n\nThis field is immutable. To change the scope, you must delete the tax and\nre-add it as a new tax.\nSee [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible values", + "nullable": true + }, + "auto_applied": { + "type": "boolean", + "description": "Determines whether the tax was automatically applied to the order based on\nthe catalog configuration. For an example, see\n[Automatically Apply Taxes to an Order](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-taxes).", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "OrderLineItemTaxScope": { + "type": "string", + "enum": [ + "OTHER_TAX_SCOPE", + "LINE_ITEM", + "ORDER" + ], + "x-enum-elements": [ + { + "name": "OTHER_TAX_SCOPE", + "description": "Used for reporting only.\nThe original transaction tax scope is currently not supported by the API." + }, + { + "name": "LINE_ITEM", + "description": "The tax should be applied only to line items specified by\nthe `OrderLineItemAppliedTax` reference records." + }, + { + "name": "ORDER", + "description": "The tax should be applied to the entire order." + } + ], + "description": "Indicates whether this is a line-item or order-level tax.", + "x-release-status": "PUBLIC" + }, + "OrderLineItemTaxType": { + "type": "string", + "enum": [ + "UNKNOWN_TAX", + "ADDITIVE", + "INCLUSIVE" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_TAX", + "description": "Used for reporting only.\nThe original transaction tax type is currently not supported by the API." + }, + { + "name": "ADDITIVE", + "description": "The tax is an additive tax. The tax amount is added on top of the price.\nFor example, an item with a cost of 1.00 USD and a 10% additive tax has a total\ncost to the buyer of 1.10 USD." + }, + { + "name": "INCLUSIVE", + "description": "The tax is an inclusive tax. Inclusive taxes are already included\nin the line item price or order total. For example, an item with a cost of\n1.00 USD and a 10% inclusive tax has a pretax cost of 0.91 USD\n(91 cents) and a 0.09 (9 cents) tax for a total cost of 1.00 USD to\nthe buyer." + } + ], + "description": "Indicates how the tax is applied to the associated line item or order.", + "x-release-status": "PUBLIC" + }, + "OrderMoneyAmounts": { + "type": "object", + "description": "A collection of various money amounts.", + "x-release-status": "BETA", + "properties": { + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total money.", + "nullable": true + }, + "tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The money associated with taxes.", + "nullable": true + }, + "discount_money": { + "$ref": "#/components/schemas/Money", + "description": "The money associated with discounts.", + "nullable": true + }, + "tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The money associated with tips.", + "nullable": true + }, + "service_charge_money": { + "$ref": "#/components/schemas/Money", + "description": "The money associated with service charges.", + "nullable": true + } + } + }, + "OrderPricingOptions": { + "type": "object", + "description": "Pricing options for an order. The options affect how the order's price is calculated.\nThey can be used, for example, to apply automatic price adjustments that are based on preconfigured\n[pricing rules](entity:CatalogPricingRule).", + "x-release-status": "PUBLIC", + "properties": { + "auto_apply_discounts": { + "type": "boolean", + "description": "The option to determine whether pricing rule-based\ndiscounts are automatically applied to an order.", + "nullable": true + }, + "auto_apply_taxes": { + "type": "boolean", + "description": "The option to determine whether rule-based taxes are automatically\napplied to an order when the criteria of the corresponding rules are met.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "OrderQuantityUnit": { + "type": "object", + "description": "Contains the measurement unit for a quantity and a precision that\nspecifies the number of digits after the decimal point for decimal quantities.", + "x-release-status": "PUBLIC", + "properties": { + "measurement_unit": { + "$ref": "#/components/schemas/MeasurementUnit", + "description": "A [MeasurementUnit](entity:MeasurementUnit) that represents the\nunit of measure for the quantity.", + "nullable": true + }, + "precision": { + "type": "integer", + "description": "For non-integer quantities, represents the number of digits after the decimal point that are\nrecorded for this quantity.\n\nFor example, a precision of 1 allows quantities such as `\"1.0\"` and `\"1.1\"`, but not `\"1.01\"`.\n\nMin: 0. Max: 5.", + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing the\n[CatalogMeasurementUnit](entity:CatalogMeasurementUnit).\n\nThis field is set when this is a catalog-backed measurement unit.", + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this measurement unit references.\n\nThis field is set when this is a catalog-backed measurement unit.", + "format": "int64", + "nullable": true + } + } + }, + "OrderReturn": { + "type": "object", + "description": "The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the return only within this order.", + "maxLength": 60, + "nullable": true + }, + "source_order_id": { + "type": "string", + "description": "An order that contains the original sale of these return line items. This is unset\nfor unlinked returns.", + "nullable": true + }, + "return_line_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnLineItem" + }, + "description": "A collection of line items that are being returned.", + "nullable": true + }, + "return_service_charges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnServiceCharge" + }, + "description": "A collection of service charges that are being returned.", + "nullable": true + }, + "return_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnTax" + }, + "description": "A collection of references to taxes being returned for an order, including the total\napplied tax amount to be returned. The taxes must reference a top-level tax ID from the source\norder.", + "readOnly": true + }, + "return_discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnDiscount" + }, + "description": "A collection of references to discounts being returned for an order, including the total\napplied discount amount to be returned. The discounts must reference a top-level discount ID\nfrom the source order.", + "readOnly": true + }, + "return_tips": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnTip" + }, + "description": "A collection of references to tips being returned for an order.", + "nullable": true + }, + "rounding_adjustment": { + "$ref": "#/components/schemas/OrderRoundingAdjustment", + "description": "A positive or negative rounding adjustment to the total value being returned. Adjustments are commonly\nused to apply cash rounding when the minimum unit of the account is smaller than the lowest\nphysical denomination of the currency.", + "nullable": true + }, + "return_amounts": { + "$ref": "#/components/schemas/OrderMoneyAmounts", + "description": "An aggregate monetary value being returned by this return entry.", + "nullable": true + } + } + }, + "OrderReturnDiscount": { + "type": "object", + "description": "Represents a discount being returned that applies to one or more return line items in an\norder.\n\nFixed-amount, order-scoped discounts are distributed across all non-zero return line item totals.\nThe amount distributed to each return line item is relative to that item’s contribution to the\norder subtotal.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the returned discount only within this order.", + "maxLength": 60, + "nullable": true + }, + "source_discount_uid": { + "type": "string", + "description": "The discount `uid` from the order that contains the original application of this discount.", + "maxLength": 60, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this discount references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The discount's name.", + "maxLength": 255, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/OrderLineItemDiscountType", + "description": "The type of the discount. If it is created by the API, it is `FIXED_PERCENTAGE` or `FIXED_AMOUNT`.\n\nDiscounts that do not reference a catalog object ID must have a type of\n`FIXED_PERCENTAGE` or `FIXED_AMOUNT`.\nSee [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the tax, as a string representation of a decimal number.\nA value of `\"7.25\"` corresponds to a percentage of 7.25%.\n\n`percentage` is not set for amount-based discounts.", + "maxLength": 10, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total declared monetary amount of the discount.\n\n`amount_money` is not set for percentage-based discounts.", + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of discount actually applied to this line item. When an amount-based\ndiscount is at the order level, this value is different from `amount_money` because the discount\nis distributed across the line items.", + "readOnly": true + }, + "scope": { + "$ref": "#/components/schemas/OrderLineItemDiscountScope", + "description": "Indicates the level at which the `OrderReturnDiscount` applies. For `ORDER` scoped\ndiscounts, the server generates references in `applied_discounts` on all\n`OrderReturnLineItem`s. For `LINE_ITEM` scoped discounts, the discount is only applied to\n`OrderReturnLineItem`s with references in their `applied_discounts` field.\nSee [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values", + "nullable": true + } + } + }, + "OrderReturnLineItem": { + "type": "object", + "description": "The line item being returned in an order.", + "x-release-status": "BETA", + "required": [ + "quantity" + ], + "properties": { + "uid": { + "type": "string", + "description": "A unique ID for this return line-item entry.", + "maxLength": 60, + "nullable": true + }, + "source_line_item_uid": { + "type": "string", + "description": "The `uid` of the line item in the original sale order.", + "maxLength": 60, + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the line item.", + "maxLength": 512, + "nullable": true + }, + "quantity": { + "type": "string", + "description": "The quantity returned, formatted as a decimal number.\nFor example, `\"3\"`.\n\nLine items with a `quantity_unit` can have non-integer quantities.\nFor example, `\"1.70000\"`.", + "minLength": 1, + "maxLength": 12 + }, + "quantity_unit": { + "$ref": "#/components/schemas/OrderQuantityUnit", + "description": "The unit and precision that this return line item's quantity is measured in.", + "nullable": true + }, + "note": { + "type": "string", + "description": "The note of the return line item.", + "maxLength": 2000, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this return line item.", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this line item references.", + "format": "int64", + "nullable": true + }, + "variation_name": { + "type": "string", + "description": "The name of the variation applied to this return line item.", + "maxLength": 400, + "nullable": true + }, + "item_type": { + "$ref": "#/components/schemas/OrderLineItemItemType", + "description": "The type of line item: an itemized return, a non-itemized return (custom amount),\nor the return of an unactivated gift card sale.\nSee [OrderLineItemItemType](#type-orderlineitemitemtype) for possible values", + "nullable": true + }, + "return_modifiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderReturnLineItemModifier" + }, + "description": "The [CatalogModifier](entity:CatalogModifier)s applied to this line item.", + "nullable": true + }, + "applied_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedTax" + }, + "description": "The list of references to `OrderReturnTax` entities applied to the return line item. Each\n`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level\n`OrderReturnTax` applied to the return line item. On reads, the applied amount\nis populated.", + "nullable": true + }, + "applied_discounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedDiscount" + }, + "description": "The list of references to `OrderReturnDiscount` entities applied to the return line item. Each\n`OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level\n`OrderReturnDiscount` applied to the return line item. On reads, the applied amount\nis populated.", + "nullable": true + }, + "base_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The base price for a single unit of the line item.", + "nullable": true + }, + "variation_total_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The total price of all item variations returned in this line item.\nThe price is calculated as `base_price_money` multiplied by `quantity` and\ndoes not include modifiers.", + "readOnly": true + }, + "gross_return_money": { + "$ref": "#/components/schemas/Money", + "description": "The gross return amount of money calculated as (item base price + modifiers price) * quantity.", + "readOnly": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tax money to return for the line item.", + "readOnly": true + }, + "total_discount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of discount money to return for the line item.", + "readOnly": true + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money to return for this line item.", + "readOnly": true + }, + "applied_service_charges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedServiceCharge" + }, + "description": "The list of references to `OrderReturnServiceCharge` entities applied to the return\nline item. Each `OrderLineItemAppliedServiceCharge` has a `service_charge_uid` that\nreferences the `uid` of a top-level `OrderReturnServiceCharge` applied to the return line\nitem. On reads, the applied amount is populated.", + "nullable": true + }, + "total_service_charge_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of apportioned service charge money to return for the line item.", + "readOnly": true + } + } + }, + "OrderReturnLineItemModifier": { + "type": "object", + "description": "A line item modifier being returned.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the return modifier only within this order.", + "maxLength": 60, + "nullable": true + }, + "source_modifier_uid": { + "type": "string", + "description": "The modifier `uid` from the order's line item that contains the\noriginal sale of this line item modifier.", + "maxLength": 60, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogModifier](entity:CatalogModifier).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this line item modifier references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the item modifier.", + "maxLength": 255, + "nullable": true + }, + "base_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The base price for the modifier.\n\n`base_price_money` is required for ad hoc modifiers.\nIf both `catalog_object_id` and `base_price_money` are set, `base_price_money` overrides the predefined [CatalogModifier](entity:CatalogModifier) price.", + "nullable": true + }, + "total_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The total price of the item modifier for its line item.\nThis is the modifier's `base_price_money` multiplied by the line item's quantity.", + "readOnly": true + }, + "quantity": { + "type": "string", + "description": "The quantity of the line item modifier. The modifier quantity can be 0 or more.\nFor example, suppose a restaurant offers a cheeseburger on the menu. When a buyer orders\nthis item, the restaurant records the purchase by creating an `Order` object with a line item\nfor a burger. The line item includes a line item modifier: the name is cheese and the quantity\nis 1. The buyer has the option to order extra cheese (or no cheese). If the buyer chooses\nthe extra cheese option, the modifier quantity increases to 2. If the buyer does not want\nany cheese, the modifier quantity is set to 0.", + "nullable": true + } + } + }, + "OrderReturnServiceCharge": { + "type": "object", + "description": "Represents the service charge applied to the original order.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the return service charge only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "source_service_charge_uid": { + "type": "string", + "description": "The service charge `uid` from the order containing the original\nservice charge. `source_service_charge_uid` is `null` for\nunlinked returns.", + "maxLength": 60, + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the service charge.", + "maxLength": 255, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID of the associated [OrderServiceCharge](entity:OrderServiceCharge).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this service charge references.", + "format": "int64", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the service charge, as a string representation of\na decimal number. For example, a value of `\"7.25\"` corresponds to a\npercentage of 7.25%.\n\nEither `percentage` or `amount_money` should be set, but not both.", + "maxLength": 10, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of a non-percentage-based service charge.\n\nEither `percentage` or `amount_money` should be set, but not both.", + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied to the order by the service charge, including\nany inclusive tax amounts, as calculated by Square.\n\n- For fixed-amount service charges, `applied_money` is equal to `amount_money`.\n- For percentage-based service charges, `applied_money` is the money calculated using the percentage.", + "readOnly": true + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money to collect for the service charge.\n\n__NOTE__: If an inclusive tax is applied to the service charge, `total_money`\ndoes not equal `applied_money` plus `total_tax_money` because the inclusive\ntax amount is already included in both `applied_money` and `total_tax_money`.", + "readOnly": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tax money to collect for the service charge.", + "readOnly": true + }, + "calculation_phase": { + "$ref": "#/components/schemas/OrderServiceChargeCalculationPhase", + "description": "The calculation phase after which to apply the service charge.\nSee [OrderServiceChargeCalculationPhase](#type-orderservicechargecalculationphase) for possible values", + "readOnly": true + }, + "taxable": { + "type": "boolean", + "description": "Indicates whether the surcharge can be taxed. Service charges\ncalculated in the `TOTAL_PHASE` cannot be marked as taxable.", + "nullable": true + }, + "applied_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedTax" + }, + "description": "The list of references to `OrderReturnTax` entities applied to the\n`OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid`\nthat references the `uid` of a top-level `OrderReturnTax` that is being\napplied to the `OrderReturnServiceCharge`. On reads, the applied amount is\npopulated.", + "x-release-status": "BETA", + "nullable": true + }, + "treatment_type": { + "$ref": "#/components/schemas/OrderServiceChargeTreatmentType", + "description": "The treatment type of the service charge.\nSee [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "scope": { + "$ref": "#/components/schemas/OrderServiceChargeScope", + "description": "Indicates the level at which the apportioned service charge applies. For `ORDER`\nscoped service charges, Square generates references in `applied_service_charges` on\nall order line items that do not have them. For `LINE_ITEM` scoped service charges,\nthe service charge only applies to line items with a service charge reference in their\n`applied_service_charges` field.\n\nThis field is immutable. To change the scope of an apportioned service charge, you must delete\nthe apportioned service charge and re-add it as a new apportioned service charge.\nSee [OrderServiceChargeScope](#type-orderservicechargescope) for possible values", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "OrderReturnTax": { + "type": "object", + "description": "Represents a tax being returned that applies to one or more return line items in an order.\n\nFixed-amount, order-scoped taxes are distributed across all non-zero return line item totals.\nThe amount distributed to each return line item is relative to that item’s contribution to the\norder subtotal.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the returned tax only within this order.", + "maxLength": 60, + "nullable": true + }, + "source_tax_uid": { + "type": "string", + "description": "The tax `uid` from the order that contains the original tax charge.", + "maxLength": 60, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing [CatalogTax](entity:CatalogTax).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this tax references.", + "format": "int64", + "nullable": true + }, + "name": { + "type": "string", + "description": "The tax's name.", + "maxLength": 255, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/OrderLineItemTaxType", + "description": "Indicates the calculation method used to apply the tax.\nSee [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The percentage of the tax, as a string representation of a decimal number.\nFor example, a value of `\"7.25\"` corresponds to a percentage of 7.25%.", + "maxLength": 10, + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied by the tax in an order.", + "readOnly": true + }, + "scope": { + "$ref": "#/components/schemas/OrderLineItemTaxScope", + "description": "Indicates the level at which the `OrderReturnTax` applies. For `ORDER` scoped\ntaxes, Square generates references in `applied_taxes` on all\n`OrderReturnLineItem`s. For `LINE_ITEM` scoped taxes, the tax is only applied to\n`OrderReturnLineItem`s with references in their `applied_discounts` field.\nSee [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible values", + "nullable": true + } + } + }, + "OrderReturnTip": { + "type": "object", + "description": "A tip being returned.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the tip only within this order.", + "maxLength": 60, + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of tip being returned\n--", + "readOnly": true + }, + "source_tender_uid": { + "type": "string", + "description": "The tender `uid` from the order that contains the original application of this tip.", + "maxLength": 192, + "nullable": true + }, + "source_tender_id": { + "type": "string", + "description": "The tender `id` from the order that contains the original application of this tip.", + "maxLength": 192, + "nullable": true + } + } + }, + "OrderReward": { + "type": "object", + "description": "Represents a reward that can be applied to an order if the necessary\nreward tier criteria are met. Rewards are created through the Loyalty API.", + "x-release-status": "BETA", + "required": [ + "id", + "reward_tier_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The identifier of the reward.", + "minLength": 1 + }, + "reward_tier_id": { + "type": "string", + "description": "The identifier of the reward tier corresponding to this reward.", + "minLength": 1 + } + } + }, + "OrderRoundingAdjustment": { + "type": "object", + "description": "A rounding adjustment of the money being returned. Commonly used to apply cash rounding\nwhen the minimum unit of the account is smaller than the lowest physical denomination of the currency.", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the rounding adjustment only within this order.", + "maxLength": 60, + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the rounding adjustment from the original sale order.", + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The actual rounding adjustment amount.", + "nullable": true + } + } + }, + "OrderServiceCharge": { + "type": "object", + "description": "Represents a service charge applied to an order.", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "A unique ID that identifies the service charge only within this order.", + "maxLength": 60, + "x-release-status": "BETA", + "nullable": true + }, + "name": { + "type": "string", + "description": "The name of the service charge.", + "maxLength": 512, + "nullable": true + }, + "catalog_object_id": { + "type": "string", + "description": "The catalog object ID referencing the service charge [CatalogObject](entity:CatalogObject).", + "maxLength": 192, + "nullable": true + }, + "catalog_version": { + "type": "integer", + "description": "The version of the catalog object that this service charge references.", + "format": "int64", + "nullable": true + }, + "percentage": { + "type": "string", + "description": "The service charge percentage as a string representation of a\ndecimal number. For example, `\"7.25\"` indicates a service charge of 7.25%.\n\nExactly 1 of `percentage` or `amount_money` should be set.", + "maxLength": 10, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of a non-percentage-based service charge.\n\nExactly one of `percentage` or `amount_money` should be set.", + "nullable": true + }, + "applied_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money applied to the order by the service charge,\nincluding any inclusive tax amounts, as calculated by Square.\n\n- For fixed-amount service charges, `applied_money` is equal to `amount_money`.\n- For percentage-based service charges, `applied_money` is the money\ncalculated using the percentage.", + "readOnly": true + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of money to collect for the service charge.\n\n__Note__: If an inclusive tax is applied to the service charge,\n`total_money` does not equal `applied_money` plus `total_tax_money`\nbecause the inclusive tax amount is already included in both\n`applied_money` and `total_tax_money`.", + "readOnly": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of tax money to collect for the service charge.", + "readOnly": true + }, + "calculation_phase": { + "$ref": "#/components/schemas/OrderServiceChargeCalculationPhase", + "description": "The calculation phase at which to apply the service charge.\nSee [OrderServiceChargeCalculationPhase](#type-orderservicechargecalculationphase) for possible values", + "nullable": true + }, + "taxable": { + "type": "boolean", + "description": "Indicates whether the service charge can be taxed. If set to `true`,\norder-level taxes automatically apply to the service charge. Note that\nservice charges calculated in the `TOTAL_PHASE` cannot be marked as taxable.", + "nullable": true + }, + "applied_taxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderLineItemAppliedTax" + }, + "description": "The list of references to the taxes applied to this service charge. Each\n`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level\n`OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied\nis populated.\n\nAn `OrderLineItemAppliedTax` is automatically created on every taxable service charge\nfor all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records\nfor `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable\nservice charge. Taxable service charges have the `taxable` field set to `true` and calculated\nin the `SUBTOTAL_PHASE`.\n\nTo change the amount of a tax, modify the referenced top-level tax.", + "x-release-status": "BETA", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-defined data attached to this service charge. Metadata fields are intended\nto store descriptive references or associations with an entity in another system or store brief\ninformation about the object. Square does not process this field; it only stores and returns it\nin relevant API calls. Do not use metadata to store any sensitive information (such as personally\nidentifiable information or card details).\n\nKeys written by applications must be 60 characters or less and must be in the character set\n`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed\nwith a namespace, separated from the key with a ':' character.\n\nValues have a maximum length of 255 characters.\n\nAn application can have up to 10 entries per metadata field.\n\nEntries written by applications are private and can only be read or modified by the same\napplication.\n\nFor more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata).", + "x-release-status": "BETA", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/OrderServiceChargeType", + "description": "The type of the service charge.\nSee [OrderServiceChargeType](#type-orderservicechargetype) for possible values", + "readOnly": true + }, + "treatment_type": { + "$ref": "#/components/schemas/OrderServiceChargeTreatmentType", + "description": "The treatment type of the service charge.\nSee [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) for possible values", + "x-release-status": "BETA", + "nullable": true + }, + "scope": { + "$ref": "#/components/schemas/OrderServiceChargeScope", + "description": "Indicates the level at which the apportioned service charge applies. For `ORDER`\nscoped service charges, Square generates references in `applied_service_charges` on\nall order line items that do not have them. For `LINE_ITEM` scoped service charges,\nthe service charge only applies to line items with a service charge reference in their\n`applied_service_charges` field.\n\nThis field is immutable. To change the scope of an apportioned service charge, you must delete\nthe apportioned service charge and re-add it as a new apportioned service charge.\nSee [OrderServiceChargeScope](#type-orderservicechargescope) for possible values", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "OrderServiceChargeCalculationPhase": { + "type": "string", + "enum": [ + "SUBTOTAL_PHASE", + "TOTAL_PHASE", + "APPORTIONED_PERCENTAGE_PHASE", + "APPORTIONED_AMOUNT_PHASE" + ], + "x-enum-elements": [ + { + "name": "SUBTOTAL_PHASE", + "description": "The service charge is applied after discounts, but before\ntaxes." + }, + { + "name": "TOTAL_PHASE", + "description": "The service charge is applied after all discounts and taxes\nare applied." + }, + { + "name": "APPORTIONED_PERCENTAGE_PHASE", + "description": "The service charge is calculated as a compounding adjustment\nafter any discounts, but before amount based apportioned service charges\nand any tax considerations." + }, + { + "name": "APPORTIONED_AMOUNT_PHASE", + "description": "The service charge is calculated as a compounding adjustment\nafter any discounts and percentage based apportioned service charges,\nbut before any tax considerations." + } + ], + "description": "Represents a phase in the process of calculating order totals.\nService charges are applied after the indicated phase.\n\n[Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated)", + "x-release-status": "PUBLIC" + }, + "OrderServiceChargeScope": { + "type": "string", + "enum": [ + "OTHER_SERVICE_CHARGE_SCOPE", + "LINE_ITEM", + "ORDER" + ], + "x-enum-elements": [ + { + "name": "OTHER_SERVICE_CHARGE_SCOPE", + "description": "Used for reporting only.\nThe original transaction service charge scope is currently not supported by the API." + }, + { + "name": "LINE_ITEM", + "description": "The service charge should be applied to only line items specified by\n`OrderLineItemAppliedServiceCharge` reference records." + }, + { + "name": "ORDER", + "description": "The service charge should be applied to the entire order." + } + ], + "description": "Indicates whether this is a line-item or order-level apportioned\nservice charge.", + "x-release-status": "BETA" + }, + "OrderServiceChargeTreatmentType": { + "type": "string", + "enum": [ + "LINE_ITEM_TREATMENT", + "APPORTIONED_TREATMENT" + ], + "x-enum-elements": [ + { + "name": "LINE_ITEM_TREATMENT", + "description": "" + }, + { + "name": "APPORTIONED_TREATMENT", + "description": "" + } + ], + "description": "Indicates whether the service charge will be treated as a value-holding line item or\napportioned toward a line item.", + "x-release-status": "BETA" + }, + "OrderServiceChargeType": { + "type": "string", + "enum": [ + "AUTO_GRATUITY", + "CUSTOM" + ], + "x-enum-elements": [ + { + "name": "AUTO_GRATUITY", + "description": "" + }, + { + "name": "CUSTOM", + "description": "" + } + ], + "x-release-status": "PUBLIC" + }, + "OrderSource": { + "type": "object", + "description": "Represents the origination details of an order.", + "x-release-status": "PUBLIC", + "properties": { + "name": { + "type": "string", + "description": "The name used to identify the place (physical or digital) that an order originates.\nIf unset, the name defaults to the name of the application that created the order.", + "nullable": true + } + } + }, + "OrderState": { + "type": "string", + "enum": [ + "OPEN", + "COMPLETED", + "CANCELED", + "DRAFT" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "Indicates that the order is open. Open orders can be updated." + }, + { + "name": "COMPLETED", + "description": "Indicates that the order is completed. Completed orders are fully paid. This is a terminal state." + }, + { + "name": "CANCELED", + "description": "Indicates that the order is canceled. Canceled orders are not paid. This is a terminal state." + }, + { + "name": "DRAFT", + "description": "Indicates that the order is in a draft state. Draft orders can be updated,\nbut cannot be paid or fulfilled.\nFor more information, see [Create Orders](https://developer.squareup.com/docs/orders-api/create-orders)." + } + ], + "description": "The state of the order.", + "x-release-status": "PUBLIC" + }, + "OrderUpdated": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_id": { + "type": "string", + "description": "The order's unique ID.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is committed to the order.\nOrders that were not created through the API do not include a version number and\ntherefore cannot be updated.\n\n[Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders)" + }, + "location_id": { + "type": "string", + "description": "The ID of the seller location that this order is associated with.", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/OrderState", + "description": "The state of the order.\nSee [OrderState](#type-orderstate) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the order was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp for when the order was last updated, in RFC 3339 format.", + "readOnly": true + } + } + }, + "OrderUpdatedEvent": { + "type": "object", + "description": "Published when an [Order](entity:Order) is updated. This\nevent is triggered by the [UpdateOrder](api-endpoint:Orders-UpdateOrder)\nendpoint call, Order Manager, or the Square Dashboard.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"order.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/OrderUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-16T23:14:26.359Z", + "data": { + "id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "object": { + "order_updated": { + "created_at": "2020-04-16T23:14:26.129Z", + "location_id": "FPYCBCHYMXFK1", + "order_id": "eA3vssLHKJrv9H0IdJCM3gNqfdcZY", + "state": "OPEN", + "updated_at": "2020-04-16T23:14:26.359Z", + "version": 2 + } + }, + "type": "order_updated" + }, + "event_id": "4b8e5c91-9f17-4cf1-900a-4a0629f81add", + "merchant_id": "5S9MXCS9Y99KK", + "type": "order.updated" + }, + "x-webhook": { + "event": "order.updated", + "scopes": [ + "ORDERS_READ" + ] + }, + "x-api": "#/components/x-apis/Orders", + "x-since": "2020-04-22" + }, + "OrderUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"order_updated\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected order." + }, + "object": { + "$ref": "#/components/schemas/OrderUpdatedObject", + "description": "An object containing information about the updated Order.", + "nullable": true + } + } + }, + "OrderUpdatedObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "order_updated": { + "$ref": "#/components/schemas/OrderUpdated", + "description": "Information about the updated order.", + "nullable": true + } + } + }, + "PauseSubscriptionRequest": { + "type": "object", + "description": "Defines input parameters in a request to the\n[PauseSubscription](api-endpoint:Subscriptions-PauseSubscription) endpoint.", + "x-release-status": "BETA", + "properties": { + "pause_effective_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the scheduled `PAUSE` action takes place on the subscription.\n\nWhen this date is unspecified or falls within the current billing cycle, the subscription is paused\non the starting date of the next billing cycle.", + "nullable": true + }, + "pause_cycle_duration": { + "type": "integer", + "description": "The number of billing cycles the subscription will be paused before it is reactivated. \n\nWhen this is set, a `RESUME` action is also scheduled to take place on the subscription at \nthe end of the specified pause cycle duration. In this case, neither `resume_effective_date` \nnor `resume_change_timing` may be specified.", + "format": "int64", + "nullable": true + }, + "resume_effective_date": { + "type": "string", + "description": "The date when the subscription is reactivated by a scheduled `RESUME` action. \nThis date must be at least one billing cycle ahead of `pause_effective_date`.", + "nullable": true + }, + "resume_change_timing": { + "$ref": "#/components/schemas/ChangeTiming", + "description": "The timing whether the subscription is reactivated immediately or at the end of the billing cycle, relative to \n`resume_effective_date`.\nSee [ChangeTiming](#type-changetiming) for possible values", + "nullable": true + }, + "pause_reason": { + "type": "string", + "description": "The user-provided reason to pause the subscription.", + "maxLength": 255, + "nullable": true + } + } + }, + "PauseSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[PauseSubscription](api-endpoint:Subscriptions-PauseSubscription) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The subscription to be paused by the scheduled `PAUSE` action." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "The list of a `PAUSE` action and a possible `RESUME` action created by the request." + } + }, + "example": { + "actions": [ + { + "effective_date": "2023-11-17", + "id": "99b2439e-63f7-3ad5-95f7-ab2447a80673", + "type": "PAUSE" + } + ], + "subscription": { + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + "ordinal": 0, + "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", + "uid": "873451e0-745b-4e87-ab0b-c574933fe616" + } + ], + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2023-06-20", + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 1 + } + } + }, + "PayOrderRequest": { + "type": "object", + "description": "Defines the fields that are included in requests to the\n[PayOrder](api-endpoint:Orders-PayOrder) endpoint.", + "x-release-status": "BETA", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this request among requests you have sent. If\nyou are unsure whether a particular payment request was completed successfully, you can reattempt\nit with the same idempotency key without worrying about duplicate payments.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1, + "maxLength": 192 + }, + "order_version": { + "type": "integer", + "description": "The version of the order being paid. If not supplied, the latest version will be paid.", + "nullable": true + }, + "payment_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the [payments](entity:Payment) to collect.\nThe payment total must match the order total.", + "nullable": true + } + }, + "example": { + "idempotency_key": "c043a359-7ad9-4136-82a9-c3f1d66dcbff", + "payment_ids": [ + "EnZdNAlWCmfh6Mt5FMNST1o7taB", + "0LRiVlbXVwe8ozu4KbZxd12mvaB" + ] + } + }, + "PayOrderResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of a request to the\n[PayOrder](api-endpoint:Orders-PayOrder) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "order": { + "$ref": "#/components/schemas/Order", + "description": "The paid, updated [order](entity:Order)." + } + }, + "example": { + "order": { + "closed_at": "2019-08-06T02:47:37.140Z", + "created_at": "2019-08-06T02:47:35.693Z", + "id": "lgwOlEityYPJtcuvKTVKT1pA986YY", + "line_items": [ + { + "base_price_money": { + "amount": 500, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 500, + "currency": "USD" + }, + "name": "Item 1", + "quantity": "1", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 500, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "QW6kofLHJK7JEKMjlSVP5C" + }, + { + "base_price_money": { + "amount": 750, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 1500, + "currency": "USD" + }, + "name": "Item 2", + "quantity": "2", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 1500, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "zhw8MNfRGdFQMI2WE1UBJD" + } + ], + "location_id": "P3CCK6HSNDAS7", + "net_amounts": { + "discount_money": { + "amount": 0, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 0, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 2000, + "currency": "USD" + } + }, + "source": { + "name": "Source Name" + }, + "state": "COMPLETED", + "tenders": [ + { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "card_details": { + "card": { + "card_brand": "VISA", + "exp_month": 2, + "exp_year": 2022, + "fingerprint": "sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ", + "last_4": "1111" + }, + "entry_method": "KEYED", + "status": "CAPTURED" + }, + "created_at": "2019-08-06T02:47:36.293Z", + "id": "EnZdNAlWCmfh6Mt5FMNST1o7taB", + "location_id": "P3CCK6HSNDAS7", + "payment_id": "EnZdNAlWCmfh6Mt5FMNST1o7taB", + "transaction_id": "lgwOlEityYPJtcuvKTVKT1pA986YY", + "type": "CARD" + }, + { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "card_details": { + "card": { + "card_brand": "VISA", + "exp_month": 2, + "exp_year": 2022, + "fingerprint": "sq-1-n_BL15KP87ClDa4-h2nXOI0fp5VnxNH6hfhzqhptTfAgxgLuGFcg6jIPngDz4IkkTQ", + "last_4": "1111" + }, + "entry_method": "KEYED", + "status": "CAPTURED" + }, + "created_at": "2019-08-06T02:47:36.809Z", + "id": "0LRiVlbXVwe8ozu4KbZxd12mvaB", + "location_id": "P3CCK6HSNDAS7", + "payment_id": "0LRiVlbXVwe8ozu4KbZxd12mvaB", + "transaction_id": "lgwOlEityYPJtcuvKTVKT1pA986YY", + "type": "CARD" + } + ], + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 2000, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2019-08-06T02:47:37.140Z", + "version": 4 + } + } + }, + "Payment": { + "type": "object", + "description": "Represents a payment processed by the Square API.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A unique ID for the payment.", + "maxLength": 192, + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the payment was created, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the payment was last updated, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount processed for this payment, not including `tip_money`.\n\nThe amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).", + "nullable": true + }, + "tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount designated as a tip for the seller's staff. \n\nTips for external vendors such as a 3rd party delivery courier must be recorded using Order.service_charges.\n\nThis amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).", + "nullable": true + }, + "total_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount for the payment, including `amount_money` and `tip_money`.\nThis amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).", + "readOnly": true + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount the developer is taking as a fee for facilitating the payment on behalf\nof the seller. This amount is specified in the smallest denomination of the applicable currency\n(for example, US dollar amounts are specified in cents). For more information,\nsee [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).\n\nThe amount cannot be more than 90% of the `total_money` value.\n\nTo set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.\nFor more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).", + "nullable": true + }, + "approved_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money approved for this payment. This value may change if Square chooses to\nobtain reauthorization as part of a call to [UpdatePayment](api-endpoint:Payments-UpdatePayment).", + "nullable": true + }, + "processing_fee": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessingFee" + }, + "description": "The processing fees and fee adjustments assessed by Square for this payment.", + "readOnly": true + }, + "refunded_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of the payment refunded to date. \n\nThis amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents).", + "readOnly": true + }, + "status": { + "type": "string", + "description": "Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED.", + "maxLength": 50, + "readOnly": true + }, + "delay_duration": { + "type": "string", + "description": "The duration of time after the payment's creation when Square automatically applies the\n`delay_action` to the payment. This automatic `delay_action` applies only to payments that\ndo not reach a terminal state (COMPLETED, CANCELED, or FAILED) before the `delay_duration`\ntime period.\n\nThis field is specified as a time duration, in RFC 3339 format.\n\nNotes:\nThis feature is only supported for card payments.\n\nDefault:\n\n- Card-present payments: \"PT36H\" (36 hours) from the creation time.\n- Card-not-present payments: \"P7D\" (7 days) from the creation time.", + "readOnly": true + }, + "delay_action": { + "type": "string", + "description": "The action to be applied to the payment when the `delay_duration` has elapsed.\n\nCurrent values include `CANCEL` and `COMPLETE`.", + "nullable": true + }, + "delayed_until": { + "type": "string", + "description": "The read-only timestamp of when the `delay_action` is automatically applied,\nin RFC 3339 format.\n\nNote that this field is calculated by summing the payment's `delay_duration` and `created_at`\nfields. The `created_at` field is generated by Square and might not exactly match the\ntime on your local machine.", + "readOnly": true + }, + "source_type": { + "type": "string", + "description": "The source type for this payment.\n\nCurrent values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `SQUARE_ACCOUNT`,\n`CASH` and `EXTERNAL`. For information about these payment source types,\nsee [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).", + "maxLength": 50, + "readOnly": true + }, + "card_details": { + "$ref": "#/components/schemas/CardPaymentDetails", + "description": "Details about a card payment. These details are only populated if the source_type is `CARD`.", + "nullable": true + }, + "cash_details": { + "$ref": "#/components/schemas/CashPaymentDetails", + "description": "Details about a cash payment. These details are only populated if the source_type is `CASH`.", + "nullable": true + }, + "bank_account_details": { + "$ref": "#/components/schemas/BankAccountPaymentDetails", + "description": "Details about a bank account payment. These details are only populated if the source_type is `BANK_ACCOUNT`.", + "readOnly": true + }, + "external_details": { + "$ref": "#/components/schemas/ExternalPaymentDetails", + "description": "Details about an external payment. The details are only populated \nif the `source_type` is `EXTERNAL`.", + "readOnly": true + }, + "wallet_details": { + "$ref": "#/components/schemas/DigitalWalletDetails", + "description": "Details about an wallet payment. The details are only populated \nif the `source_type` is `WALLET`.", + "readOnly": true + }, + "buy_now_pay_later_details": { + "$ref": "#/components/schemas/BuyNowPayLaterDetails", + "description": "Details about a Buy Now Pay Later payment. The details are only populated\nif the `source_type` is `BUY_NOW_PAY_LATER`. For more information, see \n[Afterpay Payments](https://developer.squareup.com/docs/payments-api/take-payments/afterpay-payments).", + "readOnly": true + }, + "square_account_details": { + "$ref": "#/components/schemas/SquareAccountDetails", + "description": "Details about a Square Account payment. The details are only populated\nif the `source_type` is `SQUARE_ACCOUNT`.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the payment.", + "maxLength": 50, + "readOnly": true + }, + "order_id": { + "type": "string", + "description": "The ID of the order associated with the payment.", + "maxLength": 192, + "readOnly": true + }, + "reference_id": { + "type": "string", + "description": "An optional ID that associates the payment with an entity in\nanother system.", + "maxLength": 40, + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "The ID of the customer associated with the payment. If the ID is \nnot provided in the `CreatePayment` request that was used to create the `Payment`, \nSquare may use information in the request \n(such as the billing and shipping address, email address, and payment source) \nto identify a matching customer profile in the Customer Directory. \nIf found, the profile ID is used. If a profile is not found, the \nAPI attempts to create an \n[instant profile](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles). \nIf the API cannot create an \ninstant profile (either because the seller has disabled it or the \nseller's region prevents creating it), this field remains unset. Note that \nthis process is asynchronous and it may take some time before a \ncustomer ID is added to the payment.", + "maxLength": 191, + "readOnly": true + }, + "employee_id": { + "type": "string", + "description": "__Deprecated__: Use `Payment.team_member_id` instead.\n\nAn optional ID of the employee associated with taking the payment.", + "maxLength": 192, + "readOnly": true, + "x-release-status": "DEPRECATED" + }, + "team_member_id": { + "type": "string", + "description": "An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment.", + "maxLength": 192, + "nullable": true + }, + "refund_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of `refund_id`s identifying refunds for the payment.", + "readOnly": true + }, + "risk_evaluation": { + "$ref": "#/components/schemas/RiskEvaluation", + "description": "Provides information about the risk associated with the payment, as determined by Square.\nThis field is present for payments to sellers that have opted in to receive risk\nevaluations.", + "readOnly": true, + "x-release-status": "BETA" + }, + "terminal_checkout_id": { + "type": "string", + "description": "An optional ID for a Terminal checkout that is associated with the payment.", + "readOnly": true, + "x-release-status": "BETA" + }, + "buyer_email_address": { + "type": "string", + "description": "The buyer's email address.", + "maxLength": 255, + "readOnly": true + }, + "billing_address": { + "$ref": "#/components/schemas/Address", + "description": "The buyer's billing address.", + "readOnly": true + }, + "shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "The buyer's shipping address.", + "readOnly": true + }, + "note": { + "type": "string", + "description": "An optional note to include when creating a payment.", + "maxLength": 500, + "readOnly": true + }, + "statement_description_identifier": { + "type": "string", + "description": "Additional payment information that gets added to the customer's card statement\nas part of the statement description.\n\nNote that the `statement_description_identifier` might get truncated on the statement description\nto fit the required information including the Square identifier (SQ *) and the name of the\nseller taking the payment.", + "readOnly": true + }, + "capabilities": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Actions that can be performed on this payment:\n- `EDIT_AMOUNT_UP` - The payment amount can be edited up.\n- `EDIT_AMOUNT_DOWN` - The payment amount can be edited down.\n- `EDIT_TIP_AMOUNT_UP` - The tip amount can be edited up.\n- `EDIT_TIP_AMOUNT_DOWN` - The tip amount can be edited down.\n- `EDIT_DELAY_ACTION` - The delay_action can be edited.", + "readOnly": true + }, + "receipt_number": { + "type": "string", + "description": "The payment's receipt number.\nThe field is missing if a payment is canceled.", + "maxLength": 4, + "readOnly": true + }, + "receipt_url": { + "type": "string", + "description": "The URL for the payment's receipt.\nThe field is only populated for COMPLETED payments.", + "maxLength": 255, + "readOnly": true + }, + "device_details": { + "$ref": "#/components/schemas/DeviceDetails", + "description": "Details about the device that took the payment.", + "readOnly": true + }, + "application_details": { + "$ref": "#/components/schemas/ApplicationDetails", + "description": "Details about the application that took the payment.", + "readOnly": true + }, + "is_offline_payment": { + "type": "boolean", + "description": "Whether or not this payment was taken offline.", + "readOnly": true + }, + "offline_payment_details": { + "$ref": "#/components/schemas/OfflinePaymentDetails", + "description": "Additional information about the payment if it was taken offline.", + "readOnly": true + }, + "version_token": { + "type": "string", + "description": "Used for optimistic concurrency. This opaque token identifies a specific version of the\n`Payment` object.", + "nullable": true + } + } + }, + "PaymentBalanceActivityAppFeeRefundDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "refund_id": { + "type": "string", + "description": "The ID of the refund associated with this activity.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location of the merchant associated with the payment refund activity", + "nullable": true + } + } + }, + "PaymentBalanceActivityAppFeeRevenueDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location of the merchant associated with the payment activity", + "nullable": true + } + } + }, + "PaymentBalanceActivityAutomaticSavingsDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "payout_id": { + "type": "string", + "description": "The ID of the payout associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityAutomaticSavingsReversedDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "payout_id": { + "type": "string", + "description": "The ID of the payout associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityChargeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityDepositFeeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout_id": { + "type": "string", + "description": "The ID of the payout that triggered this deposit fee activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityDepositFeeReversedDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout_id": { + "type": "string", + "description": "The ID of the payout that triggered this deposit fee activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityDisputeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "dispute_id": { + "type": "string", + "description": "The ID of the dispute associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityFeeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity\nThis will only be populated when a principal LedgerEntryToken is also populated.\nIf the fee is independent (there is no principal LedgerEntryToken) then this will likely not\nbe populated.", + "nullable": true + } + } + }, + "PaymentBalanceActivityFreeProcessingDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityHoldAdjustmentDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityOpenDisputeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "dispute_id": { + "type": "string", + "description": "The ID of the dispute associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityOtherAdjustmentDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityOtherDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityRefundDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "refund_id": { + "type": "string", + "description": "The ID of the refund associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityReleaseAdjustmentDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityReserveHoldDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityReserveReleaseDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivitySquareCapitalPaymentDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivitySquareCapitalReversedPaymentDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivitySquarePayrollTransferDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivitySquarePayrollTransferReversedDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityTaxOnFeeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "tax_rate_description": { + "type": "string", + "description": "The description of the tax rate being applied. For example: \"GST\", \"HST\".", + "nullable": true + } + } + }, + "PaymentBalanceActivityThirdPartyFeeDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + } + } + }, + "PaymentBalanceActivityThirdPartyFeeRefundDetail": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this activity.", + "nullable": true + }, + "refund_id": { + "type": "string", + "description": "The public refund id associated with this activity.", + "nullable": true + } + } + }, + "PaymentCreatedEvent": { + "type": "object", + "description": "Published when a [Payment](entity:Payment) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"payment.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/PaymentCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T21:27:30.792Z", + "data": { + "id": "KkAkhdMsgzn59SM8A89WgKwekxLZY", + "object": { + "payment": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "approved_money": { + "amount": 100, + "currency": "USD" + }, + "capabilities": [ + "EDIT_TIP_AMOUNT", + "EDIT_TIP_AMOUNT_UP", + "EDIT_TIP_AMOUNT_DOWN" + ], + "card_details": { + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "540988", + "card_brand": "MASTERCARD", + "card_type": "CREDIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg", + "last_4": "9029", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2020-11-22T21:16:51.198Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "KEYED", + "statement_description": "SQ *DEFAULT TEST ACCOUNT", + "status": "AUTHORIZED" + }, + "created_at": "2020-11-22T21:16:51.086Z", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2020-11-29T21:16:51.086Z", + "id": "hYy9pRFVxpDsO1FB05SunFWUe9JZY", + "location_id": "S8GWD5R9QB376", + "order_id": "03O3USaPaAaFnI6kkwB1JxGgBsUZY", + "receipt_number": "hYy9", + "risk_evaluation": { + "created_at": "2020-11-22T21:16:51.198Z", + "risk_level": "NORMAL" + }, + "source_type": "CARD", + "status": "APPROVED", + "total_money": { + "amount": 100, + "currency": "USD" + }, + "updated_at": "2020-11-22T21:16:51.198Z", + "version_token": "FfQhQJf9r3VSQIgyWBk1oqhIwiznLwVwJbVVA0bdyEv6o" + } + }, + "type": "payment" + }, + "event_id": "13b867cf-db3d-4b1c-90b6-2f32a9d78124", + "merchant_id": "6SSW7HV8K2ST5", + "type": "payment.created" + }, + "x-webhook": { + "event": "payment.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Payments", + "x-since": "2020-02-26" + }, + "PaymentCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"payment\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected payment.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/PaymentCreatedEventObject", + "description": "An object containing the created payment.", + "nullable": true + } + } + }, + "PaymentCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The created payment.", + "nullable": true + } + } + }, + "PaymentLink": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "version" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the payment link.", + "readOnly": true + }, + "version": { + "type": "integer", + "description": "The Square-assigned version number, which is incremented each time an update is committed to the payment link.", + "maximum": 65535 + }, + "description": { + "type": "string", + "description": "The optional description of the `payment_link` object.\nIt is primarily for use by your application and is not used anywhere.", + "maxLength": 4096, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the order associated with the payment link.", + "maxLength": 192, + "readOnly": true + }, + "checkout_options": { + "$ref": "#/components/schemas/CheckoutOptions", + "description": "The checkout options configured for the payment link.\nFor more information, see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations).", + "nullable": true + }, + "pre_populated_data": { + "$ref": "#/components/schemas/PrePopulatedData", + "description": "Describes buyer data to prepopulate\non the checkout page.", + "nullable": true + }, + "url": { + "type": "string", + "description": "The shortened URL of the payment link.", + "maxLength": 255, + "readOnly": true + }, + "long_url": { + "type": "string", + "description": "The long URL of the payment link.", + "maxLength": 255, + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the payment link was created, in RFC 3339 format." + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the payment link was last updated, in RFC 3339 format." + }, + "payment_note": { + "type": "string", + "description": "An optional note. After Square processes the payment, this note is added to the\nresulting `Payment`.", + "maxLength": 500, + "nullable": true + } + } + }, + "PaymentLinkRelatedResources": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + }, + "description": "The order associated with the payment link.", + "nullable": true + }, + "subscription_plans": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "The subscription plan associated with the payment link.", + "nullable": true + } + } + }, + "PaymentOptions": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "autocomplete": { + "type": "boolean", + "description": "Indicates whether the `Payment` objects created from this `TerminalCheckout` are\nautomatically `COMPLETED` or left in an `APPROVED` state for later modification.\n\nDefault: true", + "nullable": true + }, + "delay_duration": { + "type": "string", + "description": "The duration of time after the payment's creation when Square automatically resolves the\npayment. This automatic resolution applies only to payments that do not reach a terminal state\n(`COMPLETED` or `CANCELED`) before the `delay_duration` time period.\n\nThis parameter should be specified as a time duration, in RFC 3339 format, with a minimum value\nof 1 minute and a maximum value of 36 hours. This feature is only supported for card payments,\nand all payments will be considered card-present.\n\nThis parameter can only be set for a delayed capture payment (`autocomplete=false`). For more\ninformation, see [Delayed Capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold).\n\nDefault: \"PT36H\" (36 hours) from the creation time", + "nullable": true + }, + "accept_partial_authorization": { + "type": "boolean", + "description": "If set to `true` and charging a Square Gift Card, a payment might be returned with\n`amount_money` equal to less than what was requested. For example, a request for $20 when charging\na Square Gift Card with a balance of $5 results in an APPROVED payment of $5. You might choose\nto prompt the buyer for an additional payment to cover the remainder or cancel the Gift Card\npayment.\n\nThis parameter can only be set for a delayed capture payment (`autocomplete=false`).\n\nFor more information, see [Take Partial Payments](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/partial-payments-with-gift-cards).\n\nDefault: false", + "nullable": true + }, + "delay_action": { + "$ref": "#/components/schemas/PaymentOptionsDelayAction", + "description": "The action to be applied to the `Payment` when the delay_duration has elapsed.\nThe action must be CANCEL or COMPLETE.\n\nThe action cannot be set to COMPLETE if an `order_id` is present on the TerminalCheckout.\n\nThis parameter can only be set for a delayed capture payment (`autocomplete=false`). For more\ninformation, see [Delayed Capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture#time-threshold).\n\nDefault: CANCEL\nSee [DelayAction](#type-delayaction) for possible values", + "nullable": true + } + } + }, + "PaymentOptionsDelayAction": { + "type": "string", + "enum": [ + "CANCEL", + "COMPLETE" + ], + "x-enum-elements": [ + { + "name": "CANCEL", + "description": "Indicates that the payment should be automatically canceled when the delay duration\nelapses." + }, + { + "name": "COMPLETE", + "description": "Indicates that the payment should be automatically completed when the delay duration\nelapses." + } + ], + "description": "Describes the action to be applied to a delayed capture payment when the delay_duration\nhas elapsed.", + "x-release-status": "PUBLIC" + }, + "PaymentRefund": { + "type": "object", + "description": "Represents a refund of a payment made using Square. Contains information about\nthe original payment and the amount of money refunded.", + "x-release-status": "PUBLIC", + "required": [ + "id", + "amount_money" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID for this refund, generated by Square.", + "minLength": 1, + "maxLength": 255 + }, + "status": { + "type": "string", + "description": "The refund's status:\n- `PENDING` - Awaiting approval.\n- `COMPLETED` - Successfully completed.\n- `REJECTED` - The refund was rejected.\n- `FAILED` - An error occurred.", + "maxLength": 50, + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The location ID associated with the payment this refund is attached to.", + "maxLength": 50, + "nullable": true + }, + "unlinked": { + "type": "boolean", + "description": "Flag indicating whether or not the refund is linked to an existing payment in Square.", + "readOnly": true + }, + "destination_type": { + "type": "string", + "description": "The destination type for this refund.\n\nCurrent values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`,\n`EXTERNAL`, and `SQUARE_ACCOUNT`.", + "maxLength": 50, + "nullable": true + }, + "destination_details": { + "$ref": "#/components/schemas/DestinationDetails", + "description": "Contains information about the refund destination. This field is populated only if\n`destination_id` is defined in the `RefundPayment` request.", + "readOnly": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money refunded. This amount is specified in the smallest denomination\nof the applicable currency (for example, US dollar amounts are specified in cents)." + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money the application developer contributed to help cover the refunded amount.\nThis amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).", + "nullable": true + }, + "processing_fee": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessingFee" + }, + "description": "Processing fees and fee adjustments assessed by Square for this refund.", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The ID of the payment associated with this refund.", + "maxLength": 192, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The ID of the order associated with the refund.", + "maxLength": 192, + "nullable": true + }, + "reason": { + "type": "string", + "description": "The reason for the refund.", + "maxLength": 192, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the refund was created, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the refund was last updated, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "team_member_id": { + "type": "string", + "description": "An optional ID of the team member associated with taking the payment.", + "maxLength": 192, + "readOnly": true + }, + "terminal_refund_id": { + "type": "string", + "description": "An optional ID for a Terminal refund.", + "readOnly": true, + "x-release-status": "BETA" + } + } + }, + "PaymentUpdatedEvent": { + "type": "object", + "description": "Published when a [Payment](entity:Payment) is updated.\nTypically the `payment.status`, or `card_details.status` fields are updated\nas a payment is canceled, authorized, or completed.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"payment.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/PaymentUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T21:27:34.308Z", + "data": { + "id": "hYy9pRFVxpDsO1FB05SunFWUe9JZY", + "object": { + "payment": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "approved_money": { + "amount": 100, + "currency": "USD" + }, + "card_details": { + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "540988", + "card_brand": "MASTERCARD", + "card_type": "CREDIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg", + "last_4": "9029", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2020-11-22T21:16:51.198Z", + "captured_at": "2020-11-22T21:19:00.832Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "KEYED", + "statement_description": "SQ *DEFAULT TEST ACCOUNT", + "status": "CAPTURED" + }, + "created_at": "2020-11-22T21:16:51.086Z", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2020-11-29T21:16:51.086Z", + "id": "hYy9pRFVxpDsO1FB05SunFWUe9JZY", + "location_id": "S8GWD5R9QB376", + "order_id": "03O3USaPaAaFnI6kkwB1JxGgBsUZY", + "receipt_number": "hYy9", + "receipt_url": "https://squareup.com/receipt/preview/hYy9pRFVxpDsO1FB05SunFWUe9JZY", + "risk_evaluation": { + "created_at": "2020-11-22T21:16:51.198Z", + "risk_level": "NORMAL" + }, + "source_type": "CARD", + "status": "COMPLETED", + "total_money": { + "amount": 100, + "currency": "USD" + }, + "updated_at": "2020-11-22T21:19:00.831Z", + "version_token": "bhC3b8qKJvNDdxqKzXaeDsAjS1oMFuAKxGgT32HbE6S6o" + } + }, + "type": "payment" + }, + "event_id": "6a8f5f28-54a1-4eb0-a98a-3111513fd4fc", + "merchant_id": "6SSW7HV8K2ST5", + "type": "payment.updated" + }, + "x-webhook": { + "event": "payment.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Payments", + "x-since": "2020-02-26" + }, + "PaymentUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"payment\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected payment.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/PaymentUpdatedEventObject", + "description": "An object containing the updated payment.", + "nullable": true + } + } + }, + "PaymentUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The updated payment.", + "nullable": true + } + } + }, + "Payout": { + "type": "object", + "description": "An accounting of the amount owed the seller and record of the actual transfer to their\nexternal bank account or to the Square balance.", + "x-release-status": "PUBLIC", + "required": [ + "id", + "location_id" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique ID for the payout.", + "minLength": 1 + }, + "status": { + "$ref": "#/components/schemas/PayoutStatus", + "description": "Indicates the payout status.\nSee [PayoutStatus](#type-payoutstatus) for possible values", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the payout.", + "minLength": 1 + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the payout was created and submitted for deposit to the seller's banking destination, in RFC 3339 format." + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the payout was last updated, in RFC 3339 format." + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money involved in the payout. A positive amount indicates a deposit, and a negative amount indicates a withdrawal. This amount is never zero.", + "nullable": true + }, + "destination": { + "$ref": "#/components/schemas/Destination", + "description": "Information about the banking destination (such as a bank account, Square checking account, or debit card)\nagainst which the payout was made.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version number, which is incremented each time an update is made to this payout record.\nThe version number helps developers receive event notifications or feeds out of order." + }, + "type": { + "$ref": "#/components/schemas/PayoutType", + "description": "Indicates the payout type.\nSee [PayoutType](#type-payouttype) for possible values", + "nullable": true + }, + "payout_fee": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayoutFee" + }, + "description": "A list of transfer fees and any taxes on the fees assessed by Square for this payout.", + "nullable": true + }, + "arrival_date": { + "type": "string", + "description": "The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s banking destination.", + "nullable": true + }, + "end_to_end_id": { + "type": "string", + "description": "A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can use this ID to automate the process of reconciling each payout with the corresponding line item on the bank statement.", + "nullable": true + } + } + }, + "PayoutEntry": { + "type": "object", + "description": "One or more PayoutEntries that make up a Payout. Each one has a date, amount, and type of activity.\nThe total amount of the payout will equal the sum of the payout entries for a batch payout", + "x-release-status": "PUBLIC", + "required": [ + "id", + "payout_id" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique ID for the payout entry.", + "minLength": 1 + }, + "payout_id": { + "type": "string", + "description": "The ID of the payout entries’ associated payout.", + "minLength": 1 + }, + "effective_at": { + "type": "string", + "description": "The timestamp of when the payout entry affected the balance, in RFC 3339 format.", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/ActivityType", + "description": "The type of activity associated with this payout entry.\nSee [ActivityType](#type-activitytype) for possible values", + "nullable": true + }, + "gross_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money involved in this payout entry.", + "nullable": true + }, + "fee_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of Square fees associated with this payout entry.", + "nullable": true + }, + "net_amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The net proceeds from this transaction after any fees.", + "nullable": true + }, + "type_app_fee_revenue_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityAppFeeRevenueDetail", + "description": "Details of any developer app fee revenue generated on a payment.", + "nullable": true + }, + "type_app_fee_refund_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityAppFeeRefundDetail", + "description": "Details of a refund for an app fee on a payment.", + "nullable": true + }, + "type_automatic_savings_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityAutomaticSavingsDetail", + "description": "Details of any automatic transfer from the payment processing balance to the Square Savings account. These are, generally, proportional to the merchant's sales.", + "nullable": true + }, + "type_automatic_savings_reversed_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityAutomaticSavingsReversedDetail", + "description": "Details of any automatic transfer from the Square Savings account back to the processing balance. These are, generally, proportional to the merchant's refunds.", + "nullable": true + }, + "type_charge_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityChargeDetail", + "description": "Details of credit card payment captures.", + "nullable": true + }, + "type_deposit_fee_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityDepositFeeDetail", + "description": "Details of any fees involved with deposits such as for instant deposits.", + "nullable": true + }, + "type_deposit_fee_reversed_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityDepositFeeReversedDetail", + "description": "Details of any reversal or refund of fees involved with deposits such as for instant deposits.", + "nullable": true + }, + "type_dispute_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityDisputeDetail", + "description": "Details of any balance change due to a dispute event.", + "nullable": true + }, + "type_fee_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityFeeDetail", + "description": "Details of adjustments due to the Square processing fee.", + "nullable": true + }, + "type_free_processing_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityFreeProcessingDetail", + "description": "Square offers Free Payments Processing for a variety of business scenarios including seller referral or when Square wants to apologize for a bug, customer service, repricing complication, and so on. This entry represents details of any credit to the merchant for the purposes of Free Processing.", + "nullable": true + }, + "type_hold_adjustment_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityHoldAdjustmentDetail", + "description": "Details of any adjustment made by Square related to the holding or releasing of a payment.", + "nullable": true + }, + "type_open_dispute_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityOpenDisputeDetail", + "description": "Details of any open disputes.", + "nullable": true + }, + "type_other_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityOtherDetail", + "description": "Details of any other type that does not belong in the rest of the types.", + "nullable": true + }, + "type_other_adjustment_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityOtherAdjustmentDetail", + "description": "Details of any other type of adjustments that don't fall under existing types.", + "nullable": true + }, + "type_refund_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityRefundDetail", + "description": "Details of a refund for an existing card payment.", + "nullable": true + }, + "type_release_adjustment_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityReleaseAdjustmentDetail", + "description": "Details of fees released for adjustments.", + "nullable": true + }, + "type_reserve_hold_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityReserveHoldDetail", + "description": "Details of fees paid for funding risk reserve.", + "nullable": true + }, + "type_reserve_release_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityReserveReleaseDetail", + "description": "Details of fees released from risk reserve.", + "nullable": true + }, + "type_square_capital_payment_details": { + "$ref": "#/components/schemas/PaymentBalanceActivitySquareCapitalPaymentDetail", + "description": "Details of capital merchant cash advance (MCA) assessments. These are, generally, proportional to the merchant's sales but may be issued for other reasons related to the MCA.", + "nullable": true + }, + "type_square_capital_reversed_payment_details": { + "$ref": "#/components/schemas/PaymentBalanceActivitySquareCapitalReversedPaymentDetail", + "description": "Details of capital merchant cash advance (MCA) assessment refunds. These are, generally, proportional to the merchant's refunds but may be issued for other reasons related to the MCA.", + "nullable": true + }, + "type_tax_on_fee_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityTaxOnFeeDetail", + "description": "Details of tax paid on fee amounts.", + "nullable": true + }, + "type_third_party_fee_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityThirdPartyFeeDetail", + "description": "Details of fees collected by a 3rd party platform.", + "nullable": true + }, + "type_third_party_fee_refund_details": { + "$ref": "#/components/schemas/PaymentBalanceActivityThirdPartyFeeRefundDetail", + "description": "Details of refunded fees from a 3rd party platform.", + "nullable": true + }, + "type_square_payroll_transfer_details": { + "$ref": "#/components/schemas/PaymentBalanceActivitySquarePayrollTransferDetail", + "description": "Details of a payroll payment that was transferred to a team member’s bank account.", + "nullable": true + }, + "type_square_payroll_transfer_reversed_details": { + "$ref": "#/components/schemas/PaymentBalanceActivitySquarePayrollTransferReversedDetail", + "description": "Details of a payroll payment to a team member’s bank account that was deposited back to the seller’s account by Square.", + "nullable": true + } + } + }, + "PayoutFailedEvent": { + "type": "object", + "description": "Published when a [Payout](entity:Payout) has failed.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event that this represents, `payout.failed`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the event was verified, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/PayoutFailedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "1970-01-01T00:20:28.481Z", + "data": { + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "object": { + "payout": { + "amount_money": { + "amount": 457, + "currency_code": "EUR" + }, + "arrival_date": "2021-07-13", + "created_at": "2021-07-12T20:37:51Z", + "destination": { + "id": "bact:c164d7ec7302", + "type": "BANK_ACCOUNT" + }, + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "location_id": "LRJNZCB190DTQ", + "status": "FAILED", + "type": "BATCH", + "updated_at": "1970-01-01T00:20:28.481Z", + "version": 2 + } + }, + "type": "payout" + }, + "event_id": "7116e4a4-7622-42b0-b16c-c164d7ec7302", + "location_id": "LRJNZCB190DTQ", + "merchant_id": "MLEWJTMNJN37Z", + "type": "payout.failed" + }, + "x-webhook": { + "event": "payout.failed", + "scopes": [ + "PAYOUTS_READ", + "SETTLEMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Payouts", + "x-since": "2022-04-20" + }, + "PayoutFailedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "The name of the affected object's type, `payout`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the failed payout." + }, + "object": { + "$ref": "#/components/schemas/PayoutFailedEventObject", + "description": "An object containing the failed payout.", + "nullable": true + } + } + }, + "PayoutFailedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout": { + "$ref": "#/components/schemas/Payout", + "description": "The payout that failed.", + "nullable": true + } + } + }, + "PayoutFee": { + "type": "object", + "description": "Represents a payout fee that can incur as part of a payout.", + "x-release-status": "PUBLIC", + "properties": { + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The money amount of the payout fee.", + "nullable": true + }, + "effective_at": { + "type": "string", + "description": "The timestamp of when the fee takes effect, in RFC 3339 format.", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/PayoutFeeType", + "description": "The type of fee assessed as part of the payout.\nSee [PayoutFeeType](#type-payoutfeetype) for possible values", + "nullable": true + } + } + }, + "PayoutFeeType": { + "type": "string", + "enum": [ + "TRANSFER_FEE", + "TAX_ON_TRANSFER_FEE" + ], + "x-enum-elements": [ + { + "name": "TRANSFER_FEE", + "description": "Fee type associated with transfers." + }, + { + "name": "TAX_ON_TRANSFER_FEE", + "description": "Taxes associated with the transfer fee." + } + ], + "description": "Represents the type of payout fee that can incur as part of a payout.", + "x-release-status": "PUBLIC" + }, + "PayoutPaidEvent": { + "type": "object", + "description": "Published when a [Payout](entity:Payout) is complete.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"payout.paid\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was verified, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/PayoutPaidEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "1970-01-01T00:20:28.481Z", + "data": { + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "object": { + "payout": { + "amount_money": { + "amount": 457, + "currency_code": "EUR" + }, + "arrival_date": "2021-07-13", + "created_at": "2021-07-12T20:37:51Z", + "destination": { + "id": "bact:c164d7ec7302", + "type": "BANK_ACCOUNT" + }, + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "location_id": "LRJNZCB190DTQ", + "status": "PAID", + "type": "BATCH", + "updated_at": "1970-01-01T00:20:28.481Z", + "version": 2 + } + }, + "type": "payout" + }, + "event_id": "7116e4a4-7622-42b0-b16c-c164d7ec7302", + "location_id": "LRJNZCB190DTQ", + "merchant_id": "MLEWJTMNJN37Z", + "type": "payout.paid" + }, + "x-webhook": { + "event": "payout.paid", + "scopes": [ + "PAYOUTS_READ", + "SETTLEMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Payouts", + "x-since": "2022-04-20" + }, + "PayoutPaidEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"payout\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the completed payout." + }, + "object": { + "$ref": "#/components/schemas/PayoutPaidEventObject", + "description": "An object containing the completed payout.", + "nullable": true + } + } + }, + "PayoutPaidEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout": { + "$ref": "#/components/schemas/Payout", + "description": "The payout that has completed.", + "nullable": true + } + } + }, + "PayoutSentEvent": { + "type": "object", + "description": "Published when a [Payout](entity:Payout) is sent.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the target location associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"payout.sent\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was verified, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/PayoutSentEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "1970-01-01T00:20:28.481Z", + "data": { + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "object": { + "payout": { + "amount_money": { + "amount": 457, + "currency_code": "EUR" + }, + "arrival_date": "2021-07-13", + "created_at": "2021-07-12T20:37:51Z", + "destination": { + "id": "bact:c164d7ec7302", + "type": "BANK_ACCOUNT" + }, + "id": "po_070431e4-e351-11eb-a8bb-02420a140009", + "location_id": "LRJNZCB190DTQ", + "status": "SENT", + "type": "BATCH", + "updated_at": "1970-01-01T00:20:28.481Z", + "version": 1 + } + }, + "type": "payout" + }, + "event_id": "7116e4a4-7622-42b0-b16c-c164d7ec7302", + "location_id": "LRJNZCB190DTQ", + "merchant_id": "MLEWJTMNJN37Z", + "type": "payout.sent" + }, + "x-webhook": { + "event": "payout.sent", + "scopes": [ + "PAYOUTS_READ", + "SETTLEMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Payouts", + "x-since": "2022-04-20" + }, + "PayoutSentEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"payout\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the sent payout." + }, + "object": { + "$ref": "#/components/schemas/PayoutSentEventObject", + "description": "An object containing the sent payout.", + "nullable": true + } + } + }, + "PayoutSentEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "payout": { + "$ref": "#/components/schemas/Payout", + "description": "The payout that was sent.", + "nullable": true + } + } + }, + "PayoutStatus": { + "type": "string", + "enum": [ + "SENT", + "FAILED", + "PAID" + ], + "x-enum-elements": [ + { + "name": "SENT", + "description": "Indicates that the payout was successfully sent to the banking destination." + }, + { + "name": "FAILED", + "description": "Indicates that the payout was rejected by the banking destination." + }, + { + "name": "PAID", + "description": "Indicates that the payout has successfully completed." + } + ], + "description": "Payout status types", + "x-release-status": "PUBLIC" + }, + "PayoutType": { + "type": "string", + "enum": [ + "BATCH", + "SIMPLE" + ], + "x-enum-elements": [ + { + "name": "BATCH", + "description": "Payouts that include a list of payout entries that can be considered settled." + }, + { + "name": "SIMPLE", + "description": "Payouts that do not have any payout entries associated with them and will\nshow up as one of the payout entries in a future BATCH payout." + } + ], + "description": "The type of payout: “BATCH” or “SIMPLE”.\nBATCH payouts include a list of payout entries that can be considered settled.\nSIMPLE payouts do not have any payout entries associated with them\nand will show up as one of the payout entries in a future BATCH payout.", + "x-release-status": "PUBLIC" + }, + "Phase": { + "type": "object", + "description": "Represents a phase, which can override subscription phases as defined by plan_id", + "x-release-status": "PUBLIC", + "properties": { + "uid": { + "type": "string", + "description": "id of subscription phase", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "index of phase in total subscription plan", + "format": "int64", + "nullable": true + }, + "order_template_id": { + "type": "string", + "description": "id of order to be used in billing", + "nullable": true + }, + "plan_phase_uid": { + "type": "string", + "description": "the uid from the plan's phase in catalog", + "nullable": true + } + } + }, + "PhaseInput": { + "type": "object", + "description": "Represents the arguments used to construct a new phase.", + "x-release-status": "PUBLIC", + "required": [ + "ordinal" + ], + "properties": { + "ordinal": { + "type": "integer", + "description": "index of phase in total subscription plan", + "format": "int64" + }, + "order_template_id": { + "type": "string", + "description": "id of order to be used in billing", + "nullable": true + } + } + }, + "PrePopulatedData": { + "type": "object", + "description": "Describes buyer data to prepopulate in the payment form.\nFor more information,\nsee [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations).", + "x-release-status": "PUBLIC", + "properties": { + "buyer_email": { + "type": "string", + "description": "The buyer email to prepopulate in the payment form.", + "maxLength": 256, + "nullable": true + }, + "buyer_phone_number": { + "type": "string", + "description": "The buyer phone number to prepopulate in the payment form.", + "maxLength": 17, + "nullable": true + }, + "buyer_address": { + "$ref": "#/components/schemas/Address", + "description": "The buyer address to prepopulate in the payment form.", + "nullable": true + } + } + }, + "ProcessingFee": { + "type": "object", + "description": "Represents the Square processing fee.", + "x-release-status": "PUBLIC", + "properties": { + "effective_at": { + "type": "string", + "description": "The timestamp of when the fee takes effect, in RFC 3339 format.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of fee assessed or adjusted. The fee type can be `INITIAL` or `ADJUSTMENT`.", + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The fee amount, which might be negative, that is assessed or adjusted by Square.\n\nPositive values represent funds being assessed, while negative values represent\nfunds being returned.", + "nullable": true + } + } + }, + "Product": { + "type": "string", + "enum": [ + "SQUARE_POS", + "EXTERNAL_API", + "BILLING", + "APPOINTMENTS", + "INVOICES", + "ONLINE_STORE", + "PAYROLL", + "DASHBOARD", + "ITEM_LIBRARY_IMPORT", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "SQUARE_POS", + "description": "Square Point of Sale application." + }, + { + "name": "EXTERNAL_API", + "description": "Square Connect APIs (for example, Orders API or Checkout API)." + }, + { + "name": "BILLING", + "description": "A Square subscription (various products)." + }, + { + "name": "APPOINTMENTS", + "description": "Square Appointments." + }, + { + "name": "INVOICES", + "description": "Square Invoices." + }, + { + "name": "ONLINE_STORE", + "description": "Square Online Store." + }, + { + "name": "PAYROLL", + "description": "Square Payroll." + }, + { + "name": "DASHBOARD", + "description": "Square Dashboard." + }, + { + "name": "ITEM_LIBRARY_IMPORT", + "description": "Item Library Import." + }, + { + "name": "OTHER", + "description": "A Square product that does not match any other value." + } + ], + "description": "Indicates the Square product used to generate a change.", + "x-release-status": "PUBLIC" + }, + "ProductType": { + "type": "string", + "enum": [ + "TERMINAL_API" + ], + "x-enum-elements": [ + { + "name": "TERMINAL_API", + "description": "" + } + ], + "x-release-status": "PUBLIC" + }, + "PublishInvoiceRequest": { + "type": "object", + "description": "Describes a `PublishInvoice` request.", + "x-release-status": "PUBLIC", + "required": [ + "version" + ], + "properties": { + "version": { + "type": "integer", + "description": "The version of the [invoice](entity:Invoice) to publish.\nThis must match the current version of the invoice; otherwise, the request is rejected." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `PublishInvoice` request. If you do not \nprovide `idempotency_key` (or provide an empty string as the value), the endpoint \ntreats each request as independent.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 128, + "nullable": true + } + }, + "example": { + "idempotency_key": "32da42d0-1997-41b0-826b-f09464fc2c2e", + "version": 1 + } + }, + "PublishInvoiceResponse": { + "type": "object", + "description": "Describes a `PublishInvoice` response.", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The published invoice." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "public_url": "https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9", + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "SCHEDULED", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 1 + } + } + }, + "PublishScheduledShiftRequest": { + "type": "object", + "description": "Represents a [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) request.", + "x-release-status": "BETA", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique identifier for the `PublishScheduledShift` request, used to ensure the\n[idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)\nof the operation.", + "minLength": 1, + "maxLength": 128 + }, + "version": { + "type": "integer", + "description": "The current version of the scheduled shift, used to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol. If the provided version doesn't match the server version, the request fails.\nIf omitted, Square executes a blind write, potentially overwriting data from another publish request." + }, + "scheduled_shift_notification_audience": { + "$ref": "#/components/schemas/ScheduledShiftNotificationAudience", + "description": "Indicates whether Square should send an email notification to team members and\nwhich team members should receive the notification. The default value is `AFFECTED`.\nSee [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudience) for possible values", + "nullable": true + } + }, + "example": { + "idempotency_key": "HIDSNG5KS478L", + "scheduled_shift_notification_audience": "ALL", + "version": 2 + } + }, + "PublishScheduledShiftResponse": { + "type": "object", + "description": "Represents a [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) response.\nEither `scheduled_shift` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The published scheduled shift." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "scheduled_shift": { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-01-25T13:11:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "published_shift_details": { + "end_at": "2019-01-25T13:11:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "updated_at": "2019-02-25T03:11:00-05:00", + "version": 2 + } + } + }, + "QrCodeOptions": { + "type": "object", + "description": "Fields to describe the action that displays QR-Codes.", + "x-release-status": "BETA", + "required": [ + "title", + "body", + "barcode_contents" + ], + "properties": { + "title": { + "type": "string", + "description": "The title text to display in the QR code flow on the Terminal.", + "minLength": 1, + "maxLength": 250 + }, + "body": { + "type": "string", + "description": "The body text to display in the QR code flow on the Terminal.", + "minLength": 1, + "maxLength": 10000 + }, + "barcode_contents": { + "type": "string", + "description": "The text representation of the data to show in the QR code\nas UTF8-encoded data.", + "minLength": 1, + "maxLength": 1024 + } + } + }, + "QuickPay": { + "type": "object", + "description": "Describes an ad hoc item and price to generate a quick pay checkout link.\nFor more information,\nsee [Quick Pay Checkout](https://developer.squareup.com/docs/checkout-api/quick-pay-checkout).", + "x-release-status": "PUBLIC", + "required": [ + "name", + "price_money", + "location_id" + ], + "properties": { + "name": { + "type": "string", + "description": "The ad hoc item name. In the resulting `Order`, this name appears as the line item name.", + "minLength": 1, + "maxLength": 255 + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The price of the item." + }, + "location_id": { + "type": "string", + "description": "The ID of the business location the checkout is associated with." + } + } + }, + "Range": { + "type": "object", + "description": "The range of a number value between the specified lower and upper bounds.", + "x-release-status": "PUBLIC", + "properties": { + "min": { + "type": "string", + "description": "The lower bound of the number range. At least one of `min` or `max` must be specified.\nIf unspecified, the results will have no minimum value.", + "nullable": true + }, + "max": { + "type": "string", + "description": "The upper bound of the number range. At least one of `min` or `max` must be specified.\nIf unspecified, the results will have no maximum value.", + "nullable": true + } + } + }, + "ReceiptOptions": { + "type": "object", + "description": "Describes receipt action fields.", + "x-release-status": "BETA", + "required": [ + "payment_id" + ], + "properties": { + "payment_id": { + "type": "string", + "description": "The reference to the Square payment ID for the receipt." + }, + "print_only": { + "type": "boolean", + "description": "Instructs the device to print the receipt without displaying the receipt selection screen.\nRequires `printer_enabled` set to true.\nDefaults to false.", + "nullable": true + }, + "is_duplicate": { + "type": "boolean", + "description": "Identify the receipt as a reprint rather than an original receipt.\nDefaults to false.", + "nullable": true + } + } + }, + "ReceiveTransferOrderRequest": { + "type": "object", + "description": "Request to record receipt of items for a transfer order", + "x-release-status": "BETA", + "required": [ + "idempotency_key", + "receipt" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key to make this request idempotent", + "minLength": 1 + }, + "receipt": { + "$ref": "#/components/schemas/TransferOrderGoodsReceipt", + "description": "The receipt details" + }, + "version": { + "type": "integer", + "description": "Version for optimistic concurrency", + "format": "int64" + } + }, + "example": { + "idempotency_key": "EXAMPLE_IDEMPOTENCY_KEY_101", + "receipt": { + "line_items": [ + { + "quantity_canceled": "1", + "quantity_damaged": "1", + "quantity_received": "3", + "uid": "1" + }, + { + "quantity_canceled": "1", + "quantity_received": "2", + "uid": "2" + } + ] + }, + "transfer_order_id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "version": 1753118664873 + } + }, + "ReceiveTransferOrderResponse": { + "type": "object", + "description": "Response for receiving items for a transfer order", + "x-release-status": "BETA", + "properties": { + "transfer_order": { + "$ref": "#/components/schemas/TransferOrder", + "description": "The updated transfer order" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request" + } + }, + "example": { + "transfer_order": { + "completed_at": "2025-01-15T10:55:00Z", + "created_at": "2025-01-15T10:30:00Z", + "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", + "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", + "expected_at": "2025-11-09T05:00:00Z", + "id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "line_items": [ + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", + "quantity_canceled": "1", + "quantity_damaged": "1", + "quantity_ordered": "5", + "quantity_pending": "0", + "quantity_received": "3", + "uid": "1" + }, + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_002", + "quantity_canceled": "1", + "quantity_damaged": "0", + "quantity_ordered": "3", + "quantity_pending": "0", + "quantity_received": "2", + "uid": "2" + } + ], + "notes": "Example transfer order for inventory redistribution between locations", + "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", + "status": "COMPLETED", + "tracking_number": "TRACK123456789", + "updated_at": "2025-01-15T10:55:00Z", + "version": 1753118667248 + } + } + }, + "RedeemLoyaltyRewardRequest": { + "type": "object", + "description": "A request to redeem a loyalty reward.", + "x-release-status": "PUBLIC", + "x-params-example": "?reward_id=9f18ac21-233a-31c3-be77-b45840f5a810", + "required": [ + "idempotency_key", + "location_id" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `RedeemLoyaltyReward` request. \nKeys can be any valid string, but must be unique for every request.", + "minLength": 1, + "maxLength": 128 + }, + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location) where the reward is redeemed.", + "minLength": 1 + } + }, + "example": { + "idempotency_key": "98adc7f7-6963-473b-b29c-f3c9cdd7d994", + "location_id": "P034NEENMD09F" + } + }, + "RedeemLoyaltyRewardResponse": { + "type": "object", + "description": "A response that includes the `LoyaltyEvent` published for redeeming the reward.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "event": { + "$ref": "#/components/schemas/LoyaltyEvent", + "description": "The `LoyaltyEvent` for redeeming the reward." + } + }, + "example": { + "event": { + "created_at": "2020-05-08T21:56:00Z", + "id": "67377a6e-dbdc-369d-aa16-2e7ed422e71f", + "location_id": "P034NEENMD09F", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "redeem_reward": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "reward_id": "9f18ac21-233a-31c3-be77-b45840f5a810" + }, + "source": "LOYALTY_API", + "type": "REDEEM_REWARD" + } + } + }, + "Reference": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "$ref": "#/components/schemas/ReferenceType", + "description": "The type of entity a channel is associated with.\nSee [Type](#type-type) for possible values", + "nullable": true + }, + "id": { + "type": "string", + "description": "The id of the entity a channel is associated with." + } + } + }, + "ReferenceType": { + "type": "string", + "enum": [ + "UNKNOWN_TYPE", + "LOCATION", + "FIRST_PARTY_INTEGRATION", + "OAUTH_APPLICATION", + "ONLINE_SITE", + "ONLINE_CHECKOUT", + "INVOICE", + "GIFT_CARD", + "GIFT_CARD_MARKETPLACE", + "RECURRING_SUBSCRIPTION", + "ONLINE_BOOKING_FLOW", + "SQUARE_ASSISTANT", + "CASH_LOCAL", + "POINT_OF_SALE", + "KIOSK" + ], + "x-enum-elements": [ + { + "name": "UNKNOWN_TYPE", + "description": "" + }, + { + "name": "LOCATION", + "description": "" + }, + { + "name": "FIRST_PARTY_INTEGRATION", + "description": "" + }, + { + "name": "OAUTH_APPLICATION", + "description": "" + }, + { + "name": "ONLINE_SITE", + "description": "" + }, + { + "name": "ONLINE_CHECKOUT", + "description": "" + }, + { + "name": "INVOICE", + "description": "" + }, + { + "name": "GIFT_CARD", + "description": "" + }, + { + "name": "GIFT_CARD_MARKETPLACE", + "description": "" + }, + { + "name": "RECURRING_SUBSCRIPTION", + "description": "" + }, + { + "name": "ONLINE_BOOKING_FLOW", + "description": "" + }, + { + "name": "SQUARE_ASSISTANT", + "description": "" + }, + { + "name": "CASH_LOCAL", + "description": "" + }, + { + "name": "POINT_OF_SALE", + "description": "" + }, + { + "name": "KIOSK", + "description": "" + } + ], + "description": "The type of platform concept a channel can represent.", + "x-release-status": "BETA" + }, + "Refund": { + "type": "object", + "description": "Represents a refund processed for a Square transaction.", + "x-release-status": "PUBLIC", + "required": [ + "id", + "location_id", + "reason", + "amount_money", + "status" + ], + "properties": { + "id": { + "type": "string", + "description": "The refund's unique ID.", + "maxLength": 255 + }, + "location_id": { + "type": "string", + "description": "The ID of the refund's associated location.", + "maxLength": 50 + }, + "transaction_id": { + "type": "string", + "description": "The ID of the transaction that the refunded tender is part of.", + "maxLength": 192, + "nullable": true + }, + "tender_id": { + "type": "string", + "description": "The ID of the refunded tender.", + "maxLength": 192, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the refund was created, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "reason": { + "type": "string", + "description": "The reason for the refund being issued.", + "maxLength": 192 + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money refunded to the buyer." + }, + "status": { + "$ref": "#/components/schemas/RefundStatus", + "description": "The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`,\nor `FAILED`).\nSee [RefundStatus](#type-refundstatus) for possible values" + }, + "processing_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of Square processing fee money refunded to the *merchant*.", + "nullable": true + }, + "additional_recipients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdditionalRecipient" + }, + "description": "Additional recipients (other than the merchant) receiving a portion of this refund.\nFor example, fees assessed on a refund of a purchase by a third party integration.", + "x-release-status": "DEPRECATED", + "nullable": true + } + } + }, + "RefundCreatedEvent": { + "type": "object", + "description": "Published when a [Refund](entity:PaymentRefund) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"refund.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/RefundCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T21:27:41.852Z", + "data": { + "id": "KkAkhdMsgzn59SM8A89WgKwekxLZY_ptNBVqHYxt5gAdfcobBe4u1AZsXhoz06KTtuq9Ls24P", + "object": { + "refund": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "created_at": "2020-02-06T21:27:41.836Z", + "id": "KkAkhdMsgzn59SM8A89WgKwekxLZY_ptNBVqHYxt5gAdfcobBe4u1AZsXhoz06KTtuq9Ls24P", + "location_id": "NAQ1FHV6ZJ8YV", + "order_id": "haOyDuHiqtAXMk0d8pDKXpL7Jg4F", + "payment_id": "KkAkhdMsgzn59SM8A89WgKwekxLZY", + "status": "PENDING", + "updated_at": "2020-02-06T21:27:41.846Z", + "version": 7 + } + }, + "type": "refund" + }, + "event_id": "bc316346-6691-4243-88ed-6d651a0d0c47", + "merchant_id": "6SSW7HV8K2ST5", + "type": "refund.created" + }, + "x-webhook": { + "event": "refund.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Refunds", + "x-since": "2020-02-26" + }, + "RefundCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"refund\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected refund.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/RefundCreatedEventObject", + "description": "An object containing the created refund.", + "nullable": true + } + } + }, + "RefundCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "refund": { + "$ref": "#/components/schemas/PaymentRefund", + "description": "The created refund.", + "nullable": true + } + } + }, + "RefundPaymentRequest": { + "type": "object", + "description": "Describes a request to refund a payment using [RefundPayment](api-endpoint:Refunds-RefundPayment).", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "amount_money" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": " A unique string that identifies this `RefundPayment` request. The key can be any valid string\nbut must be unique for every `RefundPayment` request.\n\nKeys are limited to a max of 45 characters - however, the number of allowed characters might be\nless than 45, if multi-byte characters are used.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).", + "minLength": 1 + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money to refund.\n\nThis amount cannot be more than the `total_money` value of the payment minus the total\namount of all previously completed refunds for this payment.\n\nThis amount must be specified in the smallest denomination of the applicable currency\n(for example, US dollar amounts are specified in cents). For more information, see\n[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).\n\nThe currency code must match the currency associated with the business\nthat is charging the card." + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money the developer contributes to help cover the refunded amount.\nThis amount is specified in the smallest denomination of the applicable currency (for example,\nUS dollar amounts are specified in cents).\n\nThe value cannot be more than the `amount_money`.\n\nYou can specify this parameter in a refund request only if the same parameter was also included\nwhen taking the payment. This is part of the application fee scenario the API supports. For more\ninformation, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).\n\nTo set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required.\nFor more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).", + "x-release-status": "BETA", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The unique ID of the payment being refunded.\nRequired when unlinked=false, otherwise must not be set.", + "nullable": true + }, + "destination_id": { + "type": "string", + "description": "The ID indicating where funds will be refunded to. Required for unlinked refunds. For more\ninformation, see [Process an Unlinked Refund](https://developer.squareup.com/docs/refunds-api/unlinked-refunds).\n\nFor refunds linked to Square payments, `destination_id` is usually omitted; in this case, funds\nwill be returned to the original payment source. The field may be specified in order to request\na cross-method refund to a gift card. For more information,\nsee [Cross-method refunds to gift cards](https://developer.squareup.com/docs/payments-api/refund-payments#cross-method-refunds-to-gift-cards).", + "nullable": true + }, + "unlinked": { + "type": "boolean", + "description": "Indicates that the refund is not linked to a Square payment.\nIf set to true, `destination_id` and `location_id` must be supplied while `payment_id` must not\nbe provided.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The location ID associated with the unlinked refund.\nRequired for requests specifying `unlinked=true`.\nOtherwise, if included when `unlinked=false`, will throw an error.", + "maxLength": 50, + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "The [Customer](entity:Customer) ID of the customer associated with the refund.\nThis is required if the `destination_id` refers to a card on file created using the Cards\nAPI. Only allowed when `unlinked=true`.", + "nullable": true + }, + "reason": { + "type": "string", + "description": "A description of the reason for the refund.", + "maxLength": 192, + "nullable": true + }, + "payment_version_token": { + "type": "string", + "description": " Used for optimistic concurrency. This opaque token identifies the current `Payment`\nversion that the caller expects. If the server has a different version of the Payment,\nthe update fails and a response with a VERSION_MISMATCH error is returned.\nIf the versions match, or the field is not provided, the refund proceeds as normal.", + "x-release-status": "BETA", + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "An optional [TeamMember](entity:TeamMember) ID to associate with this refund.", + "maxLength": 192, + "nullable": true + }, + "cash_details": { + "$ref": "#/components/schemas/DestinationDetailsCashRefundDetails", + "description": "Additional details required when recording an unlinked cash refund (`destination_id` is CASH).", + "nullable": true + }, + "external_details": { + "$ref": "#/components/schemas/DestinationDetailsExternalRefundDetails", + "description": "Additional details required when recording an unlinked external refund\n(`destination_id` is EXTERNAL).", + "nullable": true + } + }, + "example": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "app_fee_money": { + "amount": 10, + "currency": "USD" + }, + "idempotency_key": "9b7f2dcf-49da-4411-b23e-a2d6af21333a", + "payment_id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", + "reason": "Example" + } + }, + "RefundPaymentResponse": { + "type": "object", + "description": "Defines the response returned by\n[RefundPayment](api-endpoint:Refunds-RefundPayment).\n\nIf there are errors processing the request, the `refund` field might not be\npresent, or it might be present with a status of `FAILED`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refund": { + "$ref": "#/components/schemas/PaymentRefund", + "description": "The successfully created `PaymentRefund`." + } + }, + "example": { + "refund": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "app_fee_money": { + "amount": 10, + "currency": "USD" + }, + "created_at": "2021-10-13T21:23:19.116Z", + "id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY_KlWP8IC1557ddwc9QWTKrCVU6m0JXDz15R2Qym5eQfR", + "location_id": "L88917AVBK2S5", + "order_id": "1JLEUZeEooAIX8HMqm9kvWd69aQZY", + "payment_id": "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", + "reason": "Example", + "status": "PENDING", + "updated_at": "2021-10-13T21:23:19.508Z" + } + } + }, + "RefundStatus": { + "type": "string", + "enum": [ + "PENDING", + "APPROVED", + "REJECTED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The refund is pending." + }, + { + "name": "APPROVED", + "description": "The refund has been approved by Square." + }, + { + "name": "REJECTED", + "description": "The refund has been rejected by Square." + }, + { + "name": "FAILED", + "description": "The refund failed." + } + ], + "description": "Indicates a refund's current status.", + "x-release-status": "PUBLIC" + }, + "RefundUpdatedEvent": { + "type": "object", + "description": "Published when a [Refund](entity:PaymentRefund) is updated.\nTypically the `refund.status` changes when a refund is completed.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"refund.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/RefundUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-02-06T22:14:16.421Z", + "data": { + "id": "KkAkhdMsgzn59SM8A89WgKwekxLZY_ptNBVqHYxt5gAdfcobBe4u1AZsXhoz06KTtuq9Ls24P", + "object": { + "refund": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "created_at": "2020-02-06T21:27:41.836Z", + "id": "KkAkhdMsgzn59SM8A89WgKwekxLZY_ptNBVqHYxt5gAdfcobBe4u1AZsXhoz06KTtuq9Ls24P", + "location_id": "NAQ1FHV6ZJ8YV", + "order_id": "haOyDuHiqtAXMk0d8pDKXpL7Jg4F", + "payment_id": "KkAkhdMsgzn59SM8A89WgKwekxLZY", + "processing_fee": [ + { + "amount_money": { + "amount": -59, + "currency": "USD" + }, + "effective_at": "2020-02-06T23:27:31.000Z", + "type": "INITIAL" + } + ], + "status": "COMPLETED", + "updated_at": "2020-02-06T22:14:16.381Z", + "version": 10 + } + }, + "type": "refund" + }, + "event_id": "bc316346-6691-4243-88ed-6d651a0d0c47", + "merchant_id": "6SSW7HV8K2ST5", + "type": "refund.updated" + }, + "x-webhook": { + "event": "refund.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Refunds", + "x-since": "2020-02-26" + }, + "RefundUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"refund\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected refund.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/RefundUpdatedEventObject", + "description": "An object containing the updated refund.", + "nullable": true + } + } + }, + "RefundUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "refund": { + "$ref": "#/components/schemas/PaymentRefund", + "description": "The updated refund.", + "nullable": true + } + } + }, + "RegisterDomainRequest": { + "type": "object", + "description": "Defines the parameters that can be included in the body of\na request to the [RegisterDomain](api-endpoint:ApplePay-RegisterDomain) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "domain_name" + ], + "properties": { + "domain_name": { + "type": "string", + "description": "A domain name as described in RFC-1034 that will be registered with ApplePay.", + "minLength": 1, + "maxLength": 255 + } + }, + "example": { + "domain_name": "example.com" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.csharp", + "java": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.java", + "javascript": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.javascript", + "php": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.php", + "python": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.python", + "ruby": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainRequest.ruby" + } + }, + "RegisterDomainResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RegisterDomain](api-endpoint:ApplePay-RegisterDomain) endpoint.\n\nEither `errors` or `status` are present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "status": { + "$ref": "#/components/schemas/RegisterDomainResponseStatus", + "description": "The status of the domain registration.\n\nSee [RegisterDomainResponseStatus](entity:RegisterDomainResponseStatus) for possible values.\nSee [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values" + } + }, + "example": { + "status": "VERIFIED" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.csharp", + "java": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.java", + "javascript": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.javascript", + "php": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.php", + "python": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.python", + "ruby": "/sdk_samples/ApplePay/RegisterDomain/RegisterDomainResponse.ruby" + } + }, + "RegisterDomainResponseStatus": { + "type": "string", + "enum": [ + "PENDING", + "VERIFIED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The domain is added, but not verified." + }, + { + "name": "VERIFIED", + "description": "The domain is added and verified. It can be used to accept Apple Pay transactions." + } + ], + "description": "The status of the domain registration.", + "x-release-status": "PUBLIC" + }, + "RemoveGroupFromCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RemoveGroupFromCustomer](api-endpoint:Customers-RemoveGroupFromCustomer)\nendpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {} + }, + "ResumeSubscriptionRequest": { + "type": "object", + "description": "Defines input parameters in a request to the\n[ResumeSubscription](api-endpoint:Subscriptions-ResumeSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "resume_effective_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the subscription reactivated.", + "x-release-status": "BETA", + "nullable": true + }, + "resume_change_timing": { + "$ref": "#/components/schemas/ChangeTiming", + "description": "The timing to resume a subscription, relative to the specified\n`resume_effective_date` attribute value.\nSee [ChangeTiming](#type-changetiming) for possible values", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "ResumeSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the \n[ResumeSubscription](api-endpoint:Subscriptions-ResumeSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The resumed subscription." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "A list of `RESUME` actions created by the request and scheduled for the subscription.", + "x-release-status": "BETA" + } + }, + "example": { + "actions": [ + { + "effective_date": "2023-09-01", + "id": "18ff74f4-3da4-30c5-929f-7d6fca84f115", + "type": "RESUME" + } + ], + "subscription": { + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + "ordinal": 0, + "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", + "uid": "873451e0-745b-4e87-ab0b-c574933fe616" + } + ], + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2023-06-20", + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 1 + } + } + }, + "RetrieveBookingCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [RetrieveBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The retrieved custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-11-16T15:27:30Z", + "description": "The favorite shampoo of the customer.", + "key": "favoriteShampoo", + "name": "Favorite shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-16T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] + } + }, + "RetrieveBookingCustomAttributeResponse": { + "type": "object", + "description": "Represents a [RetrieveBookingCustomAttribute](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The retrieved custom attribute. If `with_definition` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-11-16T15:50:27Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T15:50:27Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [] + } + }, + "RetrieveBookingResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The booking that was requested." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "booking": { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "created_at": "2020-10-28T15:47:41Z", + "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + "customer_note": "", + "id": "zkras0xv0xwswx", + "location_id": "LEQHH0YY8B42M", + "seller_note": "", + "start_at": "2020-11-26T13:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-10-28T15:49:25Z", + "version": 1 + }, + "errors": [] + } + }, + "RetrieveBusinessBookingProfileResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "business_booking_profile": { + "$ref": "#/components/schemas/BusinessBookingProfile", + "description": "The seller's booking profile." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "business_booking_profile": { + "allow_user_cancel": true, + "booking_enabled": true, + "booking_policy": "ACCEPT_ALL", + "business_appointment_settings": { + "alignment_time": "HALF_HOURLY", + "any_team_member_booking_enabled": true, + "cancellation_fee_money": { + "currency": "USD" + }, + "cancellation_policy": "CUSTOM_POLICY", + "location_types": [ + "BUSINESS_LOCATION" + ], + "max_booking_lead_time_seconds": 31536000, + "min_booking_lead_time_seconds": 0, + "multiple_service_booking_enabled": true, + "skip_booking_flow_staff_selection": false + }, + "created_at": "2020-09-10T21:40:38Z", + "customer_timezone_choice": "CUSTOMER_CHOICE", + "seller_id": "MLJQYZZRM0D3Y" + }, + "errors": [] + } + }, + "RetrieveCardResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RetrieveCard](api-endpoint:Cards-RetrieveCard) endpoint.\n\nNote: if there are errors processing the request, the card field will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The retrieved card." + } + }, + "example": { + "card": { + "billing_address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "bin": "411111", + "card_brand": "VISA", + "card_type": "CREDIT", + "cardholder_name": "Amelia Earhart", + "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8", + "enabled": true, + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + "hsa_fsa": false, + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + } + } + }, + "RetrieveCashDrawerShiftResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "cash_drawer_shift": { + "$ref": "#/components/schemas/CashDrawerShift", + "description": "The cash drawer shift queried for." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cash_drawer_shift": { + "cash_paid_in_money": { + "amount": 10000, + "currency": "USD" + }, + "cash_paid_out_money": { + "amount": -10000, + "currency": "USD" + }, + "cash_payment_money": { + "amount": 100, + "currency": "USD" + }, + "cash_refunds_money": { + "amount": -100, + "currency": "USD" + }, + "closed_at": "2019-11-22T00:44:49.000Z", + "closed_cash_money": { + "amount": 9970, + "currency": "USD" + }, + "closing_team_member_id": "", + "description": "Misplaced some change", + "device": { + "name": "My iPad" + }, + "ended_at": "2019-11-22T00:44:49.000Z", + "ending_team_member_id": "", + "expected_cash_money": { + "amount": 10000, + "currency": "USD" + }, + "id": "DCC99978-09A6-4926-849F-300BE9C5793A", + "opened_at": "2019-11-22T00:42:54.000Z", + "opened_cash_money": { + "amount": 10000, + "currency": "USD" + }, + "opening_team_member_id": "", + "state": "CLOSED" + } + } + }, + "RetrieveCatalogObjectResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "object": { + "$ref": "#/components/schemas/CatalogObject", + "description": "The `CatalogObject`s returned." + }, + "related_objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of `CatalogObject`s referenced by the object in the `object` field." + } + }, + "example": { + "object": { + "id": "W62UWFY35CWMYGVWK6TWJDNI", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "ordinal": 0 + } + ], + "description": "Hot Leaf Juice", + "name": "Tea", + "tax_ids": [ + "HURXQOOAIC4IZSI2BEXQRYFY" + ], + "variations": [ + { + "id": "2TZFAOHWGG7PAK2QEXWYPZSP", + "is_deleted": false, + "item_variation_data": { + "item_id": "W62UWFY35CWMYGVWK6TWJDNI", + "name": "Mug", + "ordinal": 0, + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + }, + "related_objects": [ + { + "category_data": { + "name": "Beverages" + }, + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "is_deleted": false, + "present_at_all_locations": true, + "type": "CATEGORY", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + }, + { + "id": "HURXQOOAIC4IZSI2BEXQRYFY", + "is_deleted": false, + "present_at_all_locations": true, + "tax_data": { + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "enabled": true, + "inclusion_type": "ADDITIVE", + "name": "Sales Tax", + "percentage": "5.0" + }, + "type": "TAX", + "updated_at": "2016-11-16T22:25:24.878Z", + "version": 1479335124878 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.csharp", + "java": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.java", + "javascript": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.javascript", + "php": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.php", + "python": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.python", + "ruby": "/sdk_samples/Catalog/RetrieveCatalogObject/RetrieveCatalogObjectResponse.ruby" + } + }, + "RetrieveChannelResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "channel": { + "$ref": "#/components/schemas/Channel", + "description": "The requested Channel." + } + }, + "example": { + "channel": { + "created_at": "2022-10-25T16:27:00Z", + "id": "CH_9C03D0B59", + "merchant_id": "ML64FACEA", + "name": "Contoso Fulfillment Application", + "reference": { + "id": "OA_9C03D0444", + "type": "OAUTH_APPLICATION" + }, + "status": "ACTIVE", + "updated_at": "2022-10-25T16:48:00Z", + "version": 1 + } + } + }, + "RetrieveCustomerCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [RetrieveCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The retrieved custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-04-26T15:27:30Z", + "description": "The favorite movie of the customer.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "RetrieveCustomerCustomAttributeResponse": { + "type": "object", + "description": "Represents a [RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The retrieved custom attribute. If `with_definition` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-04-26T15:50:27Z", + "key": "favoritemovie", + "updated_at": "2022-04-26T15:50:27Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "RetrieveCustomerGroupResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RetrieveCustomerGroup](api-endpoint:CustomerGroups-RetrieveCustomerGroup) endpoint.\n\nEither `errors` or `group` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "group": { + "$ref": "#/components/schemas/CustomerGroup", + "description": "The retrieved customer group." + } + }, + "example": { + "group": { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + } + } + }, + "RetrieveCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `RetrieveCustomer` endpoint.\n\nEither `errors` or `customer` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The requested customer." + } + }, + "example": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "group_ids": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ], + "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "note": "a customer", + "phone_number": "+1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "segment_ids": [ + "1KB9JE5EGJXCW.REACHABLE" + ], + "updated_at": "2016-03-23T20:21:54.859Z", + "version": 1 + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.csharp", + "java": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.java", + "javascript": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.javascript", + "php": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.php", + "python": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.python", + "ruby": "/sdk_samples/RetrieveCustomer/RetrieveCustomerResponse.ruby" + } + }, + "RetrieveCustomerSegmentResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body for requests to the `RetrieveCustomerSegment` endpoint.\n\nEither `errors` or `segment` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "segment": { + "$ref": "#/components/schemas/CustomerSegment", + "description": "The retrieved customer segment." + } + }, + "example": { + "segment": { + "created_at": "2020-01-09T19:33:24.469Z", + "id": "GMNXRZVEXNQDF.CHURN_RISK", + "name": "Lapsed", + "updated_at": "2020-04-13T23:01:13Z" + } + } + }, + "RetrieveDisputeEvidenceResponse": { + "type": "object", + "description": "Defines the fields in a `RetrieveDisputeEvidence` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "evidence": { + "$ref": "#/components/schemas/DisputeEvidence", + "description": "Metadata about the dispute evidence file." + } + }, + "example": { + "evidence": { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_file": { + "filename": "customer-interaction.jpg", + "filetype": "image/jpeg" + }, + "evidence_type": "CARDHOLDER_COMMUNICATION", + "id": "TOomLInj6iWmP3N8qfCXrB", + "uploaded_at": "2022-05-18T16:01:10.000Z" + } + } + }, + "RetrieveDisputeResponse": { + "type": "object", + "description": "Defines fields in a `RetrieveDispute` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "dispute": { + "$ref": "#/components/schemas/Dispute", + "description": "Details about the requested `Dispute`." + } + }, + "example": { + "dispute": { + "amount_money": { + "amount": 2500, + "currency": "USD" + }, + "brand_dispute_id": "100000809947", + "card_brand": "VISA", + "created_at": "2022-06-29T18:45:22.265Z", + "disputed_payment": { + "payment_id": "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" + }, + "due_at": "2022-07-13T00:00:00.000Z", + "id": "XDgyFu7yo1E2S5lQGGpYn", + "location_id": "L1HN3ZMQK64X9", + "reason": "NO_KNOWLEDGE", + "reported_at": "2022-06-29T00:00:00.000Z", + "state": "ACCEPTED", + "updated_at": "2022-07-07T19:14:42.650Z", + "version": 2 + } + } + }, + "RetrieveEmployeeResponse": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "employee": { + "$ref": "#/components/schemas/Employee" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + } + }, + "RetrieveGiftCardFromGANRequest": { + "type": "object", + "description": "A request to retrieve gift cards by their GANs.", + "x-release-status": "PUBLIC", + "required": [ + "gan" + ], + "properties": { + "gan": { + "type": "string", + "description": "The gift card account number (GAN) of the gift card to retrieve.\nThe maximum length of a GAN is 255 digits to account for third-party GANs that have been imported.\nSquare-issued gift cards have 16-digit GANs.", + "minLength": 1, + "maxLength": 255 + } + }, + "example": { + "gan": "7783320001001635" + } + }, + "RetrieveGiftCardFromGANResponse": { + "type": "object", + "description": "A response that contains a `GiftCard`. This response might contain a set of `Error` objects\nif the request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "A gift card that was fetched, if present. It returns empty if an error occurred." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 5000, + "currency": "USD" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gan": "7783320001001635", + "gan_source": "SQUARE", + "id": "gftc:6944163553804e439d89adb47caf806a", + "state": "ACTIVE", + "type": "DIGITAL" + } + } + }, + "RetrieveGiftCardFromNonceRequest": { + "type": "object", + "description": "A request to retrieve a gift card by using a payment token.", + "x-release-status": "PUBLIC", + "required": [ + "nonce" + ], + "properties": { + "nonce": { + "type": "string", + "description": "The payment token of the gift card to retrieve. Payment tokens are generated by the \nWeb Payments SDK or In-App Payments SDK.", + "minLength": 1 + } + }, + "example": { + "nonce": "cnon:7783322135245171" + } + }, + "RetrieveGiftCardFromNonceResponse": { + "type": "object", + "description": "A response that contains a `GiftCard` object. If the request resulted in errors, \nthe response contains a set of `Error` objects.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The retrieved gift card." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 5000, + "currency": "USD" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gan": "7783320001001635", + "gan_source": "SQUARE", + "id": "gftc:6944163553804e439d89adb47caf806a", + "state": "ACTIVE", + "type": "DIGITAL" + } + } + }, + "RetrieveGiftCardResponse": { + "type": "object", + "description": "A response that contains a `GiftCard`. The response might contain a set of `Error` objects\nif the request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card retrieved." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 1000, + "currency": "USD" + }, + "created_at": "2021-05-20T22:26:54.000Z", + "gan": "7783320001001635", + "gan_source": "SQUARE", + "id": "gftc:00113070ba5745f0b2377c1b9570cb03", + "state": "ACTIVE", + "type": "DIGITAL" + } + } + }, + "RetrieveInventoryAdjustmentResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "adjustment": { + "$ref": "#/components/schemas/InventoryAdjustment", + "description": "The requested [InventoryAdjustment](entity:InventoryAdjustment)." + } + }, + "example": { + "adjustment": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-17T13:02:15.142Z", + "from_state": "IN_STOCK", + "id": "UDMOEO78BG6GYWA2XDRYX3KB", + "location_id": "C6W5YS5QM06F5", + "occurred_at": "2016-11-16T25:44:22.837Z", + "quantity": "7", + "reference_id": "4a366069-4096-47a2-99a5-0084ac879509", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "team_member_id": "LRK57NSQ5X7PUD05", + "to_state": "SOLD", + "total_price_money": { + "amount": 4550, + "currency": "USD" + } + }, + "errors": [] + } + }, + "RetrieveInventoryChangesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "changes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryChange" + }, + "description": "The set of inventory changes for the requested object and locations." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "changes": [ + { + "adjustment": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-16T22:25:24.878Z", + "from_state": "IN_STOCK", + "id": "OJKJIUANKLMLQANZADNPLKAD", + "location_id": "C6W5YS5QM06F5", + "occurred_at": "2016-11-16T22:25:24.878Z", + "quantity": "3", + "reference_id": "d8207693-168f-4b44-a2fd-a7ff533ddd26", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "team_member_id": "AV7YRCGI2H1J5NQ8E1XIZCNA", + "to_state": "SOLD", + "total_price_money": { + "amount": 5000, + "currency": "USD" + }, + "transaction_id": "5APV6JYK1SNCZD11AND2RX1Z" + }, + "type": "ADJUSTMENT" + } + ], + "errors": [] + } + }, + "RetrieveInventoryCountResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "counts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InventoryCount" + }, + "description": "The current calculated inventory counts for the requested object and\nlocations." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "counts": [ + { + "calculated_at": "2016-11-16T22:28:01.223Z", + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "location_id": "C6W5YS5QM06F5", + "quantity": "22", + "state": "IN_STOCK" + } + ], + "errors": [] + } + }, + "RetrieveInventoryPhysicalCountResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "count": { + "$ref": "#/components/schemas/InventoryPhysicalCount", + "description": "The requested [InventoryPhysicalCount](entity:InventoryPhysicalCount)." + } + }, + "example": { + "count": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-16T22:25:24.878Z", + "id": "ANZADNPLKADOJKJIUANKLMLQ", + "location_id": "C6W5YS5QM06F5", + "occurred_at": "2016-11-16T22:25:24.878Z", + "quantity": "15", + "reference_id": "f857ec37-f9a0-4458-8e23-5b5e0bea4e53", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "state": "IN_STOCK", + "team_member_id": "LRK57NSQ5X7PUD05" + }, + "errors": [] + } + }, + "RetrieveInventoryTransferResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "transfer": { + "$ref": "#/components/schemas/InventoryTransfer", + "description": "The requested [InventoryTransfer](entity:InventoryTransfer)." + } + }, + "example": { + "errors": [], + "transfer": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-17T13:02:15.142Z", + "from_location_id": "C6W5YS5QM06F5", + "id": "UDMOEO78BG6GYWA2XDRYX3KB", + "occurred_at": "2016-11-16T25:44:22.837Z", + "quantity": "7", + "reference_id": "4a366069-4096-47a2-99a5-0084ac879509", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "state": "IN_STOCK", + "team_member_id": "LRK57NSQ5X7PUD05", + "to_location_id": "59TNP9SA8VGDA" + } + } + }, + "RetrieveJobResponse": { + "type": "object", + "description": "Represents a [RetrieveJob](api-endpoint:Team-RetrieveJob) response. Either `job` or `errors`\nis present in the response.", + "x-release-status": "BETA", + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The retrieved job." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "job": { + "created_at": "2021-06-11T22:55:45Z", + "id": "1yJlHapkseYnNPETIU1B", + "is_tip_eligible": true, + "title": "Cashier 1", + "updated_at": "2021-06-11T22:55:45Z", + "version": 2 + } + } + }, + "RetrieveLocationBookingProfileResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "location_booking_profile": { + "$ref": "#/components/schemas/LocationBookingProfile", + "description": "The requested location booking profile." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "errors": [], + "location_booking_profile": { + "booking_enabled": true, + "booking_site_url": "https://square.site/book/L3HETDGYQ4A2C/prod-business", + "location_id": "L3HETDGYQ4A2C" + } + } + }, + "RetrieveLocationCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [RetrieveLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The retrieved custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-12-02T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "RetrieveLocationCustomAttributeResponse": { + "type": "object", + "description": "Represents a [RetrieveLocationCustomAttribute](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The retrieved custom attribute. If `with_definition` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-01-09T19:02:58.647Z", + "key": "bestseller", + "updated_at": "2023-01-09T19:21:04.551Z", + "value": "hot cocoa", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "RetrieveLocationResponse": { + "type": "object", + "description": "Defines the fields that the [RetrieveLocation](api-endpoint:Locations-RetrieveLocation)\nendpoint returns in a response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "location": { + "$ref": "#/components/schemas/Location", + "description": "The requested location." + } + }, + "example": { + "location": { + "address": { + "address_line_1": "123 Main St", + "administrative_district_level_1": "CA", + "country": "US", + "locality": "San Francisco", + "postal_code": "94114" + }, + "business_name": "Jet Fuel Coffee", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ], + "country": "US", + "created_at": "2016-09-19T17:33:12Z", + "currency": "USD", + "id": "18YC4JDH91E1H", + "language_code": "en-US", + "merchant_id": "3MYCJG5GVYQ8Q", + "name": "Grant Park", + "phone_number": "+1 650-354-7217", + "status": "ACTIVE", + "timezone": "America/Los_Angeles" + } + } + }, + "RetrieveLocationSettingsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "location_settings": { + "$ref": "#/components/schemas/CheckoutLocationSettings", + "description": "The location settings." + } + }, + "example": { + "location_settings": { + "branding": { + "button_color": "#ffffff", + "button_shape": "ROUNDED", + "header_type": "FRAMED_LOGO" + }, + "customer_notes_enabled": true, + "location_id": "LOCATION_ID_1", + "policies": [ + { + "description": "This is my Return Policy", + "title": "Return Policy", + "uid": "POLICY_ID_1" + } + ], + "tipping": { + "default_percent": 15, + "default_whole_amount_money": { + "amount": 100, + "currency": "USD" + }, + "percentages": [ + 10, + 15, + 20 + ], + "smart_tipping_enabled": true, + "whole_amounts": [ + { + "amount": 1000, + "currency": "USD" + }, + { + "amount": 1500, + "currency": "USD" + }, + { + "amount": 2000, + "currency": "USD" + } + ] + }, + "updated_at": "2022-06-16T22:25:35Z" + } + } + }, + "RetrieveLoyaltyAccountResponse": { + "type": "object", + "description": "A response that includes the loyalty account.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_account": { + "$ref": "#/components/schemas/LoyaltyAccount", + "description": "The loyalty account." + } + }, + "example": { + "loyalty_account": { + "balance": 10, + "created_at": "2020-05-08T21:44:32Z", + "customer_id": "Q8002FAM9V1EZ0ADB2T5609X6NET1H0", + "id": "79b807d2-d786-46a9-933b-918028d7a8c5", + "lifetime_points": 20, + "mapping": { + "created_at": "2020-05-08T21:44:32Z", + "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234" + }, + "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "updated_at": "2020-05-08T21:44:32Z" + } + } + }, + "RetrieveLoyaltyProgramResponse": { + "type": "object", + "description": "A response that contains the loyalty program.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "program": { + "$ref": "#/components/schemas/LoyaltyProgram", + "description": "The loyalty program that was requested." + } + }, + "example": { + "program": { + "accrual_rules": [ + { + "accrual_type": "SPEND", + "points": 1, + "spend_data": { + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "excluded_category_ids": [ + "7ZERJKO5PVYXCVUHV2JCZ2UG", + "FQKAOJE5C4FIMF5A2URMLW6V" + ], + "excluded_item_variation_ids": [ + "CBZXBUVVTYUBZGQO44RHMR6B", + "EDILT24Z2NISEXDKGY6HP7XV" + ], + "tax_mode": "BEFORE_TAX" + } + } + ], + "created_at": "2020-04-20T16:55:11Z", + "id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "location_ids": [ + "P034NEENMD09F" + ], + "reward_tiers": [ + { + "created_at": "2020-04-20T16:55:11Z", + "id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "name": "10% off entire sale", + "points": 10, + "pricing_rule_reference": { + "catalog_version": "1605486402527", + "object_id": "74C4JSHESNLTB2A7ITO5HO6F" + } + } + ], + "status": "ACTIVE", + "terminology": { + "one": "Point", + "other": "Points" + }, + "updated_at": "2020-05-01T02:00:02Z" + } + } + }, + "RetrieveLoyaltyPromotionResponse": { + "type": "object", + "description": "Represents a [RetrieveLoyaltyPromotionPromotions](api-endpoint:Loyalty-RetrieveLoyaltyPromotion) response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_promotion": { + "$ref": "#/components/schemas/LoyaltyPromotion", + "description": "The retrieved loyalty promotion." + } + }, + "example": { + "loyalty_promotion": { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ] + }, + "created_at": "2022-08-16T08:38:54Z", + "id": "loypromo_f0f9b849-725e-378d-b810-511237e07b67", + "incentive": { + "points_multiplier_data": { + "multiplier": "3.000", + "points_multiplier": 3 + }, + "type": "POINTS_MULTIPLIER" + }, + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Tuesday Happy Hour Promo", + "qualifying_item_variation_ids": [ + "CJ3RYL56ITAKMD4VRCM7XERS", + "AT3RYLR3TUA9C34VRCB7X5RR" + ], + "status": "ACTIVE", + "trigger_limit": { + "interval": "DAY", + "times": 1 + }, + "updated_at": "2022-08-16T08:38:54Z" + } + } + }, + "RetrieveLoyaltyRewardResponse": { + "type": "object", + "description": "A response that includes the loyalty reward.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "reward": { + "$ref": "#/components/schemas/LoyaltyReward", + "description": "The loyalty reward retrieved." + } + }, + "example": { + "reward": { + "created_at": "2020-05-08T21:55:42Z", + "id": "9f18ac21-233a-31c3-be77-b45840f5a810", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "points": 10, + "redeemed_at": "2020-05-08T21:56:00Z", + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "REDEEMED", + "updated_at": "2020-05-08T21:56:00Z" + } + } + }, + "RetrieveMerchantCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a [RetrieveMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The retrieved custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2023-05-05T19:06:36.559Z", + "description": "This is the other name this merchant goes by.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2023-05-05T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "RetrieveMerchantCustomAttributeResponse": { + "type": "object", + "description": "Represents a [RetrieveMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The retrieved custom attribute. If `with_definition` was set to `true` in the request,\nthe custom attribute definition is returned in the `definition` field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-05-06T19:02:58.647Z", + "key": "alternative_seller_name", + "updated_at": "2023-05-06T19:21:04.551Z", + "value": "Ultimate Sneaker Store", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "RetrieveMerchantResponse": { + "type": "object", + "description": "The response object returned by the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "merchant": { + "$ref": "#/components/schemas/Merchant", + "description": "The requested `Merchant` object." + } + }, + "example": { + "merchant": { + "business_name": "Apple A Day", + "country": "US", + "created_at": "2021-12-10T19:25:52.484Z", + "currency": "USD", + "id": "DM7VKY8Q63GNP", + "language_code": "en-US", + "main_location_id": "9A65CGC72ZQG1", + "status": "ACTIVE" + } + } + }, + "RetrieveMerchantSettingsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "merchant_settings": { + "$ref": "#/components/schemas/CheckoutMerchantSettings", + "description": "The merchant settings." + } + }, + "example": { + "merchant_settings": { + "merchant_id": "MERCHANT_ID", + "payment_methods": { + "afterpay_clearpay": { + "enabled": true, + "item_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + }, + "order_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + } + }, + "apple_pay": { + "enabled": true + }, + "cash_app_pay": { + "enabled": true + }, + "google_pay": { + "enabled": true + } + }, + "updated_at": "2022-06-16T22:25:35Z" + } + } + }, + "RetrieveOrderCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from getting an order custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The retrieved custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-10-06T16:53:23.141Z", + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-10-06T16:53:23.141Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "RetrieveOrderCustomAttributeResponse": { + "type": "object", + "description": "Represents a response from getting an order custom attribute.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The retrieved custom attribute. If `with_definition` was set to `true` in the request, the custom attribute definition is returned in the `definition field." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-11-22T21:27:33.429Z", + "key": "cover-count", + "updated_at": "2022-11-22T21:28:35.721Z", + "value": "6", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "RetrieveOrderResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The requested order." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "order": { + "created_at": "2020-05-18T16:30:49.614Z", + "discounts": [ + { + "applied_money": { + "amount": 550, + "currency": "USD" + }, + "name": "50% Off", + "percentage": "50", + "scope": "ORDER", + "type": "FIXED_PERCENTAGE", + "uid": "zGsRZP69aqSSR9lq9euSPB" + } + ], + "id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "line_items": [ + { + "applied_discounts": [ + { + "applied_money": { + "amount": 250, + "currency": "USD" + }, + "discount_uid": "zGsRZP69aqSSR9lq9euSPB", + "uid": "9zr9S4dxvPAixvn0lpa1VC" + } + ], + "base_price_money": { + "amount": 500, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 500, + "currency": "USD" + }, + "name": "Item 1", + "quantity": "1", + "total_discount_money": { + "amount": 250, + "currency": "USD" + }, + "total_money": { + "amount": 250, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "ULkg0tQTRK2bkU9fNv3IJD", + "variation_total_price_money": { + "amount": 500, + "currency": "USD" + } + }, + { + "applied_discounts": [ + { + "applied_money": { + "amount": 300, + "currency": "USD" + }, + "discount_uid": "zGsRZP69aqSSR9lq9euSPB", + "uid": "qa8LwwZK82FgSEkQc2HYVC" + } + ], + "base_price_money": { + "amount": 300, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 600, + "currency": "USD" + }, + "name": "Item 2", + "quantity": "2", + "total_discount_money": { + "amount": 300, + "currency": "USD" + }, + "total_money": { + "amount": 300, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "mumY8Nun4BC5aKe2yyx5a", + "variation_total_price_money": { + "amount": 600, + "currency": "USD" + } + } + ], + "location_id": "D7AVYMEAPJ3A3", + "net_amounts": { + "discount_money": { + "amount": 550, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 0, + "currency": "USD" + }, + "tip_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 550, + "currency": "USD" + } + }, + "state": "OPEN", + "total_discount_money": { + "amount": 550, + "currency": "USD" + }, + "total_money": { + "amount": 550, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "total_tip_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2020-05-18T16:30:49.614Z", + "version": 1 + } + } + }, + "RetrievePaymentLinkResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "payment_link": { + "$ref": "#/components/schemas/PaymentLink", + "description": "The payment link that is retrieved." + } + }, + "example": { + "payment_link": { + "created_at": "2022-04-26T00:10:29Z", + "id": "LLO5Q3FRCFICDB4B", + "long_url": "https://checkout.square.site/EXAMPLE", + "order_id": "4uKASDATqSd1QQ9jV86sPhMdVEbSJc4F", + "url": "https://square.link/u/EXAMPLE", + "version": 1 + } + } + }, + "RetrieveScheduledShiftResponse": { + "type": "object", + "description": "Represents a [RetrieveScheduledShift](api-endpoint:Labor-RetrieveScheduledShift) response.\nEither `scheduled_shift` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The requested scheduled shift." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "scheduled_shift": { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-03-25T13:18:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Don't forget to prep the vegetables", + "start_at": "2019-03-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "updated_at": "2019-02-25T03:11:15-05:00", + "version": 2 + } + } + }, + "RetrieveSnippetResponse": { + "type": "object", + "description": "Represents a `RetrieveSnippet` response. The response can include either `snippet` or `errors`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "snippet": { + "$ref": "#/components/schemas/Snippet", + "description": "The retrieved snippet." + } + }, + "example": { + "snippet": { + "content": "\u003cscript\u003evar js = 1;\u003c/script\u003e", + "created_at": "2021-03-11T25:40:09.000000Z", + "id": "snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7", + "site_id": "site_278075276488921835", + "updated_at": "2021-03-11T25:40:09.000000Z" + } + } + }, + "RetrieveSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The subscription retrieved." + } + }, + "example": { + "subscription": { + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "charged_through_date": "2023-11-20", + "created_at": "2022-07-27T21:53:10Z", + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "id": "8151fc89-da15-4eb9-a685-1a70883cebfc", + "invoice_ids": [ + "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "inv:0-ChrcX_i3sNmfsHTGKhI4Wg2mceA" + ], + "location_id": "S8GWD5R9QB376", + "paid_until_date": "2024-08-01", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "price_override_money": { + "amount": 25000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "start_date": "2022-07-27", + "status": "ACTIVE", + "timezone": "America/Los_Angeles" + } + } + }, + "RetrieveTeamMemberBookingProfileResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "team_member_booking_profile": { + "$ref": "#/components/schemas/TeamMemberBookingProfile", + "description": "The returned team member booking profile." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "errors": [], + "team_member_booking_profile": { + "display_name": "Sandbox Staff", + "is_bookable": true, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + } + }, + "RetrieveTeamMemberResponse": { + "type": "object", + "description": "Represents a response from a retrieve request containing a `TeamMember` object or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The successfully retrieved `TeamMember` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "GA2Y9HSJ8KRYT", + "YSGH2WBKG94QZ" + ] + }, + "created_at": "2021-06-11T22:55:45Z", + "email_address": "joe_doe@example.com", + "family_name": "Doe", + "given_name": "Joe", + "id": "1yJlHapkseYnNPETIU1B", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "updated_at": "2021-06-15T17:38:05Z", + "wage_setting": { + "created_at": "2021-06-11T22:55:45Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 1443, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "1yJlHapkseYnNPETIU1B", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + } + } + }, + "RetrieveTimecardResponse": { + "type": "object", + "description": "A response to a request to get a `Timecard`. The response contains\nthe requested `Timecard` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The requested `Timecard`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "timecard": { + "breaks": [ + { + "break_type_id": "92EPDRQKJ5088", + "end_at": "2019-02-23T20:00:00-05:00", + "expected_duration": "PT1H", + "id": "M9BBKEPQAQD2T", + "is_paid": true, + "name": "Lunch Break", + "start_at": "2019-02-23T19:00:00-05:00" + } + ], + "created_at": "2019-02-27T00:12:12Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-02-23T21:00:00-05:00", + "id": "T35HMQSN89SV4", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-02-23T18:00:00-05:00", + "status": "CLOSED", + "team_member_id": "D71KRMQof6cXGUW0aAv7", + "timezone": "America/New_York", + "updated_at": "2019-02-27T00:12:12Z", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1457, + "currency": "USD" + }, + "job_id": "N4YKVLzFj3oGtNocqoYHYpW3", + "tip_eligible": true, + "title": "Cashier" + } + } + } + }, + "RetrieveTokenStatusResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `RetrieveTokenStatus` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of scopes associated with an access token." + }, + "expires_at": { + "type": "string", + "description": "The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never expires." + }, + "client_id": { + "type": "string", + "description": "The Square-issued application ID associated with the access token. This is the same application ID used to obtain the token.", + "maxLength": 191 + }, + "merchant_id": { + "type": "string", + "description": "The ID of the authorizing merchant's business.", + "minLength": 8, + "maxLength": 191 + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": " Any errors that occurred during the request." + } + }, + "example": { + "client_id": "CLIENT_ID", + "expires_at": "2022-10-14T14:44:00Z", + "merchant_id": "MERCHANT_ID", + "scopes": [ + "PAYMENTS_READ", + "PAYMENTS_WRITE" + ] + } + }, + "RetrieveTransactionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RetrieveTransaction](api-endpoint:Transactions-RetrieveTransaction) endpoint.\n\nOne of `errors` or `transaction` is present in a given response (never both).", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "transaction": { + "$ref": "#/components/schemas/Transaction", + "description": "The requested transaction." + } + }, + "example": { + "transaction": { + "created_at": "2016-03-10T22:57:56Z", + "id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "location_id": "18YC4JDH91E1H", + "product": "EXTERNAL_API", + "reference_id": "some optional reference id", + "tenders": [ + { + "additional_recipients": [ + { + "amount_money": { + "amount": 20, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "amount_money": { + "amount": 5000, + "currency": "USD" + }, + "card_details": { + "card": { + "card_brand": "VISA", + "last_4": "1111" + }, + "entry_method": "KEYED", + "status": "CAPTURED" + }, + "created_at": "2016-03-10T22:57:56Z", + "id": "MtZRYYdDrYNQbOvV7nbuBvMF", + "location_id": "18YC4JDH91E1H", + "note": "some optional note", + "processing_fee_money": { + "amount": 138, + "currency": "USD" + }, + "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "type": "CARD" + } + ] + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.csharp", + "java": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.java", + "javascript": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.javascript", + "php": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.php", + "python": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.python", + "ruby": "/sdk_samples/RetrieveTransaction/RetrieveTransactionResponse.ruby" + } + }, + "RetrieveTransferOrderResponse": { + "type": "object", + "description": "Response containing the requested transfer order", + "x-release-status": "BETA", + "properties": { + "transfer_order": { + "$ref": "#/components/schemas/TransferOrder", + "description": "The requested transfer order" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request" + } + }, + "example": { + "transfer_order": { + "created_at": "2025-01-15T10:30:00Z", + "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", + "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", + "expected_at": "2025-11-09T05:00:00Z", + "id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "line_items": [ + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", + "quantity_canceled": "0", + "quantity_damaged": "0", + "quantity_ordered": "5", + "quantity_pending": "5", + "quantity_received": "0", + "uid": "1" + }, + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_002", + "quantity_canceled": "0", + "quantity_damaged": "0", + "quantity_ordered": "3", + "quantity_pending": "3", + "quantity_received": "0", + "uid": "2" + } + ], + "notes": "Example transfer order for inventory redistribution between locations", + "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", + "status": "STARTED", + "tracking_number": "TRACK123456789", + "updated_at": "2025-01-15T10:35:00Z", + "version": 1753117449752 + } + } + }, + "RetrieveVendorResponse": { + "type": "object", + "description": "Represents an output from a call to [RetrieveVendor](api-endpoint:Vendors-RetrieveVendor).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered when the request fails." + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The successfully retrieved [Vendor](entity:Vendor) object." + } + }, + "example": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "a vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 1 + } + } + }, + "RetrieveWageSettingResponse": { + "type": "object", + "description": "Represents a response from a retrieve request containing the specified `WageSetting` object or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "wage_setting": { + "$ref": "#/components/schemas/WageSetting", + "description": "The successfully retrieved `WageSetting` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "wage_setting": { + "created_at": "2020-06-11T23:01:21+00:00", + "is_overtime_exempt": false, + "job_assignments": [ + { + "annual_rate": { + "amount": 4500000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 2164, + "currency": "USD" + }, + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + } + ], + "team_member_id": "1yJlHapkseYnNPETIU1B", + "updated_at": "2020-06-11T23:01:21+00:00", + "version": 1 + } + } + }, + "RetrieveWebhookSubscriptionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [RetrieveWebhookSubscription](api-endpoint:WebhookSubscriptions-RetrieveWebhookSubscription) endpoint.\n\nNote: if there are errors processing the request, the [Subscription](entity:WebhookSubscription) will not be\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/WebhookSubscription", + "description": "The requested [Subscription](entity:WebhookSubscription)." + } + }, + "example": { + "subscription": { + "api_version": "2021-12-15", + "created_at": "2022-01-10 23:29:48 +0000 UTC", + "enabled": true, + "event_types": [ + "payment.created", + "payment.updated" + ], + "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", + "name": "Example Webhook Subscription", + "notification_url": "https://example-webhook-url.com", + "signature_key": "1k9bIJKCeTmSQwyagtNRLg", + "updated_at": "2022-01-10 23:29:48 +0000 UTC" + } + } + }, + "RevokeTokenRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "client_id": { + "type": "string", + "description": "The Square-issued ID for your application, which is available on the **OAuth** page in the\n[Developer Dashboard](https://developer.squareup.com/apps).", + "maxLength": 191, + "nullable": true + }, + "access_token": { + "type": "string", + "description": "The access token of the merchant whose token you want to revoke.\nDo not provide a value for `merchant_id` if you provide this parameter.", + "minLength": 2, + "maxLength": 1024, + "nullable": true + }, + "merchant_id": { + "type": "string", + "description": "The ID of the merchant whose token you want to revoke.\nDo not provide a value for `access_token` if you provide this parameter.", + "nullable": true + }, + "revoke_only_access_token": { + "type": "boolean", + "description": "If `true`, terminate the given single access token, but do not\nterminate the entire authorization.\nDefault: `false`", + "nullable": true + } + }, + "example": { + "access_token": "ACCESS_TOKEN", + "client_id": "CLIENT_ID" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/RevokeToken/RevokeTokenRequest.csharp", + "java": "/sdk_samples/RevokeToken/RevokeTokenRequest.java", + "javascript": "/sdk_samples/RevokeToken/RevokeTokenRequest.javascript", + "php": "/sdk_samples/RevokeToken/RevokeTokenRequest.php", + "python": "/sdk_samples/RevokeToken/RevokeTokenRequest.python", + "ruby": "/sdk_samples/RevokeToken/RevokeTokenRequest.ruby" + } + }, + "RevokeTokenResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "success": { + "type": "boolean", + "description": "If the request is successful, this is `true`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "success": true + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/RevokeToken/RevokeTokenResponse.csharp", + "java": "/sdk_samples/RevokeToken/RevokeTokenResponse.java", + "javascript": "/sdk_samples/RevokeToken/RevokeTokenResponse.javascript", + "php": "/sdk_samples/RevokeToken/RevokeTokenResponse.php", + "python": "/sdk_samples/RevokeToken/RevokeTokenResponse.python", + "ruby": "/sdk_samples/RevokeToken/RevokeTokenResponse.ruby" + } + }, + "RiskEvaluation": { + "type": "object", + "description": "Represents fraud risk information for the associated payment.\n\nWhen you take a payment through Square's Payments API (using the `CreatePayment`\nendpoint), Square evaluates it and assigns a risk level to the payment. Sellers\ncan use this information to determine the course of action (for example,\nprovide the goods/services or refund the payment).", + "x-release-status": "BETA", + "required": [ + "status" + ], + "properties": { + "created_at": { + "type": "string", + "description": "The timestamp when payment risk was evaluated, in RFC 3339 format.", + "readOnly": true + }, + "risk_level": { + "$ref": "#/components/schemas/RiskEvaluationRiskLevel", + "description": "The risk level associated with the payment\nSee [RiskEvaluationRiskLevel](#type-riskevaluationrisklevel) for possible values", + "nullable": true + } + } + }, + "RiskEvaluationRiskLevel": { + "type": "string", + "enum": [ + "PENDING", + "NORMAL", + "MODERATE", + "HIGH" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "Indicates Square is still evaluating the payment." + }, + { + "name": "NORMAL", + "description": "Indicates payment risk is within the normal range." + }, + { + "name": "MODERATE", + "description": "Indicates elevated risk level associated with the payment." + }, + { + "name": "HIGH", + "description": "Indicates significantly elevated risk level with the payment." + } + ], + "x-release-status": "BETA" + }, + "SaveCardOptions": { + "type": "object", + "description": "Describes save-card action fields.", + "x-release-status": "BETA", + "required": [ + "customer_id" + ], + "properties": { + "customer_id": { + "type": "string", + "description": "The square-assigned ID of the customer linked to the saved card." + }, + "card_id": { + "type": "string", + "description": "The id of the created card-on-file.", + "maxLength": 64, + "readOnly": true + }, + "reference_id": { + "type": "string", + "description": "An optional user-defined reference ID that can be used to associate\nthis `Card` to another entity in an external system. For example, a customer\nID generated by a third-party system.", + "maxLength": 128, + "nullable": true + } + } + }, + "ScheduledShift": { + "type": "object", + "description": "Represents a specific time slot in a work schedule. This object is used to manage the\nlifecycle of a scheduled shift from the draft to published state. A scheduled shift contains\nthe latest draft shift details and current published shift details.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "**Read only** The Square-issued ID of the scheduled shift.", + "maxLength": 255 + }, + "draft_shift_details": { + "$ref": "#/components/schemas/ScheduledShiftDetails", + "description": "The latest draft shift details for the scheduled shift. Draft shift details are used to\nstage and manage shifts before publishing. This field is always present.", + "nullable": true + }, + "published_shift_details": { + "$ref": "#/components/schemas/ScheduledShiftDetails", + "description": "The current published (public) shift details for the scheduled shift. This field is\npresent only if the shift was published.", + "readOnly": true + }, + "version": { + "type": "integer", + "description": "**Read only** The current version of the scheduled shift, which is incremented with each update.\nThis field is used for [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol to ensure that requests don't overwrite data from another request." + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the scheduled shift was created, in RFC 3339 format presented as UTC.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the scheduled shift was last updated, in RFC 3339 format presented as UTC.", + "readOnly": true + } + } + }, + "ScheduledShiftDetails": { + "type": "object", + "description": "Represents shift details for draft and published versions of a [scheduled shift](entity:ScheduledShift),\nsuch as job ID, team member assignment, and start and end times.", + "x-release-status": "BETA", + "properties": { + "team_member_id": { + "type": "string", + "description": "The ID of the [team member](entity:TeamMember) scheduled for the shift.", + "maxLength": 255, + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location) the shift is scheduled for.", + "maxLength": 255, + "nullable": true + }, + "job_id": { + "type": "string", + "description": "The ID of the [job](entity:Job) the shift is scheduled for.", + "nullable": true + }, + "start_at": { + "type": "string", + "description": "The start time of the shift, in RFC 3339 format in the time zone \u0026plus;\noffset of the shift location specified in `location_id`. Precision up to the minute\nis respected; seconds are truncated.", + "nullable": true + }, + "end_at": { + "type": "string", + "description": "The end time for the shift, in RFC 3339 format in the time zone \u0026plus;\noffset of the shift location specified in `location_id`. Precision up to the minute\nis respected; seconds are truncated.", + "nullable": true + }, + "notes": { + "type": "string", + "description": "Optional notes for the shift.", + "maxLength": 1000, + "nullable": true + }, + "is_deleted": { + "type": "boolean", + "description": "Indicates whether the draft shift version is deleted. If set to `true` when the shift\nis published, the entire scheduled shift (including the published shift) is deleted and\ncannot be accessed using any endpoint.", + "nullable": true + }, + "timezone": { + "type": "string", + "description": "The time zone of the shift location, calculated based on the `location_id`. This field\nis provided for convenience.", + "readOnly": true + } + } + }, + "ScheduledShiftFilter": { + "type": "object", + "description": "Defines filter criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts)\nrequest. Multiple filters in a query are combined as an `AND` operation.", + "x-release-status": "BETA", + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Return shifts for the specified locations. When omitted, shifts for all\nlocations are returned. If needed, call [ListLocations](api-endpoint:Locations-ListLocations)\nto get location IDs.", + "nullable": true + }, + "start": { + "$ref": "#/components/schemas/TimeRange", + "description": "Return shifts whose `start_at` time is within the specified\ntime range (inclusive).", + "nullable": true + }, + "end": { + "$ref": "#/components/schemas/TimeRange", + "description": "Return shifts whose `end_at` time is within the specified\ntime range (inclusive).", + "nullable": true + }, + "workday": { + "$ref": "#/components/schemas/ScheduledShiftWorkday", + "description": "Return shifts based on a workday date range.", + "nullable": true + }, + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Return shifts assigned to specified team members. If needed, call\n[SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) to get team member IDs.\n\nTo return only the shifts assigned to the specified team members, include the\n`assignment_status` filter in the query. Otherwise, all unassigned shifts are\nreturned along with shifts assigned to the specified team members.", + "nullable": true + }, + "assignment_status": { + "$ref": "#/components/schemas/ScheduledShiftFilterAssignmentStatus", + "description": "Return shifts based on whether a team member is assigned. A shift is\nassigned if the `team_member_id` field is populated in the `draft_shift_details`\nor `published_shift details` field of the shift.\n\nTo return only draft or published shifts, include the `scheduled_shift_statuses`\nfilter in the query.\nSee [ScheduledShiftFilterAssignmentStatus](#type-scheduledshiftfilterassignmentstatus) for possible values", + "nullable": true + }, + "scheduled_shift_statuses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScheduledShiftFilterScheduledShiftStatus" + }, + "description": "Return shifts based on the draft or published status of the shift.\nA shift is published if the `published_shift_details` field is present.\n\nNote that shifts with `draft_shift_details.is_deleted` set to `true` are ignored\nwith the `DRAFT` filter.\nSee [ScheduledShiftFilterScheduledShiftStatus](#type-scheduledshiftfilterscheduledshiftstatus) for possible values", + "nullable": true + } + } + }, + "ScheduledShiftFilterAssignmentStatus": { + "type": "string", + "enum": [ + "ASSIGNED", + "UNASSIGNED" + ], + "x-enum-elements": [ + { + "name": "ASSIGNED", + "description": "The shift is assigned to a team member." + }, + { + "name": "UNASSIGNED", + "description": "The shift isn't assigned to a team member." + } + ], + "description": "Defines valid values for the `assignment_status` filter in a\n[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request.\nAssignment status is based on the `draft_shift_details.team_member_id` and\n`published_shift_details.team_member_id` fields of the scheduled shift.", + "x-release-status": "BETA" + }, + "ScheduledShiftFilterScheduledShiftStatus": { + "type": "string", + "enum": [ + "DRAFT", + "PUBLISHED" + ], + "x-enum-elements": [ + { + "name": "DRAFT", + "description": "The scheduled shift has never been published or its draft details were\nupdated after it was published. This means that the shift has no `published_shift_details`\nfield or that `draft_shift_details` has different settings than `published_shift_details`." + }, + { + "name": "PUBLISHED", + "description": "The scheduled shift was published. This means that the shift has a\n`published_shift_details` field." + } + ], + "description": "Defines valid values for the `scheduled_shift_statuses` filter in a\n[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request.", + "x-release-status": "BETA" + }, + "ScheduledShiftNotificationAudience": { + "type": "string", + "enum": [ + "ALL", + "AFFECTED", + "NONE" + ], + "x-enum-elements": [ + { + "name": "ALL", + "description": "Notify all active team members. Note that republishing an unchanged\nshift with this setting resends the notification." + }, + { + "name": "AFFECTED", + "description": "Notify the team member assigned to the shift. If the shift assignment\nchanges, notify both the newly assigned and previously assigned team members." + }, + { + "name": "NONE", + "description": "Do not send a notification." + } + ], + "description": "Indicates whether Square sends an email notification to team members\nwhen a scheduled shift is published and which team members receive the notification.", + "x-release-status": "BETA" + }, + "ScheduledShiftQuery": { + "type": "object", + "description": "Represents filter and sort criteria for the `query` field in a\n[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request.", + "x-release-status": "BETA", + "properties": { + "filter": { + "$ref": "#/components/schemas/ScheduledShiftFilter", + "description": "Filtering options for the query.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/ScheduledShiftSort", + "description": "Sorting options for the query.", + "nullable": true + } + } + }, + "ScheduledShiftSort": { + "type": "object", + "description": "Defines sort criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts)\nrequest.", + "x-release-status": "BETA", + "properties": { + "field": { + "$ref": "#/components/schemas/ScheduledShiftSortField", + "description": "The field to sort on. The default value is `START_AT`.\nSee [ScheduledShiftSortField](#type-scheduledshiftsortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order in which results are returned. The default value is `ASC`.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "ScheduledShiftSortField": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "Sort by the start time of the shift." + }, + { + "name": "END_AT", + "description": "Sort by the end time of the shift." + }, + { + "name": "CREATED_AT", + "description": "Sort by the creation date of the shift." + }, + { + "name": "UPDATED_AT", + "description": "Sort by the last updated date of the shift." + } + ], + "description": "Defines valid values for the `field` sort setting in a\n[SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request.", + "x-release-status": "BETA" + }, + "ScheduledShiftWorkday": { + "type": "object", + "description": "A `ScheduledShift` search query filter parameter that sets a range of days that\na `Shift` must start or end in before passing the filter condition.", + "x-release-status": "BETA", + "properties": { + "date_range": { + "$ref": "#/components/schemas/DateRange", + "description": "Dates for fetching the scheduled shifts.", + "nullable": true + }, + "match_scheduled_shifts_by": { + "$ref": "#/components/schemas/ScheduledShiftWorkdayMatcher", + "description": "The strategy on which the dates are applied.\nSee [ScheduledShiftWorkdayMatcher](#type-scheduledshiftworkdaymatcher) for possible values", + "nullable": true + }, + "default_timezone": { + "type": "string", + "description": "Location-specific timezones convert workdays to datetime filters.\nEvery location included in the query must have a timezone or this field\nmust be provided as a fallback. Format: the IANA timezone database\nidentifier for the relevant timezone.", + "nullable": true + } + } + }, + "ScheduledShiftWorkdayMatcher": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "INTERSECTION" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "All shifts that start on or after the specified workday" + }, + { + "name": "END_AT", + "description": "All shifts that end on or before the specified workday" + }, + { + "name": "INTERSECTION", + "description": "All shifts that start between the start and end workdays (inclusive)" + } + ], + "description": "Defines the logic used to apply a workday filter.", + "x-release-status": "BETA" + }, + "SearchAvailabilityFilter": { + "type": "object", + "description": "A query filter to search for buyer-accessible availabilities by.", + "x-release-status": "PUBLIC", + "required": [ + "start_at_range" + ], + "properties": { + "start_at_range": { + "$ref": "#/components/schemas/TimeRange", + "description": "The query expression to search for buy-accessible availabilities with their starting times falling within the specified time range.\nThe time range must be at least 24 hours and at most 32 days long.\nFor waitlist availabilities, the time range can be 0 or more up to 367 days long." + }, + "location_id": { + "type": "string", + "description": "The query expression to search for buyer-accessible availabilities with their location IDs matching the specified location ID.\nThis query expression cannot be set if `booking_id` is set.", + "maxLength": 32, + "nullable": true + }, + "segment_filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SegmentFilter" + }, + "description": "The query expression to search for buyer-accessible availabilities matching the specified list of segment filters.\nIf the size of the `segment_filters` list is `n`, the search returns availabilities with `n` segments per availability.\n\nThis query expression cannot be set if `booking_id` is set.", + "nullable": true + }, + "booking_id": { + "type": "string", + "description": "The query expression to search for buyer-accessible availabilities for an existing booking by matching the specified `booking_id` value.\nThis is commonly used to reschedule an appointment.\nIf this expression is set, the `location_id` and `segment_filters` expressions cannot be set.", + "maxLength": 36, + "nullable": true + } + } + }, + "SearchAvailabilityQuery": { + "type": "object", + "description": "The query used to search for buyer-accessible availabilities of bookings.", + "x-release-status": "PUBLIC", + "required": [ + "filter" + ], + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchAvailabilityFilter", + "description": "The query filter to search for buyer-accessible availabilities of existing bookings." + } + } + }, + "SearchAvailabilityRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "query" + ], + "properties": { + "query": { + "$ref": "#/components/schemas/SearchAvailabilityQuery", + "description": "Query conditions used to filter buyer-accessible booking availabilities." + } + } + }, + "SearchAvailabilityResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "availabilities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Availability" + }, + "description": "List of appointment slots available for booking." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "availabilities": [ + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T13:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T13:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T14:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T14:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T15:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T15:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-26T16:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T09:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T09:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T10:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T10:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T11:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T11:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T12:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T12:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T13:00:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T13:30:00Z" + }, + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMaJcbiRqPIGZuS9" + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T14:00:00Z" + } + ], + "errors": [] + } + }, + "SearchCatalogItemsRequest": { + "type": "object", + "description": "Defines the request body for the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "text_filter": { + "type": "string", + "description": "The text filter expression to return items or item variations containing specified text in\nthe `name`, `description`, or `abbreviation` attribute value of an item, or in\nthe `name`, `sku`, or `upc` attribute value of an item variation." + }, + "category_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The category id query expression to return items containing the specified category IDs." + }, + "stock_levels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SearchCatalogItemsRequestStockLevel" + }, + "description": "The stock-level query expression to return item variations with the specified stock levels.\nSee [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) for possible values" + }, + "enabled_location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The enabled-location query expression to return items and item variations having specified enabled locations." + }, + "cursor": { + "type": "string", + "description": "The pagination token, returned in the previous response, used to fetch the next batch of pending results." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to return per page. The default value is 100.", + "maximum": 100 + }, + "sort_order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order to sort the results by item names. The default sort order is ascending (`ASC`).\nSee [SortOrder](#type-sortorder) for possible values" + }, + "product_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogItemProductType" + }, + "description": "The product types query expression to return items or item variations having the specified product types." + }, + "custom_attribute_filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeFilter" + }, + "description": "The customer-attribute filter to return items or item variations matching the specified\ncustom attribute expressions. A maximum number of 10 custom attribute expressions are supported in\na single call to the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint." + }, + "archived_state": { + "$ref": "#/components/schemas/ArchivedState", + "description": "The query filter to return not archived (`ARCHIVED_STATE_NOT_ARCHIVED`), archived (`ARCHIVED_STATE_ARCHIVED`), or either type (`ARCHIVED_STATE_ALL`) of items." + } + }, + "example": { + "category_ids": [ + "WINE_CATEGORY_ID" + ], + "custom_attribute_filters": [ + { + "bool_filter": true, + "custom_attribute_definition_id": "VEGAN_DEFINITION_ID" + }, + { + "custom_attribute_definition_id": "BRAND_DEFINITION_ID", + "string_filter": "Dark Horse" + }, + { + "key": "VINTAGE", + "number_filter": { + "max": 2018, + "min": 2017 + } + }, + { + "custom_attribute_definition_id": "VARIETAL_DEFINITION_ID", + "selection_ids_filter": "MERLOT_SELECTION_ID" + } + ], + "enabled_location_ids": [ + "ATL_LOCATION_ID" + ], + "limit": 100, + "product_types": [ + "REGULAR" + ], + "sort_order": "ASC", + "stock_levels": [ + "OUT", + "LOW" + ], + "text_filter": "red" + } + }, + "SearchCatalogItemsRequestStockLevel": { + "type": "string", + "enum": [ + "OUT", + "LOW" + ], + "x-enum-elements": [ + { + "name": "OUT", + "description": "The item inventory is empty." + }, + { + "name": "LOW", + "description": "The item inventory is low." + } + ], + "description": "Defines supported stock levels of the item inventory.", + "x-release-status": "PUBLIC" + }, + "SearchCatalogItemsResponse": { + "type": "object", + "description": "Defines the response body returned from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "Returned items matching the specified query expressions." + }, + "cursor": { + "type": "string", + "description": "Pagination token used in the next request to return more of the search result." + }, + "matched_variation_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Ids of returned item variations matching the specified query expression." + } + }, + "example": { + "items": [ + { + "custom_attribute_values": { + "BRAND": { + "custom_attribute_definition_id": "BRAND_DEFINITION_ID", + "key": "BRAND", + "name": "Brand", + "string_value": "Dark Horse", + "type": "STRING" + }, + "VARIETAL": { + "custom_attribute_definition_id": "VARIETAL_DEFINITION_ID", + "key": "VARIETAL", + "name": "Varietal", + "selection_uid_values": [ + "MERLOT_SELECTION_ID", + null + ], + "type": "SELECTION" + }, + "VINTAGE": { + "custom_attribute_definition_id": "EI7IJQDUKYSHULREPIPH6HNU", + "key": "VINTAGE", + "name": "Vintage", + "number_value": 2018, + "type": "NUMBER" + } + }, + "id": "GPOKJPTV2KDLVKCADJ7I77EZ", + "is_deleted": false, + "item_data": { + "description": "A nice red wine", + "is_archived": false, + "name": "Dark Horse Merlot 2018", + "product_type": "REGULAR", + "variations": [ + { + "id": "VBJNPHCOKDFECR6VU25WRJUD", + "is_deleted": false, + "item_variation_data": { + "item_id": "GPOKJPTV2KDLVKCADJ7I77EZ", + "name": "750 mL", + "ordinal": 0, + "price_money": { + "amount": 1000, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2020-06-18T17:55:56.646Z", + "version": 1592502956646 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2020-06-18T17:55:56.646Z", + "version": 1592502956646 + } + ], + "matched_variation_ids": [ + "VBJNPHCOKDFECR6VU25WRJUD" + ] + } + }, + "SearchCatalogObjectsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "cursor": { + "type": "string", + "description": "The pagination cursor returned in the previous response. Leave unset for an initial request.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + }, + "object_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObjectType" + }, + "description": "The desired set of object types to appear in the search results.\n\nIf this is unspecified, the operation returns objects of all the top level types at the version\nof the Square API used to make the request. Object types that are nested onto other object types\nare not included in the defaults.\n\nAt the current API version the default object types are:\nITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, \nPRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,\nSUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS.\n\nNote that if you wish for the query to return objects belonging to nested types (i.e., COMPONENT, IMAGE,\nITEM_OPTION_VAL, ITEM_VARIATION, or MODIFIER), you must explicitly include all the types of interest\nin this field." + }, + "include_deleted_objects": { + "type": "boolean", + "description": "If `true`, deleted objects will be included in the results. Defaults to `false`. Deleted objects will have their `is_deleted` field set to `true`. If `include_deleted_objects` is `true`, then the `include_category_path_to_root` request parameter must be `false`. Both properties cannot be `true` at the same time." + }, + "include_related_objects": { + "type": "boolean", + "description": "If `true`, the response will include additional objects that are related to the\nrequested objects. Related objects are objects that are referenced by object ID by the objects\nin the response. This is helpful if the objects are being fetched for immediate display to a user.\nThis process only goes one level deep. Objects referenced by the related objects will not be included.\nFor example:\n\nIf the `objects` field of the response contains a CatalogItem, its associated\nCatalogCategory objects, CatalogTax objects, CatalogImage objects and\nCatalogModifierLists will be returned in the `related_objects` field of the\nresponse. If the `objects` field of the response contains a CatalogItemVariation,\nits parent CatalogItem will be returned in the `related_objects` field of\nthe response.\n\nDefault value: `false`" + }, + "begin_time": { + "type": "string", + "description": "Return objects modified after this [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), in RFC 3339\nformat, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is exclusive - objects with a\ntimestamp equal to `begin_time` will not be included in the response." + }, + "query": { + "$ref": "#/components/schemas/CatalogQuery", + "description": "A query to be used to filter or sort the results. If no query is specified, the entire catalog will be returned." + }, + "limit": { + "type": "integer", + "description": "A limit on the number of results to be returned in a single page. The limit is advisory -\nthe implementation may return more or fewer results. If the supplied limit is negative, zero, or\nis higher than the maximum limit of 1,000, it will be ignored." + }, + "include_category_path_to_root": { + "type": "boolean", + "description": "Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned in the response payload. If `include_category_path_to_root` is `true`, then the `include_deleted_objects` request parameter must be `false`. Both properties cannot be `true` at the same time." + } + }, + "example": { + "limit": 100, + "object_types": [ + "ITEM" + ], + "query": { + "prefix_query": { + "attribute_name": "name", + "attribute_prefix": "tea" + } + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.csharp", + "java": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.java", + "javascript": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.javascript", + "php": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.php", + "python": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.python", + "ruby": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsRequest.ruby" + } + }, + "SearchCatalogObjectsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset, this is the final response.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + }, + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "The CatalogObjects returned." + }, + "related_objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogObject" + }, + "description": "A list of CatalogObjects referenced by the objects in the `objects` field." + }, + "latest_time": { + "type": "string", + "description": "When the associated product catalog was last updated. Will\nmatch the value for `end_time` or `cursor` if either field is included in the `SearchCatalog` request.", + "x-release-status": "BETA" + } + }, + "example": { + "objects": [ + { + "id": "X5DZ5NWWAQ44CKBLKIFQGOWK", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "E7CLE5RZZ744BHWVQQEAHI2C", + "ordinal": 0 + } + ], + "description": "A delicious blend of black tea.", + "name": "Tea - Black", + "product_type": "REGULAR", + "tax_ids": [ + "ZXITPM6RWHZ7GZ7EIP3YKECM" + ], + "variations": [ + { + "id": "5GSZPX6EU7MM75S57OONG3V5", + "is_deleted": false, + "item_variation_data": { + "item_id": "X5DZ5NWWAQ44CKBLKIFQGOWK", + "name": "Regular", + "ordinal": 1, + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2017-10-26T15:27:31.626Z", + "version": 1509031651626 + }, + { + "id": "XVLBN7DU6JTWHJTG5F265B43", + "is_deleted": false, + "item_variation_data": { + "item_id": "X5DZ5NWWAQ44CKBLKIFQGOWK", + "name": "Large", + "ordinal": 2, + "price_money": { + "amount": 225, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2017-10-26T15:27:31.626Z", + "version": 1509031651626 + } + ], + "visibility": "PRIVATE" + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2017-10-26T15:41:32.337Z", + "version": 1509032492337 + }, + { + "id": "NNNEM3LA656Q46NXLWCNI7S5", + "is_deleted": false, + "item_data": { + "categories": [ + { + "id": "E7CLE5RZZ744BHWVQQEAHI2C", + "ordinal": 0 + } + ], + "description": "Relaxing green herbal tea.", + "name": "Tea - Green", + "product_type": "REGULAR", + "tax_ids": [ + "ZXITPM6RWHZ7GZ7EIP3YKECM" + ], + "variations": [ + { + "id": "FHYBVIA6NVBCSOVETA62WEA4", + "is_deleted": false, + "item_variation_data": { + "item_id": "NNNEM3LA656Q46NXLWCNI7S5", + "name": "Regular", + "ordinal": 1, + "price_money": { + "amount": 150, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2017-10-26T15:29:00.524Z", + "version": 1509031740524 + } + ], + "visibility": "PRIVATE" + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2017-10-26T15:41:23.232Z", + "version": 1509032483232 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.csharp", + "java": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.java", + "javascript": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.javascript", + "php": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.php", + "python": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.python", + "ruby": "/sdk_samples/Catalog/SearchCatalogObjects/SearchCatalogObjectsResponse.ruby" + } + }, + "SearchCustomersRequest": { + "type": "object", + "description": "Defines the fields that are included in the request body of a request to the\n`SearchCustomers` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "cursor": { + "type": "string", + "description": "Include the pagination cursor in subsequent calls to this endpoint to retrieve\nthe next set of results associated with the original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.\nIf the specified limit is invalid, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "format": "int64", + "minimum": 1, + "maximum": 100 + }, + "query": { + "$ref": "#/components/schemas/CustomerQuery", + "description": "The filtering and sorting criteria for the search request. If a query is not specified,\nSquare returns all customer profiles ordered alphabetically by `given_name` and `family_name`." + }, + "count": { + "type": "boolean", + "description": "Indicates whether to return the total count of matching customers in the `count` field of the response.\n\nThe default value is `false`." + } + }, + "example": { + "limit": 2, + "query": { + "filter": { + "created_at": { + "end_at": "2018-02-01T00:00:00-00:00", + "start_at": "2018-01-01T00:00:00-00:00" + }, + "creation_source": { + "rule": "INCLUDE", + "values": [ + "THIRD_PARTY" + ] + }, + "email_address": { + "fuzzy": "example.com" + }, + "group_ids": { + "all": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ] + } + }, + "sort": { + "field": "CREATED_AT", + "order": "ASC" + } + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/SearchCustomers/SearchCustomersRequest.csharp", + "java": "/sdk_samples/SearchCustomers/SearchCustomersRequest.java", + "javascript": "/sdk_samples/SearchCustomers/SearchCustomersRequest.javascript", + "php": "/sdk_samples/SearchCustomers/SearchCustomersRequest.php", + "python": "/sdk_samples/SearchCustomers/SearchCustomersRequest.python", + "ruby": "/sdk_samples/SearchCustomers/SearchCustomersRequest.ruby" + } + }, + "SearchCustomersResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the `SearchCustomers` endpoint.\n\nEither `errors` or `customers` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Customer" + }, + "description": "The customer profiles that match the search query. If any search condition is not met, the result is an empty object (`{}`).\nOnly customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`)\nare included in the response." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor that can be used during subsequent calls\nto `SearchCustomers` to retrieve the next set of results associated\nwith the original query. Pagination cursors are only present when\na request succeeds and additional results are available.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "count": { + "type": "integer", + "description": "The total count of customers associated with the Square account that match the search query. Only customer profiles with\npublic information (`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is\npresent only if `count` is set to `true` in the request.", + "format": "int64" + } + }, + "example": { + "cursor": "9dpS093Uy12AzeE", + "customers": [ + { + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2018-01-23T20:21:54.859Z", + "creation_source": "DIRECTORY", + "email_address": "james.bond@example.com", + "family_name": "Bond", + "given_name": "James", + "group_ids": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ], + "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "phone_number": "+1-212-555-4250", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID_2", + "segment_ids": [ + "1KB9JE5EGJXCW.REACHABLE" + ], + "updated_at": "2020-04-20T10:02:43.083Z", + "version": 7 + }, + { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2018-01-30T14:10:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "amelia.earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "group_ids": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ], + "id": "A9641GZW2H7Z56YYSD41Q12HDW", + "note": "a customer", + "phone_number": "+1-212-555-9238", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID_1", + "segment_ids": [ + "1KB9JE5EGJXCW.REACHABLE" + ], + "updated_at": "2018-03-08T18:25:21.342Z", + "version": 1 + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/SearchCustomers/SearchCustomersResponse.csharp", + "java": "/sdk_samples/SearchCustomers/SearchCustomersResponse.java", + "javascript": "/sdk_samples/SearchCustomers/SearchCustomersResponse.javascript", + "php": "/sdk_samples/SearchCustomers/SearchCustomersResponse.php", + "python": "/sdk_samples/SearchCustomers/SearchCustomersResponse.python", + "ruby": "/sdk_samples/SearchCustomers/SearchCustomersResponse.ruby" + } + }, + "SearchEventsFilter": { + "type": "object", + "description": "Criteria to filter events by.", + "x-release-status": "BETA", + "properties": { + "event_types": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter events by event types.", + "nullable": true + }, + "merchant_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter events by merchant.", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter events by location.", + "nullable": true + }, + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "Filter events by when they were created." + } + } + }, + "SearchEventsQuery": { + "type": "object", + "description": "Contains query criteria for the search.", + "x-release-status": "BETA", + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchEventsFilter", + "description": "Criteria to filter events by.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/SearchEventsSort", + "description": "Criteria to sort events by.", + "nullable": true + } + } + }, + "SearchEventsRequest": { + "type": "object", + "description": "Searches [Event](entity:Event)s for your application.", + "x-release-status": "BETA", + "properties": { + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of events for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "maxLength": 256 + }, + "limit": { + "type": "integer", + "description": "The maximum number of events to return in a single page. The response might contain fewer events. The default value is 100, which is also the maximum allowed value.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).\n\nDefault: 100", + "minimum": 1, + "maximum": 100 + }, + "query": { + "$ref": "#/components/schemas/SearchEventsQuery", + "description": "The filtering and sorting criteria for the search request. To retrieve additional pages using a cursor, you must use the original query." + } + } + }, + "SearchEventsResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [SearchEvents](api-endpoint:Events-SearchEvents) endpoint.\n\nNote: if there are errors processing the request, the events field will not be\npresent.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Event" + }, + "description": "The list of [Event](entity:Event)s returned by the search." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EventMetadata" + }, + "description": "Contains the metadata of an event. For more information, see [Event](entity:Event)." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next set of events. If empty, this is the final response.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "cursor": "6b571fc9773647f=", + "events": [ + { + "created_at": "2022-04-26T10:08:40.454726", + "data": { + "id": "ORSEVtZAJxb37RA1EiGw", + "object": { + "dispute": { + "amount_money": { + "amount": 8801, + "currency": "USD" + }, + "brand_dispute_id": "r9rKGSBBQbywBNnWWIiGFg", + "card_brand": "VISA", + "created_at": "2020-02-19T21:24:53.258Z", + "disputed_payment": { + "payment_id": "fbmsaEOpoARDKxiSGH1fqPuqoqFZY" + }, + "due_at": "2020-03-04T00:00:00.000Z", + "id": "ORSEVtZAJxb37RA1EiGw", + "location_id": "VJDQQP3CG14EY", + "reason": "AMOUNT_DIFFERS", + "reported_at": "2020-02-19T00:00:00.000Z", + "state": "WON", + "updated_at": "2020-02-19T21:34:41.851Z", + "version": 6 + } + }, + "type": "dispute" + }, + "event_id": "73ecd468-0aba-424f-b862-583d44efe7c8", + "location_id": "VJDQQP3CG14EY", + "merchant_id": "0HPGX5JYE6EE1", + "type": "dispute.state.updated" + } + ], + "metadata": [ + { + "api_version": "2022-12-13", + "event_id": "73ecd468-0aba-424f-b862-583d44efe7c8" + } + ] + } + }, + "SearchEventsSort": { + "type": "object", + "description": "Criteria to sort events by.", + "x-release-status": "BETA", + "properties": { + "field": { + "$ref": "#/components/schemas/SearchEventsSortField", + "description": "Sort events by event types.\nSee [SearchEventsSortField](#type-searcheventssortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order to use for sorting the events.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "SearchEventsSortField": { + "type": "string", + "enum": [ + "DEFAULT" + ], + "x-enum-elements": [ + { + "name": "DEFAULT", + "description": "Use the default sort key. The default behavior is to sort events by when they were created (`created_at`)." + } + ], + "description": "Specifies the sort key for events returned from a search.", + "x-release-status": "BETA" + }, + "SearchInvoicesRequest": { + "type": "object", + "description": "Describes a `SearchInvoices` request.", + "x-release-status": "PUBLIC", + "required": [ + "query" + ], + "properties": { + "query": { + "$ref": "#/components/schemas/InvoiceQuery", + "description": "Describes the query criteria for searching invoices." + }, + "limit": { + "type": "integer", + "description": "The maximum number of invoices to return (200 is the maximum `limit`). \nIf not provided, the server uses a default limit of 100 invoices." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint. \nProvide this cursor to retrieve the next set of results for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "limit": 100, + "query": { + "filter": { + "customer_ids": [ + "JDKYHBWT1D4F8MFH63DBMEN8Y4" + ], + "location_ids": [ + "ES0RJRZYEC39A" + ] + }, + "sort": { + "field": "INVOICE_SORT_DATE", + "order": "DESC" + } + } + } + }, + "SearchInvoicesResponse": { + "type": "object", + "description": "Describes a `SearchInvoices` response.", + "x-release-status": "PUBLIC", + "properties": { + "invoices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Invoice" + }, + "description": "The list of invoices returned by the search." + }, + "cursor": { + "type": "string", + "description": "When a response is truncated, it includes a cursor that you can use in a \nsubsequent request to fetch the next set of invoices. If empty, this is the final \nresponse. \nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "cursor": "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", + "invoices": [ + { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T17:45:13Z", + "version": 0 + }, + { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": true + }, + "created_at": "2021-01-23T15:29:12Z", + "delivery_method": "EMAIL", + "id": "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", + "invoice_number": "inv-455", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "order_id": "a65jnS8NXbfprvGJzY9F4fQTuaB", + "payment_requests": [ + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "due_date": "2021-01-23", + "percentage_requested": "25", + "request_type": "DEPOSIT", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "uid": "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176" + }, + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "due_date": "2021-06-15", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "120c5e18-4f80-4f6b-b159-774cb9bf8f99" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "public_url": "https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9", + "sale_or_service_date": "2030-01-24", + "status": "PARTIALLY_PAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "updated_at": "2021-01-23T15:29:56Z", + "version": 3 + } + ] + } + }, + "SearchLoyaltyAccountsRequest": { + "type": "object", + "description": "A request to search for loyalty accounts.", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/SearchLoyaltyAccountsRequestLoyaltyAccountQuery", + "description": "The search criteria for the request." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to include in the response. The default value is 30.", + "minimum": 1, + "maximum": 200 + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to \nthis endpoint. Provide this to retrieve the next set of \nresults for the original query.\n\nFor more information, \nsee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "limit": 10, + "query": { + "mappings": [ + { + "phone_number": "+14155551234" + } + ] + } + } + }, + "SearchLoyaltyAccountsRequestLoyaltyAccountQuery": { + "type": "object", + "description": "The search criteria for the loyalty accounts.", + "x-release-status": "PUBLIC", + "properties": { + "mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyAccountMapping" + }, + "description": "The set of mappings to use in the loyalty account search. \n\nThis cannot be combined with `customer_ids`. \n\nMax: 30 mappings", + "nullable": true + }, + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The set of customer IDs to use in the loyalty account search. \n\nThis cannot be combined with `mappings`. \n\nMax: 30 customer IDs", + "nullable": true + } + } + }, + "SearchLoyaltyAccountsResponse": { + "type": "object", + "description": "A response that includes loyalty accounts that satisfy the search criteria.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "loyalty_accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyAccount" + }, + "description": "The loyalty accounts that met the search criteria, \nin order of creation date." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to use in a subsequent \nrequest. If empty, this is the final response.\nFor more information, \nsee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "loyalty_accounts": [ + { + "balance": 10, + "created_at": "2020-05-08T21:44:32Z", + "customer_id": "Q8002FAM9V1EZ0ADB2T5609X6NET1H0", + "id": "79b807d2-d786-46a9-933b-918028d7a8c5", + "lifetime_points": 20, + "mapping": { + "created_at": "2020-05-08T21:44:32Z", + "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234" + }, + "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "updated_at": "2020-05-08T21:44:32Z" + } + ] + } + }, + "SearchLoyaltyEventsRequest": { + "type": "object", + "description": "A request to search for loyalty events.", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/LoyaltyEventQuery", + "description": "A set of one or more predefined query filters to apply when \nsearching for loyalty events. The endpoint performs a logical AND to \nevaluate multiple filters and performs a logical OR on arrays \nthat specifies multiple field values." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to include in the response. \nThe last page might contain fewer events. \nThe default is 30 events.", + "minimum": 1, + "maximum": 30 + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for your original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "limit": 30, + "query": { + "filter": { + "order_filter": { + "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY" + } + } + } + } + }, + "SearchLoyaltyEventsResponse": { + "type": "object", + "description": "A response that contains loyalty events that satisfy the search \ncriteria, in order by the `created_at` date.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyEvent" + }, + "description": "The loyalty events that satisfy the search criteria." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent \nrequest. If empty, this is the final response. \nFor more information, \nsee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "events": [ + { + "accumulate_points": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY", + "points": 5 + }, + "created_at": "2020-05-08T22:01:30Z", + "id": "c27c8465-806e-36f2-b4b3-71f5887b5ba8", + "location_id": "P034NEENMD09F", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "source": "LOYALTY_API", + "type": "ACCUMULATE_POINTS" + }, + { + "created_at": "2020-05-08T22:01:15Z", + "id": "e4a5cbc3-a4d0-3779-98e9-e578885d9430", + "location_id": "P034NEENMD09F", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "redeem_reward": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY", + "reward_id": "d03f79f4-815f-3500-b851-cc1e68a457f9" + }, + "source": "LOYALTY_API", + "type": "REDEEM_REWARD" + }, + { + "create_reward": { + "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "points": -10, + "reward_id": "d03f79f4-815f-3500-b851-cc1e68a457f9" + }, + "created_at": "2020-05-08T22:00:44Z", + "id": "5e127479-0b03-3671-ab1e-15faea8b7188", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "source": "LOYALTY_API", + "type": "CREATE_REWARD" + } + ] + } + }, + "SearchLoyaltyRewardsRequest": { + "type": "object", + "description": "A request to search for loyalty rewards.", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/SearchLoyaltyRewardsRequestLoyaltyRewardQuery", + "description": "The search criteria for the request. \nIf empty, the endpoint retrieves all loyalty rewards in the loyalty program." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to return in the response. The default value is 30.", + "minimum": 1, + "maximum": 30 + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to \nthis endpoint. Provide this to retrieve the next set of \nresults for the original query.\nFor more information, \nsee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "limit": 10, + "query": { + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" + } + } + }, + "SearchLoyaltyRewardsRequestLoyaltyRewardQuery": { + "type": "object", + "description": "The set of search requirements.", + "x-release-status": "PUBLIC", + "required": [ + "loyalty_account_id" + ], + "properties": { + "loyalty_account_id": { + "type": "string", + "description": "The ID of the [loyalty account](entity:LoyaltyAccount) to which the loyalty reward belongs.", + "minLength": 1 + }, + "status": { + "$ref": "#/components/schemas/LoyaltyRewardStatus", + "description": "The status of the loyalty reward.\nSee [LoyaltyRewardStatus](#type-loyaltyrewardstatus) for possible values", + "nullable": true + } + } + }, + "SearchLoyaltyRewardsResponse": { + "type": "object", + "description": "A response that includes the loyalty rewards satisfying the search criteria.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "rewards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyReward" + }, + "description": "The loyalty rewards that satisfy the search criteria.\nThese are returned in descending order by `updated_at`." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent \nrequest. If empty, this is the final response." + } + }, + "example": { + "rewards": [ + { + "created_at": "2020-05-08T22:00:44Z", + "id": "d03f79f4-815f-3500-b851-cc1e68a457f9", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY", + "points": 10, + "redeemed_at": "2020-05-08T22:01:17Z", + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "REDEEMED", + "updated_at": "2020-05-08T22:01:17Z" + }, + { + "created_at": "2020-05-08T21:55:42Z", + "id": "9f18ac21-233a-31c3-be77-b45840f5a810", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "points": 10, + "redeemed_at": "2020-05-08T21:56:00Z", + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "REDEEMED", + "updated_at": "2020-05-08T21:56:00Z" + }, + { + "created_at": "2020-05-01T21:49:54Z", + "id": "a8f43ebe-2ad6-3001-bdd5-7d7c2da08943", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "order_id": "5NB69ZNh3FbsOs1ox43bh1xrli6YY", + "points": 10, + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "DELETED", + "updated_at": "2020-05-08T21:55:10Z" + }, + { + "created_at": "2020-05-01T20:20:37Z", + "id": "a051254c-f840-3b45-8cf1-50bcd38ff92a", + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "order_id": "LQQ16znvi2VIUKPVhUfJefzr1eEZY", + "points": 10, + "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "status": "ISSUED", + "updated_at": "2020-05-01T20:20:40Z" + } + ] + } + }, + "SearchOrdersCustomerFilter": { + "type": "object", + "description": "A filter based on the order `customer_id` and any tender `customer_id`\nassociated with the order. It does not filter based on the\n[FulfillmentRecipient](entity:FulfillmentRecipient) `customer_id`.", + "x-release-status": "BETA", + "properties": { + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of customer IDs to filter by.\n\nMax: 10 customer ids.", + "nullable": true + } + } + }, + "SearchOrdersDateTimeFilter": { + "type": "object", + "description": "Filter for `Order` objects based on whether their `CREATED_AT`,\n`CLOSED_AT`, or `UPDATED_AT` timestamps fall within a specified time range.\nYou can specify the time range and which timestamp to filter for. You can filter\nfor only one time range at a time.\n\nFor each time range, the start time and end time are inclusive. If the end time\nis absent, it defaults to the time of the first request for the cursor.\n\n__Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query,\nyou must set the `sort_field` in [OrdersSort](entity:SearchOrdersSort)\nto the same field you filter for. For example, if you set the `CLOSED_AT` field\nin `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to\n`CLOSED_AT`. Otherwise, `SearchOrders` throws an error.\n[Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range)", + "x-release-status": "PUBLIC", + "properties": { + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The time range for filtering on the `created_at` timestamp. If you use this\nvalue, you must set the `sort_field` in the `OrdersSearchSort` object to\n`CREATED_AT`." + }, + "updated_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The time range for filtering on the `updated_at` timestamp. If you use this\nvalue, you must set the `sort_field` in the `OrdersSearchSort` object to\n`UPDATED_AT`." + }, + "closed_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The time range for filtering on the `closed_at` timestamp. If you use this\nvalue, you must set the `sort_field` in the `OrdersSearchSort` object to\n`CLOSED_AT`.", + "nullable": true + } + } + }, + "SearchOrdersFilter": { + "type": "object", + "description": "Filtering criteria to use for a `SearchOrders` request. Multiple filters\nare ANDed together.", + "x-release-status": "PUBLIC", + "properties": { + "state_filter": { + "$ref": "#/components/schemas/SearchOrdersStateFilter", + "description": "Filter by [OrderState](entity:OrderState).", + "nullable": true + }, + "date_time_filter": { + "$ref": "#/components/schemas/SearchOrdersDateTimeFilter", + "description": "Filter for results within a time range.\n\n__Important:__ If you filter for orders by time range, you must set `SearchOrdersSort`\nto sort by the same field.\n[Learn more about filtering orders by time range.](https://developer.squareup.com/docs/orders-api/manage-orders/search-orders#important-note-about-filtering-orders-by-time-range)", + "nullable": true + }, + "fulfillment_filter": { + "$ref": "#/components/schemas/SearchOrdersFulfillmentFilter", + "description": "Filter by the fulfillment type or state.", + "nullable": true + }, + "source_filter": { + "$ref": "#/components/schemas/SearchOrdersSourceFilter", + "description": "Filter by the source of the order.", + "nullable": true + }, + "customer_filter": { + "$ref": "#/components/schemas/SearchOrdersCustomerFilter", + "description": "Filter by customers associated with the order.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "SearchOrdersFulfillmentFilter": { + "type": "object", + "description": "Filter based on [order fulfillment](entity:Fulfillment) information.", + "x-release-status": "PUBLIC", + "properties": { + "fulfillment_types": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentType" + }, + "description": "A list of [fulfillment types](entity:FulfillmentType) to filter\nfor. The list returns orders if any of its fulfillments match any of the fulfillment types\nlisted in this field.\nSee [FulfillmentType](#type-fulfillmenttype) for possible values", + "nullable": true + }, + "fulfillment_states": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FulfillmentState" + }, + "description": "A list of [fulfillment states](entity:FulfillmentState) to filter\nfor. The list returns orders if any of its fulfillments match any of the\nfulfillment states listed in this field.\nSee [FulfillmentState](#type-fulfillmentstate) for possible values", + "nullable": true + } + } + }, + "SearchOrdersQuery": { + "type": "object", + "description": "Contains query criteria for the search.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchOrdersFilter", + "description": "Criteria to filter results by.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/SearchOrdersSort", + "description": "Criteria to sort results by.", + "nullable": true + } + } + }, + "SearchOrdersRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The location IDs for the orders to query. All locations must belong to\nthe same merchant.\n\nMax: 10 location IDs." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for your original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "query": { + "$ref": "#/components/schemas/SearchOrdersQuery", + "description": "Query conditions used to filter or sort the results. Note that when\nretrieving additional pages using a cursor, you must use the original query." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to be returned in a single page.\n\nDefault: `500`\nMax: `1000`" + }, + "return_entries": { + "type": "boolean", + "description": "A Boolean that controls the format of the search results. If `true`,\n`SearchOrders` returns [OrderEntry](entity:OrderEntry) objects. If `false`, `SearchOrders`\nreturns complete order objects.\n\nDefault: `false`." + } + }, + "example": { + "limit": 3, + "location_ids": [ + "057P5VYJ4A5X1", + "18YC4JDH91E1H" + ], + "query": { + "filter": { + "date_time_filter": { + "closed_at": { + "end_at": "2019-03-04T21:54:45+00:00", + "start_at": "2018-03-03T20:00:00+00:00" + } + }, + "state_filter": { + "states": [ + "COMPLETED" + ] + } + }, + "sort": { + "sort_field": "CLOSED_AT", + "sort_order": "DESC" + } + }, + "return_entries": true + } + }, + "SearchOrdersResponse": { + "type": "object", + "description": "Either the `order_entries` or `orders` field is set, depending on whether\n`return_entries` is set on the [SearchOrdersRequest](api-endpoint:Orders-SearchOrders).", + "x-release-status": "PUBLIC", + "properties": { + "order_entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderEntry" + }, + "description": "A list of [OrderEntries](entity:OrderEntry) that fit the query\nconditions. The list is populated only if `return_entries` is set to `true` in the request." + }, + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + }, + "description": "A list of\n[Order](entity:Order) objects that match the query conditions. The list is populated only if\n`return_entries` is set to `false` in the request." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "[Errors](entity:Error) encountered during the search." + } + }, + "example": { + "cursor": "123", + "order_entries": [ + { + "location_id": "057P5VYJ4A5X1", + "order_id": "CAISEM82RcpmcFBM0TfOyiHV3es", + "version": 1 + }, + { + "location_id": "18YC4JDH91E1H", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY" + }, + { + "location_id": "057P5VYJ4A5X1", + "order_id": "CAISEM52YcpmcWAzERDOyiWS3ty" + } + ] + } + }, + "SearchOrdersSort": { + "type": "object", + "description": "Sorting criteria for a `SearchOrders` request. Results can only be sorted\nby a timestamp field.", + "x-release-status": "PUBLIC", + "required": [ + "sort_field" + ], + "properties": { + "sort_field": { + "$ref": "#/components/schemas/SearchOrdersSortField", + "description": "The field to sort by.\n\n__Important:__ When using a [DateTimeFilter](entity:SearchOrdersFilter),\n`sort_field` must match the timestamp field that the `DateTimeFilter` uses to\nfilter. For example, if you set your `sort_field` to `CLOSED_AT` and you use a\n`DateTimeFilter`, your `DateTimeFilter` must filter for orders by their `CLOSED_AT` date.\nIf this field does not match the timestamp field in `DateTimeFilter`,\n`SearchOrders` returns an error.\n\nDefault: `CREATED_AT`.\nSee [SearchOrdersSortField](#type-searchorderssortfield) for possible values" + }, + "sort_order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The chronological order in which results are returned. Defaults to `DESC`.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "SearchOrdersSortField": { + "type": "string", + "enum": [ + "CREATED_AT", + "UPDATED_AT", + "CLOSED_AT" + ], + "x-enum-elements": [ + { + "name": "CREATED_AT", + "description": "The time when the order was created, in RFC-3339 format. If you are also\nfiltering for a time range in this query, you must set the `CREATED_AT`\nfield in your `DateTimeFilter`." + }, + { + "name": "UPDATED_AT", + "description": "The time when the order last updated, in RFC-3339 format. If you are also\nfiltering for a time range in this query, you must set the `UPDATED_AT`\nfield in your `DateTimeFilter`." + }, + { + "name": "CLOSED_AT", + "description": "The time when the order was closed, in RFC-3339 format. If you use this\nvalue, you must also set a `StateFilter` with closed states. If you are also\nfiltering for a time range in this query, you must set the `CLOSED_AT`\nfield in your `DateTimeFilter`." + } + ], + "description": "Specifies which timestamp to use to sort `SearchOrder` results.", + "x-release-status": "PUBLIC" + }, + "SearchOrdersSourceFilter": { + "type": "object", + "description": "A filter based on order `source` information.", + "x-release-status": "PUBLIC", + "properties": { + "source_names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filters by the [Source](entity:OrderSource) `name`. The filter returns any orders\nwith a `source.name` that matches any of the listed source names.\n\nMax: 10 source names.", + "nullable": true + } + } + }, + "SearchOrdersStateFilter": { + "type": "object", + "description": "Filter by the current order `state`.", + "x-release-status": "PUBLIC", + "required": [ + "states" + ], + "properties": { + "states": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderState" + }, + "description": "States to filter for.\nSee [OrderState](#type-orderstate) for possible values" + } + } + }, + "SearchScheduledShiftsRequest": { + "type": "object", + "description": "Represents a [SearchScheduledShift](api-endpoint:Labor-SearchScheduledShift) request.", + "x-release-status": "BETA", + "properties": { + "query": { + "$ref": "#/components/schemas/ScheduledShiftQuery", + "description": "Query conditions used to filter and sort the results." + }, + "limit": { + "type": "integer", + "description": "The maximum number of results to return in a single response page. The default value is 50.", + "minimum": 1, + "maximum": 50 + }, + "cursor": { + "type": "string", + "description": "The pagination cursor returned by the previous call to this endpoint. Provide\nthis cursor to retrieve the next page of results for your original request. For more\ninformation, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "cursor": "xoxp-1234-5678-90123", + "limit": 2, + "query": { + "filter": { + "assignment_status": "ASSIGNED", + "scheduled_shift_status": [ + "PUBLISHED", + "DRAFT" + ] + }, + "sort": { + "field": "CREATED_AT", + "order": "ASC" + } + } + } + }, + "SearchScheduledShiftsResponse": { + "type": "object", + "description": "Represents a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) response.\nEither `scheduled_shifts` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "scheduled_shifts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScheduledShift" + }, + "description": "A paginated list of scheduled shifts that match the query conditions." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor used to retrieve the next page of results. This field is present\nonly if additional results are available." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "cursor": "xoxp-123-2123-123232", + "scheduled_shifts": [ + { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-01-25T13:11:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "updated_at": "2019-02-25T03:11:00-05:00", + "version": 1 + } + ] + } + }, + "SearchShiftsRequest": { + "type": "object", + "description": "A request for a filtered and sorted set of `Shift` objects.", + "x-release-status": "DEPRECATED", + "properties": { + "query": { + "$ref": "#/components/schemas/ShiftQuery", + "description": "Query filters." + }, + "limit": { + "type": "integer", + "description": "The number of resources in a page (200 by default).", + "minimum": 1, + "maximum": 200 + }, + "cursor": { + "type": "string", + "description": "An opaque cursor for fetching the next page." + } + }, + "example": { + "limit": 100, + "query": { + "filter": { + "workday": { + "date_range": { + "end_date": "2019-02-03", + "start_date": "2019-01-20" + }, + "default_timezone": "America/Los_Angeles", + "match_shifts_by": "START_AT" + } + } + } + } + }, + "SearchShiftsResponse": { + "type": "object", + "description": "The response to a request for `Shift` objects. The response contains\nthe requested `Shift` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "shifts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Shift" + }, + "description": "Shifts." + }, + "cursor": { + "type": "string", + "description": "An opaque cursor for fetching the next page." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "shifts": [ + { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-21T06:11:00-05:00", + "expected_duration": "PT10M", + "id": "SJW7X6AKEJQ65", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-21T06:11:00-05:00" + } + ], + "created_at": "2019-01-24T01:12:03Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "ormj0jJJZ5OZIzxrZYJI", + "end_at": "2019-01-21T13:11:00-05:00", + "id": "X714F3HA6D1PT", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-21T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-07T22:21:08Z", + "version": 6, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + }, + { + "breaks": [ + { + "break_type_id": "WQX00VR99F53J", + "end_at": "2019-01-23T14:40:00-05:00", + "expected_duration": "PT10M", + "id": "BKS6VR7WR748A", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-23T14:30:00-05:00" + }, + { + "break_type_id": "P6Q468ZFRN1AC", + "end_at": "2019-01-22T12:44:00-05:00", + "expected_duration": "PT15M", + "id": "BQFEZSHFZSC51", + "is_paid": false, + "name": "Coffee Break", + "start_at": "2019-01-22T12:30:00-05:00" + } + ], + "created_at": "2019-01-23T23:32:45Z", + "declared_cash_tip_money": { + "amount": 0, + "currency": "USD" + }, + "employee_id": "33fJchumvVdJwxV0H6L9", + "end_at": "2019-01-22T13:02:00-05:00", + "id": "GDHYBZYWK0P2V", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-22T12:02:00-05:00", + "status": "CLOSED", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "timezone": "America/New_York", + "updated_at": "2019-01-24T00:56:25Z", + "version": 16, + "wage": { + "hourly_rate": { + "amount": 1600, + "currency": "USD" + }, + "job_id": "gcbz15vKGnMKmaWJJ152kjim", + "tip_eligible": true, + "title": "Cook" + } + } + ] + } + }, + "SearchSubscriptionsFilter": { + "type": "object", + "description": "Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions returned by \nthe [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "customer_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A filter to select subscriptions based on the subscribing customer IDs.", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A filter to select subscriptions based on the location.", + "nullable": true + }, + "source_names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A filter to select subscriptions based on the source application.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "SearchSubscriptionsQuery": { + "type": "object", + "description": "Represents a query, consisting of specified query expressions, used to search for subscriptions.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchSubscriptionsFilter", + "description": "A list of query expressions.", + "nullable": true + } + } + }, + "SearchSubscriptionsRequest": { + "type": "object", + "description": "Defines input parameters in a request to the \n[SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "cursor": { + "type": "string", + "description": "When the total number of resulting subscriptions exceeds the limit of a paged response, \nspecify the cursor returned from a preceding response here to fetch the next set of results.\nIf the cursor is unset, the response contains the last page of the results.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + }, + "limit": { + "type": "integer", + "description": "The upper limit on the number of subscriptions to return\nin a paged response.", + "minimum": 1 + }, + "query": { + "$ref": "#/components/schemas/SearchSubscriptionsQuery", + "description": "A subscription query consisting of specified filtering conditions.\n\nIf this `query` field is unspecified, the `SearchSubscriptions` call will return all subscriptions." + }, + "include": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An option to include related information in the response. \n\nThe supported values are: \n\n- `actions`: to include scheduled actions on the targeted subscriptions.", + "x-release-status": "BETA" + } + }, + "example": { + "query": { + "filter": { + "customer_ids": [ + "CHFGVKYY8RSV93M5KCYTG4PN0G" + ], + "location_ids": [ + "S8GWD5R9QB376" + ], + "source_names": [ + "My App" + ] + } + } + } + }, + "SearchSubscriptionsResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscriptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Subscription" + }, + "description": "The subscriptions matching the specified query expressions." + }, + "cursor": { + "type": "string", + "description": "When the total number of resulting subscription exceeds the limit of a paged response, \nthe response includes a cursor for you to use in a subsequent request to fetch the next set of results.\nIf the cursor is unset, the response contains the last page of the results.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)." + } + }, + "example": { + "subscriptions": [ + { + "canceled_date": "2021-10-30", + "card_id": "ccof:mueUsvgajChmjEbp4GB", + "charged_through_date": "2021-11-20", + "created_at": "2021-10-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "de86fc96-8664-474b-af1a-abbe59cacf0e", + "location_id": "S8GWD5R9QB376", + "paid_until_date": "2021-11-20", + "plan_variation_id": "L3TJVDHVBEQEGQDEZL2JJM7R", + "source": { + "name": "My Application" + }, + "start_date": "2021-10-20", + "status": "CANCELED", + "timezone": "UTC" + }, + { + "charged_through_date": "2022-08-19", + "created_at": "2022-01-19T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", + "invoice_ids": [ + "grebK0Q_l8H4fqoMMVvt-Q", + "rcX_i3sNmHTGKhI4W2mceA" + ], + "location_id": "S8GWD5R9QB376", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "price_override_money": { + "amount": 1000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "start_date": "2022-01-19", + "status": "PAUSED", + "tax_percentage": "5", + "timezone": "America/Los_Angeles", + "version": 2 + }, + { + "card_id": "ccof:qy5x8hHGYsgLrp4Q4GB", + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "56214fb2-cc85-47a1-93bc-44f3766bb56f", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + "ordinal": 0, + "plan_phase_uid": "X2Q2AONPB3RB64Y27S25QCZP", + "uid": "873451e0-745b-4e87-ab0b-c574933fe616" + } + ], + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "source": { + "name": "My Application" + }, + "start_date": "2023-06-20", + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 1 + } + ] + } + }, + "SearchTeamMembersFilter": { + "type": "object", + "description": "Represents a filter used in a search for `TeamMember` objects. `AND` logic is applied\nbetween the individual fields, and `OR` logic is applied within list-based fields.\nFor example, setting this filter value:\n```\nfilter = (locations_ids = [\"A\", \"B\"], status = ACTIVE)\n```\nreturns only active team members assigned to either location \"A\" or \"B\".", + "x-release-status": "PUBLIC", + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "When present, filters by team members assigned to the specified locations.\nWhen empty, includes team members assigned to any location.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/TeamMemberStatus", + "description": "When present, filters by team members who match the given status.\nWhen empty, includes team members of all statuses.\nSee [TeamMemberStatus](#type-teammemberstatus) for possible values", + "nullable": true + }, + "is_owner": { + "type": "boolean", + "description": "When present and set to true, returns the team member who is the owner of the Square account.", + "nullable": true + } + } + }, + "SearchTeamMembersQuery": { + "type": "object", + "description": "Represents the parameters in a search for `TeamMember` objects.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchTeamMembersFilter", + "description": "The options to filter by.", + "nullable": true + } + } + }, + "SearchTeamMembersRequest": { + "type": "object", + "description": "Represents a search request for a filtered list of `TeamMember` objects.", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/SearchTeamMembersQuery", + "description": "The query parameters." + }, + "limit": { + "type": "integer", + "description": "The maximum number of `TeamMember` objects in a page (100 by default).", + "minimum": 1, + "maximum": 200 + }, + "cursor": { + "type": "string", + "description": "The opaque cursor for fetching the next page. For more information, see\n[pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." + } + }, + "example": { + "limit": 10, + "query": { + "filter": { + "location_ids": [ + "0G5P3VGACMMQZ" + ], + "status": "ACTIVE" + } + } + } + }, + "SearchTeamMembersResponse": { + "type": "object", + "description": "Represents a response from a search request containing a filtered list of `TeamMember` objects.", + "x-release-status": "PUBLIC", + "properties": { + "team_members": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TeamMember" + }, + "description": "The filtered list of `TeamMember` objects." + }, + "cursor": { + "type": "string", + "description": "The opaque cursor for fetching the next page. For more information, see\n[pagination](https://developer.squareup.com/docs/working-with-apis/pagination)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "cursor": "N:9UglUjOXQ13-hMFypCft", + "team_members": [ + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2019-07-10T17:26:48Z", + "email_address": "johnny_cash@squareup.com", + "family_name": "Cash", + "given_name": "Johnny", + "id": "-3oZQKPKVk6gUXU_V5Qa", + "is_owner": false, + "reference_id": "12345678", + "status": "ACTIVE", + "updated_at": "2020-04-28T21:49:28Z", + "wage_setting": { + "created_at": "2021-06-11T22:55:45Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 1443, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "-3oZQKPKVk6gUXU_V5Qa", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:01Z", + "family_name": "Smith", + "given_name": "Lombard", + "id": "1AVJj0DjkzbmbJw5r4KK", + "is_owner": false, + "phone_number": "+14155552671", + "reference_id": "abcded", + "status": "ACTIVE", + "updated_at": "2020-06-09T17:38:05Z", + "wage_setting": { + "created_at": "2020-03-24T18:14:01Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "hourly_rate": { + "amount": 2400, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "1AVJj0DjkzbmbJw5r4KK", + "updated_at": "2020-06-09T17:38:05Z", + "version": 2 + } + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T01:09:25Z", + "family_name": "Sway", + "given_name": "Monica", + "id": "2JCmiJol_KKFs9z2Evim", + "is_owner": false, + "status": "ACTIVE", + "updated_at": "2020-03-24T01:11:25Z", + "wage_setting": { + "created_at": "2020-03-24T01:09:25Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "hourly_rate": { + "amount": 2400, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "2JCmiJol_KKFs9z2Evim", + "updated_at": "2020-03-24T01:09:25Z", + "version": 1 + } + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T01:09:23Z", + "family_name": "Ipsum", + "given_name": "Elton", + "id": "4uXcJQSLtbk3F0UQHFNQ", + "is_owner": false, + "status": "ACTIVE", + "updated_at": "2020-03-24T01:15:23Z" + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T01:09:23Z", + "family_name": "Lo", + "given_name": "Steven", + "id": "5CoUpyrw1YwGWcRd-eDL", + "is_owner": false, + "status": "ACTIVE", + "updated_at": "2020-03-24T01:19:23Z" + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:03Z", + "family_name": "Steward", + "given_name": "Patrick", + "id": "5MRPTTp8MMBLVSmzrGha", + "is_owner": false, + "phone_number": "+14155552671", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:18:03Z", + "wage_setting": { + "created_at": "2020-03-24T18:14:03Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "5MRPTTp8MMBLVSmzrGha", + "updated_at": "2020-03-24T18:14:03Z", + "version": 1 + } + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T01:09:25Z", + "family_name": "Manny", + "given_name": "Ivy", + "id": "7F5ZxsfRnkexhu1PTbfh", + "is_owner": false, + "status": "ACTIVE", + "updated_at": "2020-03-24T01:09:25Z" + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:02Z", + "email_address": "john_smith@example.com", + "family_name": "Smith", + "given_name": "John", + "id": "808X9HR72yKvVaigQXf4", + "is_owner": false, + "phone_number": "+14155552671", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:14:02Z" + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:00Z", + "email_address": "r_wen@example.com", + "family_name": "Wen", + "given_name": "Robert", + "id": "9MVDVoY4hazkWKGo_OuZ", + "is_owner": false, + "phone_number": "+14155552671", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:14:00Z" + }, + { + "assigned_locations": { + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS" + }, + "created_at": "2020-03-24T18:14:00Z", + "email_address": "asimpson@example.com", + "family_name": "Simpson", + "given_name": "Ashley", + "id": "9UglUjOXQ13-hMFypCft", + "is_owner": false, + "phone_number": "+14155552671", + "status": "ACTIVE", + "updated_at": "2020-03-24T18:18:00Z", + "wage_setting": { + "created_at": "2020-03-24T18:14:00Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "9UglUjOXQ13-hMFypCft", + "updated_at": "2020-03-24T18:14:03Z", + "version": 1 + } + } + ] + } + }, + "SearchTerminalActionsRequest": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "query": { + "$ref": "#/components/schemas/TerminalActionQuery", + "description": "Queries terminal actions based on given conditions and sort order.\nLeaving this unset will return all actions with the default sort order." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more\ninformation." + }, + "limit": { + "type": "integer", + "description": "Limit the number of results returned for a single request.", + "minimum": 1, + "maximum": 100 + } + }, + "example": { + "limit": 2, + "query": { + "filter": { + "created_at": { + "start_at": "2022-04-01T00:00:00.000Z" + } + }, + "sort": { + "sort_order": "DESC" + } + } + } + }, + "SearchTerminalActionsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "action": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TerminalAction" + }, + "description": "The requested search result of `TerminalAction`s." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more\ninformation." + } + }, + "example": { + "action": [ + { + "app_id": "APP_ID", + "created_at": "2022-04-08T15:14:04.895Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:oBGWlAats8xWCiCE", + "location_id": "LOCATION_ID", + "save_card_options": { + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "IN_PROGRESS", + "type": "SAVE_CARD", + "updated_at": "2022-04-08T15:14:05.446Z" + }, + { + "app_id": "APP_ID", + "created_at": "2022-04-08T15:14:01.210Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:K2NY2YSSml3lTiCE", + "location_id": "LOCATION_ID", + "save_card_options": { + "card_id": "ccof:CARD_ID", + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "COMPLETED", + "type": "SAVE_CARD", + "updated_at": "2022-04-08T15:14:09.861Z" + } + ], + "cursor": "CURSOR" + } + }, + "SearchTerminalCheckoutsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/TerminalCheckoutQuery", + "description": "Queries Terminal checkouts based on given conditions and the sort order.\nLeaving these unset returns all checkouts with the default sort order." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + }, + "limit": { + "type": "integer", + "description": "Limits the number of results returned for a single request.", + "minimum": 1, + "maximum": 100 + } + }, + "example": { + "limit": 2, + "query": { + "filter": { + "status": "COMPLETED" + } + } + } + }, + "SearchTerminalCheckoutsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "checkouts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TerminalCheckout" + }, + "description": "The requested search result of `TerminalCheckout` objects." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + } + }, + "example": { + "checkouts": [ + { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2020-03-31T18:13:15.921Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "tsQPvzwBpMqqO", + "note": "A brief note", + "payment_ids": [ + "rXnhZzywrEk4vR6pw76fPZfgvaB" + ], + "reference_id": "id14467", + "status": "COMPLETED", + "updated_at": "2020-03-31T18:13:52.725Z" + }, + { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2020-03-31T18:08:31.882Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": true, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "XlOPTgcEhrbqO", + "note": "A brief note", + "payment_ids": [ + "VYBF861PaoKPP7Pih0TlbZiNvaB" + ], + "reference_id": "id41623", + "status": "COMPLETED", + "updated_at": "2020-03-31T18:08:41.635Z" + } + ], + "cursor": "RiTJqBoTuXlbLmmrPvEkX9iG7XnQ4W4RjGnH" + } + }, + "SearchTerminalRefundsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/TerminalRefundQuery", + "description": "Queries the Terminal refunds based on given conditions and the sort order. Calling\n`SearchTerminalRefunds` without an explicit query parameter returns all available\nrefunds with the default sort order." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query." + }, + "limit": { + "type": "integer", + "description": "Limits the number of results returned for a single request.", + "minimum": 1, + "maximum": 100 + } + }, + "example": { + "limit": 1, + "query": { + "filter": { + "status": "COMPLETED" + } + } + } + }, + "SearchTerminalRefundsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "refunds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TerminalRefund" + }, + "description": "The requested search result of `TerminalRefund` objects." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If empty,\nthis is the final response.\n\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information." + } + }, + "example": { + "refunds": [ + { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "app_id": "sandbox-sq0idb-c2OuYt13YaCAeJq_2cd8OQ", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 1, + "exp_year": 2022, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "created_at": "2020-09-29T15:21:46.771Z", + "deadline_duration": "PT5M", + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "id": "009DP5HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "76C9W6K8CNNQ5", + "order_id": "kcuKDKreRaI4gF4TjmEgZjHk8Z7YY", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Returning item", + "refund_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY_43Q4iGp7sNeATiWrUruA1EYeMRUXaddXXlDDJ1EQLvb", + "status": "COMPLETED", + "updated_at": "2020-09-29T15:21:48.675Z" + } + ] + } + }, + "SearchTimecardsRequest": { + "type": "object", + "description": "A request for a filtered and sorted set of `Timecard` objects.", + "x-release-status": "PUBLIC", + "properties": { + "query": { + "$ref": "#/components/schemas/TimecardQuery", + "description": "Query filters." + }, + "limit": { + "type": "integer", + "description": "The number of resources in a page (200 by default).", + "minimum": 1, + "maximum": 200 + }, + "cursor": { + "type": "string", + "description": "An opaque cursor for fetching the next page." + } + }, + "example": { + "limit": 100, + "query": { + "filter": { + "workday": { + "date_range": { + "end_date": "2019-02-03", + "start_date": "2019-01-20" + }, + "default_timezone": "America/Los_Angeles", + "match_timecards_by": "START_AT" + } + } + } + } + }, + "SearchTimecardsResponse": { + "type": "object", + "description": "The response to a request for `Timecard` objects. The response contains\nthe requested `Timecard` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "timecards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Timecard" + }, + "description": "Timecards." + }, + "cursor": { + "type": "string", + "description": "An opaque cursor for fetching the next page." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "timecards": [ + { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-21T06:11:00-05:00", + "expected_duration": "PT10M", + "id": "SJW7X6AKEJQ65", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-21T06:11:00-05:00" + } + ], + "created_at": "2019-01-24T01:12:03Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-21T13:11:00-05:00", + "id": "X714F3HA6D1PT", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-21T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-07T22:21:08Z", + "version": 6, + "wage": { + "hourly_rate": { + "amount": 1100, + "currency": "USD" + }, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "tip_eligible": true, + "title": "Barista" + } + }, + { + "breaks": [ + { + "break_type_id": "WQX00VR99F53J", + "end_at": "2019-01-22T14:40:00-05:00", + "expected_duration": "PT10M", + "id": "BKS6VR7WR748A", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-22T14:30:00-05:00" + }, + { + "break_type_id": "P6Q468ZFRN1AC", + "end_at": "2019-01-22T12:44:00-05:00", + "expected_duration": "PT15M", + "id": "BQFEZSHFZSC51", + "is_paid": false, + "name": "Coffee Break", + "start_at": "2019-01-22T12:30:00-05:00" + } + ], + "created_at": "2019-01-23T23:32:45Z", + "declared_cash_tip_money": { + "amount": 0, + "currency": "USD" + }, + "end_at": "2019-01-22T13:02:00-05:00", + "id": "GDHYBZYWK0P2V", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-22T12:02:00-05:00", + "status": "CLOSED", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "timezone": "America/New_York", + "updated_at": "2019-01-24T00:56:25Z", + "version": 16, + "wage": { + "hourly_rate": { + "amount": 1600, + "currency": "USD" + }, + "job_id": "gcbz15vKGnMKmaWJJ152kjim", + "tip_eligible": true, + "title": "Cook" + } + } + ] + } + }, + "SearchTransferOrdersRequest": { + "type": "object", + "description": "Request to search transfer orders", + "x-release-status": "BETA", + "properties": { + "query": { + "$ref": "#/components/schemas/TransferOrderQuery", + "description": "The search query" + }, + "cursor": { + "type": "string", + "description": "Pagination cursor from a previous search response" + }, + "limit": { + "type": "integer", + "description": "Maximum number of results to return (1-100)", + "minimum": 1, + "maximum": 100 + } + }, + "example": { + "cursor": "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", + "limit": 10, + "query": { + "filter": { + "destination_location_ids": [ + "EXAMPLE_DEST_LOCATION_ID_456" + ], + "source_location_ids": [ + "EXAMPLE_SOURCE_LOCATION_ID_123" + ], + "statuses": [ + "STARTED", + "PARTIALLY_RECEIVED" + ] + }, + "sort": { + "field": "UPDATED_AT", + "order": "DESC" + } + } + } + }, + "SearchTransferOrdersResponse": { + "type": "object", + "description": "Response for searching transfer orders", + "x-release-status": "BETA", + "properties": { + "transfer_orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransferOrder" + }, + "description": "List of transfer orders matching the search criteria" + }, + "cursor": { + "type": "string", + "description": "Pagination cursor for fetching the next page of results" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request" + } + }, + "example": { + "cursor": "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTU1NDBfMTIzfQ==", + "transfer_orders": [ + { + "created_at": "2025-01-15T10:30:00Z", + "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", + "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", + "expected_at": "2025-11-09T05:00:00Z", + "id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "line_items": [ + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", + "quantity_canceled": "0", + "quantity_damaged": "0", + "quantity_ordered": "5", + "quantity_pending": "5", + "quantity_received": "0", + "uid": "1" + } + ], + "notes": "Inventory rebalance between stores", + "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", + "status": "STARTED", + "tracking_number": "TRACK123456789", + "updated_at": "2025-01-15T10:32:00Z", + "version": 1753118664873 + }, + { + "created_at": "2025-01-14T14:20:00Z", + "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", + "expected_at": "2025-11-08T12:00:00Z", + "id": "EXAMPLE_TRANSFER_ORDER_ID_456", + "line_items": [ + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_002", + "quantity_canceled": "0", + "quantity_damaged": "0", + "quantity_ordered": "10", + "quantity_pending": "3", + "quantity_received": "7", + "uid": "1" + } + ], + "notes": "Seasonal stock transfer", + "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", + "status": "PARTIALLY_RECEIVED", + "updated_at": "2025-01-15T09:45:00Z", + "version": 1753115540123 + } + ] + } + }, + "SearchVendorsRequest": { + "type": "object", + "description": "Represents an input into a call to [SearchVendors](api-endpoint:Vendors-SearchVendors).", + "x-release-status": "BETA", + "properties": { + "filter": { + "$ref": "#/components/schemas/SearchVendorsRequestFilter", + "description": "Specifies a filter used to search for vendors." + }, + "sort": { + "$ref": "#/components/schemas/SearchVendorsRequestSort", + "description": "Specifies a sorter used to sort the returned vendors." + }, + "cursor": { + "type": "string", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "query": { + "filter": { + "name": [ + "Joe's Fresh Seafood", + "Hannah's Bakery" + ], + "status": [ + "ACTIVE" + ] + }, + "sort": { + "field": "CREATED_AT", + "order": "ASC" + } + } + } + }, + "SearchVendorsRequestFilter": { + "type": "object", + "description": "Defines supported query expressions to search for vendors by.", + "x-release-status": "BETA", + "properties": { + "name": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The names of the [Vendor](entity:Vendor) objects to retrieve.", + "nullable": true + }, + "status": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VendorStatus" + }, + "description": "The statuses of the [Vendor](entity:Vendor) objects to retrieve.\nSee [VendorStatus](#type-vendorstatus) for possible values", + "nullable": true + } + } + }, + "SearchVendorsRequestSort": { + "type": "object", + "description": "Defines a sorter used to sort results from [SearchVendors](api-endpoint:Vendors-SearchVendors).", + "x-release-status": "BETA", + "properties": { + "field": { + "$ref": "#/components/schemas/SearchVendorsRequestSortField", + "description": "Specifies the sort key to sort the returned vendors.\nSee [Field](#type-field) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "Specifies the sort order for the returned vendors.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "SearchVendorsRequestSortField": { + "type": "string", + "enum": [ + "NAME", + "CREATED_AT" + ], + "x-enum-elements": [ + { + "name": "NAME", + "description": "To sort the result by the name of the [Vendor](entity:Vendor) objects." + }, + { + "name": "CREATED_AT", + "description": "To sort the result by the creation time of the [Vendor](entity:Vendor) objects." + } + ], + "description": "The field to sort the returned [Vendor](entity:Vendor) objects by.", + "x-release-status": "BETA" + }, + "SearchVendorsResponse": { + "type": "object", + "description": "Represents an output from a call to [SearchVendors](api-endpoint:Vendors-SearchVendors).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered when the request fails." + }, + "vendors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Vendor" + }, + "description": "The [Vendor](entity:Vendor) objects matching the specified search filter." + }, + "cursor": { + "type": "string", + "description": "The pagination cursor to be used in a subsequent request. If unset,\nthis is the final response.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information." + } + }, + "example": { + "vendors": [ + { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Joe's Fresh Seafood", + "note": "a vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T10:21:54.859Z", + "version": 1 + } + ] + } + }, + "SegmentFilter": { + "type": "object", + "description": "A query filter to search for buyer-accessible appointment segments by.", + "x-release-status": "PUBLIC", + "required": [ + "service_variation_id" + ], + "properties": { + "service_variation_id": { + "type": "string", + "description": "The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.", + "minLength": 1, + "maxLength": 36 + }, + "team_member_id_filter": { + "$ref": "#/components/schemas/FilterValue", + "description": "A query filter to search for buyer-accessible appointment segments with service-providing team members matching the specified list of team member IDs. Supported query expressions are\n- `ANY`: return the appointment segments with team members whose IDs match any member in this list.\n- `NONE`: return the appointment segments with team members whose IDs are not in this list.\n- `ALL`: not supported.\n\nWhen no expression is specified, any service-providing team member is eligible to fulfill the Booking.", + "nullable": true + } + } + }, + "SelectOption": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "reference_id", + "title" + ], + "properties": { + "reference_id": { + "type": "string", + "description": "The reference id for the option.", + "minLength": 1, + "maxLength": 40 + }, + "title": { + "type": "string", + "description": "The title text that displays in the select option button.", + "minLength": 1, + "maxLength": 250 + } + } + }, + "SelectOptions": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "title", + "body", + "options" + ], + "properties": { + "title": { + "type": "string", + "description": "The title text to display in the select flow on the Terminal.", + "minLength": 1, + "maxLength": 250 + }, + "body": { + "type": "string", + "description": "The body text to display in the select flow on the Terminal.", + "minLength": 1, + "maxLength": 10000 + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SelectOption" + }, + "description": "Represents the buttons/options that should be displayed in the select flow on the Terminal." + }, + "selected_option": { + "$ref": "#/components/schemas/SelectOption", + "description": "The buyer’s selected option.", + "readOnly": true + } + } + }, + "Shift": { + "type": "object", + "description": "A record of the hourly rate, start, and end times for a single work shift\nfor an employee. This might include a record of the start and end times for breaks\ntaken during the shift.\n\nDeprecated at Square API version 2025-05-21. Replaced by [Timecard](entity:Timecard).\nSee the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "required": [ + "location_id", + "start_at" + ], + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object.", + "maxLength": 255 + }, + "employee_id": { + "type": "string", + "description": "The ID of the employee this shift belongs to. DEPRECATED at version 2020-08-26. Use `team_member_id` instead.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location this shift occurred at. The location should be based on\nwhere the employee clocked in.", + "minLength": 1 + }, + "timezone": { + "type": "string", + "description": "The read-only convenience value that is calculated from the location based\non the `location_id`. Format: the IANA timezone database identifier for the\nlocation timezone.", + "nullable": true + }, + "start_at": { + "type": "string", + "description": "RFC 3339; shifted to the location timezone + offset. Precision up to the\nminute is respected; seconds are truncated.", + "minLength": 1 + }, + "end_at": { + "type": "string", + "description": "RFC 3339; shifted to the timezone + offset. Precision up to the minute is\nrespected; seconds are truncated.", + "nullable": true + }, + "wage": { + "$ref": "#/components/schemas/ShiftWage", + "description": "Job and pay related information. If the wage is not set on create, it defaults to a wage\nof zero. If the title is not set on create, it defaults to the name of the role the employee\nis assigned to, if any.", + "nullable": true + }, + "breaks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Break" + }, + "description": "A list of all the paid or unpaid breaks that were taken during this shift.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ShiftStatus", + "description": "Describes the working state of the current `Shift`.\nSee [ShiftStatus](#type-shiftstatus) for possible values", + "nullable": true + }, + "version": { + "type": "integer", + "description": "Used for resolving concurrency issues. The request fails if the version\nprovided does not match the server version at the time of the request. If not provided,\nSquare executes a blind write; potentially overwriting data from another\nwrite." + }, + "created_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format; presented in UTC.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format; presented in UTC.", + "readOnly": true + }, + "team_member_id": { + "type": "string", + "description": "The ID of the team member this shift belongs to. Replaced `employee_id` at version \"2020-08-26\".", + "nullable": true + }, + "declared_cash_tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The tips declared by the team member for the shift.", + "nullable": true + } + } + }, + "ShiftFilter": { + "type": "object", + "description": "Defines a filter used in a search for `Shift` records. `AND` logic is\nused by Square's servers to apply each filter property specified.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fetch shifts for the specified location.", + "nullable": true + }, + "employee_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` instead.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ShiftFilterStatus", + "description": "Fetch a `Shift` instance by `Shift.status`.\nSee [ShiftFilterStatus](#type-shiftfilterstatus) for possible values", + "nullable": true + }, + "start": { + "$ref": "#/components/schemas/TimeRange", + "description": "Fetch `Shift` instances that start in the time range - Inclusive.", + "nullable": true + }, + "end": { + "$ref": "#/components/schemas/TimeRange", + "description": "Fetch the `Shift` instances that end in the time range - Inclusive.", + "nullable": true + }, + "workday": { + "$ref": "#/components/schemas/ShiftWorkday", + "description": "Fetch the `Shift` instances based on the workday date range.", + "nullable": true + }, + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fetch shifts for the specified team members. Replaced `employee_ids` at version \"2020-08-26\".", + "nullable": true + } + } + }, + "ShiftFilterStatus": { + "type": "string", + "enum": [ + "OPEN", + "CLOSED" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "Shifts that have been started and not ended." + }, + { + "name": "CLOSED", + "description": "Shifts that have been started and ended." + } + ], + "description": "Specifies the `status` of `Shift` records to be returned.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED" + }, + "ShiftQuery": { + "type": "object", + "description": "The parameters of a `Shift` search query, which includes filter and sort options.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "properties": { + "filter": { + "$ref": "#/components/schemas/ShiftFilter", + "description": "Query filter options.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/ShiftSort", + "description": "Sort order details.", + "nullable": true + } + } + }, + "ShiftSort": { + "type": "object", + "description": "Sets the sort order of search results.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "properties": { + "field": { + "$ref": "#/components/schemas/ShiftSortField", + "description": "The field to sort on.\nSee [ShiftSortField](#type-shiftsortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order in which results are returned. Defaults to DESC.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "ShiftSortField": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "The start date/time of a `Shift`" + }, + { + "name": "END_AT", + "description": "The end date/time of a `Shift`" + }, + { + "name": "CREATED_AT", + "description": "The date/time that a `Shift` is created" + }, + { + "name": "UPDATED_AT", + "description": "The most recent date/time that a `Shift` is updated" + } + ], + "description": "Enumerates the `Shift` fields to sort on.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED" + }, + "ShiftStatus": { + "type": "string", + "enum": [ + "OPEN", + "CLOSED" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "Employee started a work shift and the shift is not complete" + }, + { + "name": "CLOSED", + "description": "Employee started and ended a work shift." + } + ], + "description": "Enumerates the possible status of a `Shift`.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED" + }, + "ShiftWage": { + "type": "object", + "description": "The hourly wage rate used to compensate an employee for this shift.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "properties": { + "title": { + "type": "string", + "description": "The name of the job performed during this shift.", + "nullable": true + }, + "hourly_rate": { + "$ref": "#/components/schemas/Money", + "description": "Can be a custom-set hourly wage or the calculated effective hourly\nwage based on the annual wage and hours worked per week.", + "nullable": true + }, + "job_id": { + "type": "string", + "description": "The id of the job performed during this shift. Square\nlabor-reporting UIs might group shifts together by id.", + "readOnly": true + }, + "tip_eligible": { + "type": "boolean", + "description": "Whether team members are eligible for tips when working this job.", + "nullable": true + } + } + }, + "ShiftWorkday": { + "type": "object", + "description": "A `Shift` search query filter parameter that sets a range of days that\na `Shift` must start or end in before passing the filter condition.\n\nDeprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes).", + "x-release-status": "DEPRECATED", + "properties": { + "date_range": { + "$ref": "#/components/schemas/DateRange", + "description": "Dates for fetching the shifts.", + "nullable": true + }, + "match_shifts_by": { + "$ref": "#/components/schemas/ShiftWorkdayMatcher", + "description": "The strategy on which the dates are applied.\nSee [ShiftWorkdayMatcher](#type-shiftworkdaymatcher) for possible values", + "nullable": true + }, + "default_timezone": { + "type": "string", + "description": "Location-specific timezones convert workdays to datetime filters.\nEvery location included in the query must have a timezone or this field\nmust be provided as a fallback. Format: the IANA timezone database\nidentifier for the relevant timezone.", + "nullable": true + } + } + }, + "ShiftWorkdayMatcher": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "INTERSECTION" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "All shifts that start on or after the specified workday" + }, + { + "name": "END_AT", + "description": "All shifts that end on or before the specified workday" + }, + { + "name": "INTERSECTION", + "description": "All shifts that start between the start and end workdays (inclusive)" + } + ], + "description": "Defines the logic used to apply a workday filter.", + "x-release-status": "DEPRECATED" + }, + "ShippingFee": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "charge" + ], + "properties": { + "name": { + "type": "string", + "description": "The name for the shipping fee.", + "nullable": true + }, + "charge": { + "$ref": "#/components/schemas/Money", + "description": "The amount and currency for the shipping fee." + } + } + }, + "SignatureImage": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "image_type": { + "type": "string", + "description": "The mime/type of the image data.\nUse `image/png;base64` for png.", + "readOnly": true + }, + "data": { + "type": "string", + "description": "The base64 representation of the image.", + "readOnly": true + } + } + }, + "SignatureOptions": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "title", + "body" + ], + "properties": { + "title": { + "type": "string", + "description": "The title text to display in the signature capture flow on the Terminal.", + "minLength": 1, + "maxLength": 250 + }, + "body": { + "type": "string", + "description": "The body text to display in the signature capture flow on the Terminal.", + "minLength": 1, + "maxLength": 10000 + }, + "signature": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SignatureImage" + }, + "description": "An image representation of the collected signature.", + "readOnly": true + } + } + }, + "Site": { + "type": "object", + "description": "Represents a Square Online site, which is an online store for a Square seller.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the site.", + "maxLength": 32, + "readOnly": true + }, + "site_title": { + "type": "string", + "description": "The title of the site.", + "nullable": true + }, + "domain": { + "type": "string", + "description": "The domain of the site (without the protocol). For example, `mysite1.square.site`.", + "nullable": true + }, + "is_published": { + "type": "boolean", + "description": "Indicates whether the site is published.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the site was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the site was last updated, in RFC 3339 format.", + "readOnly": true + } + } + }, + "Snippet": { + "type": "object", + "description": "Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages.", + "x-release-status": "PUBLIC", + "required": [ + "content" + ], + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID for the snippet.", + "maxLength": 48, + "readOnly": true + }, + "site_id": { + "type": "string", + "description": "The ID of the site that contains the snippet.", + "readOnly": true + }, + "content": { + "type": "string", + "description": "The snippet code, which can contain valid HTML, JavaScript, or both.", + "minLength": 1, + "maxLength": 65535 + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the snippet was initially added to the site, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the snippet was last updated on the site, in RFC 3339 format.", + "readOnly": true + } + } + }, + "SortOrder": { + "type": "string", + "enum": [ + "DESC", + "ASC" + ], + "x-enum-elements": [ + { + "name": "DESC", + "description": "The results are returned in descending (e.g., newest-first or Z-A) order." + }, + { + "name": "ASC", + "description": "The results are returned in ascending (e.g., oldest-first or A-Z) order." + } + ], + "description": "The order (e.g., chronological or alphabetical) in which results from a request are returned.", + "x-release-status": "PUBLIC" + }, + "SourceApplication": { + "type": "object", + "description": "Represents information about the application used to generate a change.", + "x-release-status": "PUBLIC", + "properties": { + "product": { + "$ref": "#/components/schemas/Product", + "description": "__Read only__ The [product](entity:Product) type of the application.\nSee [Product](#type-product) for possible values", + "nullable": true + }, + "application_id": { + "type": "string", + "description": "__Read only__ The Square-assigned ID of the application. This field is used only if the\n[product](entity:Product) type is `EXTERNAL_API`.", + "nullable": true + }, + "name": { + "type": "string", + "description": "__Read only__ The display name of the application\n(for example, `\"Custom Application\"` or `\"Square POS 4.74 for Android\"`).", + "nullable": true + } + } + }, + "SquareAccountDetails": { + "type": "object", + "description": "Additional details about Square Account payments.", + "x-release-status": "PUBLIC", + "properties": { + "payment_source_token": { + "type": "string", + "description": "Unique identifier for the payment source used for this payment.", + "maxLength": 255, + "nullable": true + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request.", + "nullable": true + } + } + }, + "StandardUnitDescription": { + "type": "object", + "description": "Contains the name and abbreviation for standard measurement unit.", + "x-release-status": "PUBLIC", + "properties": { + "unit": { + "$ref": "#/components/schemas/MeasurementUnit", + "description": "Identifies the measurement unit being described.", + "nullable": true + }, + "name": { + "type": "string", + "description": "UI display name of the measurement unit. For example, 'Pound'.", + "nullable": true + }, + "abbreviation": { + "type": "string", + "description": "UI display abbreviation for the measurement unit. For example, 'lb'.", + "nullable": true + } + } + }, + "StandardUnitDescriptionGroup": { + "type": "object", + "description": "Group of standard measurement units.", + "x-release-status": "PUBLIC", + "properties": { + "standard_unit_descriptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StandardUnitDescription" + }, + "description": "List of standard (non-custom) measurement units in this description group.", + "nullable": true + }, + "language_code": { + "type": "string", + "description": "IETF language tag.", + "nullable": true + } + } + }, + "StartTransferOrderRequest": { + "type": "object", + "description": "Request to start a transfer order, changing its status from DRAFT to STARTED.", + "x-release-status": "BETA", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this UpdateTransferOrder request. Keys can be\nany valid string but must be unique for every UpdateTransferOrder request.", + "minLength": 1 + }, + "version": { + "type": "integer", + "description": "Version for optimistic concurrency", + "format": "int64" + } + }, + "example": { + "idempotency_key": "EXAMPLE_IDEMPOTENCY_KEY_789", + "transfer_order_id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "version": 1753109537351 + } + }, + "StartTransferOrderResponse": { + "type": "object", + "description": "Response for starting a transfer order.", + "x-release-status": "BETA", + "properties": { + "transfer_order": { + "$ref": "#/components/schemas/TransferOrder", + "description": "The updated transfer order with status changed to STARTED" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request" + } + }, + "example": { + "transfer_order": { + "created_at": "2025-01-15T10:30:00Z", + "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", + "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_456", + "expected_at": "2025-11-09T05:00:00Z", + "id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "line_items": [ + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", + "quantity_canceled": "0", + "quantity_damaged": "0", + "quantity_ordered": "5", + "quantity_pending": "5", + "quantity_received": "0", + "uid": "1" + }, + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_002", + "quantity_canceled": "0", + "quantity_damaged": "0", + "quantity_ordered": "3", + "quantity_pending": "3", + "quantity_received": "0", + "uid": "2" + } + ], + "notes": "Example transfer order for inventory redistribution between locations", + "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_123", + "status": "STARTED", + "tracking_number": "TRACK123456789", + "updated_at": "2025-01-15T10:32:00Z", + "version": 1753118664873 + } + } + }, + "SubmitEvidenceResponse": { + "type": "object", + "description": "Defines the fields in a `SubmitEvidence` response.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "dispute": { + "$ref": "#/components/schemas/Dispute", + "description": "The `Dispute` for which evidence was submitted." + } + }, + "example": { + "dispute": { + "amount_money": { + "amount": 4350, + "currency": "USD" + }, + "brand_dispute_id": "100000399240", + "card_brand": "VISA", + "created_at": "2022-05-18T16:02:15.313Z", + "disputed_payment": { + "payment_id": "2yeBUWJzllJTpmnSqtMRAL19taB" + }, + "due_at": "2022-06-01T00:00:00.000Z", + "id": "EAZoK70gX3fyvibecLwIGB", + "location_id": "LSY8XKGSMMX94", + "reason": "CUSTOMER_REQUESTS_CREDIT", + "reported_at": "2022-05-18T00:00:00.000Z", + "state": "PROCESSING", + "updated_at": "2022-05-18T16:02:15.313Z", + "version": 4 + } + } + }, + "Subscription": { + "type": "object", + "description": "Represents a subscription purchased by a customer.\n\nFor more information, see\n[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The Square-assigned ID of the subscription.", + "maxLength": 255, + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The ID of the location associated with the subscription.", + "readOnly": true + }, + "plan_variation_id": { + "type": "string", + "description": "The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation).", + "readOnly": true + }, + "customer_id": { + "type": "string", + "description": "The ID of the subscribing [customer](entity:Customer) profile.", + "readOnly": true + }, + "start_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the subscription.", + "readOnly": true + }, + "canceled_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to cancel the subscription, \nwhen the subscription status changes to `CANCELED` and the subscription billing stops.\n\nIf this field is not set, the subscription ends according its subscription plan.\n\nThis field cannot be updated, other than being cleared.", + "nullable": true + }, + "charged_through_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date up to when the subscriber is invoiced for the\nsubscription.\n\nAfter the invoice is sent for a given billing period,\nthis date will be the last day of the billing period.\nFor example,\nsuppose for the month of May a subscriber gets an invoice\n(or charged the card) on May 1. For the monthly billing scenario,\nthis date is then set to May 31.", + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/SubscriptionStatus", + "description": "The current status of the subscription.\nSee [SubscriptionStatus](#type-subscriptionstatus) for possible values", + "readOnly": true + }, + "tax_percentage": { + "type": "string", + "description": "The tax amount applied when billing the subscription. The\npercentage is expressed in decimal form, using a `'.'` as the decimal\nseparator and without a `'%'` sign. For example, a value of `7.5`\ncorresponds to 7.5%.", + "nullable": true + }, + "invoice_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the [invoices](entity:Invoice) created for the\nsubscription, listed in order when the invoices were created\n(newest invoices appear first).", + "readOnly": true + }, + "price_override_money": { + "$ref": "#/components/schemas/Money", + "description": "A custom price which overrides the cost of a subscription plan variation with `STATIC` pricing.\nThis field does not affect itemized subscriptions with `RELATIVE` pricing. Instead, \nyou should edit the Subscription's [order template](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#phases-and-order-templates).", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version of the object. When updating an object, the version\nsupplied must match the version in the database, otherwise the write will\nbe rejected as conflicting.", + "format": "int64" + }, + "created_at": { + "type": "string", + "description": "The timestamp when the subscription was created, in RFC 3339 format.", + "readOnly": true + }, + "card_id": { + "type": "string", + "description": "The ID of the [subscriber's](entity:Customer) [card](entity:Card)\nused to charge for the subscription.", + "nullable": true + }, + "timezone": { + "type": "string", + "description": "Timezone that will be used in date calculations for the subscription.\nDefaults to the timezone of the location based on `location_id`.\nFormat: the IANA Timezone Database identifier for the location timezone (for example, `America/Los_Angeles`).", + "readOnly": true + }, + "source": { + "$ref": "#/components/schemas/SubscriptionSource", + "description": "The origination details of the subscription.", + "x-release-status": "BETA", + "nullable": true + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "The list of scheduled actions on this subscription. It is set only in the response from \n[RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) with the query parameter\nof `include=actions` or from \n[SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) with the input parameter \nof `include:[\"actions\"]`.", + "x-release-status": "BETA", + "nullable": true + }, + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The day of the month on which the subscription will issue invoices and publish orders.", + "readOnly": true, + "x-release-status": "BETA" + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Phase" + }, + "description": "array of phases for this subscription", + "readOnly": true + }, + "completed_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the subscription enters a terminal state.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "SubscriptionAction": { + "type": "object", + "description": "Represents an action as a pending change to a subscription.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "The ID of an action scoped to a subscription." + }, + "type": { + "$ref": "#/components/schemas/SubscriptionActionType", + "description": "The type of the action.\nSee [SubscriptionActionType](#type-subscriptionactiontype) for possible values", + "nullable": true + }, + "effective_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date when the action occurs on the subscription.", + "nullable": true + }, + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` action.", + "nullable": true + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Phase" + }, + "description": "A list of Phases, to pass phase-specific information used in the swap.", + "nullable": true + }, + "new_plan_variation_id": { + "type": "string", + "description": "The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action.", + "nullable": true + } + } + }, + "SubscriptionActionType": { + "type": "string", + "enum": [ + "CANCEL", + "PAUSE", + "RESUME", + "SWAP_PLAN", + "CHANGE_BILLING_ANCHOR_DATE", + "COMPLETE" + ], + "x-enum-elements": [ + { + "name": "CANCEL", + "description": "The action to execute a scheduled cancellation of a subscription." + }, + { + "name": "PAUSE", + "description": "The action to execute a scheduled pause of a subscription." + }, + { + "name": "RESUME", + "description": "The action to execute a scheduled resumption of a subscription." + }, + { + "name": "SWAP_PLAN", + "description": "The action to execute a scheduled swap of a subscription plan in a subscription." + }, + { + "name": "CHANGE_BILLING_ANCHOR_DATE", + "description": "A billing anchor date change action." + }, + { + "name": "COMPLETE", + "description": "The action marking when a subscription completes a fixed number of phases." + } + ], + "description": "Supported types of an action as a pending change to a subscription.", + "x-release-status": "BETA" + }, + "SubscriptionCadence": { + "type": "string", + "enum": [ + "DAILY", + "WEEKLY", + "EVERY_TWO_WEEKS", + "THIRTY_DAYS", + "SIXTY_DAYS", + "NINETY_DAYS", + "MONTHLY", + "EVERY_TWO_MONTHS", + "QUARTERLY", + "EVERY_FOUR_MONTHS", + "EVERY_SIX_MONTHS", + "ANNUAL", + "EVERY_TWO_YEARS" + ], + "x-enum-elements": [ + { + "name": "DAILY", + "description": "Once per day" + }, + { + "name": "WEEKLY", + "description": "Once per week" + }, + { + "name": "EVERY_TWO_WEEKS", + "description": "Every two weeks" + }, + { + "name": "THIRTY_DAYS", + "description": "Once every 30 days" + }, + { + "name": "SIXTY_DAYS", + "description": "Once every 60 days" + }, + { + "name": "NINETY_DAYS", + "description": "Once every 90 days" + }, + { + "name": "MONTHLY", + "description": "Once per month" + }, + { + "name": "EVERY_TWO_MONTHS", + "description": "Once every two months" + }, + { + "name": "QUARTERLY", + "description": "Once every three months" + }, + { + "name": "EVERY_FOUR_MONTHS", + "description": "Once every four months" + }, + { + "name": "EVERY_SIX_MONTHS", + "description": "Once every six months" + }, + { + "name": "ANNUAL", + "description": "Once per year" + }, + { + "name": "EVERY_TWO_YEARS", + "description": "Once every two years" + } + ], + "description": "Determines the billing cadence of a [Subscription](entity:Subscription)", + "x-release-status": "PUBLIC" + }, + "SubscriptionCreatedEvent": { + "type": "object", + "description": "Published when a [Subscription](entity:Subscription) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"subscription.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/SubscriptionCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-07-15T05:14:11.002Z", + "data": { + "id": "592b9720-d2ef-4ee4-b3fd-9d98e4f829d2", + "object": { + "subscription": { + "created_date": "2020-07-15", + "customer_id": "QX2XG9GMQS2BVBJKPG8CJ8JKCR", + "id": "592b9720-d2ef-4ee4-b3fd-9d98e4f829d2", + "location_id": "EZHGJ7SNVAJ19", + "plan_variation_id": "CRUUZUK5W6PIIM6H54242NV6", + "start_date": "2020-07-15", + "status": "ACTIVE", + "tax_percentage": "5", + "timezone": "America/New_York", + "version": 1594790050754 + } + }, + "type": "subscription" + }, + "event_id": "65bc2e81-bcdc-4add-abfd-7a012b8f3d2a", + "merchant_id": "VSE65BA53PXCC", + "type": "subscription.created" + }, + "x-webhook": { + "event": "subscription.created", + "scopes": [ + "SUBSCRIPTIONS_READ" + ] + }, + "x-api": "#/components/x-apis/Subscriptions", + "x-since": "2020-08-12" + }, + "SubscriptionCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"subscription\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected subscription.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/SubscriptionCreatedEventObject", + "description": "An object containing the created subscription.", + "nullable": true + } + } + }, + "SubscriptionCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The created subscription.", + "nullable": true + } + } + }, + "SubscriptionEvent": { + "type": "object", + "description": "Describes changes to a subscription and the subscription status.", + "x-release-status": "PUBLIC", + "required": [ + "id", + "subscription_event_type", + "effective_date", + "plan_variation_id" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the subscription event." + }, + "subscription_event_type": { + "$ref": "#/components/schemas/SubscriptionEventSubscriptionEventType", + "description": "Type of the subscription event.\nSee [SubscriptionEventSubscriptionEventType](#type-subscriptioneventsubscriptioneventtype) for possible values" + }, + "effective_date": { + "type": "string", + "description": "The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the subscription event occurred." + }, + "monthly_billing_anchor_date": { + "type": "integer", + "description": "The day-of-the-month the billing anchor date was changed to, if applicable.", + "readOnly": true, + "x-release-status": "BETA" + }, + "info": { + "$ref": "#/components/schemas/SubscriptionEventInfo", + "description": "Additional information about the subscription event.", + "nullable": true + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Phase" + }, + "description": "A list of Phases, to pass phase-specific information used in the swap.", + "nullable": true + }, + "plan_variation_id": { + "type": "string", + "description": "The ID of the subscription plan variation associated with the subscription." + } + } + }, + "SubscriptionEventInfo": { + "type": "object", + "description": "Provides information about the subscription event.", + "x-release-status": "PUBLIC", + "properties": { + "detail": { + "type": "string", + "description": "A human-readable explanation for the event.", + "nullable": true + }, + "code": { + "$ref": "#/components/schemas/SubscriptionEventInfoCode", + "description": "An info code indicating the subscription event that occurred.\nSee [InfoCode](#type-infocode) for possible values", + "nullable": true + } + } + }, + "SubscriptionEventInfoCode": { + "type": "string", + "enum": [ + "LOCATION_NOT_ACTIVE", + "LOCATION_CANNOT_ACCEPT_PAYMENT", + "CUSTOMER_DELETED", + "CUSTOMER_NO_EMAIL", + "CUSTOMER_NO_NAME", + "USER_PROVIDED" + ], + "x-enum-elements": [ + { + "name": "LOCATION_NOT_ACTIVE", + "description": "The location is not active." + }, + { + "name": "LOCATION_CANNOT_ACCEPT_PAYMENT", + "description": "The location cannot accept payments." + }, + { + "name": "CUSTOMER_DELETED", + "description": "The subscribing customer profile has been deleted." + }, + { + "name": "CUSTOMER_NO_EMAIL", + "description": "The subscribing customer does not have an email." + }, + { + "name": "CUSTOMER_NO_NAME", + "description": "The subscribing customer does not have a name." + }, + { + "name": "USER_PROVIDED", + "description": "User-provided detail." + } + ], + "description": "Supported info codes of a subscription event.", + "x-release-status": "PUBLIC" + }, + "SubscriptionEventSubscriptionEventType": { + "type": "string", + "enum": [ + "START_SUBSCRIPTION", + "PLAN_CHANGE", + "STOP_SUBSCRIPTION", + "DEACTIVATE_SUBSCRIPTION", + "RESUME_SUBSCRIPTION", + "PAUSE_SUBSCRIPTION", + "BILLING_ANCHOR_DATE_CHANGED" + ], + "x-enum-elements": [ + { + "name": "START_SUBSCRIPTION", + "description": "The subscription was started." + }, + { + "name": "PLAN_CHANGE", + "description": "The subscription plan was changed." + }, + { + "name": "STOP_SUBSCRIPTION", + "description": "The subscription was stopped." + }, + { + "name": "DEACTIVATE_SUBSCRIPTION", + "description": "The subscription was deactivated" + }, + { + "name": "RESUME_SUBSCRIPTION", + "description": "The subscription was resumed." + }, + { + "name": "PAUSE_SUBSCRIPTION", + "description": "The subscription was paused." + }, + { + "name": "BILLING_ANCHOR_DATE_CHANGED", + "description": "The billing anchor date was changed." + } + ], + "description": "Supported types of an event occurred to a subscription.", + "x-release-status": "PUBLIC" + }, + "SubscriptionPhase": { + "type": "object", + "description": "Describes a phase in a subscription plan variation. For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations).", + "x-release-status": "PUBLIC", + "required": [ + "cadence" + ], + "properties": { + "uid": { + "type": "string", + "description": "The Square-assigned ID of the subscription phase. This field cannot be changed after a `SubscriptionPhase` is created.", + "nullable": true + }, + "cadence": { + "$ref": "#/components/schemas/SubscriptionCadence", + "description": "The billing cadence of the phase. For example, weekly or monthly. This field cannot be changed after a `SubscriptionPhase` is created.\nSee [SubscriptionCadence](#type-subscriptioncadence) for possible values" + }, + "periods": { + "type": "integer", + "description": "The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can be indefinite. This field cannot be changed after a `SubscriptionPhase` is created.", + "nullable": true + }, + "recurring_price_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount to bill for each `cadence`. Failure to specify this field results in a `MISSING_REQUIRED_PARAMETER` error at runtime.", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The position this phase appears in the sequence of phases defined for the plan, indexed from 0. This field cannot be changed after a `SubscriptionPhase` is created.", + "format": "int64", + "nullable": true + }, + "pricing": { + "$ref": "#/components/schemas/SubscriptionPricing", + "description": "The subscription pricing.", + "nullable": true + } + } + }, + "SubscriptionPricing": { + "type": "object", + "description": "Describes the pricing for the subscription.", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "$ref": "#/components/schemas/SubscriptionPricingType", + "description": "RELATIVE or STATIC\nSee [SubscriptionPricingType](#type-subscriptionpricingtype) for possible values", + "nullable": true + }, + "discount_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The ids of the discount catalog objects", + "nullable": true + }, + "price_money": { + "$ref": "#/components/schemas/Money", + "description": "The price of the subscription, if STATIC", + "nullable": true + } + } + }, + "SubscriptionPricingType": { + "type": "string", + "enum": [ + "STATIC", + "RELATIVE" + ], + "x-enum-elements": [ + { + "name": "STATIC", + "description": "Static pricing" + }, + { + "name": "RELATIVE", + "description": "Relative pricing" + } + ], + "description": "Determines the pricing of a [Subscription](entity:Subscription)", + "x-release-status": "PUBLIC" + }, + "SubscriptionSource": { + "type": "object", + "description": "The origination details of the subscription.", + "x-release-status": "BETA", + "properties": { + "name": { + "type": "string", + "description": "The name used to identify the place (physical or digital) that\na subscription originates. If unset, the name defaults to the name\nof the application that created the subscription.", + "maxLength": 255, + "nullable": true + } + } + }, + "SubscriptionStatus": { + "type": "string", + "enum": [ + "PENDING", + "ACTIVE", + "CANCELED", + "DEACTIVATED", + "PAUSED", + "COMPLETED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The subscription is pending to start in the future." + }, + { + "name": "ACTIVE", + "description": "The subscription is active." + }, + { + "name": "CANCELED", + "description": "The subscription is canceled." + }, + { + "name": "DEACTIVATED", + "description": "The subscription is deactivated." + }, + { + "name": "PAUSED", + "description": "The subscription is paused." + }, + { + "name": "COMPLETED", + "description": "The subscription has completed all of its phases." + } + ], + "description": "Supported subscription statuses.", + "x-release-status": "PUBLIC" + }, + "SubscriptionTestResult": { + "type": "object", + "description": "Represents the details of a webhook subscription, including notification URL,\nevent types, and signature key.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A Square-generated unique ID for the subscription test result.", + "maxLength": 64, + "readOnly": true + }, + "status_code": { + "type": "integer", + "description": "The status code returned by the subscription notification URL.", + "nullable": true + }, + "payload": { + "type": "string", + "description": "An object containing the payload of the test event. For example, a `payment.created` event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the subscription was created, in RFC 3339 format. \nFor example, \"2016-09-04T23:59:33.123Z\".", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the subscription was updated, in RFC 3339 format. For example, \"2016-09-04T23:59:33.123Z\".\nBecause a subscription test result is unique, this field is the same as the `created_at` field.", + "readOnly": true + } + } + }, + "SubscriptionUpdatedEvent": { + "type": "object", + "description": "Published when a [Subscription](entity:Subscription) is updated.\nTypically the `subscription.status` is updated as subscriptions become active\nor cancelled.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"subscription.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/SubscriptionUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-07-15T05:14:11.213Z", + "data": { + "id": "592b9720-d2ef-4ee4-b3fd-9d98e4f829d2", + "object": { + "subscription": { + "created_date": "2020-07-15", + "customer_id": "QX2XG9GMQS2BVBJKPG8CJ8JKCR", + "id": "592b9720-d2ef-4ee4-b3fd-9d98e4f829d2", + "location_id": "EZHGJ7SNVAJ19", + "plan_variation_id": "CRUUZUK5W6PIIM6H54242NV6", + "start_date": "2020-07-15", + "status": "ACTIVE", + "tax_percentage": "5", + "timezone": "America/New_York", + "version": 1594790050754 + } + }, + "type": "subscription" + }, + "event_id": "c0b40cc0-7cb2-4aa1-81ce-0893b9b0b9b8", + "merchant_id": "VSE65BA53PXCC", + "type": "subscription.updated" + }, + "x-webhook": { + "event": "subscription.updated", + "scopes": [ + "SUBSCRIPTIONS_READ" + ] + }, + "x-api": "#/components/x-apis/Subscriptions", + "x-since": "2020-08-12" + }, + "SubscriptionUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"subscription\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected subscription.", + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/SubscriptionUpdatedEventObject", + "description": "An object containing the updated subscription.", + "nullable": true + } + } + }, + "SubscriptionUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The updated subscription.", + "nullable": true + } + } + }, + "SwapPlanRequest": { + "type": "object", + "description": "Defines input parameters in a call to the\n[SwapPlan](api-endpoint:Subscriptions-SwapPlan) endpoint.", + "x-release-status": "BETA", + "properties": { + "new_plan_variation_id": { + "type": "string", + "description": "The ID of the new subscription plan variation.\n\nThis field is required.", + "nullable": true + }, + "phases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PhaseInput" + }, + "description": "A list of PhaseInputs, to pass phase-specific information used in the swap.", + "nullable": true + } + }, + "example": { + "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "phases": [ + { + "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY", + "ordinal": 0 + } + ] + } + }, + "SwapPlanResponse": { + "type": "object", + "description": "Defines output parameters in a response of the \n[SwapPlan](api-endpoint:Subscriptions-SwapPlan) endpoint.", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The subscription with the updated subscription plan." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionAction" + }, + "description": "A list of a `SWAP_PLAN` action created by the request." + } + }, + "example": { + "actions": [ + { + "effective_date": "2023-11-17", + "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83", + "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "phases": [ + { + "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY", + "ordinal": 0 + } + ], + "type": "SWAP_PLAN" + } + ], + "subscription": { + "created_at": "2023-06-20T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "9ba40961-995a-4a3d-8c53-048c40cafc13", + "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY", + "ordinal": 0, + "plan_phase_uid": "C66BKH3ASTDYGJJCEZXQQSS7", + "uid": "98d6f53b-40e1-4714-8827-032fd923be25" + } + ], + "plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "price_override_money": { + "amount": 2000, + "currency": "USD" + }, + "source": { + "name": "My Application" + }, + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 3 + } + } + }, + "TaxCalculationPhase": { + "type": "string", + "enum": [ + "TAX_SUBTOTAL_PHASE", + "TAX_TOTAL_PHASE" + ], + "x-enum-elements": [ + { + "name": "TAX_SUBTOTAL_PHASE", + "description": "The fee is calculated based on the payment's subtotal." + }, + { + "name": "TAX_TOTAL_PHASE", + "description": "The fee is calculated based on the payment's total." + } + ], + "description": "When to calculate the taxes due on a cart.", + "x-release-status": "PUBLIC" + }, + "TaxIds": { + "type": "object", + "description": "Identifiers for the location used by various governments for tax purposes.", + "x-release-status": "BETA", + "properties": { + "eu_vat": { + "type": "string", + "description": "The EU VAT number for this location. For example, `IE3426675K`.\nIf the EU VAT number is present, it is well-formed and has been\nvalidated with VIES, the VAT Information Exchange System.", + "readOnly": true + }, + "fr_siret": { + "type": "string", + "description": "The SIRET (Système d'Identification du Répertoire des Entreprises et de leurs Etablissements)\nnumber is a 14-digit code issued by the French INSEE. For example, `39922799000021`.", + "readOnly": true + }, + "fr_naf": { + "type": "string", + "description": "The French government uses the NAF (Nomenclature des Activités Françaises) to display and\ntrack economic statistical data. This is also called the APE (Activite Principale de l’Entreprise) code.\nFor example, `6910Z`.", + "readOnly": true + }, + "es_nif": { + "type": "string", + "description": "The NIF (Numero de Identificacion Fiscal) number is a nine-character tax identifier used in Spain.\nIf it is present, it has been validated. For example, `73628495A`.", + "readOnly": true + }, + "jp_qii": { + "type": "string", + "description": "The QII (Qualified Invoice Issuer) number is a 14-character tax identifier used in Japan.\nFor example, `T1234567890123`.", + "readOnly": true + } + } + }, + "TaxInclusionType": { + "type": "string", + "enum": [ + "ADDITIVE", + "INCLUSIVE" + ], + "x-enum-elements": [ + { + "name": "ADDITIVE", + "description": "The tax is an additive tax. The tax amount is added on top of the\nCatalogItemVariation price. For example, a $1.00 item with a 10% additive\ntax would have a total cost to the buyer of $1.10." + }, + { + "name": "INCLUSIVE", + "description": "The tax is an inclusive tax. The tax amount is included in the\nCatalogItemVariation price. For example, a $1.00 item with a 10% inclusive\ntax would have a total cost to the buyer of $1.00, with $0.91 (91 cents) of\nthat total being the cost of the item and $0.09 (9 cents) being tax." + } + ], + "description": "Whether to the tax amount should be additional to or included in the CatalogItem price.", + "x-release-status": "PUBLIC" + }, + "TeamMember": { + "type": "object", + "description": "A record representing an individual team member for a business.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The unique ID for the team member.", + "readOnly": true + }, + "reference_id": { + "type": "string", + "description": "A second ID used to associate the team member with an entity in another system.", + "nullable": true + }, + "is_owner": { + "type": "boolean", + "description": "Whether the team member is the owner of the Square account.", + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/TeamMemberStatus", + "description": "Describes the status of the team member.\nSee [TeamMemberStatus](#type-teammemberstatus) for possible values", + "nullable": true + }, + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the team member.", + "nullable": true + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the team member.", + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address associated with the team member. After accepting the invitation\nfrom Square, only the team member can change this value.", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The team member's phone number, in E.164 format. For example:\n+14155552671 - the country code is 1 for US\n+551155256325 - the country code is 55 for BR", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp when the team member was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the team member was last updated, in RFC 3339 format.", + "readOnly": true + }, + "assigned_locations": { + "$ref": "#/components/schemas/TeamMemberAssignedLocations", + "description": "Describes the team member's assigned locations.", + "nullable": true + }, + "wage_setting": { + "$ref": "#/components/schemas/WageSetting", + "description": "Information about the team member's overtime exemption status, job assignments, and compensation.", + "x-release-status": "BETA", + "nullable": true + } + } + }, + "TeamMemberAssignedLocations": { + "type": "object", + "description": "An object that represents a team member's assignment to locations.", + "x-release-status": "PUBLIC", + "properties": { + "assignment_type": { + "$ref": "#/components/schemas/TeamMemberAssignedLocationsAssignmentType", + "description": "The current assignment type of the team member.\nSee [TeamMemberAssignedLocationsAssignmentType](#type-teammemberassignedlocationsassignmenttype) for possible values", + "nullable": true + }, + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The explicit locations that the team member is assigned to.", + "nullable": true + } + } + }, + "TeamMemberAssignedLocationsAssignmentType": { + "type": "string", + "enum": [ + "ALL_CURRENT_AND_FUTURE_LOCATIONS", + "EXPLICIT_LOCATIONS" + ], + "x-enum-elements": [ + { + "name": "ALL_CURRENT_AND_FUTURE_LOCATIONS", + "description": "The team member is assigned to all current and future locations. The `location_ids` field\nis empty if the team member has this assignment type." + }, + { + "name": "EXPLICIT_LOCATIONS", + "description": "The team member is assigned to an explicit subset of locations. The `location_ids` field\nis the list of locations that the team member is assigned to." + } + ], + "description": "Enumerates the possible assignment types that the team member can have.", + "x-release-status": "PUBLIC" + }, + "TeamMemberBookingProfile": { + "type": "object", + "description": "The booking profile of a seller's team member, including the team member's ID, display name, description and whether the team member can be booked as a service provider.", + "x-release-status": "PUBLIC", + "properties": { + "team_member_id": { + "type": "string", + "description": "The ID of the [TeamMember](entity:TeamMember) object for the team member associated with the booking profile.", + "maxLength": 32, + "readOnly": true + }, + "description": { + "type": "string", + "description": "The description of the team member.", + "maxLength": 65536, + "readOnly": true + }, + "display_name": { + "type": "string", + "description": "The display name of the team member.", + "maxLength": 512, + "readOnly": true + }, + "is_bookable": { + "type": "boolean", + "description": "Indicates whether the team member can be booked through the Bookings API or the seller's online booking channel or site (`true`) or not (`false`).", + "nullable": true + }, + "profile_image_url": { + "type": "string", + "description": "The URL of the team member's image for the bookings profile.", + "maxLength": 2048, + "readOnly": true + } + } + }, + "TeamMemberCreatedEvent": { + "type": "object", + "description": "Published when a Team Member is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"team_member.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TeamMemberCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2021-03-11T01:16:04.253Z", + "data": { + "id": "TMfCNDbg_wwJvUJY", + "object": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS" + }, + "created_at": "2021-03-11T01:16:03.697Z", + "email_address": "amelia.earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "TMfCNDbg_wwJvUJY", + "is_owner": false, + "phone_number": "+12125554240", + "reference_id": "example-reference-id", + "status": "ACTIVE", + "updated_at": "2021-03-11T01:16:03.697Z" + } + }, + "type": "team_member" + }, + "event_id": "91484f7e-63bc-4253-a86d-18e7ea0b0cfb", + "merchant_id": "0JV5BGNW4EG9R", + "type": "team_member.created" + }, + "x-webhook": { + "event": "team_member.created", + "scopes": [ + "EMPLOYEES_READ" + ] + }, + "x-api": "#/components/x-apis/Team", + "x-since": "2021-04-21" + }, + "TeamMemberCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"team_member\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the created team member." + }, + "object": { + "$ref": "#/components/schemas/TeamMemberCreatedEventObject", + "description": "An object containing the created team member.", + "nullable": true + } + } + }, + "TeamMemberCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The created team member.", + "nullable": true + } + } + }, + "TeamMemberInvitationStatus": { + "type": "string", + "enum": [ + "UNINVITED", + "PENDING", + "ACCEPTED" + ], + "x-enum-elements": [ + { + "name": "UNINVITED", + "description": "The team member has not received an invitation." + }, + { + "name": "PENDING", + "description": "The team member has received an invitation, but had not accepted it." + }, + { + "name": "ACCEPTED", + "description": "The team member has both received and accepted an invitation." + } + ], + "description": "Enumerates the possible invitation statuses the team member can have within a business.", + "x-release-status": "PUBLIC" + }, + "TeamMemberStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "The team member can sign in to Point of Sale and the Seller Dashboard." + }, + { + "name": "INACTIVE", + "description": "The team member can no longer sign in to Point of Sale or the Seller Dashboard,\nbut the team member's sales reports remain available." + } + ], + "description": "Enumerates the possible statuses the team member can have within a business.", + "x-release-status": "PUBLIC" + }, + "TeamMemberUpdatedEvent": { + "type": "object", + "description": "Published when a Team Member is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"team_member.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TeamMemberUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2021-03-11T01:16:04.254Z", + "data": { + "id": "TMfCNDbg_wwJvUJY", + "object": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS" + }, + "created_at": "2021-03-11T01:16:03.697Z", + "email_address": "amelia.earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "TMfCNDbg_wwJvUJY", + "is_owner": false, + "phone_number": "+12125554240", + "reference_id": "example-reference-id", + "status": "ACTIVE", + "updated_at": "2021-03-11T01:16:03.697Z" + } + }, + "type": "team_member" + }, + "event_id": "86c18838-51a7-4bdd-a6ff-3ffd2c1c5eb9", + "merchant_id": "0JV5BGNW4EG9R", + "type": "team_member.updated" + }, + "x-webhook": { + "event": "team_member.updated", + "scopes": [ + "EMPLOYEES_READ" + ] + }, + "x-api": "#/components/x-apis/Team", + "x-since": "2021-04-21" + }, + "TeamMemberUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"team_member\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected team member." + }, + "object": { + "$ref": "#/components/schemas/TeamMemberUpdatedEventObject", + "description": "An object containing the updated team member.", + "nullable": true + } + } + }, + "TeamMemberUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The updated team member.", + "nullable": true + } + } + }, + "TeamMemberWage": { + "type": "object", + "description": "Job and wage information for a [team member](entity:TeamMember).\nThis convenience object provides details needed to specify the `wage`\nfield for a [timecard](entity:Timecard).", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object." + }, + "team_member_id": { + "type": "string", + "description": "The `TeamMember` that this wage is assigned to.", + "nullable": true + }, + "title": { + "type": "string", + "description": "The job title that this wage relates to.", + "nullable": true + }, + "hourly_rate": { + "$ref": "#/components/schemas/Money", + "description": "Can be a custom-set hourly wage or the calculated effective hourly\nwage based on the annual wage and hours worked per week.", + "nullable": true + }, + "job_id": { + "type": "string", + "description": "An identifier for the [job](entity:Job) that this wage relates to.", + "nullable": true + }, + "tip_eligible": { + "type": "boolean", + "description": "Whether team members are eligible for tips when working this job.", + "nullable": true + } + } + }, + "TeamMemberWageSettingUpdatedEvent": { + "type": "object", + "description": "Published when a Wage Setting is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"team_member.wage_setting.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TeamMemberWageSettingUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2021-03-11T01:17:03Z", + "data": { + "id": "TMfCNDbg_wwJvUJY", + "object": { + "wage_setting": { + "created_at": "2021-03-11T01:17:02+00:00", + "is_overtime_exempt": true, + "job_assignments": [ + { + "hourly_rate": { + "amount": 800, + "currency": "USD" + }, + "job_title": "Barista", + "pay_type": "HOURLY" + } + ], + "team_member_id": "TMfCNDbg_wwJvUJY", + "updated_at": "2021-03-11T01:17:03+00:00", + "version": 1 + } + }, + "type": "wage_setting" + }, + "event_id": "22ce9c01-d5bc-50ca-85f5-f97140537837", + "merchant_id": "0JV5BGNW4EG9R", + "type": "team_member.wage_setting.updated" + }, + "x-webhook": { + "event": "team_member.wage_setting.updated", + "scopes": [ + "EMPLOYEES_READ" + ] + }, + "x-api": "#/components/x-apis/Team", + "x-since": "2021-04-21" + }, + "TeamMemberWageSettingUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"wage_setting\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated team member wage setting." + }, + "object": { + "$ref": "#/components/schemas/TeamMemberWageSettingUpdatedEventObject", + "description": "An object containing the updated team member wage setting.", + "nullable": true + } + } + }, + "TeamMemberWageSettingUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "wage_setting": { + "$ref": "#/components/schemas/WageSetting", + "description": "The updated team member wage setting.", + "nullable": true + } + } + }, + "Tender": { + "type": "object", + "description": "Represents a tender (i.e., a method of payment) used in a Square transaction.", + "x-release-status": "PUBLIC", + "required": [ + "type" + ], + "properties": { + "id": { + "type": "string", + "description": "The tender's unique ID. It is the associated payment ID.", + "maxLength": 192 + }, + "location_id": { + "type": "string", + "description": "The ID of the transaction's associated location.", + "maxLength": 50, + "nullable": true + }, + "transaction_id": { + "type": "string", + "description": "The ID of the tender's associated transaction.", + "maxLength": 192, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the tender was created, in RFC 3339 format.", + "maxLength": 32, + "readOnly": true + }, + "note": { + "type": "string", + "description": "An optional note associated with the tender at the time of payment.", + "maxLength": 500, + "nullable": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of the tender, including `tip_money`. If the tender has a `payment_id`,\nthe `total_money` of the corresponding [Payment](entity:Payment) will be equal to the\n`amount_money` of the tender.", + "nullable": true + }, + "tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The tip's amount of the tender.", + "nullable": true + }, + "processing_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of any Square processing fees applied to the tender.\n\nThis field is not immediately populated when a new transaction is created.\nIt is usually available after about ten seconds.", + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "If the tender is associated with a customer or represents a customer's card on file,\nthis is the ID of the associated customer.", + "maxLength": 191, + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/TenderType", + "description": "The type of tender, such as `CARD` or `CASH`.\nSee [TenderType](#type-tendertype) for possible values" + }, + "card_details": { + "$ref": "#/components/schemas/TenderCardDetails", + "description": "The details of the card tender.\n\nThis value is present only if the value of `type` is `CARD`.", + "nullable": true + }, + "cash_details": { + "$ref": "#/components/schemas/TenderCashDetails", + "description": "The details of the cash tender.\n\nThis value is present only if the value of `type` is `CASH`.", + "nullable": true + }, + "bank_account_details": { + "$ref": "#/components/schemas/TenderBankAccountDetails", + "description": "The details of the bank account tender.\n\nThis value is present only if the value of `type` is `BANK_ACCOUNT`.", + "nullable": true + }, + "buy_now_pay_later_details": { + "$ref": "#/components/schemas/TenderBuyNowPayLaterDetails", + "description": "The details of a Buy Now Pay Later tender.\n\nThis value is present only if the value of `type` is `BUY_NOW_PAY_LATER`.", + "nullable": true + }, + "square_account_details": { + "$ref": "#/components/schemas/TenderSquareAccountDetails", + "description": "The details of a Square Account tender.\n\nThis value is present only if the value of `type` is `SQUARE_ACCOUNT`.", + "nullable": true + }, + "additional_recipients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdditionalRecipient" + }, + "description": "Additional recipients (other than the merchant) receiving a portion of this tender.\nFor example, fees assessed on the purchase by a third party integration.", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The ID of the [Payment](entity:Payment) that corresponds to this tender.\nThis value is only present for payments created with the v2 Payments API.", + "maxLength": 192, + "nullable": true + } + } + }, + "TenderBankAccountDetails": { + "type": "object", + "description": "Represents the details of a tender with `type` `BANK_ACCOUNT`.\n\nSee [BankAccountPaymentDetails](entity:BankAccountPaymentDetails)\nfor more exposed details of a bank account payment.", + "x-release-status": "PUBLIC", + "properties": { + "status": { + "$ref": "#/components/schemas/TenderBankAccountDetailsStatus", + "description": "The bank account payment's current state.\n\nSee [TenderBankAccountPaymentDetailsStatus](entity:TenderBankAccountDetailsStatus) for possible values.\nSee [TenderBankAccountDetailsStatus](#type-tenderbankaccountdetailsstatus) for possible values", + "nullable": true + } + } + }, + "TenderBankAccountDetailsStatus": { + "type": "string", + "enum": [ + "PENDING", + "COMPLETED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "The bank account payment is in progress." + }, + { + "name": "COMPLETED", + "description": "The bank account payment has been completed." + }, + { + "name": "FAILED", + "description": "The bank account payment failed." + } + ], + "description": "Indicates the bank account payment's current status.", + "x-release-status": "PUBLIC" + }, + "TenderBuyNowPayLaterDetails": { + "type": "object", + "description": "Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`.", + "x-release-status": "PUBLIC", + "properties": { + "buy_now_pay_later_brand": { + "$ref": "#/components/schemas/TenderBuyNowPayLaterDetailsBrand", + "description": "The Buy Now Pay Later brand.\nSee [Brand](#type-brand) for possible values", + "readOnly": true + }, + "status": { + "$ref": "#/components/schemas/TenderBuyNowPayLaterDetailsStatus", + "description": "The buy now pay later payment's current state (such as `AUTHORIZED` or\n`CAPTURED`). See [TenderBuyNowPayLaterDetailsStatus](entity:TenderBuyNowPayLaterDetailsStatus)\nfor possible values.\nSee [Status](#type-status) for possible values", + "nullable": true + } + } + }, + "TenderBuyNowPayLaterDetailsBrand": { + "type": "string", + "enum": [ + "OTHER_BRAND", + "AFTERPAY" + ], + "x-enum-elements": [ + { + "name": "OTHER_BRAND", + "description": "" + }, + { + "name": "AFTERPAY", + "description": "" + } + ], + "x-release-status": "PUBLIC" + }, + "TenderBuyNowPayLaterDetailsStatus": { + "type": "string", + "enum": [ + "AUTHORIZED", + "CAPTURED", + "VOIDED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "AUTHORIZED", + "description": "The buy now pay later payment has been authorized but not yet captured." + }, + { + "name": "CAPTURED", + "description": "The buy now pay later payment was authorized and subsequently captured (i.e., completed)." + }, + { + "name": "VOIDED", + "description": "The buy now pay later payment was authorized and subsequently voided (i.e., canceled)." + }, + { + "name": "FAILED", + "description": "The buy now pay later payment failed." + } + ], + "x-release-status": "PUBLIC" + }, + "TenderCardDetails": { + "type": "object", + "description": "Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD`", + "x-release-status": "PUBLIC", + "properties": { + "status": { + "$ref": "#/components/schemas/TenderCardDetailsStatus", + "description": "The credit card payment's current state (such as `AUTHORIZED` or\n`CAPTURED`). See [TenderCardDetailsStatus](entity:TenderCardDetailsStatus)\nfor possible values.\nSee [TenderCardDetailsStatus](#type-tendercarddetailsstatus) for possible values", + "nullable": true + }, + "card": { + "$ref": "#/components/schemas/Card", + "description": "The credit card's non-confidential details.", + "nullable": true + }, + "entry_method": { + "$ref": "#/components/schemas/TenderCardDetailsEntryMethod", + "description": "The method used to enter the card's details for the transaction.\nSee [TenderCardDetailsEntryMethod](#type-tendercarddetailsentrymethod) for possible values", + "nullable": true + } + } + }, + "TenderCardDetailsEntryMethod": { + "type": "string", + "enum": [ + "SWIPED", + "KEYED", + "EMV", + "ON_FILE", + "CONTACTLESS" + ], + "x-enum-elements": [ + { + "name": "SWIPED", + "description": "The card was swiped through a Square reader or Square stand." + }, + { + "name": "KEYED", + "description": "The card information was keyed manually into Square Point of Sale or a\nSquare-hosted web form." + }, + { + "name": "EMV", + "description": "The card was processed via EMV with a Square reader." + }, + { + "name": "ON_FILE", + "description": "The buyer's card details were already on file with Square." + }, + { + "name": "CONTACTLESS", + "description": "The card was processed via a contactless (i.e., NFC) transaction\nwith a Square reader." + } + ], + "description": "Indicates the method used to enter the card's details.", + "x-release-status": "PUBLIC" + }, + "TenderCardDetailsStatus": { + "type": "string", + "enum": [ + "AUTHORIZED", + "CAPTURED", + "VOIDED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "AUTHORIZED", + "description": "The card transaction has been authorized but not yet captured." + }, + { + "name": "CAPTURED", + "description": "The card transaction was authorized and subsequently captured (i.e., completed)." + }, + { + "name": "VOIDED", + "description": "The card transaction was authorized and subsequently voided (i.e., canceled)." + }, + { + "name": "FAILED", + "description": "The card transaction failed." + } + ], + "description": "Indicates the card transaction's current status.", + "x-release-status": "PUBLIC" + }, + "TenderCashDetails": { + "type": "object", + "description": "Represents the details of a tender with `type` `CASH`.", + "x-release-status": "PUBLIC", + "properties": { + "buyer_tendered_money": { + "$ref": "#/components/schemas/Money", + "description": "The total amount of cash provided by the buyer, before change is given.", + "nullable": true + }, + "change_back_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of change returned to the buyer.", + "nullable": true + } + } + }, + "TenderSquareAccountDetails": { + "type": "object", + "description": "Represents the details of a tender with `type` `SQUARE_ACCOUNT`.", + "x-release-status": "PUBLIC", + "properties": { + "status": { + "$ref": "#/components/schemas/TenderSquareAccountDetailsStatus", + "description": "The Square Account payment's current state (such as `AUTHORIZED` or\n`CAPTURED`). See [TenderSquareAccountDetailsStatus](entity:TenderSquareAccountDetailsStatus)\nfor possible values.\nSee [Status](#type-status) for possible values", + "nullable": true + } + } + }, + "TenderSquareAccountDetailsStatus": { + "type": "string", + "enum": [ + "AUTHORIZED", + "CAPTURED", + "VOIDED", + "FAILED" + ], + "x-enum-elements": [ + { + "name": "AUTHORIZED", + "description": "The Square Account payment has been authorized but not yet captured." + }, + { + "name": "CAPTURED", + "description": "The Square Account payment was authorized and subsequently captured (i.e., completed)." + }, + { + "name": "VOIDED", + "description": "The Square Account payment was authorized and subsequently voided (i.e., canceled)." + }, + { + "name": "FAILED", + "description": "The Square Account payment failed." + } + ], + "x-release-status": "PUBLIC" + }, + "TenderType": { + "type": "string", + "enum": [ + "CARD", + "CASH", + "THIRD_PARTY_CARD", + "SQUARE_GIFT_CARD", + "NO_SALE", + "BANK_ACCOUNT", + "WALLET", + "BUY_NOW_PAY_LATER", + "SQUARE_ACCOUNT", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "CARD", + "description": "A credit card." + }, + { + "name": "CASH", + "description": "Cash." + }, + { + "name": "THIRD_PARTY_CARD", + "description": "A credit card processed with a card processor other than Square.\n\nThis value applies only to merchants in countries where Square does not\nyet provide card processing." + }, + { + "name": "SQUARE_GIFT_CARD", + "description": "A Square gift card." + }, + { + "name": "NO_SALE", + "description": "This tender represents the register being opened for a \"no sale\" event." + }, + { + "name": "BANK_ACCOUNT", + "description": "A bank account payment." + }, + { + "name": "WALLET", + "description": "A payment from a digital wallet, e.g. Cash App, Paypay, Rakuten Pay,\nAu Pay, D Barai, Merpay, Wechat Pay, Alipay.\n\nNote: Some \"digital wallets\", including Google Pay and Apple Pay, facilitate\ncard payments. Those payments have the `CARD` type." + }, + { + "name": "BUY_NOW_PAY_LATER", + "description": "A Buy Now Pay Later payment." + }, + { + "name": "SQUARE_ACCOUNT", + "description": "A Square House Account payment." + }, + { + "name": "OTHER", + "description": "A form of tender that does not match any other value." + } + ], + "description": "Indicates a tender's type.", + "x-release-status": "PUBLIC" + }, + "TerminalAction": { + "type": "object", + "description": "Represents an action processed by the Square Terminal.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "A unique ID for this `TerminalAction`.", + "minLength": 10, + "maxLength": 255, + "readOnly": true + }, + "device_id": { + "type": "string", + "description": "The unique Id of the device intended for this `TerminalAction`.\nThe Id can be retrieved from /v2/devices api.", + "nullable": true + }, + "deadline_duration": { + "type": "string", + "description": "The duration as an RFC 3339 duration, after which the action will be automatically canceled.\nTerminalActions that are `PENDING` will be automatically `CANCELED` and have a cancellation reason\nof `TIMED_OUT`\n\nDefault: 5 minutes from creation\n\nMaximum: 5 minutes", + "nullable": true + }, + "status": { + "type": "string", + "description": "The status of the `TerminalAction`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`", + "readOnly": true + }, + "cancel_reason": { + "$ref": "#/components/schemas/ActionCancelReason", + "description": "The reason why `TerminalAction` is canceled. Present if the status is `CANCELED`.\nSee [ActionCancelReason](#type-actioncancelreason) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The time when the `TerminalAction` was created as an RFC 3339 timestamp.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The time when the `TerminalAction` was last updated as an RFC 3339 timestamp.", + "readOnly": true + }, + "app_id": { + "type": "string", + "description": "The ID of the application that created the action.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The location id the action is attached to, if a link can be made.", + "maxLength": 64, + "readOnly": true, + "x-release-status": "PUBLIC" + }, + "type": { + "$ref": "#/components/schemas/TerminalActionActionType", + "description": "Represents the type of the action.\nSee [ActionType](#type-actiontype) for possible values", + "nullable": true + }, + "qr_code_options": { + "$ref": "#/components/schemas/QrCodeOptions", + "description": "Describes configuration for the QR code action. Requires `QR_CODE` type.", + "nullable": true + }, + "save_card_options": { + "$ref": "#/components/schemas/SaveCardOptions", + "description": "Describes configuration for the save-card action. Requires `SAVE_CARD` type.", + "nullable": true + }, + "signature_options": { + "$ref": "#/components/schemas/SignatureOptions", + "description": "Describes configuration for the signature capture action. Requires `SIGNATURE` type.", + "nullable": true + }, + "confirmation_options": { + "$ref": "#/components/schemas/ConfirmationOptions", + "description": "Describes configuration for the confirmation action. Requires `CONFIRMATION` type.", + "nullable": true + }, + "receipt_options": { + "$ref": "#/components/schemas/ReceiptOptions", + "description": "Describes configuration for the receipt action. Requires `RECEIPT` type.", + "nullable": true + }, + "data_collection_options": { + "$ref": "#/components/schemas/DataCollectionOptions", + "description": "Describes configuration for the data collection action. Requires `DATA_COLLECTION` type.", + "nullable": true + }, + "select_options": { + "$ref": "#/components/schemas/SelectOptions", + "description": "Describes configuration for the select action. Requires `SELECT` type.", + "nullable": true + }, + "device_metadata": { + "$ref": "#/components/schemas/DeviceMetadata", + "description": "Details about the Terminal that received the action request (such as battery level,\noperating system version, and network connection settings).\n\nOnly available for `PING` action type.", + "readOnly": true + }, + "await_next_action": { + "type": "boolean", + "description": "Indicates the action will be linked to another action and requires a waiting dialog to be\ndisplayed instead of returning to the idle screen on completion of the action.\n\nOnly supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types.", + "nullable": true + }, + "await_next_action_duration": { + "type": "string", + "description": "The timeout duration of the waiting dialog as an RFC 3339 duration, after which the\nwaiting dialog will no longer be displayed and the Terminal will return to the idle screen.\n\nDefault: 5 minutes from when the waiting dialog is displayed\n\nMaximum: 5 minutes", + "nullable": true + } + } + }, + "TerminalActionActionType": { + "type": "string", + "enum": [ + "QR_CODE", + "PING", + "SAVE_CARD", + "SIGNATURE", + "CONFIRMATION", + "RECEIPT", + "DATA_COLLECTION", + "SELECT" + ], + "x-enum-elements": [ + { + "name": "QR_CODE", + "description": "The action represents a request to display a QR code. Details are contained in\nthe `qr_code_options` object." + }, + { + "name": "PING", + "description": "The action represents a request to check if the specific device is\nonline or currently active with the merchant in question. Does not require an action options value." + }, + { + "name": "SAVE_CARD", + "description": "Represents a request to save a card for future card-on-file use. Details are contained\nin the `save_card_options` object." + }, + { + "name": "SIGNATURE", + "description": "The action represents a request to capture a buyer's signature. Details are contained\nin the `signature_options` object." + }, + { + "name": "CONFIRMATION", + "description": "The action represents a request to collect a buyer's confirmation decision to the\ndisplayed terms. Details are contained in the `confirmation_options` object." + }, + { + "name": "RECEIPT", + "description": "The action represents a request to display the receipt screen options. Details are\ncontained in the `receipt_options` object." + }, + { + "name": "DATA_COLLECTION", + "description": "The action represents a request to collect a buyer's text data. Details\nare contained in the `data_collection_options` object." + }, + { + "name": "SELECT", + "description": "The action represents a request to allow the buyer to select from provided options.\nDetails are contained in the `select_options` object." + } + ], + "description": "Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum.", + "x-release-status": "BETA" + }, + "TerminalActionCreatedEvent": { + "type": "object", + "description": "Published when a TerminalAction is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.action.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalActionCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2021-03-10T14:43:55.262Z", + "data": { + "id": "dhgENdnFOPXqO", + "object": { + "action": { + "app_id": "APP_ID", + "created_at": "2021-03-10T14:43:55.262Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:jveJIAkkAjILHkdCE", + "save_card_options": { + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "PENDING", + "type": "SAVE_CARD", + "updated_at": "2020-04-10T14:43:55.262Z" + } + }, + "type": "action" + }, + "event_id": "7229a692-def5-4a7e-b4f3-80638aa2f24d", + "merchant_id": "MERCHANT_ID", + "type": "terminal.action.created" + }, + "x-webhook": { + "event": "terminal.action.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2022-05-12" + }, + "TerminalActionCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the created object’s type, `\"action\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the created terminal action." + }, + "object": { + "$ref": "#/components/schemas/TerminalActionCreatedEventObject", + "description": "An object containing the created terminal action.", + "nullable": true + } + } + }, + "TerminalActionCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The created terminal action.", + "nullable": true + } + } + }, + "TerminalActionQuery": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "filter": { + "$ref": "#/components/schemas/TerminalActionQueryFilter", + "description": "Options for filtering returned `TerminalAction`s", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/TerminalActionQuerySort", + "description": "Option for sorting returned `TerminalAction` objects.", + "nullable": true + } + }, + "example": { + "include": [ + "CUSTOMER" + ], + "limit": 2, + "query": { + "filter": { + "status": "COMPLETED" + } + } + } + }, + "TerminalActionQueryFilter": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "device_id": { + "type": "string", + "description": "`TerminalAction`s associated with a specific device. If no device is specified then all\n`TerminalAction`s for the merchant will be displayed.", + "nullable": true + }, + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "Time range for the beginning of the reporting period. Inclusive.\nDefault value: The current time minus one day.\nNote that `TerminalAction`s are available for 30 days after creation." + }, + "status": { + "type": "string", + "description": "Filter results with the desired status of the `TerminalAction`\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/TerminalActionActionType", + "description": "Filter results with the requested ActionType.\nSee [TerminalActionActionType](#type-terminalactionactiontype) for possible values", + "nullable": true + } + } + }, + "TerminalActionQuerySort": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "sort_order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order in which results are listed.\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "TerminalActionUpdatedEvent": { + "type": "object", + "description": "Published when a TerminalAction is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.action.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalActionUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2021-03-10T14:44:06.039Z", + "data": { + "id": "dhgENdnFOPXqO", + "object": { + "action": { + "app_id": "APP_ID", + "created_at": "2021-03-10T14:43:55.262Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:RZDei5nMuO0rMmCE", + "save_card_options": { + "card_id": "ccof:CARD_ID", + "customer_id": "CUSTOMER_ID", + "reference_id": "user-id-1" + }, + "status": "COMPLETED", + "type": "SAVE_CARD", + "updated_at": "2021-03-10T14:44:55.262Z" + } + }, + "type": "action" + }, + "event_id": "1c3ef831-670d-4f4c-b59c-f0bb2d2fc872", + "merchant_id": "MERCHANT_ID", + "type": "terminal.action.updated" + }, + "x-webhook": { + "event": "terminal.action.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2022-05-12" + }, + "TerminalActionUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the updated object’s type, `\"action\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated terminal action." + }, + "object": { + "$ref": "#/components/schemas/TerminalActionUpdatedEventObject", + "description": "An object containing the updated terminal action.", + "nullable": true + } + } + }, + "TerminalActionUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "action": { + "$ref": "#/components/schemas/TerminalAction", + "description": "The updated terminal action.", + "nullable": true + } + } + }, + "TerminalCheckout": { + "type": "object", + "description": "Represents a checkout processed by the Square Terminal.", + "x-release-status": "PUBLIC", + "required": [ + "amount_money", + "device_options" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique ID for this `TerminalCheckout`.", + "minLength": 10, + "maxLength": 255, + "readOnly": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money (including the tax amount) that the Square Terminal device should try to collect." + }, + "reference_id": { + "type": "string", + "description": "An optional user-defined reference ID that can be used to associate\nthis `TerminalCheckout` to another entity in an external system. For example, an order\nID generated by a third-party shopping cart. The ID is also associated with any payments\nused to complete the checkout.", + "maxLength": 40, + "nullable": true + }, + "note": { + "type": "string", + "description": "An optional note to associate with the checkout, as well as with any payments used to complete the checkout.\nNote: maximum 500 characters", + "maxLength": 500, + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The reference to the Square order ID for the checkout request.", + "nullable": true + }, + "payment_options": { + "$ref": "#/components/schemas/PaymentOptions", + "description": "Payment-specific options for the checkout request.", + "nullable": true + }, + "device_options": { + "$ref": "#/components/schemas/DeviceCheckoutOptions", + "description": "Options to control the display and behavior of the Square Terminal device." + }, + "deadline_duration": { + "type": "string", + "description": "An RFC 3339 duration, after which the checkout is automatically canceled.\nA `TerminalCheckout` that is `PENDING` is automatically `CANCELED` and has a cancellation reason\nof `TIMED_OUT`.\n\nDefault: 5 minutes from creation\n\nMaximum: 5 minutes", + "x-release-status": "DEPRECATED", + "nullable": true + }, + "status": { + "type": "string", + "description": "The status of the `TerminalCheckout`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`", + "readOnly": true + }, + "cancel_reason": { + "$ref": "#/components/schemas/ActionCancelReason", + "description": "The reason why `TerminalCheckout` is canceled. Present if the status is `CANCELED`.\nSee [ActionCancelReason](#type-actioncancelreason) for possible values", + "readOnly": true + }, + "payment_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of IDs for payments created by this `TerminalCheckout`.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The time when the `TerminalCheckout` was created, as an RFC 3339 timestamp.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The time when the `TerminalCheckout` was last updated, as an RFC 3339 timestamp.", + "readOnly": true + }, + "app_id": { + "type": "string", + "description": "The ID of the application that created the checkout.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The location of the device where the `TerminalCheckout` was directed.", + "maxLength": 64, + "readOnly": true + }, + "payment_type": { + "$ref": "#/components/schemas/CheckoutOptionsPaymentType", + "description": "The type of payment the terminal should attempt to capture from. Defaults to `CARD_PRESENT`.\nSee [CheckoutOptionsPaymentType](#type-checkoutoptionspaymenttype) for possible values", + "nullable": true + }, + "team_member_id": { + "type": "string", + "description": "An optional ID of the team member associated with creating the checkout.", + "nullable": true + }, + "customer_id": { + "type": "string", + "description": "An optional ID of the customer associated with the checkout.", + "nullable": true + }, + "app_fee_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount the developer is taking as a fee for facilitating the payment on behalf\nof the seller.\n\nThe amount cannot be more than 90% of the total amount of the payment.\n\nThe amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).\n\nThe fee currency code must match the currency associated with the seller that is accepting the payment. The application must be from a developer account in the same country and using the same currency code as the seller.\n\nFor more information about the application fee scenario, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).\n\nTo set this field, PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).", + "nullable": true + }, + "statement_description_identifier": { + "type": "string", + "description": "Optional additional payment information to include on the customer's card statement as\npart of the statement description. This can be, for example, an invoice number, ticket number,\nor short description that uniquely identifies the purchase.", + "maxLength": 20, + "nullable": true + }, + "tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount designated as a tip, in addition to `amount_money`. This may only be set for a\ncheckout that has tipping disabled (`tip_settings.allow_tipping` is `false`).", + "nullable": true + } + } + }, + "TerminalCheckoutCreatedEvent": { + "type": "object", + "description": "Published when a [TerminalCheckout](entity:TerminalCheckout) is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.checkout.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalCheckoutCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-10T14:43:55.262Z", + "data": { + "id": "dhgENdnFOPXqO", + "object": { + "checkout": { + "amount_money": { + "amount": 111, + "currency": "USD" + }, + "app_id": "sq0idp-734Md5EcFjFmwpaR0Snm6g", + "created_at": "2020-04-10T14:43:55.262Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "907CS13101300122", + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "dhgENdnFOPXqO", + "note": "A simple note", + "reference_id": "id72709", + "status": "PENDING", + "updated_at": "2020-04-10T14:43:55.262Z" + } + }, + "type": "checkout" + }, + "event_id": "7229a692-def5-4a7e-b4f3-80638aa2f24d", + "merchant_id": "7NZR58EPNGNPC", + "type": "terminal.checkout.created" + }, + "x-webhook": { + "event": "terminal.checkout.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2020-04-22" + }, + "TerminalCheckoutCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the created object’s type, `\"checkout\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the created terminal checkout.", + "minLength": 10, + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/TerminalCheckoutCreatedEventObject", + "description": "An object containing the created terminal checkout", + "nullable": true + } + } + }, + "TerminalCheckoutCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The created terminal checkout", + "nullable": true + } + } + }, + "TerminalCheckoutQuery": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/TerminalCheckoutQueryFilter", + "description": "Options for filtering returned `TerminalCheckout` objects.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/TerminalCheckoutQuerySort", + "description": "Option for sorting returned `TerminalCheckout` objects.", + "nullable": true + } + } + }, + "TerminalCheckoutQueryFilter": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "device_id": { + "type": "string", + "description": "The `TerminalCheckout` objects associated with a specific device. If no device is specified, then all\n`TerminalCheckout` objects for the merchant are displayed.", + "nullable": true + }, + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The time range for the beginning of the reporting period, which is inclusive.\nDefault value: The current time minus one day.\nNote that `TerminalCheckout`s are available for 30 days after creation." + }, + "status": { + "type": "string", + "description": "Filtered results with the desired status of the `TerminalCheckout`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`", + "nullable": true + } + } + }, + "TerminalCheckoutQuerySort": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "sort_order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order in which results are listed.\nDefault: `DESC`\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "TerminalCheckoutUpdatedEvent": { + "type": "object", + "description": "Published when a [TerminalCheckout](entity:TerminalCheckout) is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.checkout.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalCheckoutUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-04-10T14:44:06.039Z", + "data": { + "id": "dhgENdnFOPXqO", + "object": { + "checkout": { + "amount_money": { + "amount": 111, + "currency": "USD" + }, + "app_id": "sq0idp-734Md5EcFjFmwpaR0Snm6g", + "created_at": "2020-04-10T14:43:55.262Z", + "deadline_duration": "PT5M", + "device_options": { + "device_id": "907CS13101300122", + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": false + } + }, + "id": "dhgENdnFOPXqO", + "note": "A simple note", + "payment_ids": [ + "dgzrZTeIeVuOGwYgekoTHsPouaB" + ], + "reference_id": "id72709", + "status": "COMPLETED", + "updated_at": "2020-04-10T14:44:06.039Z" + } + }, + "type": "checkout" + }, + "event_id": "1c3ef831-670d-4f4c-b59c-f0bb2d2fc872", + "merchant_id": "7NZR58EPNGNPC", + "type": "terminal.checkout.updated" + }, + "x-webhook": { + "event": "terminal.checkout.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2020-04-22" + }, + "TerminalCheckoutUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the updated object’s type, `\"checkout\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated terminal checkout.", + "minLength": 10, + "maxLength": 255 + }, + "object": { + "$ref": "#/components/schemas/TerminalCheckoutUpdatedEventObject", + "description": "An object containing the updated terminal checkout", + "nullable": true + } + } + }, + "TerminalCheckoutUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "checkout": { + "$ref": "#/components/schemas/TerminalCheckout", + "description": "The updated terminal checkout", + "nullable": true + } + } + }, + "TerminalRefund": { + "type": "object", + "description": "Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds.", + "x-release-status": "PUBLIC", + "required": [ + "payment_id", + "amount_money", + "reason", + "device_id" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique ID for this `TerminalRefund`.", + "minLength": 10, + "maxLength": 255, + "readOnly": true + }, + "refund_id": { + "type": "string", + "description": "The reference to the payment refund created by completing this `TerminalRefund`.", + "readOnly": true + }, + "payment_id": { + "type": "string", + "description": "The unique ID of the payment being refunded.", + "minLength": 1 + }, + "order_id": { + "type": "string", + "description": "The reference to the Square order ID for the payment identified by the `payment_id`.", + "readOnly": true + }, + "amount_money": { + "$ref": "#/components/schemas/Money", + "description": "The amount of money, inclusive of `tax_money`, that the `TerminalRefund` should return.\nThis value is limited to the amount taken in the original payment minus any completed or\npending refunds." + }, + "reason": { + "type": "string", + "description": "A description of the reason for the refund.", + "maxLength": 192 + }, + "device_id": { + "type": "string", + "description": "The unique ID of the device intended for this `TerminalRefund`.\nThe Id can be retrieved from /v2/devices api." + }, + "deadline_duration": { + "type": "string", + "description": "The RFC 3339 duration, after which the refund is automatically canceled.\nA `TerminalRefund` that is `PENDING` is automatically `CANCELED` and has a cancellation reason\nof `TIMED_OUT`.\n\nDefault: 5 minutes from creation.\n\nMaximum: 5 minutes", + "nullable": true + }, + "status": { + "type": "string", + "description": "The status of the `TerminalRefund`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`.", + "readOnly": true + }, + "cancel_reason": { + "$ref": "#/components/schemas/ActionCancelReason", + "description": "Present if the status is `CANCELED`.\nSee [ActionCancelReason](#type-actioncancelreason) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The time when the `TerminalRefund` was created, as an RFC 3339 timestamp.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The time when the `TerminalRefund` was last updated, as an RFC 3339 timestamp.", + "readOnly": true + }, + "app_id": { + "type": "string", + "description": "The ID of the application that created the refund.", + "readOnly": true + }, + "location_id": { + "type": "string", + "description": "The location of the device where the `TerminalRefund` was directed.", + "maxLength": 64, + "readOnly": true + } + } + }, + "TerminalRefundCreatedEvent": { + "type": "object", + "description": "Published when a Terminal API refund is created.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.refund.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalRefundCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-09-22T14:29:19.459Z", + "data": { + "id": "S67MS3HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "object": { + "refund": { + "amount_money": { + "amount": 100, + "currency": "CAD" + }, + "app_id": "sq0idp-734Md5EcFjFmwpaR0Snm6g", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 12, + "exp_year": 2020, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "card_details": { + "avs_status": "AVS_NOT_CHECKED", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 12, + "exp_year": 2020, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "cvv_status": "CVV_NOT_CHECKED", + "entry_method": "EMV", + "statement_description": "SQ *DEFAULT TEST ACCOUNT", + "status": "CAPTURED" + }, + "created_at": "2020-09-22T14:29:19.459Z", + "deadline_duration": "PT5M", + "device_id": "907CS13101300122", + "id": "S67MS3HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "A6SYFRSV4WAFW", + "order_id": "9VeViC6PeooYw4GVAgiuEMseV", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Refund reason", + "status": "PENDING", + "updated_at": "2020-09-22T14:29:19.459Z" + } + }, + "type": "refund" + }, + "event_id": "9232cde1-6e72-4356-8b08-bd2af7bb87a2", + "merchant_id": "7NZR58EPNGNPC", + "type": "terminal.refund.created" + }, + "x-webhook": { + "event": "terminal.refund.created", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2020-10-28" + }, + "TerminalRefundCreatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the created object’s type, `\"refund\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the created terminal refund." + }, + "object": { + "$ref": "#/components/schemas/TerminalRefundCreatedEventObject", + "description": "An object containing the created terminal refund.", + "nullable": true + } + } + }, + "TerminalRefundCreatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The created terminal refund.", + "nullable": true + } + } + }, + "TerminalRefundQuery": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/TerminalRefundQueryFilter", + "description": "The filter for the Terminal refund query.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/TerminalRefundQuerySort", + "description": "The sort order for the Terminal refund query.", + "nullable": true + } + } + }, + "TerminalRefundQueryFilter": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "device_id": { + "type": "string", + "description": "`TerminalRefund` objects associated with a specific device. If no device is specified, then all\n`TerminalRefund` objects for the signed-in account are displayed.", + "nullable": true + }, + "created_at": { + "$ref": "#/components/schemas/TimeRange", + "description": "The timestamp for the beginning of the reporting period, in RFC 3339 format. Inclusive.\nDefault value: The current time minus one day.\nNote that `TerminalRefund`s are available for 30 days after creation." + }, + "status": { + "type": "string", + "description": "Filtered results with the desired status of the `TerminalRefund`.\nOptions: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`.", + "nullable": true + } + } + }, + "TerminalRefundQuerySort": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "sort_order": { + "type": "string", + "description": "The order in which results are listed.\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).", + "nullable": true + } + } + }, + "TerminalRefundUpdatedEvent": { + "type": "object", + "description": "Published when a Terminal API refund is updated.", + "x-release-status": "PUBLIC", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"terminal.refund.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "RFC 3339 timestamp of when the event was created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TerminalRefundUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "example": { + "created_at": "2020-09-22T14:34:40.334Z", + "data": { + "id": "S67MS3HD-rbh7ygmmPfnEsP6OcuOEFL9FuaB", + "object": { + "refund": { + "amount_money": { + "amount": 100, + "currency": "CAD" + }, + "app_id": "sq0idp-734Md5EcFjFmwpaR0Snm6g", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 12, + "exp_year": 2020, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "card_details": { + "avs_status": "AVS_NOT_CHECKED", + "card": { + "bin": "411111", + "card_brand": "INTERAC", + "card_type": "CREDIT", + "exp_month": 12, + "exp_year": 2020, + "fingerprint": "sq-1-B1fP9MNNmZgVVaPKRND6oDKYbz25S2cTvg9Mzwg3RMTK1zT1PiGRT-AE3nTA8vSmmw", + "last_4": "1111" + }, + "cvv_status": "CVV_NOT_CHECKED", + "entry_method": "EMV", + "statement_description": "SQ *DEFAULT TEST ACCOUNT", + "status": "CAPTURED" + }, + "created_at": "2020-09-22T14:29:19.459Z", + "deadline_duration": "PT5M", + "device_id": "907CS13101300122", + "id": "S67MS3HD-5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "location_id": "A6SYFRSV4WAFW", + "order_id": "9VeViC6PeooYw4GVAgiuEMseV", + "payment_id": "5O5OvgkcNUhl7JBuINflcjKqUzXZY", + "reason": "Refund reason", + "status": "IN PROGRESS", + "updated_at": "2020-09-22T14:34:40.334Z" + } + }, + "type": "refund" + }, + "event_id": "d15cfe13-f02c-4155-b381-ef36dd5be92f", + "merchant_id": "ET1TXH00Q2X3B", + "type": "terminal.refund.updated" + }, + "x-webhook": { + "event": "terminal.refund.updated", + "scopes": [ + "PAYMENTS_READ" + ] + }, + "x-api": "#/components/x-apis/Terminal", + "x-since": "2020-10-28" + }, + "TerminalRefundUpdatedEventData": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "type": { + "type": "string", + "description": "Name of the updated object’s type, `\"refund\"`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the updated terminal refund." + }, + "object": { + "$ref": "#/components/schemas/TerminalRefundUpdatedEventObject", + "description": "An object containing the updated terminal refund.", + "nullable": true + } + } + }, + "TerminalRefundUpdatedEventObject": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "refund": { + "$ref": "#/components/schemas/TerminalRefund", + "description": "The updated terminal refund.", + "nullable": true + } + } + }, + "TestWebhookSubscriptionRequest": { + "type": "object", + "description": "Tests a [Subscription](entity:WebhookSubscription) by sending a test event to its notification URL.", + "x-release-status": "PUBLIC", + "properties": { + "event_type": { + "type": "string", + "description": "The event type that will be used to test the [Subscription](entity:WebhookSubscription). The event type must be\ncontained in the list of event types in the [Subscription](entity:WebhookSubscription).", + "nullable": true + } + }, + "example": { + "event_type": "payment.created" + } + }, + "TestWebhookSubscriptionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [TestWebhookSubscription](api-endpoint:WebhookSubscriptions-TestWebhookSubscription) endpoint.\n\nNote: If there are errors processing the request, the [SubscriptionTestResult](entity:SubscriptionTestResult) field is not\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "subscription_test_result": { + "$ref": "#/components/schemas/SubscriptionTestResult", + "description": "The [SubscriptionTestResult](entity:SubscriptionTestResult)." + } + }, + "example": { + "subscription_test_result": { + "created_at": "2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746", + "id": "23eed5a9-2b12-403e-b212-7e2889aea0f6", + "payload": "{\"merchant_id\":\"1ZYMKZY1YFGBW\",\"type\":\"payment.created\",\"event_id\":\"23eed5a9-2b12-403e-b212-7e2889aea0f6\",\"created_at\":\"2022-01-11T00:06:48.322945116Z\",\"data\":{\"type\":\"payment\",\"id\":\"KkAkhdMsgzn59SM8A89WgKwekxLZY\",\"object\":{\"payment\":{\"amount_money\":{\"amount\":100,\"currency\":\"USD\"},\"approved_money\":{\"amount\":100,\"currency\":\"USD\"},\"capabilities\":[\"EDIT_TIP_AMOUNT\",\"EDIT_TIP_AMOUNT_UP\",\"EDIT_TIP_AMOUNT_DOWN\"],\"card_details\":{\"avs_status\":\"AVS_ACCEPTED\",\"card\":{\"bin\":\"540988\",\"card_brand\":\"MASTERCARD\",\"card_type\":\"CREDIT\",\"exp_month\":11,\"exp_year\":2022,\"fingerprint\":\"sq-1-Tvruf3vPQxlvI6n0IcKYfBukrcv6IqWr8UyBdViWXU2yzGn5VMJvrsHMKpINMhPmVg\",\"last_4\":\"9029\",\"prepaid_type\":\"NOT_PREPAID\"},\"card_payment_timeline\":{\"authorized_at\":\"2020-11-22T21:16:51.198Z\"},\"cvv_status\":\"CVV_ACCEPTED\",\"entry_method\":\"KEYED\",\"statement_description\":\"SQ *DEFAULT TEST ACCOUNT\",\"status\":\"AUTHORIZED\"},\"created_at\":\"2020-11-22T21:16:51.086Z\",\"delay_action\":\"CANCEL\",\"delay_duration\":\"PT168H\",\"delayed_until\":\"2020-11-29T21:16:51.086Z\",\"id\":\"hYy9pRFVxpDsO1FB05SunFWUe9JZY\",\"location_id\":\"S8GWD5R9QB376\",\"order_id\":\"03O3USaPaAaFnI6kkwB1JxGgBsUZY\",\"receipt_number\":\"hYy9\",\"risk_evaluation\":{\"created_at\":\"2020-11-22T21:16:51.198Z\",\"risk_level\":\"NORMAL\"},\"source_type\":\"CARD\",\"status\":\"APPROVED\",\"total_money\":{\"amount\":100,\"currency\":\"USD\"},\"updated_at\":\"2020-11-22T21:16:51.198Z\",\"version_token\":\"FfQhQJf9r3VSQIgyWBk1oqhIwiznLwVwJbVVA0bdyEv6o\"}}}}", + "status_code": 404, + "updated_at": "2022-01-11 00:06:48.322945116 +0000 UTC m=+3863.054453746" + } + } + }, + "TimeRange": { + "type": "object", + "description": "Represents a generic time range. The start and end values are\nrepresented in RFC 3339 format. Time ranges are customized to be\ninclusive or exclusive based on the needs of a particular endpoint.\nRefer to the relevant endpoint-specific documentation to determine\nhow time ranges are handled.", + "x-release-status": "PUBLIC", + "properties": { + "start_at": { + "type": "string", + "description": "A datetime value in RFC 3339 format indicating when the time range\nstarts.", + "nullable": true + }, + "end_at": { + "type": "string", + "description": "A datetime value in RFC 3339 format indicating when the time range\nends.", + "nullable": true + } + } + }, + "Timecard": { + "type": "object", + "description": "A record of the hourly rate, start time, and end time of a single timecard (shift)\nfor a team member. This might include a record of the start and end times of breaks\ntaken during the shift.", + "x-release-status": "PUBLIC", + "required": [ + "location_id", + "start_at", + "team_member_id" + ], + "properties": { + "id": { + "type": "string", + "description": "**Read only** The Square-issued UUID for this object.", + "maxLength": 255 + }, + "location_id": { + "type": "string", + "description": "The ID of the [location](entity:Location) for this timecard. The location should be based on\nwhere the team member clocked in.", + "minLength": 1 + }, + "timezone": { + "type": "string", + "description": "**Read only** The time zone calculated from the location based on the `location_id`,\nprovided as a convenience value. Format: the IANA time zone database identifier for the\nlocation time zone.", + "nullable": true + }, + "start_at": { + "type": "string", + "description": "The start time of the timecard, in RFC 3339 format and shifted to the location\ntimezone + offset. Precision up to the minute is respected; seconds are truncated.", + "minLength": 1 + }, + "end_at": { + "type": "string", + "description": "The end time of the timecard, in RFC 3339 format and shifted to the location\ntimezone + offset. Precision up to the minute is respected; seconds are truncated.", + "nullable": true + }, + "wage": { + "$ref": "#/components/schemas/TimecardWage", + "description": "Job and pay related information. If the wage is not set on create, it defaults to a wage\nof zero. If the title is not set on create, it defaults to the name of the role the team member\nis assigned to, if any.", + "nullable": true + }, + "breaks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Break" + }, + "description": "A list of all the paid or unpaid breaks that were taken during this timecard.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/TimecardStatus", + "description": "Describes the working state of the timecard.\nSee [TimecardStatus](#type-timecardstatus) for possible values", + "nullable": true + }, + "version": { + "type": "integer", + "description": "**Read only** The current version of the timecard, which is incremented with each update.\nThis field is used for [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol to ensure that requests don't overwrite data from another request." + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the timecard was created, in RFC 3339 format presented as UTC.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the timecard was last updated, in RFC 3339 format presented as UTC.", + "readOnly": true + }, + "team_member_id": { + "type": "string", + "description": "The ID of the [team member](entity:TeamMember) this timecard belongs to.", + "minLength": 1 + }, + "declared_cash_tip_money": { + "$ref": "#/components/schemas/Money", + "description": "The cash tips declared by the team member for this timecard.", + "nullable": true + } + } + }, + "TimecardFilter": { + "type": "object", + "description": "Defines a filter used in a search for `Timecard` records. `AND` logic is\nused by Square's servers to apply each filter property specified.", + "x-release-status": "PUBLIC", + "properties": { + "location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fetch timecards for the specified location.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/TimecardFilterStatus", + "description": "Fetch a `Timecard` instance by `Timecard.status`.\nSee [TimecardFilterStatus](#type-timecardfilterstatus) for possible values", + "nullable": true + }, + "start": { + "$ref": "#/components/schemas/TimeRange", + "description": "Fetch `Timecard` instances that start in the time range - Inclusive.", + "nullable": true + }, + "end": { + "$ref": "#/components/schemas/TimeRange", + "description": "Fetch the `Timecard` instances that end in the time range - Inclusive.", + "nullable": true + }, + "workday": { + "$ref": "#/components/schemas/TimecardWorkday", + "description": "Fetch the `Timecard` instances based on the workday date range.", + "nullable": true + }, + "team_member_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fetch timecards for the specified team members.", + "nullable": true + } + } + }, + "TimecardFilterStatus": { + "type": "string", + "enum": [ + "OPEN", + "CLOSED" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "Timecards that have been started and not ended." + }, + { + "name": "CLOSED", + "description": "Timecards that have been started and ended." + } + ], + "description": "Specifies the `status` of `Timecard` records to be returned.", + "x-release-status": "PUBLIC" + }, + "TimecardQuery": { + "type": "object", + "description": "The parameters of a `Timecard` search query, which includes filter and sort options.", + "x-release-status": "PUBLIC", + "properties": { + "filter": { + "$ref": "#/components/schemas/TimecardFilter", + "description": "Query filter options.", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/TimecardSort", + "description": "Sort order details.", + "nullable": true + } + } + }, + "TimecardSort": { + "type": "object", + "description": "Sets the sort order of search results.", + "x-release-status": "PUBLIC", + "properties": { + "field": { + "$ref": "#/components/schemas/TimecardSortField", + "description": "The field to sort on.\nSee [TimecardSortField](#type-timecardsortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "The order in which results are returned. Defaults to DESC.\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "TimecardSortField": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "The start date/time of a `Timecard`" + }, + { + "name": "END_AT", + "description": "The end date/time of a `Timecard`" + }, + { + "name": "CREATED_AT", + "description": "The date/time that a `Timecard` is created" + }, + { + "name": "UPDATED_AT", + "description": "The most recent date/time that a `Timecard` is updated" + } + ], + "description": "Enumerates the `Timecard` fields to sort on.", + "x-release-status": "PUBLIC" + }, + "TimecardStatus": { + "type": "string", + "enum": [ + "OPEN", + "CLOSED" + ], + "x-enum-elements": [ + { + "name": "OPEN", + "description": "The timecard has a `start_at` time but no `end_at` time, indicating an ongoing shift." + }, + { + "name": "CLOSED", + "description": "The timecard has both `start_at` and `end_at` times, indicating a completed shift." + } + ], + "description": "**Read only** Enumerates the possible status of a [timecard](entity:Timecard).", + "x-release-status": "PUBLIC" + }, + "TimecardWage": { + "type": "object", + "description": "The hourly wage rate used to compensate a team member for a [timecard](entity:Timecard).", + "x-release-status": "PUBLIC", + "properties": { + "title": { + "type": "string", + "description": "The name of the job performed during this timecard.", + "nullable": true + }, + "hourly_rate": { + "$ref": "#/components/schemas/Money", + "description": "Can be a custom-set hourly wage or the calculated effective hourly\nwage based on the annual wage and hours worked per week.", + "nullable": true + }, + "job_id": { + "type": "string", + "description": "The ID of the [job](entity:Job) performed for this timecard. Square\nlabor-reporting UIs might group timecards together by ID.", + "readOnly": true + }, + "tip_eligible": { + "type": "boolean", + "description": "Whether team members are eligible for tips when working this job.", + "nullable": true + } + } + }, + "TimecardWorkday": { + "type": "object", + "description": "A `Timecard` search query filter parameter that sets a range of days that\na `Timecard` must start or end in before passing the filter condition.", + "x-release-status": "PUBLIC", + "properties": { + "date_range": { + "$ref": "#/components/schemas/DateRange", + "description": "Dates for fetching the timecards.", + "nullable": true + }, + "match_timecards_by": { + "$ref": "#/components/schemas/TimecardWorkdayMatcher", + "description": "The strategy on which the dates are applied.\nSee [TimecardWorkdayMatcher](#type-timecardworkdaymatcher) for possible values", + "nullable": true + }, + "default_timezone": { + "type": "string", + "description": "Location-specific timezones convert workdays to datetime filters.\nEvery location included in the query must have a timezone or this field\nmust be provided as a fallback. Format: the IANA timezone database\nidentifier for the relevant timezone.", + "nullable": true + } + } + }, + "TimecardWorkdayMatcher": { + "type": "string", + "enum": [ + "START_AT", + "END_AT", + "INTERSECTION" + ], + "x-enum-elements": [ + { + "name": "START_AT", + "description": "All timecards that start on or after the specified workday" + }, + { + "name": "END_AT", + "description": "All timecards that end on or before the specified workday" + }, + { + "name": "INTERSECTION", + "description": "All timecards that start between the start and end workdays (inclusive)" + } + ], + "description": "Defines the logic used to apply a workday filter.", + "x-release-status": "PUBLIC" + }, + "TipSettings": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "allow_tipping": { + "type": "boolean", + "description": "Indicates whether tipping is enabled for this checkout. Defaults to false.", + "nullable": true + }, + "separate_tip_screen": { + "type": "boolean", + "description": "Indicates whether tip options should be presented on the screen before presenting\nthe signature screen during card payment. Defaults to false.", + "nullable": true + }, + "custom_tip_field": { + "type": "boolean", + "description": "Indicates whether custom tip amounts are allowed during the checkout flow. Defaults to false.", + "nullable": true + }, + "tip_percentages": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "A list of tip percentages that should be presented during the checkout flow, specified as\nup to 3 non-negative integers from 0 to 100 (inclusive). Defaults to 15, 20, and 25.", + "nullable": true + }, + "smart_tipping": { + "type": "boolean", + "description": "Enables the \"Smart Tip Amounts\" behavior.\nExact tipping options depend on the region in which the Square seller is active.\n\nFor payments under 10.00, in the Australia, Canada, Ireland, United Kingdom, and United States, tipping options are presented as no tip, .50, 1.00 or 2.00.\n\nFor payment amounts of 10.00 or greater, tipping options are presented as the following percentages: 0%, 5%, 10%, 15%.\n\nIf set to true, the `tip_percentages` settings is ignored.\nDefaults to false.\n\nTo learn more about smart tipping, see [Accept Tips with the Square App](https://squareup.com/help/us/en/article/5069-accept-tips-with-the-square-app).", + "nullable": true + } + } + }, + "Transaction": { + "type": "object", + "description": "Represents a transaction processed with Square, either with the\nConnect API or with Square Point of Sale.\n\nThe `tenders` field of this object lists all methods of payment used to pay in\nthe transaction.", + "x-release-status": "DEPRECATED", + "properties": { + "id": { + "type": "string", + "description": "The transaction's unique ID, issued by Square payments servers.", + "maxLength": 192 + }, + "location_id": { + "type": "string", + "description": "The ID of the transaction's associated location.", + "maxLength": 50, + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The timestamp for when the transaction was created, in RFC 3339 format.", + "maxLength": 32 + }, + "tenders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tender" + }, + "description": "The tenders used to pay in the transaction.", + "nullable": true + }, + "refunds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Refund" + }, + "description": "Refunds that have been applied to any tender in the transaction.", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "If the transaction was created with the [Charge](api-endpoint:Transactions-Charge)\nendpoint, this value is the same as the value provided for the `reference_id`\nparameter in the request to that endpoint. Otherwise, it is not set.", + "maxLength": 40, + "nullable": true + }, + "product": { + "$ref": "#/components/schemas/TransactionProduct", + "description": "The Square product that processed the transaction.\nSee [TransactionProduct](#type-transactionproduct) for possible values", + "nullable": true + }, + "client_id": { + "type": "string", + "description": "If the transaction was created in the Square Point of Sale app, this value\nis the ID generated for the transaction by Square Point of Sale.\n\nThis ID has no relationship to the transaction's canonical `id`, which is\ngenerated by Square's backend servers. This value is generated for bookkeeping\npurposes, in case the transaction cannot immediately be completed (for example,\nif the transaction is processed in offline mode).\n\nIt is not currently possible with the Connect API to perform a transaction\nlookup by this value.", + "maxLength": 192, + "nullable": true + }, + "shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "The shipping address provided in the request, if any.", + "nullable": true + }, + "order_id": { + "type": "string", + "description": "The order_id is an identifier for the order associated with this transaction, if any.", + "maxLength": 192, + "nullable": true + } + } + }, + "TransactionProduct": { + "type": "string", + "enum": [ + "REGISTER", + "EXTERNAL_API", + "BILLING", + "APPOINTMENTS", + "INVOICES", + "ONLINE_STORE", + "PAYROLL", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "REGISTER", + "description": "Square Point of Sale." + }, + { + "name": "EXTERNAL_API", + "description": "The Square Connect API." + }, + { + "name": "BILLING", + "description": "A Square subscription for one of multiple products." + }, + { + "name": "APPOINTMENTS", + "description": "Square Appointments." + }, + { + "name": "INVOICES", + "description": "Square Invoices." + }, + { + "name": "ONLINE_STORE", + "description": "Square Online Store." + }, + { + "name": "PAYROLL", + "description": "Square Payroll." + }, + { + "name": "OTHER", + "description": "A Square product that does not match any other value." + } + ], + "description": "Indicates the Square product used to process a transaction.", + "x-release-status": "DEPRECATED" + }, + "TransactionType": { + "type": "string", + "enum": [ + "DEBIT", + "CREDIT" + ], + "x-enum-elements": [ + { + "name": "DEBIT", + "description": "" + }, + { + "name": "CREDIT", + "description": "" + } + ], + "description": "The transaction type used in the disputed payment.", + "x-release-status": "PUBLIC" + }, + "TransferOrder": { + "type": "object", + "description": "Represents a transfer order for moving [CatalogItemVariation](entity:CatalogItemVariation)s \nbetween [Location](entity:Location)s. Transfer orders track the entire lifecycle of an inventory \ntransfer, including:\n- What items and quantities are being moved\n- Source and destination locations\n- Current [TransferOrderStatus](entity:TransferOrderStatus)\n- Shipping information and tracking\n- Which [TeamMember](entity:TeamMember) initiated the transfer\n\nThis object is commonly used to:\n- Track [CatalogItemVariation](entity:CatalogItemVariation) movements between [Location](entity:Location)s\n- Reconcile expected vs received quantities\n- Monitor transfer progress and shipping status\n- Audit inventory movement history", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "Unique system-generated identifier for this transfer order. Use this ID for:\n- Retrieving transfer order details\n- Tracking status changes via webhooks\n- Linking transfers in external systems", + "readOnly": true + }, + "source_location_id": { + "type": "string", + "description": "The source [Location](entity:Location) sending the [CatalogItemVariation](entity:CatalogItemVariation)s.\nThis location must:\n- Be active in your Square organization\n- Have sufficient inventory for the items being transferred\n- Not be the same as the destination location\n\nThis field is not updatable.", + "nullable": true + }, + "destination_location_id": { + "type": "string", + "description": "The destination [Location](entity:Location) receiving the [CatalogItemVariation](entity:CatalogItemVariation)s.\nThis location must:\n- Be active in your Square organization\n- Not be the same as the source location\n\nThis field is not updatable.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/TransferOrderStatus", + "description": "Current [TransferOrderStatus](entity:TransferOrderStatus) indicating where the order is in its lifecycle.\nStatus transitions follow this progression:\n1. [DRAFT](entity:TransferOrderStatus) -\u003e [STARTED](entity:TransferOrderStatus) via [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder)\n2. [STARTED](entity:TransferOrderStatus) -\u003e [PARTIALLY_RECEIVED](entity:TransferOrderStatus) via [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder)\n3. [PARTIALLY_RECEIVED](entity:TransferOrderStatus) -\u003e [COMPLETED](entity:TransferOrderStatus) after all items received\n\nOrders can be [CANCELED](entity:TransferOrderStatus) from [STARTED](entity:TransferOrderStatus) or \n[PARTIALLY_RECEIVED](entity:TransferOrderStatus) status.\n\nThis field is read-only and reflects the current state of the transfer order, and cannot be updated directly. Use the appropriate\nendpoints (e.g. [StartPurchaseOrder](api-endpoint:TransferOrders-StartTransferOrder), to change the status.\nSee [TransferOrderStatus](#type-transferorderstatus) for possible values", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "Timestamp when the transfer order was created, in RFC 3339 format.\nUsed for:\n- Auditing transfer history\n- Tracking order age\n- Reporting and analytics", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "Timestamp when the transfer order was last updated, in RFC 3339 format.\nUpdated when:\n- Order status changes\n- Items are received\n- Notes or metadata are modified", + "readOnly": true + }, + "expected_at": { + "type": "string", + "description": "Expected transfer completion date, in RFC 3339 format.\nUsed for:\n- Planning inventory availability\n- Scheduling receiving staff\n- Monitoring transfer timeliness", + "nullable": true + }, + "completed_at": { + "type": "string", + "description": "Timestamp when the transfer order was completed or canceled, in RFC 3339 format (e.g. \"2023-10-01T12:00:00Z\").", + "readOnly": true + }, + "notes": { + "type": "string", + "description": "Optional notes about the transfer.", + "nullable": true + }, + "tracking_number": { + "type": "string", + "description": "Shipment tracking number for monitoring transfer progress.", + "nullable": true + }, + "created_by_team_member_id": { + "type": "string", + "description": "ID of the [TeamMember](entity:TeamMember) who created this transfer order. This field is not writeable by the Connect V2 API.", + "readOnly": true + }, + "line_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransferOrderLine" + }, + "description": "List of [CatalogItemVariation](entity:CatalogItemVariation)s being transferred.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "Version for optimistic concurrency control. This is a monotonically increasing integer\nthat changes whenever the transfer order is modified. Use this when calling \n[UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder) and other endpoints to ensure you're\nnot overwriting concurrent changes.", + "format": "int64" + } + } + }, + "TransferOrderCreatedEvent": { + "type": "object", + "description": "Published when a transfer_order is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"transfer_order.created\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TransferOrderCreatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "x-webhook": { + "event": "transfer_order.created", + "scopes": [ + "INVENTORY_READ", + "INVENTORY_WRITE" + ] + }, + "x-api": "#/components/x-apis/TransferOrder" + }, + "TransferOrderCreatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"transfer_order\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected transfer_order.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/TransferOrderCreatedEventObject", + "description": "An object containing the created transfer_order.", + "nullable": true + } + } + }, + "TransferOrderCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "transfer_order": { + "$ref": "#/components/schemas/TransferOrder", + "description": "The created transfer_order.", + "nullable": true + } + } + }, + "TransferOrderDeletedEvent": { + "type": "object", + "description": "Published when a transfer_order is deleted.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"transfer_order.deleted\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TransferOrderDeletedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "x-webhook": { + "event": "transfer_order.deleted", + "scopes": [ + "INVENTORY_WRITE" + ] + }, + "x-api": "#/components/x-apis/TransferOrder" + }, + "TransferOrderDeletedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"transfer_order\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected transfer_order.", + "maxLength": 192 + }, + "deleted": { + "type": "boolean", + "description": "Is true if the affected object was deleted. Otherwise absent.", + "nullable": true + } + } + }, + "TransferOrderFilter": { + "type": "object", + "description": "Filter criteria for searching transfer orders", + "x-release-status": "BETA", + "properties": { + "source_location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter by source location IDs", + "nullable": true + }, + "destination_location_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Filter by destination location IDs", + "nullable": true + }, + "statuses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransferOrderStatus" + }, + "description": "Filter by order statuses\nSee [TransferOrderStatus](#type-transferorderstatus) for possible values", + "nullable": true + } + } + }, + "TransferOrderGoodsReceipt": { + "type": "object", + "description": "The goods receipt details for a transfer order. This object represents a single receipt\nof goods against a transfer order, tracking:\n\n- Which [CatalogItemVariation](entity:CatalogItemVariation)s were received\n- Quantities received in good condition\n- Quantities damaged during transit/handling\n- Quantities canceled during receipt\n\nMultiple goods receipts can be created for a single transfer order to handle:\n- Partial deliveries\n- Multiple shipments\n- Split receipts across different dates\n- Cancellations of specific quantities\n\nEach receipt automatically:\n- Updates the transfer order status\n- Adjusts received quantities\n- Updates inventory levels at both source and destination [Location](entity:Location)s", + "x-release-status": "BETA", + "properties": { + "line_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransferOrderGoodsReceiptLineItem" + }, + "description": "Line items being received. Each line item specifies:\n- The item being received\n- Quantity received in good condition\n- Quantity received damaged\n- Quantity canceled\n\nConstraints:\n- Must include at least one line item\n- Maximum of 1000 line items per receipt\n- Each line item must reference a valid item from the transfer order\n- Total of received, damaged, and canceled quantities cannot exceed ordered quantity", + "nullable": true + } + } + }, + "TransferOrderGoodsReceiptLineItem": { + "type": "object", + "description": "A simplified line item for goods receipts in transfer orders", + "x-release-status": "BETA", + "required": [ + "transfer_order_line_uid" + ], + "properties": { + "transfer_order_line_uid": { + "type": "string", + "description": "The unique identifier of the Transfer Order line being received", + "maxLength": 64 + }, + "quantity_received": { + "type": "string", + "description": "The quantity received for this line item as a decimal string (e.g. \"10.5\").\nThese items will be added to the destination [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of IN_STOCK.", + "minLength": 1, + "maxLength": 16, + "pattern": "^(0|[1-9]\\d*)(\\.\\d{1,4})?$", + "nullable": true + }, + "quantity_damaged": { + "type": "string", + "description": "The quantity that was damaged during shipping/handling as a decimal string (e.g. \"1.5\").\nThese items will be added to the destination [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of WASTE.", + "minLength": 1, + "maxLength": 16, + "pattern": "^(0|[1-9]\\d*)(\\.\\d{1,4})?$", + "nullable": true + }, + "quantity_canceled": { + "type": "string", + "description": "The quantity that was canceled during shipping/handling as a decimal string (e.g. \"1.5\"). These will be immediately added to inventory in the source location.", + "minLength": 1, + "maxLength": 16, + "pattern": "^(0|[1-9]\\d*)(\\.\\d{1,4})?$", + "nullable": true + } + } + }, + "TransferOrderLine": { + "type": "object", + "description": "Represents a line item in a transfer order. Each line item tracks a specific \n[CatalogItemVariation](entity:CatalogItemVariation) being transferred, including ordered quantities\nand receipt status.", + "x-release-status": "BETA", + "required": [ + "item_variation_id", + "quantity_ordered" + ], + "properties": { + "uid": { + "type": "string", + "description": "Unique system-generated identifier for the line item. Provide when updating/removing a line via [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder).", + "readOnly": true + }, + "item_variation_id": { + "type": "string", + "description": "The required identifier of the [CatalogItemVariation](entity:CatalogItemVariation) being transferred. Must reference\na valid catalog item variation that exists in the [Catalog](api:Catalog).", + "minLength": 1, + "maxLength": 64, + "pattern": "^[a-zA-Z0-9_:\\-]+$" + }, + "quantity_ordered": { + "type": "string", + "description": "Total quantity ordered, formatted as a decimal string (e.g. \"10 or 10.0000\"). Required to be a positive number.\n\nTo remove a line item, set `remove` to `true` in [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder).", + "minLength": 1, + "pattern": "^\\d*\\.?\\d*$" + }, + "quantity_pending": { + "type": "string", + "description": "Calculated quantity of this line item's yet to be received stock. This is the difference between the total quantity ordered and the sum of quantities received, canceled, and damaged.", + "readOnly": true + }, + "quantity_received": { + "type": "string", + "description": "Quantity received at destination. These items are added to the destination\n[Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of IN_STOCK.\n\nThis field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder).", + "readOnly": true + }, + "quantity_damaged": { + "type": "string", + "description": "Quantity received in damaged condition. These items are added to the destination\n[Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of WASTE.\n\nThis field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder).", + "readOnly": true + }, + "quantity_canceled": { + "type": "string", + "description": "Quantity that was canceled. These items will be immediately added to inventory in the source location.\n\nThis field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) or [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder).", + "readOnly": true + } + } + }, + "TransferOrderQuery": { + "type": "object", + "description": "Query parameters for searching transfer orders", + "x-release-status": "BETA", + "properties": { + "filter": { + "$ref": "#/components/schemas/TransferOrderFilter", + "description": "Filter criteria", + "nullable": true + }, + "sort": { + "$ref": "#/components/schemas/TransferOrderSort", + "description": "Sort configuration", + "nullable": true + } + } + }, + "TransferOrderSort": { + "type": "object", + "description": "Sort configuration for search results", + "x-release-status": "BETA", + "properties": { + "field": { + "$ref": "#/components/schemas/TransferOrderSortField", + "description": "Field to sort by\nSee [TransferOrderSortField](#type-transferordersortfield) for possible values", + "nullable": true + }, + "order": { + "$ref": "#/components/schemas/SortOrder", + "description": "Sort order direction\nSee [SortOrder](#type-sortorder) for possible values", + "nullable": true + } + } + }, + "TransferOrderSortField": { + "type": "string", + "enum": [ + "CREATED_AT", + "UPDATED_AT" + ], + "x-enum-elements": [ + { + "name": "CREATED_AT", + "description": "Sort by creation date (created_at field). Useful for:\n- Finding newest transfers\n- Chronological order processing\n- Historical analysis\n- Auditing transfer patterns" + }, + { + "name": "UPDATED_AT", + "description": "Sort by last update date (updated_at field). Useful for:\n- Finding recently modified transfers\n- Tracking status changes\n- Monitoring receiving progress\n- Synchronizing with external systems" + } + ], + "description": "Fields that can be used for sorting [TransferOrder](entity:TransferOrder)s in search results.\nUsed with [SearchTransferOrders](api-endpoint:TransferOrders-SearchTransferOrders) to control\nthe order of returned results.", + "x-release-status": "BETA" + }, + "TransferOrderStatus": { + "type": "string", + "enum": [ + "DRAFT", + "STARTED", + "PARTIALLY_RECEIVED", + "COMPLETED", + "CANCELED" + ], + "x-enum-elements": [ + { + "name": "DRAFT", + "description": "Initial status when transfer order is created via [CreateTransferOrder](api-endpoint:TransferOrders-CreateTransferOrder).\nOrder can be modified or deleted. No inventory impact at this stage." + }, + { + "name": "STARTED", + "description": "Transfer order has been started via [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder).\nOrder can no longer be deleted. [CatalogItemVariation](entity:CatalogItemVariation)s are decremented \nfrom source [Location](entity:Location) and marked as in-transit to destination." + }, + { + "name": "PARTIALLY_RECEIVED", + "description": "Some items have been received via [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder)\nbut there are still pending quantities. Additional receipts are allowed.\n[CatalogItemVariation](entity:CatalogItemVariation)s are incrementally added to destination \n[Location](entity:Location) inventory as they are received." + }, + { + "name": "COMPLETED", + "description": "All items have been received or canceled, no pending quantities remain. \nOnly metadata modifications are allowed. Final inventory adjustments are complete\nat both source and destination [Location](entity:Location)s." + }, + { + "name": "CANCELED", + "description": "Transfer order was canceled via [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder).\nAny pending quantities are no longer receivable and are returned to source [Location](entity:Location). \nOnly metadata modifications are allowed." + } + ], + "description": "Status values for transfer orders. Represents the current state of a \n[TransferOrder](entity:TransferOrder) in its lifecycle from creation to completion.\nEach status determines what actions are available and how inventory is affected.", + "x-release-status": "BETA" + }, + "TransferOrderUpdatedEvent": { + "type": "object", + "description": "Published when a transfer_order is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of the target merchant associated with the event.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of event this represents, `\"transfer_order.updated\"`.", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for the event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "Timestamp of when the event was created, in RFC 3339 format.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/TransferOrderUpdatedEventData", + "description": "Data associated with the event.", + "nullable": true + } + }, + "x-webhook": { + "event": "transfer_order.updated", + "scopes": [ + "INVENTORY_READ", + "INVENTORY_WRITE" + ] + }, + "x-api": "#/components/x-apis/TransferOrder" + }, + "TransferOrderUpdatedEventData": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "Name of the affected object’s type, `\"transfer_order\"`.", + "maxLength": 50, + "nullable": true + }, + "id": { + "type": "string", + "description": "ID of the affected transfer_order.", + "maxLength": 192 + }, + "object": { + "$ref": "#/components/schemas/TransferOrderUpdatedEventObject", + "description": "An object containing the updated transfer_order.", + "nullable": true + } + } + }, + "TransferOrderUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "transfer_order": { + "$ref": "#/components/schemas/TransferOrder", + "description": "The updated transfer_order.", + "nullable": true + } + } + }, + "UnlinkCustomerFromGiftCardRequest": { + "type": "object", + "description": "A request to unlink a customer from a gift card.", + "x-release-status": "PUBLIC", + "x-params-example": "?gift_card_id=gftc:71ea002277a34f8a945e284b04822edb", + "required": [ + "customer_id" + ], + "properties": { + "customer_id": { + "type": "string", + "description": "The ID of the customer to unlink from the gift card.", + "minLength": 1, + "maxLength": 191 + } + }, + "example": { + "customer_id": "GKY0FZ3V717AH8Q2D821PNT2ZW" + } + }, + "UnlinkCustomerFromGiftCardResponse": { + "type": "object", + "description": "A response that contains the unlinked `GiftCard` object. If the request resulted in errors, \nthe response contains a set of `Error` objects.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "gift_card": { + "$ref": "#/components/schemas/GiftCard", + "description": "The gift card with the ID of the unlinked customer removed from the `customer_ids` field. \nIf no other customers are linked, the `customer_ids` field is also removed." + } + }, + "example": { + "gift_card": { + "balance_money": { + "amount": 2500, + "currency": "USD" + }, + "created_at": "2021-03-25T05:13:01Z", + "gan": "7783320005440920", + "gan_source": "SQUARE", + "id": "gftc:71ea002277a34f8a945e284b04822edb", + "state": "ACTIVE", + "type": "DIGITAL" + } + } + }, + "UpdateBookingCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) request.", + "x-release-status": "PUBLIC", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition that contains the fields to update. Only the following fields can be updated:\n- `name`\n- `description`\n- `visibility`\n- `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed\nselections are supported.\n\nFor more information, see\n[Updatable definition fields](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields).\n\nTo enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, include the optional `version` field and specify the current version of the custom attribute definition." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "UpdateBookingCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The updated custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-11-16T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoriteShampoo", + "name": "Favorite shampoo", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-11-16T15:39:38Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [] + } + }, + "UpdateBookingRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "booking" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique key to make this request an idempotent operation.", + "maxLength": 255, + "nullable": true + }, + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The booking to be updated. Individual attributes explicitly specified here override the corresponding values of the existing booking." + } + } + }, + "UpdateBookingResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "booking": { + "$ref": "#/components/schemas/Booking", + "description": "The booking that was updated." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors that occurred during the request." + } + }, + "example": { + "booking": { + "address": { + "address_line_1": "1955 Broadway", + "address_line_2": "Suite 600", + "administrative_district_level_1": "CA", + "locality": "Oakland", + "postal_code": "94612" + }, + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t" + } + ], + "created_at": "2020-10-28T15:47:41Z", + "customer_id": "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + "customer_note": "I would like to sit near the window please", + "id": "zkras0xv0xwswx", + "location_id": "LEQHH0YY8B42M", + "location_type": "CUSTOMER_LOCATION", + "seller_note": "", + "start_at": "2020-11-26T13:00:00Z", + "status": "ACCEPTED", + "updated_at": "2020-10-28T15:49:25Z", + "version": 2 + }, + "errors": [] + } + }, + "UpdateBreakTypeRequest": { + "type": "object", + "description": "A request to update a `BreakType`.", + "x-release-status": "PUBLIC", + "required": [ + "break_type" + ], + "properties": { + "break_type": { + "$ref": "#/components/schemas/BreakType", + "description": "The updated `BreakType`." + } + }, + "example": { + "break_type": { + "break_name": "Lunch", + "expected_duration": "PT50M", + "is_paid": true, + "location_id": "26M7H24AZ9N6R", + "version": 1 + } + } + }, + "UpdateBreakTypeResponse": { + "type": "object", + "description": "A response to a request to update a `BreakType`. The response contains\nthe requested `BreakType` objects and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "break_type": { + "$ref": "#/components/schemas/BreakType", + "description": "The response object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "break_type": { + "break_name": "Lunch", + "created_at": "2018-06-12T20:19:12Z", + "expected_duration": "PT50M", + "id": "Q6JSJS6D4DBCH", + "is_paid": true, + "location_id": "26M7H24AZ9N6R", + "updated_at": "2019-02-26T23:12:59Z", + "version": 2 + } + } + }, + "UpdateCatalogImageRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "idempotency_key" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this UpdateCatalogImage request.\nKeys can be any valid string but must be unique for every UpdateCatalogImage request.\n\nSee [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 128 + } + }, + "example": { + "idempotency_key": "528dea59-7bfb-43c1-bd48-4a6bba7dd61f86", + "image": { + "image_data": { + "caption": "A picture of a cup of coffee", + "name": "Coffee" + }, + "type": "IMAGE" + }, + "object_id": "ND6EA5AAJEO5WL3JNNIAQA32" + } + }, + "UpdateCatalogImageResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "image": { + "$ref": "#/components/schemas/CatalogObject", + "description": "The newly updated `CatalogImage` including a Square-generated\nURL for the encapsulated image file." + } + }, + "example": { + "image": { + "id": "L52QOQN2SW3M5QTF9JOCQKNB", + "image_data": { + "caption": "A picture of a cup of coffee", + "name": "Coffee", + "url": "https://..." + }, + "type": "IMAGE" + } + } + }, + "UpdateCustomerCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents an [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?key=favoritemovie", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition that contains the fields to update. This endpoint\nsupports sparse updates, so only new or changed fields need to be included in the request.\nOnly the following fields can be updated:\n\n- `name`\n- `description`\n- `visibility`\n- `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed\nselections are supported.\n\nFor more information, see\n[Updatable definition fields](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields).\n\nTo enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) \ncontrol, include the optional `version` field and specify the current version of the custom attribute definition." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute_definition": { + "description": "Update the description as desired.", + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateCustomerCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents an [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The updated custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-04-26T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-04-26T15:39:38Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateCustomerGroupRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in a request to the\n[UpdateCustomerGroup](api-endpoint:CustomerGroups-UpdateCustomerGroup) endpoint.", + "x-release-status": "PUBLIC", + "required": [ + "group" + ], + "properties": { + "group": { + "$ref": "#/components/schemas/CustomerGroup", + "description": "The `CustomerGroup` object including all the updates you want to make." + } + }, + "example": { + "group": { + "name": "Loyal Customers" + } + } + }, + "UpdateCustomerGroupResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [UpdateCustomerGroup](api-endpoint:CustomerGroups-UpdateCustomerGroup) endpoint.\n\nEither `errors` or `group` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "group": { + "$ref": "#/components/schemas/CustomerGroup", + "description": "The successfully updated customer group." + } + }, + "example": { + "group": { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + } + } + }, + "UpdateCustomerRequest": { + "type": "object", + "description": "Defines the body parameters that can be included in a request to the\n`UpdateCustomer` endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "given_name": { + "type": "string", + "description": "The given name (that is, the first name) associated with the customer profile.\n\nThe maximum length for this value is 300 characters.", + "nullable": true + }, + "family_name": { + "type": "string", + "description": "The family name (that is, the last name) associated with the customer profile.\n\nThe maximum length for this value is 300 characters.", + "nullable": true + }, + "company_name": { + "type": "string", + "description": "A business name associated with the customer profile.\n\nThe maximum length for this value is 500 characters.", + "nullable": true + }, + "nickname": { + "type": "string", + "description": "A nickname for the customer profile.\n\nThe maximum length for this value is 100 characters.", + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address associated with the customer profile.\n\nThe maximum length for this value is 254 characters.", + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The physical address associated with the customer profile. Only new or changed fields are required in the request.\n\nFor maximum length constraints, see [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).\nThe `first_name` and `last_name` fields are ignored if they are present in the request.", + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number associated with the customer profile. The phone number must be valid and can contain\n9–16 digits, with an optional `+` prefix and country code. For more information, see\n[Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).", + "nullable": true + }, + "reference_id": { + "type": "string", + "description": "An optional second ID used to associate the customer profile with an\nentity in another system.\n\nThe maximum length for this value is 100 characters.", + "nullable": true + }, + "note": { + "type": "string", + "description": "A custom note associated with the customer profile.", + "nullable": true + }, + "birthday": { + "type": "string", + "description": "The birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,\nspecify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in `YYYY-MM-DD`\nformat, where `YYYY` is the specified birth year or `0000` if a birth year is not specified.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "The current version of the customer profile.\n\nAs a best practice, you should include this field to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For more information, see [Update a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#update-a-customer-profile).", + "format": "int64" + }, + "tax_ids": { + "$ref": "#/components/schemas/CustomerTaxIds", + "description": "The tax ID associated with the customer profile. This field is available only for customers of sellers\nin EU countries or the United Kingdom. For more information,\nsee [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).", + "nullable": true + } + }, + "example": { + "email_address": "New.Amelia.Earhart@example.com", + "note": "updated customer note", + "phone_number": null, + "version": 2 + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.csharp", + "java": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.java", + "javascript": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.javascript", + "php": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.php", + "python": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.python", + "ruby": "/sdk_samples/UpdateCustomer/UpdateCustomerRequest.ruby" + } + }, + "UpdateCustomerResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [UpdateCustomer](api-endpoint:Customers-UpdateCustomer) or\n[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint.\n\nEither `errors` or `customer` is present in a given response (never both).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "customer": { + "$ref": "#/components/schemas/Customer", + "description": "The updated customer." + } + }, + "example": { + "customer": { + "address": { + "address_line_1": "500 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", + "email_address": "New.Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "note": "updated customer note", + "preferences": { + "email_unsubscribed": false + }, + "reference_id": "YOUR_REFERENCE_ID", + "updated_at": "2016-05-15T20:21:55Z", + "version": 3 + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.csharp", + "java": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.java", + "javascript": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.javascript", + "php": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.php", + "python": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.python", + "ruby": "/sdk_samples/UpdateCustomer/UpdateCustomerResponse.ruby" + } + }, + "UpdateInvoiceRequest": { + "type": "object", + "description": "Describes a `UpdateInvoice` request.", + "x-release-status": "PUBLIC", + "required": [ + "invoice" + ], + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The invoice fields to add, change, or clear. Fields can be cleared using\nnull values or the `remove` field (for individual payment requests or reminders).\nThe current invoice `version` is also required. For more information, including requirements,\nlimitations, and more examples, see [Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices)." + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the `UpdateInvoice` request. If you do not\nprovide `idempotency_key` (or provide an empty string as the value), the endpoint\ntreats each request as independent.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 128, + "nullable": true + }, + "fields_to_clear": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of fields to clear. Although this field is currently supported, we\nrecommend using null values or the `remove` field when possible. For examples, see\n[Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices).", + "nullable": true + } + }, + "example": { + "idempotency_key": "4ee82288-0910-499e-ab4c-5d0071dad1be", + "invoice": { + "payment_requests": [ + { + "reminders": null, + "tipping_enabled": false, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "version": 1 + } + } + }, + "UpdateInvoiceResponse": { + "type": "object", + "description": "Describes a `UpdateInvoice` response.", + "x-release-status": "PUBLIC", + "properties": { + "invoice": { + "$ref": "#/components/schemas/Invoice", + "description": "The updated invoice." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + } + }, + "example": { + "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "buy_now_pay_later": false, + "card": true, + "cash_app_pay": false, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" + }, + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" + }, + "due_date": "2030-01-24", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "UNPAID", + "store_payment_method_enabled": false, + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T18:23:11Z", + "version": 2 + } + } + }, + "UpdateItemModifierListsRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "item_ids" + ], + "properties": { + "item_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the catalog items associated with the CatalogModifierList objects being updated." + }, + "modifier_lists_to_enable": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the CatalogModifierList objects to enable for the CatalogItem.\nAt least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified.", + "nullable": true + }, + "modifier_lists_to_disable": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the CatalogModifierList objects to disable for the CatalogItem.\nAt least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must be specified.", + "nullable": true + } + }, + "example": { + "item_ids": [ + "H42BRLUJ5KTZTTMPVSLFAACQ", + "2JXOBJIHCWBQ4NZ3RIXQGJA6" + ], + "modifier_lists_to_disable": [ + "7WRC16CJZDVLSNDQ35PP6YAD" + ], + "modifier_lists_to_enable": [ + "H42BRLUJ5KTZTTMPVSLFAACQ", + "2JXOBJIHCWBQ4NZ3RIXQGJA6" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.csharp", + "java": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.java", + "javascript": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.javascript", + "php": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.php", + "python": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.python", + "ruby": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsRequest.ruby" + } + }, + "UpdateItemModifierListsResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "updated_at": { + "type": "string", + "description": "The database [timestamp](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-dates) of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`." + } + }, + "example": { + "updated_at": "2016-11-16T22:25:24.878Z" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.csharp", + "java": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.java", + "javascript": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.javascript", + "php": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.php", + "python": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.python", + "ruby": "/sdk_samples/Catalog/UpdateItemModifierLists/UpdateItemModifierListsResponse.ruby" + } + }, + "UpdateItemTaxesRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "item_ids" + ], + "properties": { + "item_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IDs for the CatalogItems associated with the CatalogTax objects being updated.\nNo more than 1,000 IDs may be provided." + }, + "taxes_to_enable": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IDs of the CatalogTax objects to enable.\nAt least one of `taxes_to_enable` or `taxes_to_disable` must be specified.", + "nullable": true + }, + "taxes_to_disable": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IDs of the CatalogTax objects to disable.\nAt least one of `taxes_to_enable` or `taxes_to_disable` must be specified.", + "nullable": true + } + }, + "example": { + "item_ids": [ + "H42BRLUJ5KTZTTMPVSLFAACQ", + "2JXOBJIHCWBQ4NZ3RIXQGJA6" + ], + "taxes_to_disable": [ + "AQCEGCEBBQONINDOHRGZISEX" + ], + "taxes_to_enable": [ + "4WRCNHCJZDVLSNDQ35PP6YAD" + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.csharp", + "java": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.java", + "javascript": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.javascript", + "php": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.php", + "python": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.python", + "ruby": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesRequest.ruby" + } + }, + "UpdateItemTaxesResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "updated_at": { + "type": "string", + "description": "The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update in RFC 3339 format, e.g., `2016-09-04T23:59:33.123Z`." + } + }, + "example": { + "updated_at": "2016-11-16T22:25:24.878Z" + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.csharp", + "java": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.java", + "javascript": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.javascript", + "php": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.php", + "python": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.python", + "ruby": "/sdk_samples/Catalog/UpdateItemTaxes/UpdateItemTaxesResponse.ruby" + } + }, + "UpdateJobRequest": { + "type": "object", + "description": "Represents an [UpdateJob](api-endpoint:Team-UpdateJob) request.", + "x-release-status": "BETA", + "required": [ + "job" + ], + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The job with the updated fields, either `title`, `is_tip_eligible`, or both. Only changed fields need\nto be included in the request. Optionally include `version` to enable optimistic concurrency control." + } + }, + "example": { + "job": { + "is_tip_eligible": true, + "title": "Cashier 1" + } + } + }, + "UpdateJobResponse": { + "type": "object", + "description": "Represents an [UpdateJob](api-endpoint:Team-UpdateJob) response. Either `job` or `errors`\nis present in the response.", + "x-release-status": "BETA", + "properties": { + "job": { + "$ref": "#/components/schemas/Job", + "description": "The updated job." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "job": { + "created_at": "2021-06-11T22:55:45Z", + "id": "1yJlHapkseYnNPETIU1B", + "is_tip_eligible": true, + "title": "Cashier 1", + "updated_at": "2021-06-13T12:55:45Z", + "version": 2 + } + } + }, + "UpdateLocationCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents an [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) request.", + "x-release-status": "BETA", + "x-params-example": "?key=bestseller", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition that contains the fields to update. This endpoint\nsupports sparse updates, so only new or changed fields need to be included in the request.\nOnly the following fields can be updated:\n- `name`\n- `description`\n- `visibility`\n- `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed\nselections are supported.\n\nFor more information, see\n[Update a location custom attribute definition](https://developer.squareup.com/docs/location-custom-attributes-api/custom-attribute-definitions#update-custom-attribute-definition).\nTo enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, specify the current version of the custom attribute definition. \nIf this is not important for your application, `version` can be set to -1." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute_definition": { + "description": "Update the description as desired.", + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateLocationCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents an [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The updated custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Update the description as desired.", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2022-12-02T19:34:10.181Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateLocationRequest": { + "type": "object", + "description": "The request object for the [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "location": { + "$ref": "#/components/schemas/Location", + "description": "The `Location` object with only the fields to update.", + "nullable": true + } + }, + "example": { + "location": { + "business_hours": { + "periods": [ + { + "day_of_week": "FRI", + "end_local_time": "18:00", + "start_local_time": "07:00" + }, + { + "day_of_week": "SAT", + "end_local_time": "18:00", + "start_local_time": "07:00" + }, + { + "day_of_week": "SUN", + "end_local_time": "15:00", + "start_local_time": "09:00" + } + ] + }, + "description": "Midtown Atlanta store - Open weekends" + } + } + }, + "UpdateLocationResponse": { + "type": "object", + "description": "The response object returned by the [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information about errors encountered during the request." + }, + "location": { + "$ref": "#/components/schemas/Location", + "description": "The updated `Location` object." + } + }, + "example": { + "location": { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309" + }, + "business_hours": { + "periods": [ + { + "day_of_week": "FRI", + "end_local_time": "18:00", + "start_local_time": "07:00" + }, + { + "day_of_week": "SAT", + "end_local_time": "18:00", + "start_local_time": "07:00" + }, + { + "day_of_week": "SUN", + "end_local_time": "15:00", + "start_local_time": "09:00" + } + ] + }, + "business_name": "Jet Fuel Coffee", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ], + "coordinates": { + "latitude": 33.7889, + "longitude": -84.3841 + }, + "country": "US", + "created_at": "2022-02-19T17:58:25Z", + "currency": "USD", + "description": "Midtown Atlanta store - Open weekends", + "id": "3Z4V4WHQK64X9", + "language_code": "en-US", + "mcc": "7299", + "merchant_id": "3MYCJG5GVYQ8Q", + "name": "Midtown", + "status": "ACTIVE", + "timezone": "America/New_York", + "type": "PHYSICAL" + } + } + }, + "UpdateLocationSettingsRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "location_settings" + ], + "properties": { + "location_settings": { + "$ref": "#/components/schemas/CheckoutLocationSettings", + "description": "Describe your updates using the `location_settings` object. Make sure it contains only the fields that have changed." + } + } + }, + "UpdateLocationSettingsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred when updating the location settings." + }, + "location_settings": { + "$ref": "#/components/schemas/CheckoutLocationSettings", + "description": "The updated location settings." + } + }, + "example": { + "location_settings": { + "branding": { + "button_color": "#00b23b", + "button_shape": "ROUNDED", + "header_type": "FRAMED_LOGO" + }, + "customer_notes_enabled": false, + "location_id": "LOCATION_ID_1", + "policies": [ + { + "description": "This is my Return Policy", + "title": "Return Policy", + "uid": "POLICY_ID_1" + }, + { + "description": "Items may be returned within 30 days of purchase.", + "title": "Return Policy", + "uid": "POLICY_ID_2" + } + ], + "tipping": { + "default_percent": 20, + "default_whole_amount_money": { + "amount": 100, + "currency": "USD" + }, + "percentages": [ + 15, + 20, + 25 + ], + "smart_tipping_enabled": true, + "whole_amounts": [ + { + "amount": 1000, + "currency": "USD" + }, + { + "amount": 1500, + "currency": "USD" + }, + { + "amount": 2000, + "currency": "USD" + } + ] + }, + "updated_at": "2022-06-16T22:25:35Z" + } + } + }, + "UpdateMerchantCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) request.", + "x-release-status": "BETA", + "x-params-example": "?key=alternative_seller_name", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition that contains the fields to update. This endpoint\nsupports sparse updates, so only new or changed fields need to be included in the request.\nOnly the following fields can be updated:\n- `name`\n- `description`\n- `visibility`\n- `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed\nselections are supported.\nFor more information, see\n[Update a merchant custom attribute definition](https://developer.squareup.com/docs/merchant-custom-attributes-api/custom-attribute-definitions#update-custom-attribute-definition).\nThe version field must match the current version of the custom attribute definition to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\nIf this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute_definition": { + "description": "Update the description as desired.", + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateMerchantCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The updated custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2023-05-05T19:06:36.559Z", + "description": "Update the description as desired.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + }, + "updated_at": "2023-05-05T19:34:10.181Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateMerchantSettingsRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "merchant_settings" + ], + "properties": { + "merchant_settings": { + "$ref": "#/components/schemas/CheckoutMerchantSettings", + "description": "Describe your updates using the `merchant_settings` object. Make sure it contains only the fields that have changed." + } + } + }, + "UpdateMerchantSettingsResponse": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred when updating the merchant settings." + }, + "merchant_settings": { + "$ref": "#/components/schemas/CheckoutMerchantSettings", + "description": "The updated merchant settings." + } + }, + "example": { + "merchant_settings": { + "merchant_id": "MERCHANT_ID", + "payment_methods": { + "afterpay_clearpay": { + "enabled": true, + "item_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + }, + "order_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + } + }, + "apple_pay": { + "enabled": false + }, + "cash_app_pay": { + "enabled": true + }, + "google_pay": { + "enabled": true + } + }, + "updated_at": "2022-06-16T22:25:35Z" + } + } + }, + "UpdateOrderCustomAttributeDefinitionRequest": { + "type": "object", + "description": "Represents an update request for an order custom attribute definition.", + "x-release-status": "BETA", + "x-params-example": "?key=cover-count", + "required": [ + "custom_attribute_definition" + ], + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The custom attribute definition that contains the fields to update. This endpoint supports sparse updates, \nso only new or changed fields need to be included in the request. For more information, see \n[Updatable definition fields](https://developer.squareup.com/docs/orders-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields).\n\nTo enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control, include the optional `version` field and specify the current version of the custom attribute definition." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. \nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute_definition": { + "key": "cover-count", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "idempotency_key": "IDEMPOTENCY_KEY" + } + }, + "UpdateOrderCustomAttributeDefinitionResponse": { + "type": "object", + "description": "Represents a response from updating an order custom attribute definition.", + "x-release-status": "BETA", + "properties": { + "custom_attribute_definition": { + "$ref": "#/components/schemas/CustomAttributeDefinition", + "description": "The updated order custom attribute definition." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute_definition": { + "created_at": "2022-11-16T16:53:23.141Z", + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + }, + "updated_at": "2022-11-16T17:44:11.436Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpdateOrderRequest": { + "type": "object", + "description": "Defines the fields that are included in requests to the\n[UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint.", + "x-release-status": "BETA", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects)\ncontaining only the fields to update and the version to which the update is\nbeing applied.", + "nullable": true + }, + "fields_to_clear": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete)\nfields to clear. For example, `line_items[uid].note`.\nFor more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#deleting-fields).", + "nullable": true + }, + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this update request.\n\nIf you are unsure whether a particular update was applied to an order successfully,\nyou can reattempt it with the same idempotency key without\nworrying about creating duplicate updates to the order.\nThe latest order version is returned.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 192, + "nullable": true + } + }, + "example": { + "fields_to_clear": [ + "discounts" + ], + "idempotency_key": "UNIQUE_STRING", + "order": { + "line_items": [ + { + "base_price_money": { + "amount": 200, + "currency": "USD" + }, + "name": "COOKIE", + "quantity": "2", + "uid": "cookie_uid" + } + ], + "version": 1 + } + } + }, + "UpdateOrderResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint.", + "x-release-status": "BETA", + "properties": { + "order": { + "$ref": "#/components/schemas/Order", + "description": "The updated order." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "order": { + "created_at": "2019-08-23T18:26:18.243Z", + "id": "DREk7wJcyXNHqULq8JJ2iPAsluJZY", + "line_items": [ + { + "base_price_money": { + "amount": 500, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 500, + "currency": "USD" + }, + "name": "Small Coffee", + "quantity": "1", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 500, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "EuYkakhmu3ksHIds5Hiot", + "variation_total_price_money": { + "amount": 500, + "currency": "USD" + } + }, + { + "base_price_money": { + "amount": 200, + "currency": "USD" + }, + "gross_sales_money": { + "amount": 400, + "currency": "USD" + }, + "name": "COOKIE", + "quantity": "2", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 400, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "cookie_uid", + "variation_total_price_money": { + "amount": 400, + "currency": "USD" + } + } + ], + "location_id": "MXVQSVNDGN3C8", + "net_amounts": { + "discount_money": { + "amount": 0, + "currency": "USD" + }, + "service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "tax_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 900, + "currency": "USD" + } + }, + "source": { + "name": "Cookies" + }, + "state": "OPEN", + "total_discount_money": { + "amount": 0, + "currency": "USD" + }, + "total_money": { + "amount": 900, + "currency": "USD" + }, + "total_service_charge_money": { + "amount": 0, + "currency": "USD" + }, + "total_tax_money": { + "amount": 0, + "currency": "USD" + }, + "updated_at": "2019-08-23T18:33:47.523Z", + "version": 2 + } + } + }, + "UpdatePaymentLinkRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "payment_link" + ], + "properties": { + "payment_link": { + "$ref": "#/components/schemas/PaymentLink", + "description": "The `payment_link` object describing the updates to apply.\nFor more information, see [Update a payment link](https://developer.squareup.com/docs/checkout-api/manage-checkout#update-a-payment-link)." + } + }, + "example": { + "payment_link": { + "checkout_options": { + "ask_for_shipping_address": true + }, + "version": 1 + } + } + }, + "UpdatePaymentLinkResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred when updating the payment link." + }, + "payment_link": { + "$ref": "#/components/schemas/PaymentLink", + "description": "The updated payment link." + } + }, + "example": { + "payment_link": { + "checkout_options": { + "ask_for_shipping_address": true + }, + "created_at": "2022-04-26T00:15:15Z", + "id": "TY4BWEDJ6AI5MBIV", + "long_url": "https://checkout.square.site/EXAMPLE", + "order_id": "Qqc8ypQGvxVwc46Cch4zHTaJqc4F", + "payment_note": "test", + "updated_at": "2022-04-26T00:18:24Z", + "url": "https://square.link/u/EXAMPLE", + "version": 2 + } + } + }, + "UpdatePaymentRequest": { + "type": "object", + "description": "Describes a request to update a payment using\n[UpdatePayment](api-endpoint:Payments-UpdatePayment).", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key" + ], + "properties": { + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The updated `Payment` object.", + "nullable": true + }, + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this `UpdatePayment` request. Keys can be any valid string\nbut must be unique for every `UpdatePayment` request.\n\nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45 + } + }, + "example": { + "idempotency_key": "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de", + "payment": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "tip_money": { + "amount": 100, + "currency": "USD" + }, + "version_token": "ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o" + } + } + }, + "UpdatePaymentResponse": { + "type": "object", + "description": "Defines the response returned by\n[UpdatePayment](api-endpoint:Payments-UpdatePayment).", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "payment": { + "$ref": "#/components/schemas/Payment", + "description": "The updated payment." + } + }, + "example": { + "payment": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "application_details": { + "application_id": "sq0ids-TcgftTEtKxJTRF1lCFJ9TA", + "square_product": "ECOMMERCE_API" + }, + "approved_money": { + "amount": 1000, + "currency": "USD" + }, + "capabilities": [ + "EDIT_AMOUNT_UP", + "EDIT_AMOUNT_DOWN", + "EDIT_TIP_AMOUNT_UP", + "EDIT_TIP_AMOUNT_DOWN" + ], + "card_details": { + "auth_result_code": "68aLBM", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 11, + "exp_year": 2022, + "fingerprint": "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2021-10-13T20:26:44.364Z" + }, + "cvv_status": "CVV_ACCEPTED", + "entry_method": "ON_FILE", + "statement_description": "SQ *EXAMPLE TEST GOSQ.C", + "status": "AUTHORIZED" + }, + "created_at": "2021-10-13T20:26:44.191Z", + "customer_id": "W92WH6P11H4Z77CTET0RNTGFW8", + "delay_action": "CANCEL", + "delay_duration": "PT168H", + "delayed_until": "2021-10-20T20:26:44.191Z", + "id": "1QjqpBVyrI9S4H9sTGDWU9JeiWdZY", + "location_id": "L88917AVBK2S5", + "note": "Example Note", + "order_id": "nUSN9TdxpiK3SrQg3wzmf6r8LP9YY", + "receipt_number": "1Qjq", + "risk_evaluation": { + "created_at": "2021-10-13T20:26:45.271Z", + "risk_level": "NORMAL" + }, + "source_type": "CARD", + "status": "APPROVED", + "tip_money": { + "amount": 100, + "currency": "USD" + }, + "total_money": { + "amount": 1100, + "currency": "USD" + }, + "updated_at": "2021-10-13T20:26:44.364Z", + "version_token": "rDrXnqiS7fJgexccgdpzmwqTiXui1aIKCp9EchZ7trE6o" + } + } + }, + "UpdateScheduledShiftRequest": { + "type": "object", + "x-release-status": "BETA", + "required": [ + "scheduled_shift" + ], + "properties": { + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The scheduled shift with any updates in the `draft_shift_details` field.\nIf needed, call [ListLocations](api-endpoint:Locations-ListLocations) to get location IDs,\n[ListJobs](api-endpoint:Team-ListJobs) to get job IDs, and [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers)\nto get team member IDs and current job assignments. Updates made to `published_shift_details`\nare ignored.\n\nIf provided, the `start_at` and `end_at` timestamps must be in the time zone + offset of the\nshift location specified in `location_id`. Example for Pacific Standard Time: 2024-10-31T12:30:00-08:00\n\nTo enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for the request, provide the current version of the shift in the `version` field.\nIf the provided version doesn't match the server version, the request fails. If `version` is\nomitted, Square executes a blind write, potentially overwriting data from another publish request." + } + }, + "example": { + "scheduled_shift": { + "draft_shift_details": { + "end_at": "2019-03-25T13:18:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-03-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI" + }, + "version": 1 + } + } + }, + "UpdateScheduledShiftResponse": { + "type": "object", + "description": "Represents an [UpdateScheduledShift](api-endpoint:Labor-UpdateScheduledShift) response.\nEither `scheduled_shift` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "scheduled_shift": { + "$ref": "#/components/schemas/ScheduledShift", + "description": "The updated scheduled shift. To make the changes public, call \n[PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) or\n[BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts)." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "scheduled_shift": { + "created_at": "2019-02-25T03:11:00-05:00", + "draft_shift_details": { + "end_at": "2019-03-25T13:18:00-05:00", + "is_deleted": false, + "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M", + "location_id": "PAA1RJZZKXBFG", + "notes": "Dont forget to prep the vegetables", + "start_at": "2019-03-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York" + }, + "id": "K0YH4CV5462JB", + "updated_at": "2019-02-25T03:11:15-05:00", + "version": 2 + } + } + }, + "UpdateShiftRequest": { + "type": "object", + "description": "A request to update a `Shift` object.", + "x-release-status": "DEPRECATED", + "required": [ + "shift" + ], + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The updated `Shift` object." + } + }, + "example": { + "shift": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1500, + "currency": "USD" + }, + "tip_eligible": true, + "title": "Bartender" + } + } + } + }, + "UpdateShiftResponse": { + "type": "object", + "description": "The response to a request to update a `Shift`. The response contains\nthe updated `Shift` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "DEPRECATED", + "properties": { + "shift": { + "$ref": "#/components/schemas/Shift", + "description": "The updated `Shift`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "shift": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "created_at": "2019-02-28T00:39:02Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "employee_id": "ormj0jJJZ5OZIzxrZYJI", + "end_at": "2019-01-25T13:11:00-05:00", + "id": "K0YH4CV5462JB", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-28T00:42:41Z", + "version": 2, + "wage": { + "hourly_rate": { + "amount": 1500, + "currency": "USD" + }, + "job_id": "dZtrPh5GSDGugyXGByesVp51", + "tip_eligible": true, + "title": "Bartender" + } + } + } + }, + "UpdateSubscriptionRequest": { + "type": "object", + "description": "Defines input parameters in a request to the \n[UpdateSubscription](api-endpoint:Subscriptions-UpdateSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The subscription object containing the current version, and fields to update.\nUnset fields will be left at their current server values, and JSON `null` values will\nbe treated as a request to clear the relevant data.", + "nullable": true + } + }, + "example": { + "subscription": { + "canceled_date": null, + "card_id": "{NEW CARD ID}" + } + } + }, + "UpdateSubscriptionResponse": { + "type": "object", + "description": "Defines output parameters in a response from the\n[UpdateSubscription](api-endpoint:Subscriptions-UpdateSubscription) endpoint.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/Subscription", + "description": "The updated subscription." + } + }, + "example": { + "subscription": { + "card_id": "{NEW CARD ID}", + "charged_through_date": "2023-03-13", + "created_at": "2023-01-30T19:27:32Z", + "customer_id": "AM69AB81FT4479YH9HGWS1HZY8", + "id": "7217d8ca-1fee-4446-a9e5-8540b5d8c9bb", + "invoice_ids": [ + "inv:0-ChAPSfVYvNewckgf3x4iigN_ENMM", + "inv:0-ChBQaCCLfjcm9WEUBGxvuydJENMM" + ], + "location_id": "LPJKHYR7WFDKN", + "plan_variation_id": "XOUNEKCE6NSXQW5NTSQ73MMX", + "source": { + "name": "My Application" + }, + "start_date": "2023-01-30", + "status": "ACTIVE", + "timezone": "UTC", + "version": 3 + } + } + }, + "UpdateTeamMemberRequest": { + "type": "object", + "description": "Represents an update request for a `TeamMember` object.", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The team member fields to add, change, or clear. Fields can be cleared using a null value. To update\n`wage_setting.job_assignments`, you must provide the complete list of job assignments. If needed, call\n[ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values.", + "nullable": true + } + }, + "example": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "YSGH2WBKG94QZ", + "GA2Y9HSJ8KRYT" + ] + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "wage_setting": { + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 1200, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "pay_type": "HOURLY" + } + ] + } + } + } + }, + "UpdateTeamMemberResponse": { + "type": "object", + "description": "Represents a response from an update request containing the updated `TeamMember` object or error messages.", + "x-release-status": "PUBLIC", + "properties": { + "team_member": { + "$ref": "#/components/schemas/TeamMember", + "description": "The successfully updated `TeamMember` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "GA2Y9HSJ8KRYT", + "YSGH2WBKG94QZ" + ] + }, + "created_at": "2021-06-11T22:55:45Z", + "email_address": "joe_doe@example.com", + "family_name": "Doe", + "given_name": "Joe", + "id": "1yJlHapkseYnNPETIU1B", + "is_owner": false, + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "updated_at": "2021-06-15T17:38:05Z", + "wage_setting": { + "created_at": "2021-06-11T22:55:45Z", + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 1443, + "currency": "USD" + }, + "job_id": "FjS8x95cqHiMenw4f1NAUH4P", + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 1200, + "currency": "USD" + }, + "job_id": "VDNpRv8da51NU8qZFC5zDWpF", + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "1yJlHapkseYnNPETIU1B", + "updated_at": "2021-06-11T22:55:45Z", + "version": 1 + } + } + } + }, + "UpdateTimecardRequest": { + "type": "object", + "description": "A request to update a `Timecard` object.", + "x-release-status": "PUBLIC", + "required": [ + "timecard" + ], + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The updated `Timecard` object." + } + }, + "example": { + "idempotency_key": "HIDSNG5KS478L", + "timecard": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "version": 1, + "wage": { + "hourly_rate": { + "amount": 1500, + "currency": "USD" + }, + "tip_eligible": true, + "title": "Bartender" + } + } + } + }, + "UpdateTimecardResponse": { + "type": "object", + "description": "The response to a request to update a `Timecard`. The response contains\nthe updated `Timecard` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "timecard": { + "$ref": "#/components/schemas/Timecard", + "description": "The updated `Timecard`." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "timecard": { + "breaks": [ + { + "break_type_id": "REGS1EQR1TPZ5", + "end_at": "2019-01-25T06:16:00-05:00", + "expected_duration": "PT5M", + "id": "X7GAQYVVRRG6P", + "is_paid": true, + "name": "Tea Break", + "start_at": "2019-01-25T06:11:00-05:00" + } + ], + "created_at": "2019-02-28T00:39:02Z", + "declared_cash_tip_money": { + "amount": 500, + "currency": "USD" + }, + "end_at": "2019-01-25T13:11:00-05:00", + "id": "K0YH4CV5462JB", + "location_id": "PAA1RJZZKXBFG", + "start_at": "2019-01-25T03:11:00-05:00", + "status": "CLOSED", + "team_member_id": "ormj0jJJZ5OZIzxrZYJI", + "timezone": "America/New_York", + "updated_at": "2019-02-28T00:42:41Z", + "version": 2, + "wage": { + "hourly_rate": { + "amount": 1500, + "currency": "USD" + }, + "job_id": "dZtrPh5GSDGugyXGByesVp51", + "tip_eligible": true, + "title": "Bartender" + } + } + } + }, + "UpdateTransferOrderData": { + "type": "object", + "description": "Data model for updating a transfer order. All fields are optional.", + "x-release-status": "BETA", + "properties": { + "source_location_id": { + "type": "string", + "description": "The source [Location](entity:Location) that will send the items. Must be an active location\nin your Square account with sufficient inventory of the requested items.", + "minLength": 1, + "maxLength": 64, + "nullable": true + }, + "destination_location_id": { + "type": "string", + "description": "The destination [Location](entity:Location) that will receive the items. Must be an active location\nin your Square account.", + "minLength": 1, + "maxLength": 64, + "nullable": true + }, + "expected_at": { + "type": "string", + "description": "Expected transfer date in RFC 3339 format (e.g. \"2023-10-01T12:00:00Z\").", + "nullable": true + }, + "notes": { + "type": "string", + "description": "Optional notes about the transfer", + "maxLength": 4096, + "nullable": true + }, + "tracking_number": { + "type": "string", + "description": "Shipment tracking number", + "maxLength": 64, + "nullable": true + }, + "line_items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UpdateTransferOrderLineData" + }, + "description": "List of items being transferred", + "nullable": true + } + } + }, + "UpdateTransferOrderLineData": { + "type": "object", + "description": "Represents a line item update in a transfer order", + "x-release-status": "BETA", + "properties": { + "uid": { + "type": "string", + "description": "Line item id being updated. Required for updating/removing existing line items, but should not be set for new line items.", + "minLength": 1, + "maxLength": 64, + "nullable": true + }, + "item_variation_id": { + "type": "string", + "description": "Catalog item variation being transferred\n\nRequired for new line items, but otherwise is not updatable.", + "minLength": 1, + "maxLength": 64, + "nullable": true + }, + "quantity_ordered": { + "type": "string", + "description": "Total quantity ordered", + "minLength": 1, + "maxLength": 16, + "pattern": "^(0|[1-9]\\d*)(\\.\\d{1,4})?$", + "nullable": true + }, + "remove": { + "type": "boolean", + "description": "Flag to remove the line item during update. Must include `uid` in removal request", + "nullable": true + } + } + }, + "UpdateTransferOrderRequest": { + "type": "object", + "description": "Request to update a transfer order", + "x-release-status": "BETA", + "required": [ + "idempotency_key", + "transfer_order" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies this UpdateTransferOrder request. Keys must contain only alphanumeric characters, dashes and underscores", + "minLength": 1 + }, + "transfer_order": { + "$ref": "#/components/schemas/UpdateTransferOrderData", + "description": "The transfer order updates to apply" + }, + "version": { + "type": "integer", + "description": "Version for optimistic concurrency", + "format": "int64" + } + }, + "example": { + "idempotency_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479", + "transfer_order": { + "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_101", + "expected_at": "2025-11-10T08:00:00Z", + "line_items": [ + { + "quantity_ordered": "7", + "uid": "1" + }, + { + "item_variation_id": "EXAMPLE_NEW_ITEM_VARIATION_ID_003", + "quantity_ordered": "2" + }, + { + "remove": true, + "uid": "2" + } + ], + "notes": "Updated: Priority transfer due to low stock at destination", + "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_789", + "tracking_number": "TRACK987654321" + }, + "transfer_order_id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "version": 1753109537351 + } + }, + "UpdateTransferOrderResponse": { + "type": "object", + "description": "Response for updating a transfer order", + "x-release-status": "BETA", + "properties": { + "transfer_order": { + "$ref": "#/components/schemas/TransferOrder", + "description": "The updated transfer order" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request" + } + }, + "example": { + "transfer_order": { + "created_at": "2025-01-15T10:30:00Z", + "created_by_team_member_id": "EXAMPLE_TEAM_MEMBER_ID_789", + "destination_location_id": "EXAMPLE_DEST_LOCATION_ID_101", + "expected_at": "2025-11-10T08:00:00Z", + "id": "EXAMPLE_TRANSFER_ORDER_ID_123", + "line_items": [ + { + "item_variation_id": "EXAMPLE_ITEM_VARIATION_ID_001", + "quantity_canceled": "0", + "quantity_damaged": "0", + "quantity_ordered": "7", + "quantity_pending": "7", + "quantity_received": "0", + "uid": "1" + }, + { + "item_variation_id": "EXAMPLE_NEW_ITEM_VARIATION_ID_003", + "quantity_canceled": "0", + "quantity_damaged": "0", + "quantity_ordered": "2", + "quantity_pending": "2", + "quantity_received": "0", + "uid": "3" + } + ], + "notes": "Updated: Priority transfer due to low stock at destination", + "source_location_id": "EXAMPLE_SOURCE_LOCATION_ID_789", + "status": "DRAFT", + "tracking_number": "TRACK987654321", + "updated_at": "2025-01-15T11:15:00Z", + "version": 1753122900456 + } + } + }, + "UpdateVendorRequest": { + "type": "object", + "description": "Represents an input to a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor).", + "x-release-status": "BETA", + "required": [ + "vendor" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A client-supplied, universally unique identifier (UUID) for the\nrequest.\n\nSee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the\n[API Development 101](https://developer.squareup.com/docs/buildbasics) section for more\ninformation.", + "maxLength": 128, + "nullable": true + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The specified [Vendor](entity:Vendor) to be updated." + } + }, + "example": { + "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", + "vendor": { + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Jack's Chicken Shack", + "status": "ACTIVE", + "version": 1 + } + } + }, + "UpdateVendorResponse": { + "type": "object", + "description": "Represents an output from a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor).", + "x-release-status": "BETA", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Errors occurred when the request fails." + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The [Vendor](entity:Vendor) that has been updated." + } + }, + "example": { + "vendor": { + "account_number": "4025391", + "address": { + "address_line_1": "505 Electric Ave", + "address_line_2": "Suite 600", + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "INV_VC_FMCYHBWT1TPL8MFH52PBMEN92A", + "name": "Joe Burrow", + "ordinal": 0, + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T10:21:54.859Z", + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Jack's Chicken Shack", + "status": "ACTIVE", + "updated_at": "2022-03-16T20:21:54.859Z", + "version": 2 + } + } + }, + "UpdateWageSettingRequest": { + "type": "object", + "description": "Represents an update request for the `WageSetting` object describing a `TeamMember`.", + "x-release-status": "PUBLIC", + "required": [ + "wage_setting" + ], + "properties": { + "wage_setting": { + "$ref": "#/components/schemas/WageSetting", + "description": "The complete `WageSetting` object. For all job assignments, specify one of the following:\n- `job_id` (recommended) - If needed, call [ListJobs](api-endpoint:Team-ListJobs) to get a list of all jobs.\nRequires Square API version 2024-12-18 or later.\n- `job_title` - Use the exact, case-sensitive spelling of an existing title unless you want to create a new job.\nThis value is ignored if `job_id` is also provided." + } + }, + "example": { + "wage_setting": { + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ] + } + } + }, + "UpdateWageSettingResponse": { + "type": "object", + "description": "Represents a response from an update request containing the updated `WageSetting` object\nor error messages.", + "x-release-status": "PUBLIC", + "properties": { + "wage_setting": { + "$ref": "#/components/schemas/WageSetting", + "description": "The successfully updated `WageSetting` object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "The errors that occurred during the request." + } + }, + "example": { + "wage_setting": { + "created_at": "2019-07-10T17:26:48+00:00", + "is_overtime_exempt": true, + "job_assignments": [ + { + "annual_rate": { + "amount": 3000000, + "currency": "USD" + }, + "hourly_rate": { + "amount": 1443, + "currency": "USD" + }, + "job_title": "Manager", + "pay_type": "SALARY", + "weekly_hours": 40 + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_title": "Cashier", + "pay_type": "HOURLY" + } + ], + "team_member_id": "-3oZQKPKVk6gUXU_V5Qa", + "updated_at": "2020-06-11T23:12:04+00:00", + "version": 1 + } + } + }, + "UpdateWebhookSubscriptionRequest": { + "type": "object", + "description": "Updates a [Subscription](entity:WebhookSubscription).", + "x-release-status": "PUBLIC", + "properties": { + "subscription": { + "$ref": "#/components/schemas/WebhookSubscription", + "description": "The [Subscription](entity:WebhookSubscription) to update.", + "nullable": true + } + }, + "example": { + "subscription": { + "enabled": false, + "name": "Updated Example Webhook Subscription" + } + } + }, + "UpdateWebhookSubscriptionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [UpdateWebhookSubscription](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscription) endpoint.\n\nNote: If there are errors processing the request, the [Subscription](entity:WebhookSubscription) is not\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "subscription": { + "$ref": "#/components/schemas/WebhookSubscription", + "description": "The updated [Subscription](entity:WebhookSubscription)." + } + }, + "example": { + "subscription": { + "api_version": "2021-12-15", + "created_at": "2022-01-10 23:29:48 +0000 UTC", + "enabled": false, + "event_types": [ + "payment.created", + "payment.updated" + ], + "id": "wbhk_b35f6b3145074cf9ad513610786c19d5", + "name": "Updated Example Webhook Subscription", + "notification_url": "https://example-webhook-url.com", + "updated_at": "2022-01-10 23:45:51 +0000 UTC" + } + } + }, + "UpdateWebhookSubscriptionSignatureKeyRequest": { + "type": "object", + "description": "Updates a [Subscription](entity:WebhookSubscription) by replacing the existing signature key with a new one.", + "x-release-status": "PUBLIC", + "properties": { + "idempotency_key": { + "type": "string", + "description": "A unique string that identifies the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) request.", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "idempotency_key": "ed80ae6b-0654-473b-bbab-a39aee89a60d" + } + }, + "UpdateWebhookSubscriptionSignatureKeyResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) endpoint.\n\nNote: If there are errors processing the request, the [Subscription](entity:WebhookSubscription) is not\npresent.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Information on errors encountered during the request." + }, + "signature_key": { + "type": "string", + "description": "The new Square-generated signature key used to validate the origin of the webhook event.", + "readOnly": true + } + }, + "example": { + "signature_key": "1k9bIJKCeTmSQwyagtNRLg" + } + }, + "UpdateWorkweekConfigRequest": { + "type": "object", + "description": "A request to update a `WorkweekConfig` object.", + "x-release-status": "PUBLIC", + "required": [ + "workweek_config" + ], + "properties": { + "workweek_config": { + "$ref": "#/components/schemas/WorkweekConfig", + "description": "The updated `WorkweekConfig` object." + } + }, + "example": { + "workweek_config": { + "start_of_day_local_time": "10:00", + "start_of_week": "MON", + "version": 10 + } + } + }, + "UpdateWorkweekConfigResponse": { + "type": "object", + "description": "The response to a request to update a `WorkweekConfig` object. The response contains\nthe updated `WorkweekConfig` object and might contain a set of `Error` objects if\nthe request resulted in errors.", + "x-release-status": "PUBLIC", + "properties": { + "workweek_config": { + "$ref": "#/components/schemas/WorkweekConfig", + "description": "The response object." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "workweek_config": { + "created_at": "2016-02-04T00:58:24Z", + "id": "FY4VCAQN700GM", + "start_of_day_local_time": "10:00", + "start_of_week": "MON", + "updated_at": "2019-02-28T01:04:35Z", + "version": 11 + } + } + }, + "UpsertBookingCustomAttributeRequest": { + "type": "object", + "description": "Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) request.", + "x-release-status": "PUBLIC", + "required": [ + "custom_attribute" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Value data types](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for an update operation, include this optional field and specify the current version\nof the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + } + }, + "UpsertBookingCustomAttributeResponse": { + "type": "object", + "description": "Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-11-16T15:50:27Z", + "key": "favoriteShampoo", + "updated_at": "2022-11-16T15:50:27Z", + "value": "Spring Fresh", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [] + } + }, + "UpsertCatalogObjectRequest": { + "type": "object", + "x-release-status": "PUBLIC", + "required": [ + "idempotency_key", + "object" + ], + "properties": { + "idempotency_key": { + "type": "string", + "description": "A value you specify that uniquely identifies this\nrequest among all your requests. A common way to create\na valid idempotency key is to use a Universally unique\nidentifier (UUID).\n\nIf you're unsure whether a particular request was successful,\nyou can reattempt it with the same idempotency key without\nworrying about creating duplicate objects.\n\nSee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information.", + "minLength": 1, + "maxLength": 128 + }, + "object": { + "$ref": "#/components/schemas/CatalogObject", + "description": "A CatalogObject to be created or updated.\n\n- For updates, the object must be active (the `is_deleted` field is not `true`).\n- For creates, the object ID must start with `#`. The provided ID is replaced with a server-generated ID." + } + }, + "example": { + "idempotency_key": "af3d1afc-7212-4300-b463-0bfc5314a5ae", + "object": { + "id": "#Cocoa", + "item_data": { + "abbreviation": "Ch", + "description_html": "\u003cp\u003e\u003cstrong\u003eHot\u003c/strong\u003e Chocolate\u003c/p\u003e", + "name": "Cocoa", + "variations": [ + { + "id": "#Small", + "item_variation_data": { + "item_id": "#Cocoa", + "name": "Small", + "pricing_type": "VARIABLE_PRICING" + }, + "type": "ITEM_VARIATION" + }, + { + "id": "#Large", + "item_variation_data": { + "item_id": "#Cocoa", + "name": "Large", + "price_money": { + "amount": 400, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING" + }, + "type": "ITEM_VARIATION" + } + ] + }, + "type": "ITEM" + } + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.csharp", + "java": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.java", + "javascript": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.javascript", + "php": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.php", + "python": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.python", + "ruby": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectRequest.ruby" + } + }, + "UpsertCatalogObjectResponse": { + "type": "object", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "catalog_object": { + "$ref": "#/components/schemas/CatalogObject", + "description": "The successfully created or updated CatalogObject." + }, + "id_mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CatalogIdMapping" + }, + "description": "The mapping between client and server IDs for this upsert." + } + }, + "example": { + "catalog_object": { + "id": "R2TA2FOBUGCJZNIWJSOSNAI4", + "is_deleted": false, + "item_data": { + "abbreviation": "Ch", + "description": "Hot Chocolate", + "description_html": "\u003cp\u003e\u003cstrong\u003eHot\u003c/strong\u003e Chocolate\u003c/p\u003e", + "description_plaintext": "Hot Chocolate", + "name": "Cocoa", + "product_type": "REGULAR", + "variations": [ + { + "id": "QRT53UP4LITLWGOGBZCUWP63", + "is_deleted": false, + "item_variation_data": { + "item_id": "R2TA2FOBUGCJZNIWJSOSNAI4", + "name": "Small", + "ordinal": 0, + "pricing_type": "VARIABLE_PRICING", + "stockable": true + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2021-06-14T15:51:39.021Z", + "version": 1623685899021 + }, + { + "id": "NS77DKEIQ3AEQTCP727DSA7U", + "is_deleted": false, + "item_variation_data": { + "item_id": "R2TA2FOBUGCJZNIWJSOSNAI4", + "name": "Large", + "ordinal": 1, + "price_money": { + "amount": 400, + "currency": "USD" + }, + "pricing_type": "FIXED_PRICING", + "stockable": true + }, + "present_at_all_locations": true, + "type": "ITEM_VARIATION", + "updated_at": "2021-06-14T15:51:39.021Z", + "version": 1623685899021 + } + ] + }, + "present_at_all_locations": true, + "type": "ITEM", + "updated_at": "2021-06-14T15:51:39.021Z", + "version": 1623685899021 + }, + "id_mappings": [ + { + "client_object_id": "#Cocoa", + "object_id": "R2TA2FOBUGCJZNIWJSOSNAI4" + }, + { + "client_object_id": "#Small", + "object_id": "QRT53UP4LITLWGOGBZCUWP63" + }, + { + "client_object_id": "#Large", + "object_id": "NS77DKEIQ3AEQTCP727DSA7U" + } + ] + }, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.csharp", + "java": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.java", + "javascript": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.javascript", + "php": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.php", + "python": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.python", + "ruby": "/sdk_samples/Catalog/UpsertCatalogObject/UpsertCatalogObjectResponse.ruby" + } + }, + "UpsertCustomerCustomAttributeRequest": { + "type": "object", + "description": "Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) request.", + "x-release-status": "PUBLIC", + "x-params-example": "?customer_id=Z57QXKM2FGXEQDV42W8RBZY7BR\u0026key=favoritemovie", + "required": [ + "custom_attribute" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n\n- `value`. This value must conform to the `schema` specified by the definition. \nFor more information, see [Value data types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for an update operation, include this optional field and specify the current version\nof the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute": { + "value": "Dune" + } + } + }, + "UpsertCustomerCustomAttributeResponse": { + "type": "object", + "description": "Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "PUBLIC", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-04-26T15:50:27Z", + "key": "favoritemovie", + "updated_at": "2022-04-26T15:50:27Z", + "value": "Dune", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpsertLocationCustomAttributeRequest": { + "type": "object", + "description": "Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) request.", + "x-release-status": "BETA", + "x-params-example": "?location_id=L0TBCBTB7P8RQ\u0026key=bestseller", + "required": [ + "custom_attribute" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol for an update operation, include the current version of the custom attribute.\nIf this is not important for your application, version can be set to -1." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute": { + "value": "hot cocoa" + } + } + }, + "UpsertLocationCustomAttributeResponse": { + "type": "object", + "description": "Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-01-09T19:02:58.647Z", + "key": "bestseller", + "updated_at": "2023-01-09T19:21:04.551Z", + "value": "hot cocoa", + "version": 2, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "UpsertMerchantCustomAttributeRequest": { + "type": "object", + "description": "Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) request.", + "x-release-status": "BETA", + "x-params-example": "?merchant_id=DM7VKY8Q63GNP\u0026key=alternative_seller_name", + "required": [ + "custom_attribute" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n- `value`. This value must conform to the `schema` specified by the definition.\nFor more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types).\n- The version field must match the current version of the custom attribute definition to enable\n[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\nIf this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. For more information,\nsee [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute": { + "value": "Ultimate Sneaker Store" + } + } + }, + "UpsertMerchantCustomAttributeResponse": { + "type": "object", + "description": "Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) response.\nEither `custom_attribute_definition` or `errors` is present in the response.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The new or updated custom attribute." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2023-05-06T19:02:58.647Z", + "key": "alternative_seller_name", + "updated_at": "2023-05-06T19:21:04.551Z", + "value": "Ultimate Sneaker Store", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + } + } + }, + "UpsertOrderCustomAttributeRequest": { + "type": "object", + "description": "Represents an upsert request for an order custom attribute.", + "x-release-status": "BETA", + "required": [ + "custom_attribute" + ], + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The custom attribute to create or update, with the following fields:\n\n- `value`. This value must conform to the `schema` specified by the definition. \nFor more information, see [Value data types](https://developer.squareup.com/docs/customer-custom-attributes-api/custom-attributes#value-data-types).\n\n- `version`. To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, include this optional field and specify the current version of the custom attribute." + }, + "idempotency_key": { + "type": "string", + "description": "A unique identifier for this request, used to ensure idempotency. \nFor more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).", + "minLength": 1, + "maxLength": 45, + "nullable": true + } + }, + "example": { + "custom_attribute": { + "key": "table-number", + "value": "42", + "version": 1 + } + } + }, + "UpsertOrderCustomAttributeResponse": { + "type": "object", + "description": "Represents a response from upserting order custom attribute definitions.", + "x-release-status": "BETA", + "properties": { + "custom_attribute": { + "$ref": "#/components/schemas/CustomAttribute", + "description": "The order custom attribute that was created or modified." + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": { + "custom_attribute": { + "created_at": "2022-10-06T20:41:22.673Z", + "key": "table-number", + "updated_at": "2022-10-06T20:41:22.673Z", + "value": "42", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + } + }, + "UpsertSnippetRequest": { + "type": "object", + "description": "Represents an `UpsertSnippet` request.", + "x-release-status": "PUBLIC", + "required": [ + "snippet" + ], + "properties": { + "snippet": { + "$ref": "#/components/schemas/Snippet", + "description": "The snippet for the site." + } + }, + "example": { + "snippet": { + "content": "\u003cscript\u003evar js = 1;\u003c/script\u003e" + } + } + }, + "UpsertSnippetResponse": { + "type": "object", + "description": "Represents an `UpsertSnippet` response. The response can include either `snippet` or `errors`.", + "x-release-status": "PUBLIC", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + }, + "snippet": { + "$ref": "#/components/schemas/Snippet", + "description": "The new or updated snippet." + } + }, + "example": { + "snippet": { + "content": "\u003cscript\u003evar js = 1;\u003c/script\u003e", + "created_at": "2021-03-11T25:40:09.000000Z", + "id": "snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7", + "site_id": "site_278075276488921835", + "updated_at": "2021-03-11T25:40:09.000000Z" + } + } + }, + "V1Money": { + "type": "object", + "x-release-status": "DEPRECATED", + "properties": { + "amount": { + "type": "integer", + "description": "Amount in the lowest denominated value of this Currency. E.g. in USD\nthese are cents, in JPY they are Yen (which do not have a 'cent' concept).", + "nullable": true + }, + "currency_code": { + "$ref": "#/components/schemas/Currency", + "description": "\nSee [Currency](#type-currency) for possible values", + "nullable": true + } + } + }, + "V1Order": { + "type": "object", + "description": "V1Order", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The order's unique identifier." + }, + "buyer_email": { + "type": "string", + "description": "The email address of the order's buyer.", + "nullable": true + }, + "recipient_name": { + "type": "string", + "description": "The name of the order's buyer.", + "nullable": true + }, + "recipient_phone_number": { + "type": "string", + "description": "The phone number to use for the order's delivery.", + "nullable": true + }, + "state": { + "$ref": "#/components/schemas/V1OrderState", + "description": "Whether the tax is an ADDITIVE tax or an INCLUSIVE tax.\nSee [V1OrderState](#type-v1orderstate) for possible values", + "nullable": true + }, + "shipping_address": { + "$ref": "#/components/schemas/Address", + "description": "The address to ship the order to.", + "nullable": true + }, + "subtotal_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The amount of all items purchased in the order, before taxes and shipping.", + "nullable": true + }, + "total_shipping_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The shipping cost for the order.", + "nullable": true + }, + "total_tax_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The total of all taxes applied to the order.", + "nullable": true + }, + "total_price_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The total cost of the order.", + "nullable": true + }, + "total_discount_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The total of all discounts applied to the order.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the order was created, in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "description": "The time when the order was last modified, in ISO 8601 format." + }, + "expires_at": { + "type": "string", + "description": "The time when the order expires if no action is taken, in ISO 8601 format.", + "nullable": true + }, + "payment_id": { + "type": "string", + "description": "The unique identifier of the payment associated with the order.", + "nullable": true + }, + "buyer_note": { + "type": "string", + "description": "A note provided by the buyer when the order was created, if any.", + "nullable": true + }, + "completed_note": { + "type": "string", + "description": "A note provided by the merchant when the order's state was set to COMPLETED, if any", + "nullable": true + }, + "refunded_note": { + "type": "string", + "description": "A note provided by the merchant when the order's state was set to REFUNDED, if any.", + "nullable": true + }, + "canceled_note": { + "type": "string", + "description": "A note provided by the merchant when the order's state was set to CANCELED, if any.", + "nullable": true + }, + "tender": { + "$ref": "#/components/schemas/V1Tender", + "description": "The tender used to pay for the order.", + "nullable": true + }, + "order_history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V1OrderHistoryEntry" + }, + "description": "The history of actions associated with the order.", + "nullable": true + }, + "promo_code": { + "type": "string", + "description": "The promo code provided by the buyer, if any.", + "nullable": true + }, + "btc_receive_address": { + "type": "string", + "description": "For Bitcoin transactions, the address that the buyer sent Bitcoin to.", + "nullable": true + }, + "btc_price_satoshi": { + "type": "number", + "description": "For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 BTC).", + "nullable": true + } + } + }, + "V1OrderHistoryEntry": { + "type": "object", + "description": "V1OrderHistoryEntry", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "properties": { + "action": { + "$ref": "#/components/schemas/V1OrderHistoryEntryAction", + "description": "The type of action performed on the order.\nSee [V1OrderHistoryEntryAction](#type-v1orderhistoryentryaction) for possible values", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time when the action was performed, in ISO 8601 format." + } + } + }, + "V1OrderHistoryEntryAction": { + "type": "string", + "enum": [ + "ORDER_PLACED", + "DECLINED", + "PAYMENT_RECEIVED", + "CANCELED", + "COMPLETED", + "REFUNDED", + "EXPIRED" + ], + "x-enum-elements": [ + { + "name": "ORDER_PLACED", + "description": "" + }, + { + "name": "DECLINED", + "description": "" + }, + { + "name": "PAYMENT_RECEIVED", + "description": "" + }, + { + "name": "CANCELED", + "description": "" + }, + { + "name": "COMPLETED", + "description": "" + }, + { + "name": "REFUNDED", + "description": "" + }, + { + "name": "EXPIRED", + "description": "" + } + ], + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY" + }, + "V1OrderState": { + "type": "string", + "enum": [ + "PENDING", + "OPEN", + "COMPLETED", + "CANCELED", + "REFUNDED", + "REJECTED" + ], + "x-enum-elements": [ + { + "name": "PENDING", + "description": "" + }, + { + "name": "OPEN", + "description": "" + }, + { + "name": "COMPLETED", + "description": "" + }, + { + "name": "CANCELED", + "description": "" + }, + { + "name": "REFUNDED", + "description": "" + }, + { + "name": "REJECTED", + "description": "" + } + ], + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY" + }, + "V1Tender": { + "type": "object", + "description": "A tender represents a discrete monetary exchange. Square represents this\nexchange as a money object with a specific currency and amount, where the\namount is given in the smallest denomination of the given currency.\n\nSquare POS can accept more than one form of tender for a single payment (such\nas by splitting a bill between a credit card and a gift card). The `tender`\nfield of the Payment object lists all forms of tender used for the payment.\n\nSplit tender payments behave slightly differently from single tender payments:\n\nThe receipt_url for a split tender corresponds only to the first tender listed\nin the tender field. To get the receipt URLs for the remaining tenders, use\nthe receipt_url fields of the corresponding Tender objects.\n\n*A note on gift cards**: when a customer purchases a Square gift card from a\nmerchant, the merchant receives the full amount of the gift card in the\nassociated payment.\n\nWhen that gift card is used as a tender, the balance of the gift card is\nreduced and the merchant receives no funds. A `Tender` object with a type of\n`SQUARE_GIFT_CARD` indicates a gift card was used for some or all of the\nassociated payment.", + "x-release-status": "DEPRECATED", + "properties": { + "id": { + "type": "string", + "description": "The tender's unique ID." + }, + "type": { + "$ref": "#/components/schemas/V1TenderType", + "description": "The type of tender.\nSee [V1TenderType](#type-v1tendertype) for possible values", + "nullable": true + }, + "name": { + "type": "string", + "description": "A human-readable description of the tender.", + "nullable": true + }, + "employee_id": { + "type": "string", + "description": "The ID of the employee that processed the tender.", + "nullable": true + }, + "receipt_url": { + "type": "string", + "description": "The URL of the receipt for the tender.", + "nullable": true + }, + "card_brand": { + "$ref": "#/components/schemas/V1TenderCardBrand", + "description": "The brand of credit card provided.\nSee [V1TenderCardBrand](#type-v1tendercardbrand) for possible values", + "nullable": true + }, + "pan_suffix": { + "type": "string", + "description": "The last four digits of the provided credit card's account number.", + "nullable": true + }, + "entry_method": { + "$ref": "#/components/schemas/V1TenderEntryMethod", + "description": "The tender's unique ID.\nSee [V1TenderEntryMethod](#type-v1tenderentrymethod) for possible values", + "nullable": true + }, + "payment_note": { + "type": "string", + "description": "Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER.", + "nullable": true + }, + "total_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The total amount of money provided in this form of tender.", + "nullable": true + }, + "tendered_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The amount of total_money applied to the payment.", + "nullable": true + }, + "tendered_at": { + "type": "string", + "description": "The time when the tender was created, in ISO 8601 format.", + "nullable": true + }, + "settled_at": { + "type": "string", + "description": "The time when the tender was settled, in ISO 8601 format.", + "nullable": true + }, + "change_back_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The amount of total_money returned to the buyer as change.", + "nullable": true + }, + "refunded_money": { + "$ref": "#/components/schemas/V1Money", + "description": "The total of all refunds applied to this tender. This amount is always negative or zero.", + "nullable": true + }, + "is_exchange": { + "type": "boolean", + "description": "Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the tender represents the value of goods returned in an exchange not the actual money paid. The exchange value reduces the tender amounts needed to pay for items purchased in the exchange.", + "nullable": true + } + } + }, + "V1TenderCardBrand": { + "type": "string", + "enum": [ + "OTHER_BRAND", + "VISA", + "MASTER_CARD", + "AMERICAN_EXPRESS", + "DISCOVER", + "DISCOVER_DINERS", + "JCB", + "CHINA_UNIONPAY", + "SQUARE_GIFT_CARD" + ], + "x-enum-elements": [ + { + "name": "OTHER_BRAND", + "description": "" + }, + { + "name": "VISA", + "description": "" + }, + { + "name": "MASTER_CARD", + "description": "" + }, + { + "name": "AMERICAN_EXPRESS", + "description": "" + }, + { + "name": "DISCOVER", + "description": "" + }, + { + "name": "DISCOVER_DINERS", + "description": "" + }, + { + "name": "JCB", + "description": "" + }, + { + "name": "CHINA_UNIONPAY", + "description": "" + }, + { + "name": "SQUARE_GIFT_CARD", + "description": "" + } + ], + "description": "The brand of a credit card.", + "x-release-status": "DEPRECATED" + }, + "V1TenderEntryMethod": { + "type": "string", + "enum": [ + "MANUAL", + "SCANNED", + "SQUARE_CASH", + "SQUARE_WALLET", + "SWIPED", + "WEB_FORM", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "MANUAL", + "description": "" + }, + { + "name": "SCANNED", + "description": "" + }, + { + "name": "SQUARE_CASH", + "description": "" + }, + { + "name": "SQUARE_WALLET", + "description": "" + }, + { + "name": "SWIPED", + "description": "" + }, + { + "name": "WEB_FORM", + "description": "" + }, + { + "name": "OTHER", + "description": "" + } + ], + "x-release-status": "DEPRECATED" + }, + "V1TenderType": { + "type": "string", + "enum": [ + "CREDIT_CARD", + "CASH", + "THIRD_PARTY_CARD", + "NO_SALE", + "SQUARE_WALLET", + "SQUARE_GIFT_CARD", + "UNKNOWN", + "OTHER" + ], + "x-enum-elements": [ + { + "name": "CREDIT_CARD", + "description": "" + }, + { + "name": "CASH", + "description": "" + }, + { + "name": "THIRD_PARTY_CARD", + "description": "" + }, + { + "name": "NO_SALE", + "description": "" + }, + { + "name": "SQUARE_WALLET", + "description": "" + }, + { + "name": "SQUARE_GIFT_CARD", + "description": "" + }, + { + "name": "UNKNOWN", + "description": "" + }, + { + "name": "OTHER", + "description": "" + } + ], + "x-release-status": "DEPRECATED" + }, + "V1UpdateOrderRequest": { + "type": "object", + "description": "V1UpdateOrderRequest", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "required": [ + "action" + ], + "properties": { + "action": { + "$ref": "#/components/schemas/V1UpdateOrderRequestAction", + "description": "The action to perform on the order (COMPLETE, CANCEL, or REFUND).\nSee [V1UpdateOrderRequestAction](#type-v1updateorderrequestaction) for possible values" + }, + "shipped_tracking_number": { + "type": "string", + "description": "The tracking number of the shipment associated with the order. Only valid if action is COMPLETE.", + "nullable": true + }, + "completed_note": { + "type": "string", + "description": "A merchant-specified note about the completion of the order. Only valid if action is COMPLETE.", + "nullable": true + }, + "refunded_note": { + "type": "string", + "description": "A merchant-specified note about the refunding of the order. Only valid if action is REFUND.", + "nullable": true + }, + "canceled_note": { + "type": "string", + "description": "A merchant-specified note about the canceling of the order. Only valid if action is CANCEL.", + "nullable": true + } + } + }, + "V1UpdateOrderRequestAction": { + "type": "string", + "enum": [ + "COMPLETE", + "CANCEL", + "REFUND" + ], + "x-enum-elements": [ + { + "name": "COMPLETE", + "description": "" + }, + { + "name": "CANCEL", + "description": "" + }, + { + "name": "REFUND", + "description": "" + } + ], + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY" + }, + "Vendor": { + "type": "object", + "description": "Represents a supplier to a seller.", + "x-release-status": "BETA", + "properties": { + "id": { + "type": "string", + "description": "A unique Square-generated ID for the [Vendor](entity:Vendor).\nThis field is required when attempting to update a [Vendor](entity:Vendor).", + "maxLength": 100 + }, + "created_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when the\n[Vendor](entity:Vendor) was created.", + "maxLength": 34, + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "An RFC 3339-formatted timestamp that indicates when the\n[Vendor](entity:Vendor) was last updated.", + "maxLength": 34, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the [Vendor](entity:Vendor).\nThis field is required when attempting to create or update a [Vendor](entity:Vendor).", + "maxLength": 100, + "nullable": true + }, + "address": { + "$ref": "#/components/schemas/Address", + "description": "The address of the [Vendor](entity:Vendor).", + "nullable": true + }, + "contacts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VendorContact" + }, + "description": "The contacts of the [Vendor](entity:Vendor).", + "nullable": true + }, + "account_number": { + "type": "string", + "description": "The account number of the [Vendor](entity:Vendor).", + "maxLength": 100, + "nullable": true + }, + "note": { + "type": "string", + "description": "A note detailing information about the [Vendor](entity:Vendor).", + "maxLength": 4096, + "nullable": true + }, + "version": { + "type": "integer", + "description": "The version of the [Vendor](entity:Vendor)." + }, + "status": { + "$ref": "#/components/schemas/VendorStatus", + "description": "The status of the [Vendor](entity:Vendor).\nSee [Status](#type-status) for possible values", + "nullable": true + } + } + }, + "VendorContact": { + "type": "object", + "description": "Represents a contact of a [Vendor](entity:Vendor).", + "x-release-status": "BETA", + "required": [ + "ordinal" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique Square-generated ID for the [VendorContact](entity:VendorContact).\nThis field is required when attempting to update a [VendorContact](entity:VendorContact).", + "maxLength": 100 + }, + "name": { + "type": "string", + "description": "The name of the [VendorContact](entity:VendorContact).\nThis field is required when attempting to create a [Vendor](entity:Vendor).", + "maxLength": 255, + "nullable": true + }, + "email_address": { + "type": "string", + "description": "The email address of the [VendorContact](entity:VendorContact).", + "maxLength": 255, + "nullable": true + }, + "phone_number": { + "type": "string", + "description": "The phone number of the [VendorContact](entity:VendorContact).", + "maxLength": 255, + "nullable": true + }, + "removed": { + "type": "boolean", + "description": "The state of the [VendorContact](entity:VendorContact).", + "nullable": true + }, + "ordinal": { + "type": "integer", + "description": "The ordinal of the [VendorContact](entity:VendorContact)." + } + } + }, + "VendorCreatedEvent": { + "type": "object", + "description": "Published when a [Vendor](entity:Vendor) is created.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of a seller associated with this event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of a location associated with the event, if the event is associated with the location of the seller.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"vendor.created\".`", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for this event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The RFC 3339-formatted time when the underlying event data object is created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/VendorCreatedEventData", + "description": "The data associated with this event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-03-16T01:04:37.308555597Z", + "data": { + "id": "5b041563-c3fa-4989-baaf-dec90e81de0b", + "object": { + "operation": "CREATED", + "vendor": { + "address": { + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "W43ANBJLR5UAV7WT", + "name": "Joe Burrow", + "ordinal": 0, + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T01:04:12.581Z", + "id": "BXIDSDOUIU34VY2V", + "name": "A vendor", + "status": "ACTIVE", + "updated_at": "2022-03-16T01:04:12.581Z", + "version": 1 + } + }, + "type": "vendor" + }, + "event_id": "4edd919d-ed19-492d-bcb0-1a1ef65dda1a", + "merchant_id": "ETCE****QDYP", + "type": "vendor.created" + }, + "x-webhook": { + "event": "vendor.created", + "scopes": [ + "VENDOR_READ" + ] + }, + "x-api": "#/components/x-apis/Vendors", + "x-since": "2022-03-16" + }, + "VendorCreatedEventData": { + "type": "object", + "description": "Defines the `vendor.created` event data structure.", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `vendor`", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object." + }, + "object": { + "$ref": "#/components/schemas/VendorCreatedEventObject", + "description": "An object containing the created vendor.", + "nullable": true + } + } + }, + "VendorCreatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "operation": { + "$ref": "#/components/schemas/VendorCreatedEventObjectOperation", + "description": "The operation on the vendor that caused the event to be published. The value is `CREATED`.\nSee [Operation](#type-operation) for possible values", + "nullable": true + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The created vendor as the result of the specified operation.", + "nullable": true + } + } + }, + "VendorCreatedEventObjectOperation": { + "type": "string", + "enum": [ + "CREATED" + ], + "x-enum-elements": [ + { + "name": "CREATED", + "description": "" + } + ], + "description": "The operation that can be performed against a vendor to cause the event to be published.", + "x-release-status": "BETA" + }, + "VendorStatus": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "x-enum-elements": [ + { + "name": "ACTIVE", + "description": "Vendor is active and can receive purchase orders." + }, + { + "name": "INACTIVE", + "description": "Vendor is inactive and cannot receive purchase orders." + } + ], + "description": "The status of the [Vendor](entity:Vendor),\nwhether a [Vendor](entity:Vendor) is active or inactive.", + "x-release-status": "BETA" + }, + "VendorUpdatedEvent": { + "type": "object", + "description": "Published when a [Vendor](entity:Vendor) is updated.", + "x-release-status": "BETA", + "properties": { + "merchant_id": { + "type": "string", + "description": "The ID of a seller associated with this event.", + "nullable": true + }, + "location_id": { + "type": "string", + "description": "The ID of a seller location associated with this event, if the event is associated with the location.", + "nullable": true + }, + "type": { + "type": "string", + "description": "The type of this event. The value is `\"vendor.updated\".`", + "nullable": true + }, + "event_id": { + "type": "string", + "description": "A unique ID for this webhoook event.", + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The RFC 3339-formatted time when the underlying event data object is created.", + "readOnly": true + }, + "data": { + "$ref": "#/components/schemas/VendorUpdatedEventData", + "description": "The data associated with this event.", + "nullable": true + } + }, + "example": { + "created_at": "2022-03-16T01:15:35.780283073Z", + "data": { + "id": "1e8d9885-21dc-41b9-8a8f-6ccf64da5462", + "object": { + "operation": "UPDATED", + "vendor": { + "address": { + "administrative_district_level_1": "NY", + "country": "US", + "locality": "New York", + "postal_code": "10003" + }, + "contacts": [ + { + "email_address": "joe@joesfreshseafood.com", + "id": "W43ANBJLR5UAV7WT", + "name": "Joe Burrow", + "ordinal": 0, + "phone_number": "1-212-555-4250" + } + ], + "created_at": "2022-03-16T01:04:12.581Z", + "id": "BXIDSDOUIU34VY2V", + "name": "Macro Brewing", + "note": "Preferred beer supplier", + "status": "ACTIVE", + "updated_at": "2022-03-16T01:15:35.774Z", + "version": 2 + } + }, + "type": "vendor" + }, + "event_id": "1ae8cc43-bf73-48f6-a767-90bdfa197421", + "merchant_id": "ETCE****QDYP", + "type": "vendor.updated" + }, + "x-webhook": { + "event": "vendor.updated", + "scopes": [ + "VENDOR_READ" + ] + }, + "x-api": "#/components/x-apis/Vendors", + "x-since": "2022-03-16" + }, + "VendorUpdatedEventData": { + "type": "object", + "description": "Defines the `vendor.updated` event data structure.", + "x-release-status": "BETA", + "properties": { + "type": { + "type": "string", + "description": "The type of the event data object. The value is `vendor`.", + "nullable": true + }, + "id": { + "type": "string", + "description": "The ID of the event data object." + }, + "object": { + "$ref": "#/components/schemas/VendorUpdatedEventObject", + "description": "An object containing updated vendor.", + "nullable": true + } + } + }, + "VendorUpdatedEventObject": { + "type": "object", + "x-release-status": "BETA", + "properties": { + "operation": { + "$ref": "#/components/schemas/VendorUpdatedEventObjectOperation", + "description": "The operation on the vendor that caused the event to be published. The value is `UPDATED`.\nSee [Operation](#type-operation) for possible values", + "nullable": true + }, + "vendor": { + "$ref": "#/components/schemas/Vendor", + "description": "The updated vendor as the result of the specified operation.", + "nullable": true + } + } + }, + "VendorUpdatedEventObjectOperation": { + "type": "string", + "enum": [ + "UPDATED" + ], + "x-enum-elements": [ + { + "name": "UPDATED", + "description": "" + } + ], + "description": "The operation that can be performed against a vendor to cause the event to be published.", + "x-release-status": "BETA" + }, + "VisibilityFilter": { + "type": "string", + "enum": [ + "ALL", + "READ", + "READ_WRITE" + ], + "x-enum-elements": [ + { + "name": "ALL", + "description": "All custom attributes or custom attribute definitions." + }, + { + "name": "READ", + "description": "All custom attributes or custom attribute definitions with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`." + }, + { + "name": "READ_WRITE", + "description": "All custom attributes or custom attribute definitions with the `visibility` field set to `VISIBILITY_READ_WRITE_VALUES`." + } + ], + "description": "Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions.", + "x-release-status": "PUBLIC" + }, + "VoidTransactionResponse": { + "type": "object", + "description": "Defines the fields that are included in the response body of\na request to the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint.", + "x-release-status": "DEPRECATED", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + }, + "description": "Any errors that occurred during the request." + } + }, + "example": {}, + "x-sq-sdk-sample-code": { + "csharp": "/sdk_samples/VoidTransaction/VoidTransactionResponse.csharp", + "java": "/sdk_samples/VoidTransaction/VoidTransactionResponse.java", + "javascript": "/sdk_samples/VoidTransaction/VoidTransactionResponse.javascript", + "php": "/sdk_samples/VoidTransaction/VoidTransactionResponse.php", + "python": "/sdk_samples/VoidTransaction/VoidTransactionResponse.python", + "ruby": "/sdk_samples/VoidTransaction/VoidTransactionResponse.ruby" + } + }, + "WageSetting": { + "type": "object", + "description": "Represents information about the overtime exemption status, job assignments, and compensation\nfor a [team member](entity:TeamMember).", + "x-release-status": "PUBLIC", + "properties": { + "team_member_id": { + "type": "string", + "description": "The ID of the team member associated with the wage setting.", + "nullable": true + }, + "job_assignments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/JobAssignment" + }, + "description": "**Required** The ordered list of jobs that the team member is assigned to.\nThe first job assignment is considered the team member's primary job.", + "nullable": true + }, + "is_overtime_exempt": { + "type": "boolean", + "description": "Whether the team member is exempt from the overtime rules of the seller's country.", + "nullable": true + }, + "version": { + "type": "integer", + "description": "**Read only** Used for resolving concurrency issues. The request fails if the version\nprovided does not match the server version at the time of the request. If not provided,\nSquare executes a blind write, potentially overwriting data from another write. For more information,\nsee [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency)." + }, + "created_at": { + "type": "string", + "description": "The timestamp when the wage setting was created, in RFC 3339 format.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp when the wage setting was last updated, in RFC 3339 format.", + "readOnly": true + } + } + }, + "WebhookSubscription": { + "type": "object", + "description": "Represents the details of a webhook subscription, including notification URL,\nevent types, and signature key.", + "x-release-status": "PUBLIC", + "properties": { + "id": { + "type": "string", + "description": "A Square-generated unique ID for the subscription.", + "maxLength": 64, + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of this subscription.", + "maxLength": 64, + "nullable": true + }, + "enabled": { + "type": "boolean", + "description": "Indicates whether the subscription is enabled (`true`) or not (`false`).", + "nullable": true + }, + "event_types": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The event types associated with this subscription.", + "nullable": true + }, + "notification_url": { + "type": "string", + "description": "The URL to which webhooks are sent.", + "nullable": true + }, + "api_version": { + "type": "string", + "description": "The API version of the subscription.\nThis field is optional for `CreateWebhookSubscription`. \nThe value defaults to the API version used by the application.", + "nullable": true + }, + "signature_key": { + "type": "string", + "description": "The Square-generated signature key used to validate the origin of the webhook event.", + "readOnly": true + }, + "created_at": { + "type": "string", + "description": "The timestamp of when the subscription was created, in RFC 3339 format. For example, \"2016-09-04T23:59:33.123Z\".", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "The timestamp of when the subscription was last updated, in RFC 3339 format.\nFor example, \"2016-09-04T23:59:33.123Z\".", + "readOnly": true + } + } + }, + "Weekday": { + "type": "string", + "enum": [ + "MON", + "TUE", + "WED", + "THU", + "FRI", + "SAT", + "SUN" + ], + "x-enum-elements": [ + { + "name": "MON", + "description": "Monday" + }, + { + "name": "TUE", + "description": "Tuesday" + }, + { + "name": "WED", + "description": "Wednesday" + }, + { + "name": "THU", + "description": "Thursday" + }, + { + "name": "FRI", + "description": "Friday" + }, + { + "name": "SAT", + "description": "Saturday" + }, + { + "name": "SUN", + "description": "Sunday" + } + ], + "description": "The days of the week.", + "x-release-status": "PUBLIC" + }, + "WorkweekConfig": { + "type": "object", + "description": "Sets the day of the week and hour of the day that a business starts a\nworkweek. This is used to calculate overtime pay.", + "x-release-status": "PUBLIC", + "required": [ + "start_of_week", + "start_of_day_local_time" + ], + "properties": { + "id": { + "type": "string", + "description": "The UUID for this object." + }, + "start_of_week": { + "$ref": "#/components/schemas/Weekday", + "description": "The day of the week on which a business week starts for\ncompensation purposes.\nSee [Weekday](#type-weekday) for possible values" + }, + "start_of_day_local_time": { + "type": "string", + "description": "The local time at which a business week starts. Represented as a\nstring in `HH:MM` format (`HH:MM:SS` is also accepted, but seconds are\ntruncated).", + "minLength": 1 + }, + "version": { + "type": "integer", + "description": "Used for resolving concurrency issues. The request fails if the version\nprovided does not match the server version at the time of the request. If not provided,\nSquare executes a blind write; potentially overwriting data from another\nwrite." + }, + "created_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format; presented in UTC.", + "readOnly": true + }, + "updated_at": { + "type": "string", + "description": "A read-only timestamp in RFC 3339 format; presented in UTC.", + "readOnly": true + } + } + } + }, + "x-apis": { + "ApplePay": { + "name": "Apple Pay", + "summary": "Apple Pay support APIs", + "description": "\nThe Apple Pay APIs provides an easy way for platform developers\nto bulk activate Web Apple Pay with Square for merchants using their platform.\n\nFor more information, see the following guides:\n- [Web Payments SDK](https://developer.squareup.com/docs/web-payments/apple-pay)\n- [In-App Payments SDK](https://developer.squareup.com/docs/in-app-payments-sdk/add-digital-wallets/apple-pay)" + }, + "BankAccounts": { + "name": "Bank Accounts", + "summary": "Get a list of a seller's bank accounts.", + "description": "\nThe Bank Accounts API allows you to get basic details about a seller's bank account, such as the\nlast few digits of the account number and the routing number. It can be paired with the Payouts API to understand the\npattern of deposits and withdrawals from a seller's bank account.\n\nFor more information, see the following guides:\n - [Bank Accounts](https://developer.squareup.com/docs/bank-accounts-api)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)\n" + }, + "BookingCustomAttributes": { + "name": "Booking Custom Attributes", + "summary": "Create and manage booking-related custom attribute definitions and custom attributes.", + "description": "\nUse the Booking Custom Attributes API to create and manage custom attributes for bookings to store properties or \nmetadata to support seller-specific customizations of and extensions to the `Booking` object. \n\nFor more information, see the following guides: \n - [Booking Custom Attributes](https://developer.squareup.com/docs/booking-custom-attributes-api/overview).\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)\n" + }, + "Bookings": { + "name": "Bookings", + "summary": "Create and manage bookings for Square sellers with the Bookings API.", + "description": "\nThe Bookings API allows you to create, retrieve, update, and cancel appointments online. When used with other Square APIs (such as the Locations API, Team API, Catalog API, and Customers API), the Bookings API lets you create online-booking applications for users to book services provided by Square sellers. \n\n\n## Why Use the Bookings API?\nThe Bookings API simplifies the scheduling process for Square sellers and their customers. By integrating with Square’s broader ecosystem, it offers a robust solution for managing appointments. Key Bookings API benefits include:\n\n\n* Comprehensive calendar control for sellers, with permissions that allow flexibility in creating bookings.\n* Streamlined buyer-level operations with secure and limited access.\n* Compatibility with Square’s Appointments subscription plans, offering additional features and functionality.\n* Custom attributes to personalize the booking experience.\n* Seamless integration with other Square APIs, such as [Customers API](https://developer.squareup.com/docs/customers-api/what-it-does), [Locations API](https://developer.squareup.com/docs/locations-api), [Team API](https://developer.squareup.com/docs/team/overview), and [Catalog API](https://developer.squareup.com/docs/catalog-api/what-it-does).\n\n\nFor more information, see the following guides:\n - [Bookings API Guide](https://developer.squareup.com/docs/bookings-api/what-it-is)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)\n" + }, + "Cards": { + "name": "Cards", + "summary": "Use the Cards API to save a credit or debit card on file.", + "description": "\nYou can use the [CreateCard](/reference/square/cards-api/create-card) endpoint to save a credit or debit card to a Square account.\nDevelopers can integrate the Cards API in their application to let Square sellers:\n\n- **Save a card that can be charged by any Square seller who uses your application.** Your application specifies the organization access token in the `CreateCard` request.\n- **Save a card that can be charged by a single Square seller.** Your application specifies the access token of the specific seller account in the `CreateCard` request.\n\nThe Cards API also supports other endpoints to manage the cards.\n\nFor more information, see the following guides:\n - [Cards](https://developer.squareup.com/docs/cards-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "CashDrawers": { + "name": "Cash Drawers", + "summary": "Get details about cash drawer shifts.", + "description": "\nCash drawer shifts track cash transactions so that the total money in the cash drawers can be reconciled for a\nspecific period of time (a cash drawer shift), for a particular device, in a particular location. The Cash Drawer Shifts API\nenables you to list and retrieve information about cash drawer shifts.\n\nFor more information, see the following guide:\n - [Cash Drawer Shifts](https://developer.squareup.com/docs/cashdrawershift-api/reporting)" + }, + "Catalog": { + "name": "Catalog", + "summary": "Programmatically catalogs a Square seller’s products for sale and services for hire.", + "description": "\nThe Catalog API allows you to programmatically catalog products or services, including items, variations, categories, discounts, taxes, modifiers, and more.\n\nFor more information, see the following guides:\n - [Catalog](https://developer.squareup.com/docs/catalog-api/what-it-does)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Channels": { + "name": "Channels", + "summary": "Returns a seller's sales, marketing, and fulfillment channels.", + "description": "The Channels API allows applications to retrieve the channels that a seller has assigned catalog items to.\n\nFor more information, see the following guides:\n - [Channels](https://developer.squareup.com/docs/channels-api)\n" + }, + "Checkout": { + "name": "Checkout", + "summary": "Accept payments through a pre-built, Square-hosted checkout page. No frontend required.", + "description": "\nWith the Square Checkout API, your customers can pay for a purchase through a simple, Square-hosted checkout page. It can be integrated into any payments workflow with minimal coding. \n\nYou can create and configure your checkout page through a `CreatePaymentLink` request, specifying the accepted payment methods and checkout options like tipping and custom fields. You can also configure a URL for customers to be redirected to once they complete their purchase. \n\nFirst time Square developers should utilize the payment link endpoints to create, update, retrieve, and list checkout pages. \n\nFor more information, see the following guide:\n - [Checkout](https://developer.squareup.com/docs/checkout-api-overview)" + }, + "CustomerCustomAttributes": { + "name": "Customer Custom Attributes", + "summary": "Create and manage customer-related custom attribute definitions and custom attributes.", + "description": "\nUse the Customer Custom Attributes API to create and manage custom attributes for customer profiles. Custom attributes can be used to store properties or metadata that simplify integration, synchronization, and personalization workflows. After a custom attribute definition is created in a Square seller account, the custom attribute value can be set for customer profiles in the seller's Customer Directory.\n\nFor more information, see the following guides:\n - [Customer Custom Attributes](https://developer.squareup.com/docs/customer-custom-attributes-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "CustomerGroups": { + "name": "Customer Groups", + "summary": "Create and manage customer groups to streamline and automate workflows and help personalize customer interactions.", + "description": "\nThe Customer Groups API lets you create and manage customer groups to provide targeted promotions or take other customized actions based on group membership. For example, you can create Weekly, Monthly, and Quarterly customer groups and add customers to them based on their preferences to receive marketing promotions on a weekly, monthly, and quarterly basis. You can then use the information to manage your marketing email schedule. \n\nYou can use the Customer Groups API to retrieve and manage customer groups. You can use the Customers API to add customers to and remove customers from groups and search for customers based on group membership.\n\nFor more information, see the following guide:\n - [Customer Groups](https://developer.squareup.com/docs/customer-groups-api/what-it-does)" + }, + "CustomerSegments": { + "name": "Customer Segments", + "summary": "Retrieve customer segments (also called smart groups) in a business account.", + "description": "\nThe Customer Segments API lets you retrieve information about the segments defined for a business. Square sellers can create customer segments in the Seller Dashboard or Point of Sale by defining filters for the segment. For example, a segment can include customers who have visited more than 10 times. Customers are automatically added to and removed from the segment over time based on this criterion. \n\nYou can inspect the customer's `segment_ids` property to determine which segments a customer belongs to. Then, you can use the Customer Segments API to retrieve basic details about each segment, such as the segment name and the time when it was created.\n\nFor more information, see the following guide:\n - [Customer Segments](https://developer.squareup.com/docs/customer-segments-api/what-it-does)" + }, + "Customers": { + "name": "Customers", + "summary": "Create and manage customer profiles and sync CRM systems with Square.", + "description": "\nThe Customers API enables you to create and manage customer profiles, as well as search for customers based on various criteria (including customer group membership). You can also use the API to sync contacts between your CRM system and Square.\n\nFor more information, see the following guides:\n - [Customers](https://developer.squareup.com/docs/customers-api/what-it-does)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Devices": { + "name": "Devices", + "summary": "Create device codes used to connect Square Terminal with a 3rd-party point of sale system, and get details about all connected Terminals. ", + "description": "\nFor more information, see the following guides:\n - [Devices](https://developer.squareup.com/docs/terminal-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Disputes": { + "name": "Disputes", + "summary": "Use the Disputes API to manage disputes (chargebacks).", + "description": "\nA seller has the following options to process a dispute:\n\n- Accept the dispute using the [AcceptDispute](/reference/square/disputes-api/accept-dispute) endpoint. Square returns the disputed amount from the account balance of the Square account.\n- Challenge the dispute using the [SubmitEvidence](/reference/square/disputes-api/submit-evidence) endpoint. If the payment was valid, you can contest the disputed payment.\nYou submit supporting evidence you have about the transaction, such as receipts, invoices, email correspondence, proof of delivery, or photos.\nYou upload evidence using the [CreateDisputeEvidenceFile](/reference/square/disputes-api/create-dispute-evidence-file) endpoint.\n\nThe Disputes API also supports other endpoints useful in dispute management.\n\nFor more information, see the following guides:\n - [Disputes](https://developer.squareup.com/docs/disputes-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Employees": { + "name": "Employees", + "summary": "Pull employee data into accounting and payroll systems with the Employees API.", + "description": "\nThe Employees API allows applications to retrieve a roster of employees registered in the Square Point\nof Sale system, which can be useful in payroll and account contexts.\n\nPrior to 2020-08-26, the Employees API was best used in conjunction with the Labor API, where you provide employee IDs to\nmanage shifts, breaks, and wages. After that deprecation date, the Team API should be used.\n\nFor information about migrating your code to the Team API, see [Migrate from the Square Employees API](https://developer.squareup.com/docs/team/migrate-from-v2-employees?environment=master\u0026preview=true)" + }, + "Events": { + "name": "Events", + "summary": "Search for Square API events that occur within a 28-day timeframe.", + "description": "\nIf you don't need a real-time response to data changes or need a disaster recovery or reconciliation mechanism for missed webhook events (caused by server outages, misconfigured webhook subscriptions, network errors, and other events), you can use the Events API instead of webhook subscriptions managed manually or through the Webhook Subscriptions API.\n\nBecause Square events are owned by the application and not any one seller, you cannot use OAuth access tokens with the Events API. You must use the application’s [personal access token](/docs/build-basics/access-tokens).\n\nFor more information, see:\n - [Events API](https://developer.squareup.com/docs/events-api/overview) \n" + }, + "GiftCardActivities": { + "name": "Gift Card Activities", + "summary": "Create and retrieve gift card activities.", + "description": "\nUse the Gift Card Activities API to create activities for a Square gift card (such as activating or reloading the gift card) and to track gift card activities. The Gift Card Activities API is used with the [Gift Cards API](https://developer.squareup.com/reference/square/gift-cards-api) to manage the gift card program for a Square seller.\n\nFor more information, see the following guides:\n - [Gift Card Activities](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "GiftCards": { + "name": "Gift Cards", + "summary": "Create and retrieve gift cards and manage gift cards on file.", + "description": "\n[Square Gift Cards](https://squareup.com/gift-cards) enable sellers to boost sales and attract new customers. Customers can purchase gift cards and redeem them at any of the seller's locations. Sellers can manage gift cards and track activity.\n\nUse the Gift Cards API to create and retrieve gift cards (for example, to get the gift card balance) and manage gift cards on file by linking or unlinking gift cards with customers. After creating a gift card, use the [Gift Card Activities API](https://developer.squareup.com/reference/square/gift-card-activities-api) to activate the gift card with an initial balance and manage other activities.\n\nFor more information, see the following guides:\n - [Gift Cards](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Inventory": { + "name": "Inventory", + "summary": "Programmatically manages a Square seller’s inventory of catalog items.", + "description": "\nThe Inventory API allows you to programmatically manage inventory counts and inventory changes of products or services.\n\nFor more information, see the following guides:\n - [Inventory](https://developer.squareup.com/docs/inventory-api/what-it-does)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Invoices": { + "name": "Invoices", + "summary": "Create, configure, and publish invoices for orders that were created using the Orders API.", + "description": "\n[Square Invoices](https://squareup.com/invoices) makes it easy for sellers to request and collect payments from their customers. Square notifies customers and processes invoice payments.\n\nUse the Invoices API to create and manage invoices for orders that were created using the Orders API. After you create the invoice and configure its delivery method, payment schedule, and other invoice settings, you can publish the invoice. Depending on the invoice settings, Square can send the invoice to the customer or automatically charge a card on file. Square hosts each invoice on a web page where customers can pay for it.\n\nFor more information, see the following guides:\n - [Invoices](https://developer.squareup.com/docs/invoices-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Labor": { + "name": "Labor", + "summary": "Manage timecards and schedules for team members.", + "description": "\nThe Labor API allows applications to manage time tracking and shift scheduling workflows.\n\n**Time tracking** - Create and manage timecards (shifts) to track work hours, breaks, and declared cash tips for payroll processing and labor cost calculations. The Labor API provides search capabilities to retrieve timecards by location, time period, status, and team member assignments. It can also be used to access job and wage information for team members, define break types, and configure workweek start times for overtime calculations and reporting periods.\n\n**Scheduling** - Create and manage scheduled shifts with draft and published states to coordinate team member work schedules. The Labor API supports both individual and bulk publishing of scheduled shifts and provides search capabilities to retrieve scheduled shifts by location, time period, status, and team member assignments.\n\nThe Labor API integrates closely with the Team API.\n\nFor more information, see the following guides:\n - [Labor](https://developer.squareup.com/docs/labor-api/what-it-does)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)\n" + }, + "LocationCustomAttributes": { + "name": "Location Custom Attributes", + "summary": "Create and manage location-related custom attribute definitions and custom attributes.", + "description": "\nUse the Location Custom Attributes API to create and manage custom attributes for locations. Custom attributes can be used to store properties or metadata that simplify integration, synchronization, and personalization workflows. After a custom attribute definition is created in a Square seller account, the custom attribute value can be set for locations.\n\nFor more information, see the following guides:\n - [Location Custom Attributes](https://developer.squareup.com/docs/location-custom-attributes-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Locations": { + "name": "Locations", + "summary": "Create and manage the locations of a seller's business.", + "description": "\nMany sellers use multiple locations to track where they make sales. The Locations API allows you to\ncreate and manage data about those locations, such as their addresses, names, and business hours.\n\nFor more information, see the following guides:\n - [Locations](https://developer.squareup.com/docs/locations-api)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Loyalty": { + "name": "Loyalty", + "summary": "Enroll buyers in a Square loyalty program, view program settings, manage and track loyalty activity, and create and manage promotions.", + "description": "\nSellers subscribe to [Square Loyalty](https://squareup.com/software/loyalty) to offer a loyalty program that can increase repeat visits to their business by rewarding customers.\n\nUse the Loyalty API to create loyalty accounts for buyers and enable them to earn points for purchases and redeem points for reward discounts. Also use the Loyalty API to retrieve details about the loyalty program, create and manage loyalty promotions that extend the base program, and track balance-changing events for loyalty accounts.\n\nFor more information, see the following guides:\n - [Loyalty](https://developer.squareup.com/docs/loyalty-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "MerchantCustomAttributes": { + "name": "Merchant Custom Attributes", + "summary": "Create and manage merchant-related custom attribute definitions and custom attributes.", + "description": "\nUse the Merchant Custom Attributes API to create and manage custom attributes for merchants that connect to your application. Custom attributes can be used to store properties or metadata that simplify integration, synchronization, and personalization workflows.\n\nFor more information, see the following guides:\n - [Merchant Custom Attributes](https://developer.squareup.com/docs/merchant-custom-attributes-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Merchants": { + "name": "Merchants", + "summary": "Retrieve information about an organization that sells with Square.", + "description": "\nThe Merchants API groups individual seller locations into larger organizations, allowing them to operate as a single entity. Each merchant represents one organization or business that sells with Square. Use this API to retrieve core information about the organization connecting to your application such as the merchant ID, language preferences, country, account status, and the name of the overall business.\n\nFor more information, see the following guide:\n - [Merchants](https://developer.squareup.com/docs/merchants-api)" + }, + "MobileAuthorization": { + "name": "Mobile Authorization", + "summary": "Authorize Reader SDK applications to take in-person payments.", + "description": "\n**Deprecated** - Developers should update their Reader SDK integration to use the \n[Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. \n\nThe Mobile Authorization API accepts an account credential (an OAuth token or a personal access token) and a\nlocation ID and returns an authorization code that custom mobile applications can use to initialize Square mobile\nsolutions, like Reader SDK, to accept payments using Square hardware.\n\nFor more information, see the following guide:\n - [Mobile Authorization](https://developer.squareup.com/docs/mobile-authz/what-it-does)" + }, + "OAuth": { + "name": "OAuth", + "summary": "Allow your application to gain programmatic access to Square seller accounts.", + "description": "\nApplications use the OAuth API to obtain access tokens that allow them to call Square APIs on behalf of Square sellers. Applications can request scoped permissions to limit their access to only the resources they need. The OAuth flow for obtaining an OAuth access token has three stages:\n\n**Authorization** - Your application directs the seller to the Square authorization page using an authorization URL that specifies your requested permissions. The seller signs in to Square and reviews the permissions.\n\n**Callback** - After approving the permissions, Square redirects the seller back to your application's registered redirect URL with an authorization code appended as a query parameter.\n\n**Token request** - Your application calls the `ObtainToken` endpoint with the authorization code, your application ID, and other information. Square returns an access token and refresh token.\n\nFor more information, see the following guides:\n - [OAuth](https://developer.squareup.com/docs/oauth-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "OrderCustomAttributes": { + "name": "Order Custom Attributes", + "summary": "Create and manage order-related custom attribute definitions and custom attributes.", + "description": "\nUse the Order Custom Attributes API to create and manage custom attributes for orders. Custom attributes can be used to store properties or metadata that simplify integration, synchronization, and personalization workflows. After a custom attribute definition is created in a Square seller account, the custom attribute value can be set for orders.\n\nFor more information, see the following guides:\n - [Order Custom Attributes](https://developer.squareup.com/docs/orders-custom-attributes-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Orders": { + "name": "Orders", + "summary": "Get sales data for a Square seller, itemize payments, push orders to POS, and more.", + "description": "\nThe Orders API is your one-stop shop for adding rich functionality to payments. You can itemize\npayments using custom line items or catalog objects, send orders to physical Point of Sale devices\nto be fulfilled, attach a customer to a payment, and more.\n\nIn addition, the Orders API lets you search through all of a seller's past sales and returns itemization\ndata, customer references, and other details from sales made using POS or online.\n\nIf you use the Square Orders API with a non-Square payments provider, Square charges a transaction fee. For more information, see [Orders API fee structure.](https://developer.squareup.com/docs/payments-pricing#orders-api-fee-structure)\n\nFor more information, see the following guides:\n - [Orders](https://developer.squareup.com/docs/orders-api/what-it-does)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Payments": { + "name": "Payments", + "summary": "The Payments API lets developers take and manage payments.", + "description": "\nApplications need the following input to take a payment:\n\n- The amount to charge.\n- The payment recipient. The payment goes to the account identified by the Authorization header in the API request.\n- The payment source. The source can be a payment token or card on file.\n\n You can generate a payment token using the Web Payments SDK and the In-App Payments SDK. For working code examples, see [Square Connect API Examples](https://github.com/square/connect-api-examples).\n\n A card on file is a credit card, debit card, or gift card that is associated with a customer. \n You can create a customer and add a card on file using Square APIs, the Square Seller Dashboard, or the Square Point of Sale application.\n\n For more information, see the following guides:\n - [Payments](https://developer.squareup.com/docs/payments-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Payouts": { + "name": "Payouts", + "summary": "Get a list of deposits and withdrawals from a seller's bank accounts.", + "description": "\nThe Payouts API allows you to see a complete list of payouts made to a seller's banking destination,\nwith a list of payout entries that describe the payments associated with each payout. It can be paired with the\nBank Accounts API to add detail about which bank account each payout was made to.\n\nFor more information, see the following guide:\n - [Payouts](https://developer.squareup.com/docs/payouts/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Refunds": { + "name": "Refunds", + "summary": "Manage and issue refunds for payments made to Square sellers.", + "description": "\nThe following applies to refunds:\n\n- You cannot refund more than what was originally collected.\n- The refund amount must be available in the account's Square balance. If the amount is not available, Square attempts to take money out of\n the associated bank account. Refunds are in a state of PENDING until the funds are secured.\n- If funds cannot be secured, the refund is not completed and the buyer does not receive a credit. The refund has \n a status of FAILED. Future refunds to this payment are not allowed and the buyer should be reimbursed by other means.\n- You can refund only payments with status COMPLETED. You cannot refund an APPROVED payment; however, you can cancel\n an approved payment.\n\nFor more information, see the following guides:\n - [Refunds](https://developer.squareup.com/docs/payments-api/refund-payments)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Reporting": { + "name": "Reporting", + "summary": "Deprecated - Use the Orders and Payments APIs instead.", + "description": "\nPrior to 2019/08/15, the Reporting API was the way to review multi-party payments taken with the Transactions\nAPI. The Payments API now includes an \"application fee\" parameter you can use to replace this functionality." + }, + "Sites": { + "name": "Sites", + "summary": "Get details about Square Online sites that belong to Square sellers.", + "description": "\nSquare sellers use Square Online to build eCommerce websites. The Sites API lets you get basic details about Square Online sites, such as the site ID, title, and domain. You can use the Sites API with the Snippets API to manage snippets that extend Square Online features.\n\n __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).\n\n For more information, see the following guide:\n - [Sites](https://developer.squareup.com/docs/sites-api/overview)" + }, + "Snippets": { + "name": "Snippets", + "summary": "Manage snippets for Square Online sites.", + "description": "\nThe Snippets API lets you manage snippets that add custom functionality to Square Online sites. A snippet is HTML, CSS, and JavaScript that is injected into the `head` element of all pages on a site, except for checkout pages. You can use the Snippets API to create applications that help meet the many needs of Square sellers.\n\n __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).\n\n For more information, see the following guide:\n - [Snippets](https://developer.squareup.com/docs/snippets-api/overview)" + }, + "Subscriptions": { + "name": "Subscriptions", + "summary": "Create and manage subscriptions.", + "description": "\nSubscriptions enable sellers to generate a reliable cash flow and recurring revenue to grow their businesses. Square offers the Subscriptions API for developers to embed subscription functionality in their applications. You first create a subscription plan using the Catalog API and then use the Subscriptions API to create and manage subscriptions. \n\nFor more information, see the following guides:\n - [Subscriptions](https://developer.squareup.com/docs/subscriptions/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Team": { + "name": "Team", + "summary": "Manage a roster of team members and pull employee data into accounting and payroll systems.", + "description": "\nThe Team API allows applications to manage team members and job definitions for Square sellers. \nThis includes creating and managing team member profiles, wage settings, and job data. The Team API \nsupports synchronization of team member data with accounting and payroll systems, which is useful \nfor applications that handle payroll, scheduling, and other team member-related activities. \nNote that some operations, such as setting permissions and passcodes, still need to be done directly \nthrough the Square Dashboard.\n\nThe Team API integrates closely with the Labor API.\n\nFor more information, see the following guide:\n - [Team](https://developer.squareup.com/docs/team/overview)\n - [Square Webhooks](https://developer.squareup.com/docs/webhooks-overview)\n" + }, + "Terminal": { + "name": "Terminal", + "summary": "Requests a checkout from a paired Square Terminal.", + "description": "\nThe Terminal API allows you to manage sending and receiving requests and responses from a paired Square Terminal. For a Terminal checkout, refund, or action, you can create a request, check its status, cancel the request, search for in-process requests, and get the results of the request after it is completed. In the current implementation, refunds are only supported for Interac debit cards in Canada.\n\nFor more information, see the following guides:\n - [Terminal](https://developer.squareup.com/docs/terminal-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "Transactions": { + "name": "Transactions", + "summary": "Deprecated - Use the Orders and Payments APIs instead.", + "description": "\nPrior to 2019/08/15, the Transactions API was the way to take online payments. Going forward, the Payments API \nand Refunds API (together with the Orders API) replace the Transactions API. For information about migrating your code to the Payments API, see [Migrate from Transactions](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api)" + }, + "TransferOrder": { + "name": "Transfer Order", + "summary": "Programmatically manages a Square seller’s location stock transfers.", + "description": "\nThe Trasfer Orders API allows you to programmatically manage inventory transfers of products between seller locations.\n\nFor more information, see the following guides:\n - [Get Started with Transfer Orders](https://developer.squareup.com/docs/commerce)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "V1Webhooks": { + "name": "V1Webhooks", + "summary": "Deprecated - Use V2 Webhooks.", + "description": "\nIf you are working with V1 (deprecated) webhooks, you use the Webhooks API to subscribe to events for each seller you are interested in receiving events for.\n\nIf you are working with V2 webhooks, you do not need to use this API.\nInstead, you subscribe to events using the [Developer Dashboard](/apps) or the [Webhook Subscriptions API](/reference/square/webhook-subscriptions-api).\nLearn how to subscribe to V2 webhooks using the [dashboard](/docs/webhooks/step2subscribe) or the [API](/docs/webhooks/webhook-subscriptions-api)." + }, + "Vendors": { + "name": "Vendors", + "summary": "Manages a seller's suppliers.", + "description": "The Vendors API allows applications to create, retrieve, and update vendors as suppliers to a seller.\n\nFor more information, see the following guides:\n - [Vendors](https://developer.squareup.com/docs/vendors-api/overview)\n - [Square Webhooks Overview](https://developer.squareup.com/docs/webhooks-overview)" + }, + "WebhookSubscriptions": { + "name": "Webhook Subscriptions", + "summary": "Create and manage webhook subscriptions.", + "description": "\nThe Webhook Subscriptions API allows you to create, retrieve, update, and delete webhook subscriptions. Because Webhook subscriptions are owned by the application and not any one seller, you cannot use OAuth Access Tokens with the Webhook Subscriptions API. You must use the application’s [personal access token](/docs/build-basics/access-tokens).\n\nFor more information, see the following guide the following guide:\n - [Webhook Subscriptions](https://developer.squareup.com/docs/webhooks/webhook-subscriptions-api)" + } + }, + "x-categories": { + "Commerce": { + "name": "Commerce", + "summary": "Process orders, manage catalogs, track inventory, book reservations, and manage vendors. ", + "description": "", + "apis": [ + "#/components/x-apis/Orders", + "#/components/x-apis/OrderCustomAttributes", + "#/components/x-apis/Catalog", + "#/components/x-apis/Inventory", + "#/components/x-apis/TransferOrder", + "#/components/x-apis/Bookings", + "#/components/x-apis/Booking Custom Attributes", + "#/components/x-apis/Vendors", + "#/components/x-apis/Channels", + "#/components/x-apis/Sites", + "#/components/x-apis/Snippets", + "#/components/x-apis/Cash Drawers", + "#/components/x-apis/channels" + ] + }, + "Customers": { + "name": "Customers", + "summary": "Securely manage customer data and integrate engagement features to increase repeat business and attract new customers.", + "description": "\n", + "apis": [ + "#/components/x-apis/Customers", + "#/components/x-apis/CustomerCustomAttributes", + "#/components/x-apis/CustomerGroups", + "#/components/x-apis/CustomerSegments", + "#/components/x-apis/Loyalty", + "#/components/x-apis/GiftCards", + "#/components/x-apis/GiftCardActivities" + ] + }, + "Dev Essentials": { + "name": "Dev Essentials", + "summary": "Authenticate your app, provide secure delegated access to Square account data, and manage webhook subscriptions.", + "description": "", + "apis": [ + "#/components/x-apis/OAuth", + "#/components/x-apis/WebhookSubscriptions", + "#/components/x-apis/Events" + ] + }, + "Merchants": { + "name": "Merchants", + "summary": "Manage a seller's core business information used for business, and suppliers.", + "description": "", + "apis": [ + "#/components/x-apis/Merchants", + "#/components/x-apis/MerchantCustomAttributes", + "#/components/x-apis/Locations", + "#/components/x-apis/LocationCustomAttributes" + ] + }, + "Payments": { + "name": "Payments", + "summary": "Take payments, process refunds, manage disputes, enable subscriptions, and get paid for your sales.", + "description": "\n", + "apis": [ + "#/components/x-apis/Payments", + "#/components/x-apis/Refunds", + "#/components/x-apis/Checkout", + "#/components/x-apis/Terminal", + "#/components/x-apis/Disputes", + "#/components/x-apis/Invoices", + "#/components/x-apis/Cards", + "#/components/x-apis/Subscriptions", + "#/components/x-apis/BankAccounts", + "#/components/x-apis/Payouts", + "#/components/x-apis/MobileAuthorization", + "#/components/x-apis/Devices", + "#/components/x-apis/ApplePay" + ] + }, + "Staff": { + "name": "Staff", + "summary": "Manage team members and jobs, track hours worked, and manage team schedules.", + "description": "", + "apis": [ + "#/components/x-apis/Labor", + "#/components/x-apis/Team" + ] + } + }, + "x-categories-order": [ + "Dev Essentials", + "Payments", + "Commerce", + "Customers", + "Staff", + "Merchants" + ], + "x-v1-api-mappings": { + "V1Employees": { + "V1CreateEmployee": "Employees", + "V1CreateEmployeeRole": "Employees", + "V1CreateTimecard": "Labor", + "V1DeleteTimecard": "Labor", + "V1ListCashDrawerShifts": "CashDrawers", + "V1ListEmployeeRoles": "Employees", + "V1ListEmployees": "Employees", + "V1ListTimecardEvents": "Labor", + "V1ListTimecards": "Labor", + "V1RetrieveCashDrawerShift": "CashDrawers", + "V1RetrieveEmployee": "Employees", + "V1RetrieveEmployeeRole": "Employees", + "V1RetrieveTimecard": "Labor", + "V1UpdateEmployee": "Employees", + "V1UpdateEmployeeRole": "Employees", + "V1UpdateTimecard": "Labor" + }, + "V1Items": { + "V1AdjustInventory": "Inventory", + "V1ApplyFee": "Catalog", + "V1ApplyModifierList": "Catalog", + "V1CreateCategory": "Catalog", + "V1CreateDiscount": "Catalog", + "V1CreateFee": "Catalog", + "V1CreateItem": "Catalog", + "V1CreateModifierList": "Catalog", + "V1CreateModifierOption": "Catalog", + "V1CreatePage": "Catalog", + "V1CreateVariation": "Catalog", + "V1DeleteCategory": "Catalog", + "V1DeleteDiscount": "Catalog", + "V1DeleteFee": "Catalog", + "V1DeleteItem": "Catalog", + "V1DeleteModifierList": "Catalog", + "V1DeleteModifierOption": "Catalog", + "V1DeletePage": "Catalog", + "V1DeletePageCell": "Catalog", + "V1DeleteVariation": "Catalog", + "V1ListCategories": "Catalog", + "V1ListDiscounts": "Catalog", + "V1ListFees": "Catalog", + "V1ListInventory": "Inventory", + "V1ListItems": "Catalog", + "V1ListModifierLists": "Catalog", + "V1ListPages": "Catalog", + "V1RemoveFee": "Catalog", + "V1RemoveModifierList": "Catalog", + "V1RetrieveItem": "Catalog", + "V1RetrieveModifierList": "Catalog", + "V1UpdateCategory": "Catalog", + "V1UpdateDiscount": "Catalog", + "V1UpdateFee": "Catalog", + "V1UpdateItem": "Catalog", + "V1UpdateModifierList": "Catalog", + "V1UpdateModifierOption": "Catalog", + "V1UpdatePage": "Catalog", + "V1UpdatePageCell": "Catalog", + "V1UpdateVariation": "Catalog", + "V1UploadItemImage": "Catalog" + }, + "V1Locations": { + "V1ListLocations": "Locations", + "V1RetrieveBusiness": "Merchants" + }, + "V1Transactions": { + "V1CreateRefund": "Refunds", + "V1ListBankAccounts": "BankAccounts", + "V1ListPayments": "Payments", + "V1ListRefunds": "Refunds", + "V1ListSettlements": "Payouts", + "V1RetrieveBankAccount": "BankAccounts", + "V1RetrievePayment": "Payments", + "V1RetrieveSettlement": "Payouts" + }, + "V1Webhooks": { + "V1ListWebhooks": "V1Webhooks", + "V1UpdateWebhooks": "V1Webhooks" + } + } + }, + "paths": { + "/mobile/authorization-code": { + "post": { + "tags": [ + "MobileAuthorization" + ], + "summary": "CreateMobileAuthorizationCode", + "operationId": "CreateMobileAuthorizationCode", + "description": "__Note:__ This endpoint is used by the deprecated Reader SDK. \nDevelopers should update their integration to use the [Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. \n\nGenerates code to authorize a mobile application to connect to a Square card reader.\n\nAuthorization codes are one-time-use codes and expire 60 minutes after being issued.\n\nThe `Authorization` header you provide to this endpoint must have the following format:\n\n```\nAuthorization: Bearer ACCESS_TOKEN\n```\n\nReplace `ACCESS_TOKEN` with a\n[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens).", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": {}, + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE_IN_PERSON" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMobileAuthorizationCodeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMobileAuthorizationCodeResponse" + } + } + } + } + } + } + }, + "/oauth2/revoke": { + "post": { + "tags": [ + "OAuth" + ], + "summary": "RevokeToken", + "operationId": "RevokeToken", + "description": "Revokes an access token generated with the OAuth flow.\n\nIf an account has more than one OAuth access token for your application, this\nendpoint revokes all of them, regardless of which token you specify. \n\n__Important:__ The `Authorization` header for this endpoint must have the\nfollowing format:\n\n```\nAuthorization: Client APPLICATION_SECRET\n```\n\nReplace `APPLICATION_SECRET` with the application secret on the **OAuth**\npage for your application in the Developer Dashboard.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": null + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RevokeTokenRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RevokeTokenResponse" + } + } + } + } + } + } + }, + "/oauth2/token": { + "post": { + "tags": [ + "OAuth" + ], + "summary": "ObtainToken", + "operationId": "ObtainToken", + "description": "Returns an OAuth access token and refresh token using the `authorization_code`\nor `refresh_token` grant type.\n\nWhen `grant_type` is `authorization_code`:\n- With the [code flow](https://developer.squareup.com/docs/oauth-api/overview#code-flow),\nprovide `code`, `client_id`, and `client_secret`.\n- With the [PKCE flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow),\nprovide `code`, `client_id`, and `code_verifier`. \n\nWhen `grant_type` is `refresh_token`:\n- With the code flow, provide `refresh_token`, `client_id`, and `client_secret`.\nThe response returns the same refresh token provided in the request.\n- With the PKCE flow, provide `refresh_token` and `client_id`. The response returns\na new refresh token.\n\nYou can use the `scopes` parameter to limit the set of permissions authorized by the\naccess token. You can use the `short_lived` parameter to create an access token that\nexpires in 24 hours.\n\n__Important:__ OAuth tokens should be encrypted and stored on a secure server.\nApplication clients should never interact directly with OAuth tokens.", + "x-release-status": "PUBLIC", + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ObtainTokenRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ObtainTokenResponse" + } + } + } + } + } + } + }, + "/oauth2/token/status": { + "post": { + "tags": [ + "OAuth" + ], + "summary": "RetrieveTokenStatus", + "operationId": "RetrieveTokenStatus", + "description": "Returns information about an [OAuth access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-an-oauth-access-token) or an application’s [personal access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-a-personal-access-token).\n\nAdd the access token to the Authorization header of the request.\n\n__Important:__ The `Authorization` header you provide to this endpoint must have the following format:\n\n```\nAuthorization: Bearer ACCESS_TOKEN\n```\n\nwhere `ACCESS_TOKEN` is a\n[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens).\n\nIf the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTokenStatusResponse" + } + } + } + } + } + } + }, + "/v1/{location_id}/orders": { + "get": { + "tags": [ + "V1Transactions" + ], + "summary": "V1ListOrders", + "operationId": "V1ListOrders", + "description": "Provides summary information for a merchant's online store orders.", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "deprecated": true, + "x-deprecation": {}, + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to list online store orders for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "order", + "description": "The order in which payments are listed in the response.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of payments to return in a single response. This value cannot exceed 200.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "batch_token", + "description": "A pagination cursor to retrieve the next set of results for your\noriginal query to the endpoint.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V1Order" + } + } + } + } + } + } + } + }, + "/v1/{location_id}/orders/{order_id}": { + "get": { + "tags": [ + "V1Transactions" + ], + "summary": "V1RetrieveOrder", + "operationId": "V1RetrieveOrder", + "description": "Provides comprehensive information for a single online store order, including the order's history.", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "deprecated": true, + "x-deprecation": {}, + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the order's associated location.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "order_id", + "description": "The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V1Order" + } + } + } + } + } + }, + "put": { + "tags": [ + "V1Transactions" + ], + "summary": "V1UpdateOrder", + "operationId": "V1UpdateOrder", + "description": "Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions:", + "x-release-status": "DEPRECATED", + "x-visibility": "SDK_ONLY", + "deprecated": true, + "x-deprecation": {}, + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the order's associated location.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "order_id", + "description": "The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V1UpdateOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V1Order" + } + } + } + } + } + } + }, + "/v2/apple-pay/domains": { + "post": { + "tags": [ + "ApplePay" + ], + "summary": "RegisterDomain", + "operationId": "RegisterDomain", + "description": "Activates a domain for use with Apple Pay on the Web and Square. A validation\nis performed on this domain by Apple to ensure that it is properly set up as\nan Apple Pay enabled domain.\n\nThis endpoint provides an easy way for platform developers to bulk activate\nApple Pay on the Web with Square for merchants using their platform.\n\nNote: You will need to host a valid domain verification file on your domain to support Apple Pay. The\ncurrent version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association,\nand should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your\ndomain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding\nlong-lived caches that might not keep in sync with the correct file version.\n\nTo learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterDomainRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterDomainResponse" + } + } + } + } + } + } + }, + "/v2/bank-accounts": { + "get": { + "tags": [ + "BankAccounts" + ], + "summary": "ListBankAccounts", + "operationId": "ListBankAccounts", + "description": "Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "BANK_ACCOUNTS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "The pagination cursor returned by a previous call to this endpoint.\nUse it in the next `ListBankAccounts` request to retrieve the next set \nof results.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "Upper limit on the number of bank accounts to return in the response. \nCurrently, 1000 is the largest supported limit. You can specify a limit \nof up to 1000 bank accounts. This is also the default limit.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "Location ID. You can specify this optional filter \nto retrieve only the linked bank accounts belonging to a specific location.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBankAccountsResponse" + } + } + } + } + } + } + }, + "/v2/bank-accounts/by-v1-id/{v1_bank_account_id}": { + "get": { + "tags": [ + "BankAccounts" + ], + "summary": "GetBankAccountByV1Id", + "operationId": "GetBankAccountByV1Id", + "description": "Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank account ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "BANK_ACCOUNTS_READ" + ] + } + ], + "parameters": [ + { + "name": "v1_bank_account_id", + "description": "Connect V1 ID of the desired `BankAccount`. For more information, see \n[Retrieve a bank account by using an ID issued by V1 Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api#retrieve-a-bank-account-by-using-an-id-issued-by-v1-bank-accounts-api).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBankAccountByV1IdResponse" + } + } + } + } + } + } + }, + "/v2/bank-accounts/{bank_account_id}": { + "get": { + "tags": [ + "BankAccounts" + ], + "summary": "GetBankAccount", + "operationId": "GetBankAccount", + "description": "Returns details of a [BankAccount](entity:BankAccount)\nlinked to a Square account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "BANK_ACCOUNTS_READ" + ] + } + ], + "parameters": [ + { + "name": "bank_account_id", + "description": "Square-issued ID of the desired `BankAccount`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBankAccountResponse" + } + } + } + } + } + } + }, + "/v2/bookings": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "ListBookings", + "operationId": "ListBookings", + "description": "Retrieve a collection of bookings.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "limit", + "description": "The maximum number of results per page to return in a paged response.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "customer_id", + "description": "The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "team_member_id", + "description": "The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "start_at_min", + "description": "The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "start_at_max", + "description": "The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBookingsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Bookings" + ], + "summary": "CreateBooking", + "operationId": "CreateBooking", + "description": "Creates a booking.\n\nThe required input must include the following:\n- `Booking.location_id`\n- `Booking.start_at`\n- `Booking.AppointmentSegment.team_member_id`\n- `Booking.AppointmentSegment.service_variation_id`\n- `Booking.AppointmentSegment.service_variation_version`\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBookingRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBookingResponse" + } + } + } + } + } + } + }, + "/v2/bookings/availability/search": { + "post": { + "tags": [ + "Bookings" + ], + "summary": "SearchAvailability", + "operationId": "SearchAvailability", + "description": "Searches for availabilities for booking.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchAvailabilityRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchAvailabilityResponse" + } + } + } + } + } + } + }, + "/v2/bookings/bulk-retrieve": { + "post": { + "tags": [ + "Bookings" + ], + "summary": "BulkRetrieveBookings", + "operationId": "BulkRetrieveBookings", + "description": "Bulk-Retrieves a list of bookings by booking IDs.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveBookingsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveBookingsResponse" + } + } + } + } + } + } + }, + "/v2/bookings/business-booking-profile": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "RetrieveBusinessBookingProfile", + "operationId": "RetrieveBusinessBookingProfile", + "description": "Retrieves a seller's booking profile.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveBusinessBookingProfileResponse" + } + } + } + } + } + } + }, + "/v2/bookings/custom-attribute-definitions": { + "get": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "ListBookingCustomAttributeDefinitions", + "operationId": "ListBookingCustomAttributeDefinitions", + "description": "Get all bookings custom attribute definitions.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBookingCustomAttributeDefinitionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "CreateBookingCustomAttributeDefinition", + "operationId": "CreateBookingCustomAttributeDefinition", + "description": "Creates a bookings custom attribute definition.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBookingCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBookingCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/bookings/custom-attribute-definitions/{key}": { + "delete": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "DeleteBookingCustomAttributeDefinition", + "operationId": "DeleteBookingCustomAttributeDefinition", + "description": "Deletes a bookings custom attribute definition.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteBookingCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "RetrieveBookingCustomAttributeDefinition", + "operationId": "RetrieveBookingCustomAttributeDefinition", + "description": "Retrieves a bookings custom attribute definition.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to retrieve. If the requesting application\nis not the definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The current version of the custom attribute definition, which is used for strongly consistent\nreads to guarantee that you receive the most up-to-date data. When included in the request,\nSquare returns the specified version or a higher version if one exists. If the specified version\nis higher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveBookingCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "UpdateBookingCustomAttributeDefinition", + "operationId": "UpdateBookingCustomAttributeDefinition", + "description": "Updates a bookings custom attribute definition.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBookingCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBookingCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/bookings/custom-attributes/bulk-delete": { + "post": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "BulkDeleteBookingCustomAttributes", + "operationId": "BulkDeleteBookingCustomAttributes", + "description": "Bulk deletes bookings custom attributes.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteBookingCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteBookingCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/custom-attributes/bulk-upsert": { + "post": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "BulkUpsertBookingCustomAttributes", + "operationId": "BulkUpsertBookingCustomAttributes", + "description": "Bulk upserts bookings custom attributes.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertBookingCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertBookingCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/location-booking-profiles": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "ListLocationBookingProfiles", + "operationId": "ListLocationBookingProfiles", + "description": "Lists location booking profiles of a seller.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "limit", + "description": "The maximum number of results to return in a paged response.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLocationBookingProfilesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/location-booking-profiles/{location_id}": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "RetrieveLocationBookingProfile", + "operationId": "RetrieveLocationBookingProfile", + "description": "Retrieves a seller's location booking profile.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to retrieve the booking profile.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLocationBookingProfileResponse" + } + } + } + } + } + } + }, + "/v2/bookings/team-member-booking-profiles": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "ListTeamMemberBookingProfiles", + "operationId": "ListTeamMemberBookingProfiles", + "description": "Lists booking profiles for team members.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "bookable_only", + "description": "Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`).", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a paged response.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "Indicates whether to include only team members enabled at the given location in the returned result.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTeamMemberBookingProfilesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/team-member-booking-profiles/bulk-retrieve": { + "post": { + "tags": [ + "Bookings" + ], + "summary": "BulkRetrieveTeamMemberBookingProfiles", + "operationId": "BulkRetrieveTeamMemberBookingProfiles", + "description": "Retrieves one or more team members' booking profiles.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveTeamMemberBookingProfilesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveTeamMemberBookingProfilesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/team-member-booking-profiles/{team_member_id}": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "RetrieveTeamMemberBookingProfile", + "operationId": "RetrieveTeamMemberBookingProfile", + "description": "Retrieves a team member's booking profile.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_BUSINESS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "The ID of the team member to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTeamMemberBookingProfileResponse" + } + } + } + } + } + } + }, + "/v2/bookings/{booking_id}": { + "get": { + "tags": [ + "Bookings" + ], + "summary": "RetrieveBooking", + "operationId": "RetrieveBooking", + "description": "Retrieves a booking.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the [Booking](entity:Booking) object representing the to-be-retrieved booking.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveBookingResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Bookings" + ], + "summary": "UpdateBooking", + "operationId": "UpdateBooking", + "description": "Updates a booking.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the [Booking](entity:Booking) object representing the to-be-updated booking.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBookingRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBookingResponse" + } + } + } + } + } + } + }, + "/v2/bookings/{booking_id}/cancel": { + "post": { + "tags": [ + "Bookings" + ], + "summary": "CancelBooking", + "operationId": "CancelBooking", + "description": "Cancels an existing booking.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the [Booking](entity:Booking) object representing the to-be-cancelled booking.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelBookingRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelBookingResponse" + } + } + } + } + } + } + }, + "/v2/bookings/{booking_id}/custom-attributes": { + "get": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "ListBookingCustomAttributes", + "operationId": "ListBookingCustomAttributes", + "description": "Lists a booking's custom attributes.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the target [booking](entity:Booking).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request. For more\ninformation, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "with_definitions", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBookingCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/bookings/{booking_id}/custom-attributes/{key}": { + "delete": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "DeleteBookingCustomAttribute", + "operationId": "DeleteBookingCustomAttribute", + "description": "Deletes a bookings custom attribute.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the target [booking](entity:Booking).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to delete. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteBookingCustomAttributeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "RetrieveBookingCustomAttribute", + "operationId": "RetrieveBookingCustomAttribute", + "description": "Retrieves a bookings custom attribute.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the target [booking](entity:Booking).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to retrieve. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "with_definition", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of\nthe custom attribute. Set this parameter to `true` to get the name and description of the custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "version", + "description": "The current version of the custom attribute, which is used for strongly consistent reads to\nguarantee that you receive the most up-to-date data. When included in the request, Square\nreturns the specified version or a higher version if one exists. If the specified version is\nhigher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveBookingCustomAttributeResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "BookingCustomAttributes" + ], + "summary": "UpsertBookingCustomAttribute", + "operationId": "UpsertBookingCustomAttribute", + "description": "Upserts a bookings custom attribute.\n\nTo call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.\nTo call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.\n\nFor calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*\nor *Appointments Premium*.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "APPOINTMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "booking_id", + "description": "The ID of the target [booking](entity:Booking).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to create or update. This key must match the `key` of a\ncustom attribute definition in the Square seller account. If the requesting application is not\nthe definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertBookingCustomAttributeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertBookingCustomAttributeResponse" + } + } + } + } + } + } + }, + "/v2/cards": { + "get": { + "tags": [ + "Cards" + ], + "summary": "ListCards", + "operationId": "ListCards", + "description": "Retrieves a list of cards owned by the account making the request.\nA max of 25 cards will be returned.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for your original query.\n\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "customer_id", + "description": "Limit results to cards associated with the customer supplied.\nBy default, all cards owned by the merchant are returned.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "include_disabled", + "description": "Includes disabled cards.\nBy default, all enabled cards owned by the merchant are returned.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "reference_id", + "description": "Limit results to cards associated with the reference_id supplied.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "Sorts the returned list by when the card was created with the specified order.\nThis field defaults to ASC.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCardsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Cards" + ], + "summary": "CreateCard", + "operationId": "CreateCard", + "description": "Adds a card on file to an existing merchant.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_DECLINED_VERIFICATION_REQUIRED" + }, + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + }, + { + "error-code": "SOURCE_EXPIRED" + }, + { + "error-code": "SOURCE_USED" + }, + { + "error-code": "INVALID_CARD_DATA" + } + ] + } + }, + "/v2/cards/{card_id}": { + "get": { + "tags": [ + "Cards" + ], + "summary": "RetrieveCard", + "operationId": "RetrieveCard", + "description": "Retrieves details for a specific Card.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "card_id", + "description": "Unique ID for the desired Card.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/cards/{card_id}/disable": { + "post": { + "tags": [ + "Cards" + ], + "summary": "DisableCard", + "operationId": "DisableCard", + "description": "Disables the card, preventing any further updates or charges.\nDisabling an already disabled card is allowed but has no effect.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "card_id", + "description": "Unique ID for the desired Card.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DisableCardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/cash-drawers/shifts": { + "get": { + "tags": [ + "CashDrawers" + ], + "summary": "ListCashDrawerShifts", + "operationId": "ListCashDrawerShifts", + "description": "Provides the details for all of the cash drawer shifts for a location\nin a date range.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CASH_DRAWER_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to query for a list of cash drawer shifts.", + "schema": { + "type": "string" + }, + "in": "query", + "required": true + }, + { + "name": "sort_order", + "description": "The order in which cash drawer shifts are listed in the response,\nbased on their opened_at field. Default value: ASC", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "begin_time", + "description": "The inclusive start time of the query on opened_at, in ISO 8601 format.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "The exclusive end date of the query on opened_at, in ISO 8601 format.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "Number of cash drawer shift events in a page of results (200 by\ndefault, 1000 max).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "Opaque cursor for fetching the next page of results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCashDrawerShiftsResponse" + } + } + } + } + } + } + }, + "/v2/cash-drawers/shifts/{shift_id}": { + "get": { + "tags": [ + "CashDrawers" + ], + "summary": "RetrieveCashDrawerShift", + "operationId": "RetrieveCashDrawerShift", + "description": "Provides the summary details for a single cash drawer shift. See\n[ListCashDrawerShiftEvents](api-endpoint:CashDrawers-ListCashDrawerShiftEvents) for a list of cash drawer shift events.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CASH_DRAWER_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to retrieve cash drawer shifts from.", + "schema": { + "type": "string" + }, + "in": "query", + "required": true + }, + { + "name": "shift_id", + "description": "The shift ID.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCashDrawerShiftResponse" + } + } + } + } + } + } + }, + "/v2/cash-drawers/shifts/{shift_id}/events": { + "get": { + "tags": [ + "CashDrawers" + ], + "summary": "ListCashDrawerShiftEvents", + "operationId": "ListCashDrawerShiftEvents", + "description": "Provides a paginated list of events for a single cash drawer shift.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CASH_DRAWER_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to list cash drawer shifts for.", + "schema": { + "type": "string" + }, + "in": "query", + "required": true + }, + { + "name": "shift_id", + "description": "The shift ID.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "limit", + "description": "Number of resources to be returned in a page of results (200 by\ndefault, 1000 max).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "Opaque cursor for fetching the next page of results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCashDrawerShiftEventsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/batch-delete": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "BatchDeleteCatalogObjects", + "operationId": "BatchDeleteCatalogObjects", + "description": "Deletes a set of [CatalogItem](entity:CatalogItem)s based on the\nprovided list of target IDs and returns a set of successfully deleted IDs in\nthe response. Deletion is a cascading event such that all children of the\ntargeted object are also deleted. For example, deleting a CatalogItem will\nalso delete all of its [CatalogItemVariation](entity:CatalogItemVariation)\nchildren.\n\n`BatchDeleteCatalogObjects` succeeds even if only a portion of the targeted\nIDs can be deleted. The response will only include IDs that were\nactually deleted.\n\nTo ensure consistency, only one delete request is processed at a time per seller account.\nWhile one (batch or non-batch) delete request is being processed, other (batched and non-batched)\ndelete requests are rejected with the `429` error code.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchDeleteCatalogObjectsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchDeleteCatalogObjectsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/batch-retrieve": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "BatchRetrieveCatalogObjects", + "operationId": "BatchRetrieveCatalogObjects", + "description": "Returns a set of objects based on the provided ID.\nEach [CatalogItem](entity:CatalogItem) returned in the set includes all of its\nchild information including: all of its\n[CatalogItemVariation](entity:CatalogItemVariation) objects, references to\nits [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of\nany [CatalogTax](entity:CatalogTax) objects that apply to it.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveCatalogObjectsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveCatalogObjectsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/batch-upsert": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "BatchUpsertCatalogObjects", + "operationId": "BatchUpsertCatalogObjects", + "description": "Creates or updates up to 10,000 target objects based on the provided\nlist of objects. The target objects are grouped into batches and each batch is\ninserted/updated in an all-or-nothing manner. If an object within a batch is\nmalformed in some way, or violates a database constraint, the entire batch\ncontaining that item will be disregarded. However, other batches in the same\nrequest may still succeed. Each batch may contain up to 1,000 objects, and\nbatches will be processed in order as long as the total object count for the\nrequest (items, variations, modifier lists, discounts, and taxes) is no more\nthan 10,000.\n\nTo ensure consistency, only one update request is processed at a time per seller account.\nWhile one (batch or non-batch) update request is being processed, other (batched and non-batched)\nupdate requests are rejected with the `429` error code.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchUpsertCatalogObjectsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchUpsertCatalogObjectsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "GENERIC_DECLINE" + } + ] + } + }, + "/v2/catalog/images": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "CreateCatalogImage", + "operationId": "CreateCatalogImage", + "description": "Uploads an image file to be represented by a [CatalogImage](entity:CatalogImage) object that can be linked to an existing\n[CatalogObject](entity:CatalogObject) instance. The resulting `CatalogImage` is unattached to any `CatalogObject` if the `object_id`\nis not specified.\n\nThis `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in\nJPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "request": { + "$ref": "#/components/schemas/CreateCatalogImageRequest" + }, + "image_file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "image_file": { + "contentType": "image/jpeg" + }, + "request": { + "contentType": "application/json; charset=utf-8" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCatalogImageResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "GENERIC_DECLINE" + } + ] + } + }, + "/v2/catalog/images/{image_id}": { + "put": { + "tags": [ + "Catalog" + ], + "summary": "UpdateCatalogImage", + "operationId": "UpdateCatalogImage", + "description": "Uploads a new image file to replace the existing one in the specified [CatalogImage](entity:CatalogImage) object.\n\nThis `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in\nJPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "image_id", + "description": "The ID of the `CatalogImage` object to update the encapsulated image file.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "request": { + "$ref": "#/components/schemas/UpdateCatalogImageRequest" + }, + "image_file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "image_file": { + "contentType": "image/jpeg" + }, + "request": { + "contentType": "application/json; charset=utf-8" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCatalogImageResponse" + } + } + } + } + } + } + }, + "/v2/catalog/info": { + "get": { + "tags": [ + "Catalog" + ], + "summary": "CatalogInfo", + "operationId": "CatalogInfo", + "description": "Retrieves information about the Square Catalog API, such as batch size\nlimits that can be used by the `BatchUpsertCatalogObjects` endpoint.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CatalogInfoResponse" + } + } + } + } + } + } + }, + "/v2/catalog/list": { + "get": { + "tags": [ + "Catalog" + ], + "summary": "ListCatalog", + "operationId": "ListCatalog", + "description": "Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog.\n\nThe `types` parameter is specified as a comma-separated list of the [CatalogObjectType](entity:CatalogObjectType) values,\nfor example, \"`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`\".\n\n__Important:__ ListCatalog does not return deleted catalog items. To retrieve\ndeleted catalog items, use [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects)\nand set the `include_deleted_objects` attribute value to `true`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "The pagination cursor returned in the previous response. Leave unset for an initial request.\nThe page size is currently set to be 100.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "types", + "description": "An optional case-insensitive, comma-separated list of object types to retrieve.\n\nThe valid values are defined in the [CatalogObjectType](entity:CatalogObjectType) enum, for example,\n`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,\n`MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc.\n\nIf this is unspecified, the operation returns objects of all the top level types at the version\nof the Square API used to make the request. Object types that are nested onto other object types\nare not included in the defaults.\n\nAt the current API version the default object types are:\nITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, \nPRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,\nSUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "catalog_version", + "description": "The specific version of the catalog objects to be included in the response.\nThis allows you to retrieve historical versions of objects. The specified version value is matched against\nthe [CatalogObject](entity:CatalogObject)s' `version` attribute. If not included, results will be from the\ncurrent version of the catalog.", + "schema": { + "type": "integer", + "format": "int64" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCatalogResponse" + } + } + } + } + } + } + }, + "/v2/catalog/object": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "UpsertCatalogObject", + "operationId": "UpsertCatalogObject", + "description": "Creates a new or updates the specified [CatalogObject](entity:CatalogObject).\n\nTo ensure consistency, only one update request is processed at a time per seller account.\nWhile one (batch or non-batch) update request is being processed, other (batched and non-batched)\nupdate requests are rejected with the `429` error code.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertCatalogObjectRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertCatalogObjectResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "GENERIC_DECLINE" + }, + { + "error-code": "INVALID_LOCATION" + } + ] + } + }, + "/v2/catalog/object/{object_id}": { + "delete": { + "tags": [ + "Catalog" + ], + "summary": "DeleteCatalogObject", + "operationId": "DeleteCatalogObject", + "description": "Deletes a single [CatalogObject](entity:CatalogObject) based on the\nprovided ID and returns the set of successfully deleted IDs in the response.\nDeletion is a cascading event such that all children of the targeted object\nare also deleted. For example, deleting a [CatalogItem](entity:CatalogItem)\nwill also delete all of its\n[CatalogItemVariation](entity:CatalogItemVariation) children.\n\nTo ensure consistency, only one delete request is processed at a time per seller account.\nWhile one (batch or non-batch) delete request is being processed, other (batched and non-batched)\ndelete requests are rejected with the `429` error code.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "object_id", + "description": "The ID of the catalog object to be deleted. When an object is deleted, other\nobjects in the graph that depend on that object will be deleted as well (for example, deleting a\ncatalog item will delete its catalog item variations).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCatalogObjectResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Catalog" + ], + "summary": "RetrieveCatalogObject", + "operationId": "RetrieveCatalogObject", + "description": "Returns a single [CatalogItem](entity:CatalogItem) as a\n[CatalogObject](entity:CatalogObject) based on the provided ID. The returned\nobject includes all of the relevant [CatalogItem](entity:CatalogItem)\ninformation including: [CatalogItemVariation](entity:CatalogItemVariation)\nchildren, references to its\n[CatalogModifierList](entity:CatalogModifierList) objects, and the ids of\nany [CatalogTax](entity:CatalogTax) objects that apply to it.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [ + { + "name": "object_id", + "description": "The object ID of any type of catalog objects to be retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "include_related_objects", + "description": "If `true`, the response will include additional objects that are related to the\nrequested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field\nof the response. These objects are put in the `related_objects` field. Setting this to `true` is\nhelpful when the objects are needed for immediate display to a user.\nThis process only goes one level deep. Objects referenced by the related objects will not be included. For example,\n\nif the `objects` field of the response contains a CatalogItem, its associated\nCatalogCategory objects, CatalogTax objects, CatalogImage objects and\nCatalogModifierLists will be returned in the `related_objects` field of the\nresponse. If the `objects` field of the response contains a CatalogItemVariation,\nits parent CatalogItem will be returned in the `related_objects` field of\nthe response.\n\nDefault value: `false`", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "catalog_version", + "description": "Requests objects as of a specific version of the catalog. This allows you to retrieve historical\nversions of objects. The value to retrieve a specific version of an object can be found\nin the version field of [CatalogObject](entity:CatalogObject)s. If not included, results will\nbe from the current version of the catalog.", + "schema": { + "type": "integer", + "format": "int64" + }, + "in": "query", + "required": false + }, + { + "name": "include_category_path_to_root", + "description": "Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists\nof `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category\nand ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned\nin the response payload.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCatalogObjectResponse" + } + } + } + } + } + } + }, + "/v2/catalog/search": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "SearchCatalogObjects", + "operationId": "SearchCatalogObjects", + "description": "Searches for [CatalogObject](entity:CatalogObject) of any type by matching supported search attribute values,\nexcluding custom attribute values on items or item variations, against one or more of the specified query filters.\n\nThis (`SearchCatalogObjects`) endpoint differs from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems)\nendpoint in the following aspects:\n\n- `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects.\n- `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not.\n- `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does.\n- The both endpoints have different call conventions, including the query filter formats.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCatalogObjectsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCatalogObjectsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/search-catalog-items": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "SearchCatalogItems", + "operationId": "SearchCatalogItems", + "description": "Searches for catalog items or item variations by matching supported search attribute values, including\ncustom attribute values, against one or more of the specified query filters.\n\nThis (`SearchCatalogItems`) endpoint differs from the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects)\nendpoint in the following aspects:\n\n- `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects.\n- `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not.\n- `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does.\n- The both endpoints use different call conventions, including the query filter formats.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCatalogItemsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCatalogItemsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/update-item-modifier-lists": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "UpdateItemModifierLists", + "operationId": "UpdateItemModifierLists", + "description": "Updates the [CatalogModifierList](entity:CatalogModifierList) objects\nthat apply to the targeted [CatalogItem](entity:CatalogItem) without having\nto perform an upsert on the entire item.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateItemModifierListsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateItemModifierListsResponse" + } + } + } + } + } + } + }, + "/v2/catalog/update-item-taxes": { + "post": { + "tags": [ + "Catalog" + ], + "summary": "UpdateItemTaxes", + "operationId": "UpdateItemTaxes", + "description": "Updates the [CatalogTax](entity:CatalogTax) objects that apply to the\ntargeted [CatalogItem](entity:CatalogItem) without having to perform an\nupsert on the entire item.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ITEMS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateItemTaxesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateItemTaxesResponse" + } + } + } + } + } + } + }, + "/v2/channels": { + "get": { + "tags": [ + "Channels" + ], + "summary": "ListChannels", + "operationId": "ListChannels", + "description": "", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "CHANNELS_READ" + ] + } + ], + "parameters": [ + { + "name": "reference_type", + "description": "Type of reference associated to channel", + "schema": { + "$ref": "#/components/schemas/ReferenceType" + }, + "in": "query", + "required": false + }, + { + "name": "reference_id", + "description": "id of reference associated to channel", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "status", + "description": "Status of channel", + "schema": { + "$ref": "#/components/schemas/ChannelStatus" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "Cursor to fetch the next result", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "Maximum number of results to return.\nWhen not provided the returned results will be cap at 100 channels.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListChannelsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "FORBIDDEN" + }, + { + "error-code": "MISSING_REQUIRED_PARAMETER" + } + ] + } + }, + "/v2/channels/bulk-retrieve": { + "post": { + "tags": [ + "Channels" + ], + "summary": "BulkRetrieveChannels", + "operationId": "BulkRetrieveChannels", + "description": "", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "CHANNELS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveChannelsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveChannelsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "FORBIDDEN" + }, + { + "error-code": "MISSING_REQUIRED_PARAMETER" + } + ] + } + }, + "/v2/channels/{channel_id}": { + "get": { + "tags": [ + "Channels" + ], + "summary": "RetrieveChannel", + "operationId": "RetrieveChannel", + "description": "", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "CHANNELS_READ" + ] + } + ], + "parameters": [ + { + "name": "channel_id", + "description": "A channel id", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveChannelResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "FORBIDDEN" + }, + { + "error-code": "MISSING_REQUIRED_PARAMETER" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/customers": { + "get": { + "tags": [ + "Customers" + ], + "summary": "ListCustomers", + "operationId": "ListCustomers", + "description": "Lists customer profiles associated with a Square account.\n\nUnder normal operating conditions, newly created or updated customer profiles become available\nfor the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated\nprofiles can take closer to one minute or longer, especially during network incidents and outages.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.\nIf the specified limit is less than 1 or greater than 100, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "sort_field", + "description": "Indicates how customers should be sorted.\n\nThe default value is `DEFAULT`.", + "schema": { + "$ref": "#/components/schemas/CustomerSortField" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "Indicates whether customers should be sorted in ascending (`ASC`) or\ndescending (`DESC`) order.\n\nThe default value is `ASC`.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "count", + "description": "Indicates whether to return the total count of customers in the `count` field of the response.\n\nThe default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCustomersResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Customers" + ], + "summary": "CreateCustomer", + "operationId": "CreateCustomer", + "description": "Creates a new customer for a business.\n\nYou must provide at least one of the following values in your request to this\nendpoint:\n\n- `given_name`\n- `family_name`\n- `company_name`\n- `email_address`\n- `phone_number`", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "INVALID_PHONE_NUMBER" + }, + { + "error-code": "INVALID_TIME" + }, + { + "error-code": "VALUE_TOO_LONG" + } + ] + } + }, + "/v2/customers/bulk-create": { + "post": { + "tags": [ + "Customers" + ], + "summary": "BulkCreateCustomers", + "operationId": "BulkCreateCustomers", + "description": "Creates multiple [customer profiles](entity:Customer) for a business.\n\nThis endpoint takes a map of individual create requests and returns a map of responses.\n\nYou must provide at least one of the following values in each create request:\n\n- `given_name`\n- `family_name`\n- `company_name`\n- `email_address`\n- `phone_number`", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateCustomersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateCustomersResponse" + } + } + } + } + } + } + }, + "/v2/customers/bulk-delete": { + "post": { + "tags": [ + "Customers" + ], + "summary": "BulkDeleteCustomers", + "operationId": "BulkDeleteCustomers", + "description": "Deletes multiple customer profiles.\n\nThe endpoint takes a list of customer IDs and returns a map of responses.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteCustomersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteCustomersResponse" + } + } + } + } + } + } + }, + "/v2/customers/bulk-retrieve": { + "post": { + "tags": [ + "Customers" + ], + "summary": "BulkRetrieveCustomers", + "operationId": "BulkRetrieveCustomers", + "description": "Retrieves multiple customer profiles.\n\nThis endpoint takes a list of customer IDs and returns a map of responses.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveCustomersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveCustomersResponse" + } + } + } + } + } + } + }, + "/v2/customers/bulk-update": { + "post": { + "tags": [ + "Customers" + ], + "summary": "BulkUpdateCustomers", + "operationId": "BulkUpdateCustomers", + "description": "Updates multiple customer profiles.\n\nThis endpoint takes a map of individual update requests and returns a map of responses.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateCustomersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateCustomersResponse" + } + } + } + } + } + } + }, + "/v2/customers/custom-attribute-definitions": { + "get": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "ListCustomerCustomAttributeDefinitions", + "operationId": "ListCustomerCustomAttributeDefinitions", + "description": "Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.\n\nWhen all response pages are retrieved, the results include all custom attribute definitions\nthat are visible to the requesting application, including those that are created by other\napplications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that\nseller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCustomerCustomAttributeDefinitionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "CreateCustomerCustomAttributeDefinition", + "operationId": "CreateCustomerCustomAttributeDefinition", + "description": "Creates a customer-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\nUse this endpoint to define a custom attribute that can be associated with customer profiles.\n\nA custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties\nfor a custom attribute. After the definition is created, you can call\n[UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) or\n[BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes)\nto set the custom attribute for customer profiles in the seller's Customer Directory.\n\nSellers can view all custom attributes in exported customer data, including those set to\n`VISIBILITY_HIDDEN`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/customers/custom-attribute-definitions/{key}": { + "delete": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "DeleteCustomerCustomAttributeDefinition", + "operationId": "DeleteCustomerCustomAttributeDefinition", + "description": "Deletes a customer-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\n\nDeleting a custom attribute definition also deletes the corresponding custom attribute from\nall customer profiles in the seller's Customer Directory.\n\nOnly the definition owner can delete a custom attribute definition.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomerCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "RetrieveCustomerCustomAttributeDefinition", + "operationId": "RetrieveCustomerCustomAttributeDefinition", + "description": "Retrieves a customer-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\n\nTo retrieve a custom attribute definition created by another application, the `visibility`\nsetting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to retrieve. If the requesting application\nis not the definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The current version of the custom attribute definition, which is used for strongly consistent\nreads to guarantee that you receive the most up-to-date data. When included in the request,\nSquare returns the specified version or a higher version if one exists. If the specified version\nis higher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCustomerCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "UpdateCustomerCustomAttributeDefinition", + "operationId": "UpdateCustomerCustomAttributeDefinition", + "description": "Updates a customer-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\n\nUse this endpoint to update the following fields: `name`, `description`, `visibility`, or the\n`schema` for a `Selection` data type.\n\nOnly the definition owner can update a custom attribute definition. Note that sellers can view\nall custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/customers/custom-attributes/bulk-upsert": { + "post": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "BulkUpsertCustomerCustomAttributes", + "operationId": "BulkUpsertCustomerCustomAttributes", + "description": "Creates or updates [custom attributes](entity:CustomAttribute) for customer profiles as a bulk operation.\n\nUse this endpoint to set the value of one or more custom attributes for one or more customer profiles.\nA custom attribute is based on a custom attribute definition in a Square seller account, which is\ncreated using the [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) endpoint.\n\nThis `BulkUpsertCustomerCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert\nrequests and returns a map of individual upsert responses. Each upsert request has a unique ID\nand provides a customer ID and custom attribute. Each upsert response is returned with the ID\nof the corresponding request.\n\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertCustomerCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertCustomerCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/customers/groups": { + "get": { + "tags": [ + "CustomerGroups" + ], + "summary": "ListCustomerGroups", + "operationId": "ListCustomerGroups", + "description": "Retrieves the list of customer groups of a business.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.\nIf the limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCustomerGroupsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "CustomerGroups" + ], + "summary": "CreateCustomerGroup", + "operationId": "CreateCustomerGroup", + "description": "Creates a new customer group for a business.\n\nThe request must include the `name` value of the group.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerGroupRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerGroupResponse" + } + } + } + } + } + } + }, + "/v2/customers/groups/{group_id}": { + "delete": { + "tags": [ + "CustomerGroups" + ], + "summary": "DeleteCustomerGroup", + "operationId": "DeleteCustomerGroup", + "description": "Deletes a customer group as identified by the `group_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "group_id", + "description": "The ID of the customer group to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomerGroupResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "CustomerGroups" + ], + "summary": "RetrieveCustomerGroup", + "operationId": "RetrieveCustomerGroup", + "description": "Retrieves a specific customer group as identified by the `group_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "group_id", + "description": "The ID of the customer group to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCustomerGroupResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "CustomerGroups" + ], + "summary": "UpdateCustomerGroup", + "operationId": "UpdateCustomerGroup", + "description": "Updates a customer group as identified by the `group_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "group_id", + "description": "The ID of the customer group to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerGroupRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerGroupResponse" + } + } + } + } + } + } + }, + "/v2/customers/search": { + "post": { + "tags": [ + "Customers" + ], + "summary": "SearchCustomers", + "operationId": "SearchCustomers", + "description": "Searches the customer profiles associated with a Square account using one or more supported query filters.\n\nCalling `SearchCustomers` without any explicit query filter returns all\ncustomer profiles ordered alphabetically based on `given_name` and\n`family_name`.\n\nUnder normal operating conditions, newly created or updated customer profiles become available\nfor the search operation in well under 30 seconds. Occasionally, propagation of the new or updated\nprofiles can take closer to one minute or longer, especially during network incidents and outages.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCustomersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchCustomersResponse" + } + } + } + } + } + } + }, + "/v2/customers/segments": { + "get": { + "tags": [ + "CustomerSegments" + ], + "summary": "ListCustomerSegments", + "operationId": "ListCustomerSegments", + "description": "Retrieves the list of customer segments of a business.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by previous calls to `ListCustomerSegments`.\nThis cursor is used to retrieve the next set of query results.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.\nIf the specified limit is less than 1 or greater than 50, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 50.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCustomerSegmentsResponse" + } + } + } + } + } + } + }, + "/v2/customers/segments/{segment_id}": { + "get": { + "tags": [ + "CustomerSegments" + ], + "summary": "RetrieveCustomerSegment", + "operationId": "RetrieveCustomerSegment", + "description": "Retrieves a specific customer segment as identified by the `segment_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "segment_id", + "description": "The Square-issued ID of the customer segment.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCustomerSegmentResponse" + } + } + } + } + } + } + }, + "/v2/customers/{customer_id}": { + "delete": { + "tags": [ + "Customers" + ], + "summary": "DeleteCustomer", + "operationId": "DeleteCustomer", + "description": "Deletes a customer profile from a business.\n\nTo delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The current version of the customer profile.\n\nAs a best practice, you should include this parameter to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For more information, see [Delete a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile).", + "schema": { + "type": "integer", + "format": "int64" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomerResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Customers" + ], + "summary": "RetrieveCustomer", + "operationId": "RetrieveCustomer", + "description": "Returns details for a single customer.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCustomerResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Customers" + ], + "summary": "UpdateCustomer", + "operationId": "UpdateCustomer", + "description": "Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request.\nTo add or update a field, specify the new value. To remove a field, specify `null`.\n\nTo update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCustomerResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "INVALID_PHONE_NUMBER" + }, + { + "error-code": "INVALID_TIME" + }, + { + "error-code": "VALUE_TOO_LONG" + } + ] + } + }, + "/v2/customers/{customer_id}/cards": { + "post": { + "tags": [ + "Customers" + ], + "summary": "CreateCustomerCard", + "operationId": "CreateCustomerCard", + "description": "Adds a card on file to an existing customer.\n\nAs with charges, calls to `CreateCustomerCard` are idempotent. Multiple\ncalls with the same card nonce return the same card record that was created\nwith the provided nonce during the _first_ call.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "replacedBy": "CreateCard", + "guideUrl": "https://developer.squareup.com/docs/customers-api/what-it-does#deprecated-createcustomercard-endpoint" + }, + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The Square ID of the customer profile the card is linked to.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerCardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomerCardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_EXPIRED" + }, + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CARD_TOKEN_EXPIRED" + }, + { + "error-code": "CARD_TOKEN_USED" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "INVALID_CARD_DATA" + }, + { + "error-code": "INVALID_EXPIRATION" + }, + { + "error-code": "UNSUPPORTED_ENTRY_METHOD" + }, + { + "error-code": "VERIFY_AVS_FAILURE" + }, + { + "error-code": "VERIFY_CVV_FAILURE" + } + ] + } + }, + "/v2/customers/{customer_id}/cards/{card_id}": { + "delete": { + "tags": [ + "Customers" + ], + "summary": "DeleteCustomerCard", + "operationId": "DeleteCustomerCard", + "description": "Removes a card on file from a customer.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "replacedBy": "DisableCard", + "guideUrl": "https://developer.squareup.com/docs/customers-api/what-it-does#deprecated-deletecustomercard-endpoint" + }, + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer that the card on file belongs to.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "card_id", + "description": "The ID of the card on file to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomerCardResponse" + } + } + } + } + } + } + }, + "/v2/customers/{customer_id}/custom-attributes": { + "get": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "ListCustomerCustomAttributes", + "operationId": "ListCustomerCustomAttributes", + "description": "Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile.\n\nYou can use the `with_definitions` query parameter to also retrieve custom attribute definitions\nin the same call.\n\nWhen all response pages are retrieved, the results include all custom attributes that are\nvisible to the requesting application, including those that are owned by other applications\nand set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the target [customer profile](entity:Customer).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request. For more\ninformation, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "with_definitions", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCustomerCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/customers/{customer_id}/custom-attributes/{key}": { + "delete": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "DeleteCustomerCustomAttribute", + "operationId": "DeleteCustomerCustomAttribute", + "description": "Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile.\n\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the target [customer profile](entity:Customer).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to delete. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomerCustomAttributeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "RetrieveCustomerCustomAttribute", + "operationId": "RetrieveCustomerCustomAttribute", + "description": "Retrieves a [custom attribute](entity:CustomAttribute) associated with a customer profile.\n\nYou can use the `with_definition` query parameter to also retrieve the custom attribute definition\nin the same call.\n\nTo retrieve a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the target [customer profile](entity:Customer).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to retrieve. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "with_definition", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of\nthe custom attribute. Set this parameter to `true` to get the name and description of the custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "version", + "description": "The current version of the custom attribute, which is used for strongly consistent reads to\nguarantee that you receive the most up-to-date data. When included in the request, Square\nreturns the specified version or a higher version if one exists. If the specified version is\nhigher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveCustomerCustomAttributeResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "CustomerCustomAttributes" + ], + "summary": "UpsertCustomerCustomAttribute", + "operationId": "UpsertCustomerCustomAttribute", + "description": "Creates or updates a [custom attribute](entity:CustomAttribute) for a customer profile.\n\nUse this endpoint to set the value of a custom attribute for a specified customer profile.\nA custom attribute is based on a custom attribute definition in a Square seller account, which\nis created using the [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) endpoint.\n\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the target [customer profile](entity:Customer).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to create or update. This key must match the `key` of a\ncustom attribute definition in the Square seller account. If the requesting application is not\nthe definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertCustomerCustomAttributeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertCustomerCustomAttributeResponse" + } + } + } + } + } + } + }, + "/v2/customers/{customer_id}/groups/{group_id}": { + "delete": { + "tags": [ + "Customers" + ], + "summary": "RemoveGroupFromCustomer", + "operationId": "RemoveGroupFromCustomer", + "description": "Removes a group membership from a customer.\n\nThe customer is identified by the `customer_id` value\nand the customer group is identified by the `group_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer to remove from the group.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "group_id", + "description": "The ID of the customer group to remove the customer from.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoveGroupFromCustomerResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Customers" + ], + "summary": "AddGroupToCustomer", + "operationId": "AddGroupToCustomer", + "description": "Adds a group membership to a customer.\n\nThe customer is identified by the `customer_id` value\nand the customer group is identified by the `group_id` value.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "customer_id", + "description": "The ID of the customer to add to a group.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "group_id", + "description": "The ID of the customer group to add the customer to.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddGroupToCustomerResponse" + } + } + } + } + } + } + }, + "/v2/devices": { + "get": { + "tags": [ + "Devices" + ], + "summary": "ListDevices", + "operationId": "ListDevices", + "description": "List devices associated with the merchant. Currently, only Terminal API\ndevices are supported.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "DEVICES_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nSee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which results are listed.\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The number of results to return in a single page.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "If present, only returns devices at the target location.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDevicesResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + } + ] + } + }, + "/v2/devices/codes": { + "get": { + "tags": [ + "Devices" + ], + "summary": "ListDeviceCodes", + "operationId": "ListDeviceCodes", + "description": "Lists all DeviceCodes associated with the merchant.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DEVICE_CREDENTIAL_MANAGEMENT" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for your original query.\n\nSee [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "If specified, only returns DeviceCodes of the specified location.\nReturns DeviceCodes of all locations if empty.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "product_type", + "description": "If specified, only returns DeviceCodes targeting the specified product type.\nReturns DeviceCodes of all product types if empty.", + "schema": { + "$ref": "#/components/schemas/ProductType" + }, + "in": "query", + "required": false + }, + { + "name": "status", + "description": "If specified, returns DeviceCodes with the specified statuses.\nReturns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty.", + "schema": { + "$ref": "#/components/schemas/DeviceCodeStatus" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDeviceCodesResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_CURSOR" + }, + { + "error-code": "BAD_REQUEST" + } + ] + }, + "post": { + "tags": [ + "Devices" + ], + "summary": "CreateDeviceCode", + "operationId": "CreateDeviceCode", + "description": "Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected\nterminal mode.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DEVICE_CREDENTIAL_MANAGEMENT" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDeviceCodeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDeviceCodeResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "IDEMPOTENCY_KEY_REUSED" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "UNAUTHORIZED" + } + ] + } + }, + "/v2/devices/codes/{id}": { + "get": { + "tags": [ + "Devices" + ], + "summary": "GetDeviceCode", + "operationId": "GetDeviceCode", + "description": "Retrieves DeviceCode with the associated ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DEVICE_CREDENTIAL_MANAGEMENT" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The unique identifier for the device code.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetDeviceCodeResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "UNAUTHORIZED" + } + ] + } + }, + "/v2/devices/{device_id}": { + "get": { + "tags": [ + "Devices" + ], + "summary": "GetDevice", + "operationId": "GetDevice", + "description": "Retrieves Device with the associated `device_id`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "DEVICES_READ" + ] + } + ], + "parameters": [ + { + "name": "device_id", + "description": "The unique ID for the desired `Device`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetDeviceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/disputes": { + "get": { + "tags": [ + "Disputes" + ], + "summary": "ListDisputes", + "operationId": "ListDisputes", + "description": "Returns a list of disputes associated with a particular account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "states", + "description": "The dispute states used to filter the result. If not specified, the endpoint returns all disputes.", + "schema": { + "$ref": "#/components/schemas/DisputeState" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "The ID of the location for which to return a list of disputes.\nIf not specified, the endpoint returns disputes associated with all locations.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDisputesResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}": { + "get": { + "tags": [ + "Disputes" + ], + "summary": "RetrieveDispute", + "operationId": "RetrieveDispute", + "description": "Returns details about a specific dispute.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_READ" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute you want more details about.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveDisputeResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/accept": { + "post": { + "tags": [ + "Disputes" + ], + "summary": "AcceptDispute", + "operationId": "AcceptDispute", + "description": "Accepts the loss on a dispute. Square returns the disputed amount to the cardholder and\nupdates the dispute state to ACCEPTED.\n\nSquare debits the disputed amount from the seller’s Square account. If the Square account\ndoes not have sufficient funds, Square debits the associated bank account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute you want to accept.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptDisputeResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/evidence": { + "get": { + "tags": [ + "Disputes" + ], + "summary": "ListDisputeEvidence", + "operationId": "ListDisputeEvidence", + "description": "Returns a list of evidence associated with a dispute.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_READ" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDisputeEvidenceResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/evidence-files": { + "post": { + "tags": [ + "Disputes" + ], + "summary": "CreateDisputeEvidenceFile", + "operationId": "CreateDisputeEvidenceFile", + "description": "Uploads a file to use as evidence in a dispute challenge. The endpoint accepts HTTP\nmultipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute for which you want to upload evidence.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "request": { + "$ref": "#/components/schemas/CreateDisputeEvidenceFileRequest" + }, + "image_file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "image_file": { + "contentType": "image/jpeg" + }, + "request": { + "contentType": "application/json; charset=utf-8" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDisputeEvidenceFileResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/evidence-text": { + "post": { + "tags": [ + "Disputes" + ], + "summary": "CreateDisputeEvidenceText", + "operationId": "CreateDisputeEvidenceText", + "description": "Uploads text to use as evidence for a dispute challenge.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute for which you want to upload evidence.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDisputeEvidenceTextRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateDisputeEvidenceTextResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/evidence/{evidence_id}": { + "delete": { + "tags": [ + "Disputes" + ], + "summary": "DeleteDisputeEvidence", + "operationId": "DeleteDisputeEvidence", + "description": "Removes specified evidence from a dispute.\nSquare does not send the bank any evidence that is removed.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute from which you want to remove evidence.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "evidence_id", + "description": "The ID of the evidence you want to remove.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteDisputeEvidenceResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Disputes" + ], + "summary": "RetrieveDisputeEvidence", + "operationId": "RetrieveDisputeEvidence", + "description": "Returns the metadata for the evidence specified in the request URL path.\n\nYou must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_READ" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute from which you want to retrieve evidence metadata.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "evidence_id", + "description": "The ID of the evidence to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveDisputeEvidenceResponse" + } + } + } + } + } + } + }, + "/v2/disputes/{dispute_id}/submit-evidence": { + "post": { + "tags": [ + "Disputes" + ], + "summary": "SubmitEvidence", + "operationId": "SubmitEvidence", + "description": "Submits evidence to the cardholder's bank.\n\nThe evidence submitted by this endpoint includes evidence uploaded\nusing the [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenceFile) and\n[CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText) endpoints and\nevidence automatically provided by Square, when available. Evidence cannot be removed from\na dispute after submission.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "DISPUTES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "dispute_id", + "description": "The ID of the dispute for which you want to submit evidence.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmitEvidenceResponse" + } + } + } + } + } + } + }, + "/v2/employees": { + "get": { + "tags": [ + "Employees" + ], + "summary": "ListEmployees", + "operationId": "ListEmployees", + "description": "", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2020-08-26", + "retirementDate": "2021-08-26", + "replacedBy": "SearchTeamMembers", + "guideUrl": "https://developer.squareup.com/docs/team/migrate-from-v2-employees" + }, + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "status", + "description": "Specifies the EmployeeStatus to filter the employee by.", + "schema": { + "$ref": "#/components/schemas/EmployeeStatus" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The number of employees to be returned on each page.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The token required to retrieve the specified page of results.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEmployeesResponse" + } + } + } + } + } + } + }, + "/v2/employees/{id}": { + "get": { + "tags": [ + "Employees" + ], + "summary": "RetrieveEmployee", + "operationId": "RetrieveEmployee", + "description": "", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2020-08-26", + "retirementDate": "2021-08-26", + "replacedBy": "RetrieveTeamMember", + "guideUrl": "https://developer.squareup.com/docs/team/migrate-from-v2-employees" + }, + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "UUID for the employee that was requested.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveEmployeeResponse" + } + } + } + } + } + } + }, + "/v2/events": { + "post": { + "tags": [ + "Events" + ], + "summary": "SearchEvents", + "operationId": "SearchEvents", + "description": "Search for Square API events that occur within a 28-day timeframe.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchEventsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchEventsResponse" + } + } + } + } + } + } + }, + "/v2/events/disable": { + "put": { + "tags": [ + "Events" + ], + "summary": "DisableEvents", + "operationId": "DisableEvents", + "description": "Disables events to prevent them from being searchable.\nAll events are disabled by default. You must enable events to make them searchable.\nDisabling events for a specific time period prevents them from being searchable, even if you re-enable them later.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DisableEventsResponse" + } + } + } + } + } + } + }, + "/v2/events/enable": { + "put": { + "tags": [ + "Events" + ], + "summary": "EnableEvents", + "operationId": "EnableEvents", + "description": "Enables events to make them searchable. Only events that occur while in the enabled state are searchable.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EnableEventsResponse" + } + } + } + } + } + } + }, + "/v2/events/types": { + "get": { + "tags": [ + "Events" + ], + "summary": "ListEventTypes", + "operationId": "ListEventTypes", + "description": "Lists all event types that you can subscribe to as webhooks or query using the Events API.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "api_version", + "description": "The API version for which to list event types. Setting this field overrides the default version used by the application.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEventTypesResponse" + } + } + } + } + } + } + }, + "/v2/gift-cards": { + "get": { + "tags": [ + "GiftCards" + ], + "summary": "ListGiftCards", + "operationId": "ListGiftCards", + "description": "Lists all gift cards. You can specify optional filters to retrieve \na subset of the gift cards. Results are sorted by `created_at` in ascending order.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "type", + "description": "If a [type](entity:GiftCardType) is provided, the endpoint returns gift cards of the specified type.\nOtherwise, the endpoint returns gift cards of all types.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "state", + "description": "If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the specified state.\nOtherwise, the endpoint returns the gift cards of all states.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "If a limit is provided, the endpoint returns only the specified number of results per page.\nThe maximum value is 200. The default value is 30.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nIf a cursor is not provided, the endpoint returns the first page of the results. \nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "customer_id", + "description": "If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListGiftCardsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "GiftCards" + ], + "summary": "CreateGiftCard", + "operationId": "CreateGiftCard", + "description": "Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift card\nhas a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, call\n[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) and create an `ACTIVATE`\nactivity with the initial balance. Alternatively, you can use [RefundPayment](api-endpoint:Refunds-RefundPayment)\nto refund a payment to the new gift card.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGiftCardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGiftCardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "TEMPORARY_ERROR" + } + ] + } + }, + "/v2/gift-cards/activities": { + "get": { + "tags": [ + "GiftCardActivities" + ], + "summary": "ListGiftCardActivities", + "operationId": "ListGiftCardActivities", + "description": "Lists gift card activities. By default, you get gift card activities for all\ngift cards in the seller's account. You can optionally specify query parameters to\nfilter the list. For example, you can get a list of gift card activities for a gift card,\nfor all gift cards in a specific region, or for activities within a time window.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "gift_card_id", + "description": "If a gift card ID is provided, the endpoint returns activities related \nto the specified gift card. Otherwise, the endpoint returns all gift card activities for \nthe seller.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "type", + "description": "If a [type](entity:GiftCardActivityType) is provided, the endpoint returns gift card activities of the specified type. \nOtherwise, the endpoint returns all types of gift card activities.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "If a location ID is provided, the endpoint returns gift card activities for the specified location. \nOtherwise, the endpoint returns gift card activities for all locations.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "begin_time", + "description": "The timestamp for the beginning of the reporting period, in RFC 3339 format.\nThis start time is inclusive. The default value is the current time minus one year.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "The timestamp for the end of the reporting period, in RFC 3339 format.\nThis end time is inclusive. The default value is the current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "If a limit is provided, the endpoint returns the specified number \nof results (or fewer) per page. The maximum value is 100. The default value is 50.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nIf a cursor is not provided, the endpoint returns the first page of the results.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which the endpoint returns the activities, based on `created_at`.\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListGiftCardActivitiesResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "GiftCardActivities" + ], + "summary": "CreateGiftCardActivity", + "operationId": "CreateGiftCardActivity", + "description": "Creates a gift card activity to manage the balance or state of a [gift card](entity:GiftCard).\nFor example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGiftCardActivityRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGiftCardActivityResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INSUFFICIENT_FUNDS" + }, + { + "error-code": "PAYMENT_LIMIT_EXCEEDED" + }, + { + "error-code": "REFUND_AMOUNT_INVALID" + }, + { + "error-code": "TEMPORARY_ERROR" + } + ] + } + }, + "/v2/gift-cards/from-gan": { + "post": { + "tags": [ + "GiftCards" + ], + "summary": "RetrieveGiftCardFromGAN", + "operationId": "RetrieveGiftCardFromGAN", + "description": "Retrieves a gift card using the gift card account number (GAN).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveGiftCardFromGANRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveGiftCardFromGANResponse" + } + } + } + } + } + } + }, + "/v2/gift-cards/from-nonce": { + "post": { + "tags": [ + "GiftCards" + ], + "summary": "RetrieveGiftCardFromNonce", + "operationId": "RetrieveGiftCardFromNonce", + "description": "Retrieves a gift card using a secure payment token that represents the gift card.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveGiftCardFromNonceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveGiftCardFromNonceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_TOKEN_EXPIRED" + }, + { + "error-code": "CARD_TOKEN_USED" + } + ] + } + }, + "/v2/gift-cards/{gift_card_id}/link-customer": { + "post": { + "tags": [ + "GiftCards" + ], + "summary": "LinkCustomerToGiftCard", + "operationId": "LinkCustomerToGiftCard", + "description": "Links a customer to a gift card, which is also referred to as adding a card on file.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "gift_card_id", + "description": "The ID of the gift card to be linked.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LinkCustomerToGiftCardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LinkCustomerToGiftCardResponse" + } + } + } + } + } + } + }, + "/v2/gift-cards/{gift_card_id}/unlink-customer": { + "post": { + "tags": [ + "GiftCards" + ], + "summary": "UnlinkCustomerFromGiftCard", + "operationId": "UnlinkCustomerFromGiftCard", + "description": "Unlinks a customer from a gift card, which is also referred to as removing a card on file.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "gift_card_id", + "description": "The ID of the gift card to be unlinked.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnlinkCustomerFromGiftCardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnlinkCustomerFromGiftCardResponse" + } + } + } + } + } + } + }, + "/v2/gift-cards/{id}": { + "get": { + "tags": [ + "GiftCards" + ], + "summary": "RetrieveGiftCard", + "operationId": "RetrieveGiftCard", + "description": "Retrieves a gift card using the gift card ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "GIFTCARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the gift card to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveGiftCardResponse" + } + } + } + } + } + } + }, + "/v2/inventory/adjustment/{adjustment_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "DeprecatedRetrieveInventoryAdjustment", + "operationId": "DeprecatedRetrieveInventoryAdjustment", + "description": "Deprecated version of [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) after the endpoint URL\nis updated to conform to the standard convention.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "RetrieveInventoryAdjustment" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "adjustment_id", + "description": "ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryAdjustmentResponse" + } + } + } + } + } + } + }, + "/v2/inventory/adjustments/{adjustment_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "RetrieveInventoryAdjustment", + "operationId": "RetrieveInventoryAdjustment", + "description": "Returns the [InventoryAdjustment](entity:InventoryAdjustment) object\nwith the provided `adjustment_id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "adjustment_id", + "description": "ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryAdjustmentResponse" + } + } + } + } + } + } + }, + "/v2/inventory/batch-change": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "DeprecatedBatchChangeInventory", + "operationId": "DeprecatedBatchChangeInventory", + "description": "Deprecated version of [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) after the endpoint URL\nis updated to conform to the standard convention.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "BatchChangeInventory" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchChangeInventoryRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchChangeInventoryResponse" + } + } + } + } + } + } + }, + "/v2/inventory/batch-retrieve-changes": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "DeprecatedBatchRetrieveInventoryChanges", + "operationId": "DeprecatedBatchRetrieveInventoryChanges", + "description": "Deprecated version of [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) after the endpoint URL\nis updated to conform to the standard convention.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "BatchRetrieveInventoryChanges" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryChangesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryChangesResponse" + } + } + } + } + } + } + }, + "/v2/inventory/batch-retrieve-counts": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "DeprecatedBatchRetrieveInventoryCounts", + "operationId": "DeprecatedBatchRetrieveInventoryCounts", + "description": "Deprecated version of [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) after the endpoint URL\nis updated to conform to the standard convention.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "BatchRetrieveInventoryCounts" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryCountsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryCountsResponse" + } + } + } + } + } + } + }, + "/v2/inventory/changes/batch-create": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "BatchChangeInventory", + "operationId": "BatchChangeInventory", + "description": "Applies adjustments and counts to the provided item quantities.\n\nOn success: returns the current calculated counts for all objects\nreferenced in the request.\nOn failure: returns a list of related errors.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchChangeInventoryRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchChangeInventoryResponse" + } + } + } + } + } + } + }, + "/v2/inventory/changes/batch-retrieve": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "BatchRetrieveInventoryChanges", + "operationId": "BatchRetrieveInventoryChanges", + "description": "Returns historical physical counts and adjustments based on the\nprovided filter criteria.\n\nResults are paginated and sorted in ascending order according their\n`occurred_at` timestamp (oldest first).\n\nBatchRetrieveInventoryChanges is a catch-all query endpoint for queries\nthat cannot be handled by other, simpler endpoints.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryChangesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryChangesResponse" + } + } + } + } + } + } + }, + "/v2/inventory/counts/batch-retrieve": { + "post": { + "tags": [ + "Inventory" + ], + "summary": "BatchRetrieveInventoryCounts", + "operationId": "BatchRetrieveInventoryCounts", + "description": "Returns current counts for the provided\n[CatalogObject](entity:CatalogObject)s at the requested\n[Location](entity:Location)s.\n\nResults are paginated and sorted in descending order according to their\n`calculated_at` timestamp (newest first).\n\nWhen `updated_after` is specified, only counts that have changed since that\ntime (based on the server timestamp for the most recent change) are\nreturned. This allows clients to perform a \"sync\" operation, for example\nin response to receiving a Webhook notification.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryCountsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveInventoryCountsResponse" + } + } + } + } + } + } + }, + "/v2/inventory/physical-count/{physical_count_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "DeprecatedRetrieveInventoryPhysicalCount", + "operationId": "DeprecatedRetrieveInventoryPhysicalCount", + "description": "Deprecated version of [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) after the endpoint URL\nis updated to conform to the standard convention.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "RetrieveInventoryPhysicalCount" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "physical_count_id", + "description": "ID of the\n[InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryPhysicalCountResponse" + } + } + } + } + } + } + }, + "/v2/inventory/physical-counts/{physical_count_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "RetrieveInventoryPhysicalCount", + "operationId": "RetrieveInventoryPhysicalCount", + "description": "Returns the [InventoryPhysicalCount](entity:InventoryPhysicalCount)\nobject with the provided `physical_count_id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "physical_count_id", + "description": "ID of the\n[InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryPhysicalCountResponse" + } + } + } + } + } + } + }, + "/v2/inventory/transfers/{transfer_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "RetrieveInventoryTransfer", + "operationId": "RetrieveInventoryTransfer", + "description": "Returns the [InventoryTransfer](entity:InventoryTransfer) object\nwith the provided `transfer_id`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "transfer_id", + "description": "ID of the [InventoryTransfer](entity:InventoryTransfer) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryTransferResponse" + } + } + } + } + } + } + }, + "/v2/inventory/{catalog_object_id}": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "RetrieveInventoryCount", + "operationId": "RetrieveInventoryCount", + "description": "Retrieves the current calculated stock count for a given\n[CatalogObject](entity:CatalogObject) at a given set of\n[Location](entity:Location)s. Responses are paginated and unsorted.\nFor more sophisticated queries, use a batch endpoint.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "catalog_object_id", + "description": "ID of the [CatalogObject](entity:CatalogObject) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "location_ids", + "description": "The [Location](entity:Location) IDs to look up as a comma-separated\nlist. An empty list queries all locations.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryCountResponse" + } + } + } + } + } + } + }, + "/v2/inventory/{catalog_object_id}/changes": { + "get": { + "tags": [ + "Inventory" + ], + "summary": "RetrieveInventoryChanges", + "operationId": "RetrieveInventoryChanges", + "description": "Returns a set of physical counts and inventory adjustments for the\nprovided [CatalogObject](entity:CatalogObject) at the requested\n[Location](entity:Location)s.\n\nYou can achieve the same result by calling [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges)\nand having the `catalog_object_ids` list contain a single element of the `CatalogObject` ID.\n\nResults are paginated and sorted in descending order according to their\n`occurred_at` timestamp (newest first).\n\nThere are no limits on how far back the caller can page. This endpoint can be\nused to display recent changes for a specific item. For more\nsophisticated queries, use a batch endpoint.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-06-16", + "retirementDate": "2023-11-15", + "replacedBy": "BatchRetrieveInventoryChanges" + }, + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "catalog_object_id", + "description": "ID of the [CatalogObject](entity:CatalogObject) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "location_ids", + "description": "The [Location](entity:Location) IDs to look up as a comma-separated\nlist. An empty list queries all locations.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for the original query.\n\nSee the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveInventoryChangesResponse" + } + } + } + } + } + } + }, + "/v2/invoices": { + "get": { + "tags": [ + "Invoices" + ], + "summary": "ListInvoices", + "operationId": "ListInvoices", + "description": "Returns a list of invoices for a given location. The response \nis paginated. If truncated, the response includes a `cursor` that you \nuse in a subsequent request to retrieve the next set of invoices.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVOICES_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location for which to list invoices.", + "schema": { + "type": "string" + }, + "in": "query", + "required": true + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint. \nProvide this cursor to retrieve the next set of results for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of invoices to return (200 is the maximum `limit`). \nIf not provided, the server uses a default limit of 100 invoices.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListInvoicesResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Invoices" + ], + "summary": "CreateInvoice", + "operationId": "CreateInvoice", + "description": "Creates a draft [invoice](entity:Invoice) \nfor an order created using the Orders API.\n\nA draft invoice remains in your account and no action is taken. \nYou must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateInvoiceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateInvoiceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "MERCHANT_SUBSCRIPTION_NOT_FOUND" + } + ] + } + }, + "/v2/invoices/search": { + "post": { + "tags": [ + "Invoices" + ], + "summary": "SearchInvoices", + "operationId": "SearchInvoices", + "description": "Searches for invoices from a location specified in \nthe filter. You can optionally specify customers in the filter for whom to \nretrieve invoices. In the current implementation, you can only specify one location and \noptionally one customer.\n\nThe response is paginated. If truncated, the response includes a `cursor` \nthat you use in a subsequent request to retrieve the next set of invoices.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVOICES_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchInvoicesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchInvoicesResponse" + } + } + } + } + } + } + }, + "/v2/invoices/{invoice_id}": { + "delete": { + "tags": [ + "Invoices" + ], + "summary": "DeleteInvoice", + "operationId": "DeleteInvoice", + "description": "Deletes the specified invoice. When an invoice is deleted, the \nassociated order status changes to CANCELED. You can only delete a draft \ninvoice (you cannot delete a published invoice, including one that is scheduled for processing).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the invoice to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The version of the [invoice](entity:Invoice) to delete.\nIf you do not know the version, you can call [GetInvoice](api-endpoint:Invoices-GetInvoice) or \n[ListInvoices](api-endpoint:Invoices-ListInvoices).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteInvoiceResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Invoices" + ], + "summary": "GetInvoice", + "operationId": "GetInvoice", + "description": "Retrieves an invoice by invoice ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVOICES_READ" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the invoice to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetInvoiceResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Invoices" + ], + "summary": "UpdateInvoice", + "operationId": "UpdateInvoice", + "description": "Updates an invoice. This endpoint supports sparse updates, so you only need\nto specify the fields you want to change along with the required `version` field.\nSome restrictions apply to updating invoices. For example, you cannot change the\n`order_id` or `location_id` field.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the invoice to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateInvoiceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateInvoiceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_DECLINED" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "MERCHANT_SUBSCRIPTION_NOT_FOUND" + } + ] + } + }, + "/v2/invoices/{invoice_id}/attachments": { + "post": { + "tags": [ + "Invoices" + ], + "summary": "CreateInvoiceAttachment", + "operationId": "CreateInvoiceAttachment", + "description": "Uploads a file and attaches it to an invoice. This endpoint accepts HTTP multipart/form-data file uploads\nwith a JSON `request` part and a `file` part. The `file` part must be a `readable stream` that contains a file\nin a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF.\n\nInvoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added only to invoices\nin the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state.\n\n__NOTE:__ When testing in the Sandbox environment, the total file size is limited to 1 KB.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the [invoice](entity:Invoice) to attach the file to.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "request": { + "$ref": "#/components/schemas/CreateInvoiceAttachmentRequest" + }, + "image_file": { + "type": "string", + "format": "binary" + } + } + }, + "encoding": { + "image_file": { + "contentType": "image/jpeg" + }, + "request": { + "contentType": "application/json; charset=utf-8" + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateInvoiceAttachmentResponse" + } + } + } + } + } + } + }, + "/v2/invoices/{invoice_id}/attachments/{attachment_id}": { + "delete": { + "tags": [ + "Invoices" + ], + "summary": "DeleteInvoiceAttachment", + "operationId": "DeleteInvoiceAttachment", + "description": "Removes an attachment from an invoice and permanently deletes the file. Attachments can be removed only\nfrom invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the [invoice](entity:Invoice) to delete the attachment from.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "attachment_id", + "description": "The ID of the [attachment](entity:InvoiceAttachment) to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteInvoiceAttachmentResponse" + } + } + } + } + } + } + }, + "/v2/invoices/{invoice_id}/cancel": { + "post": { + "tags": [ + "Invoices" + ], + "summary": "CancelInvoice", + "operationId": "CancelInvoice", + "description": "Cancels an invoice. The seller cannot collect payments for \nthe canceled invoice.\n\nYou cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the [invoice](entity:Invoice) to cancel.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelInvoiceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelInvoiceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "VERSION_MISMATCH" + } + ] + } + }, + "/v2/invoices/{invoice_id}/publish": { + "post": { + "tags": [ + "Invoices" + ], + "summary": "PublishInvoice", + "operationId": "PublishInvoice", + "description": "Publishes the specified draft invoice. \n\nAfter an invoice is published, Square \nfollows up based on the invoice configuration. For example, Square \nsends the invoice to the customer's email address, charges the customer's card on file, or does \nnothing. Square also makes the invoice available on a Square-hosted invoice page. \n\nThe invoice `status` also changes from `DRAFT` to a status \nbased on the invoice configuration. For example, the status changes to `UNPAID` if \nSquare emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the \ninvoice amount.\n\nIn addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ`\nand `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "invoice_id", + "description": "The ID of the invoice to publish.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublishInvoiceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublishInvoiceResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_DECLINED" + }, + { + "error-code": "INVALID_CARD" + } + ] + } + }, + "/v2/labor/break-types": { + "get": { + "tags": [ + "Labor" + ], + "summary": "ListBreakTypes", + "operationId": "ListBreakTypes", + "description": "Returns a paginated list of `BreakType` instances for a business.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "Filter the returned `BreakType` results to only those that are associated with the\nspecified location.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of `BreakType` results to return per page. The number can range between 1\nand 200. The default is 200.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pointer to the next page of `BreakType` results to fetch.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBreakTypesResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Labor" + ], + "summary": "CreateBreakType", + "operationId": "CreateBreakType", + "description": "Creates a new `BreakType`.\n\nA `BreakType` is a template for creating `Break` objects.\nYou must provide the following values in your request to this\nendpoint:\n\n- `location_id`\n- `break_name`\n- `expected_duration`\n- `is_paid`\n\nYou can only have three `BreakType` instances per location. If you attempt to add a fourth\n`BreakType` for a location, an `INVALID_REQUEST_ERROR` \"Exceeded limit of 3 breaks per location.\"\nis returned.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBreakTypeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBreakTypeResponse" + } + } + } + } + } + } + }, + "/v2/labor/break-types/{id}": { + "delete": { + "tags": [ + "Labor" + ], + "summary": "DeleteBreakType", + "operationId": "DeleteBreakType", + "description": "Deletes an existing `BreakType`.\n\nA `BreakType` can be deleted even if it is referenced from a `Shift`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `BreakType` being deleted.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteBreakTypeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Labor" + ], + "summary": "GetBreakType", + "operationId": "GetBreakType", + "description": "Returns a single `BreakType` specified by `id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `BreakType` being retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBreakTypeResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Labor" + ], + "summary": "UpdateBreakType", + "operationId": "UpdateBreakType", + "description": "Updates an existing `BreakType`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_WRITE", + "TIMECARDS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": " The UUID for the `BreakType` being updated.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBreakTypeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBreakTypeResponse" + } + } + } + } + } + } + }, + "/v2/labor/employee-wages": { + "get": { + "tags": [ + "Labor" + ], + "summary": "ListEmployeeWages", + "operationId": "ListEmployeeWages", + "description": "Returns a paginated list of `EmployeeWage` instances for a business.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2020-08-26", + "retirementDate": "TBD", + "replacedBy": "ListTeamMemberWages", + "guideUrl": "https://developer.squareup.com/docs/labor-api/migrate-to-teams" + }, + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "employee_id", + "description": "Filter the returned wages to only those that are associated with the specified employee.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of `EmployeeWage` results to return per page. The number can range between\n1 and 200. The default is 200.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pointer to the next page of `EmployeeWage` results to fetch.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEmployeeWagesResponse" + } + } + } + } + } + } + }, + "/v2/labor/employee-wages/{id}": { + "get": { + "tags": [ + "Labor" + ], + "summary": "GetEmployeeWage", + "operationId": "GetEmployeeWage", + "description": "Returns a single `EmployeeWage` specified by `id`.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2020-08-26", + "retirementDate": "TBD", + "replacedBy": "GetTeamMemberWage", + "guideUrl": "https://developer.squareup.com/docs/labor-api/migrate-to-teams" + }, + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `EmployeeWage` being retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetEmployeeWageResponse" + } + } + } + } + } + } + }, + "/v2/labor/scheduled-shifts": { + "post": { + "tags": [ + "Labor" + ], + "summary": "CreateScheduledShift", + "operationId": "CreateScheduledShift", + "description": "Creates a scheduled shift by providing draft shift details such as job ID,\nteam member assignment, and start and end times.\n\nThe following `draft_shift_details` fields are required:\n- `location_id`\n- `job_id`\n- `start_at`\n- `end_at`", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateScheduledShiftRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateScheduledShiftResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + } + ] + } + }, + "/v2/labor/scheduled-shifts/bulk-publish": { + "post": { + "tags": [ + "Labor" + ], + "summary": "BulkPublishScheduledShifts", + "operationId": "BulkPublishScheduledShifts", + "description": "Publishes 1 - 100 scheduled shifts. This endpoint takes a map of individual publish\nrequests and returns a map of responses. When a scheduled shift is published, Square keeps\nthe `draft_shift_details` field as is and copies it to the `published_shift_details` field.\n\nThe minimum `start_at` and maximum `end_at` timestamps of all shifts in a\n`BulkPublishScheduledShifts` request must fall within a two-week period.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkPublishScheduledShiftsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkPublishScheduledShiftsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + } + ] + } + }, + "/v2/labor/scheduled-shifts/search": { + "post": { + "tags": [ + "Labor" + ], + "summary": "SearchScheduledShifts", + "operationId": "SearchScheduledShifts", + "description": "Returns a paginated list of scheduled shifts, with optional filter and sort settings.\nBy default, results are sorted by `start_at` in ascending order.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchScheduledShiftsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchScheduledShiftsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "EXPECTED_STRING" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/labor/scheduled-shifts/{id}": { + "get": { + "tags": [ + "Labor" + ], + "summary": "RetrieveScheduledShift", + "operationId": "RetrieveScheduledShift", + "description": "Retrieves a scheduled shift by ID.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the scheduled shift to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveScheduledShiftResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + }, + "put": { + "tags": [ + "Labor" + ], + "summary": "UpdateScheduledShift", + "operationId": "UpdateScheduledShift", + "description": "Updates the draft shift details for a scheduled shift. This endpoint supports\nsparse updates, so only new, changed, or removed fields are required in the request.\nYou must publish the shift to make updates public.\n\nYou can make the following updates to `draft_shift_details`:\n- Change the `location_id`, `job_id`, `start_at`, and `end_at` fields.\n- Add, change, or clear the `team_member_id` and `notes` fields. To clear these fields,\nset the value to null.\n- Change the `is_deleted` field. To delete a scheduled shift, set `is_deleted` to true\nand then publish the shift.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the scheduled shift to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateScheduledShiftRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateScheduledShiftResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "VERSION_MISMATCH" + } + ] + } + }, + "/v2/labor/scheduled-shifts/{id}/publish": { + "post": { + "tags": [ + "Labor" + ], + "summary": "PublishScheduledShift", + "operationId": "PublishScheduledShift", + "description": "Publishes a scheduled shift. When a scheduled shift is published, Square keeps the\n`draft_shift_details` field as is and copies it to the `published_shift_details` field.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the scheduled shift to publish.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublishScheduledShiftRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PublishScheduledShiftResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + } + ] + } + }, + "/v2/labor/shifts": { + "post": { + "tags": [ + "Labor" + ], + "summary": "CreateShift", + "operationId": "CreateShift", + "description": "Creates a new `Shift`.\n\nA `Shift` represents a complete workday for a single team member.\nYou must provide the following values in your request to this\nendpoint:\n\n- `location_id`\n- `team_member_id`\n- `start_at`\n\nAn attempt to create a new `Shift` can result in a `BAD_REQUEST` error when:\n- The `status` of the new `Shift` is `OPEN` and the team member has another\nshift with an `OPEN` status.\n- The `start_at` date is in the future.\n- The `start_at` or `end_at` date overlaps another shift for the same team member.\n- The `Break` instances are set in the request and a break `start_at`\nis before the `Shift.start_at`, a break `end_at` is after\nthe `Shift.end_at`, or both.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2025-05-21", + "retirementDate": "2026-05-21", + "replacedBy": "CreateTimecard", + "guideUrl": "https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes" + }, + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateShiftRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateShiftResponse" + } + } + } + } + } + } + }, + "/v2/labor/shifts/search": { + "post": { + "tags": [ + "Labor" + ], + "summary": "SearchShifts", + "operationId": "SearchShifts", + "description": "Returns a paginated list of `Shift` records for a business.\nThe list to be returned can be filtered by:\n- Location IDs\n- Team member IDs\n- Shift status (`OPEN` or `CLOSED`)\n- Shift start\n- Shift end\n- Workday details\n\nThe list can be sorted by:\n- `START_AT`\n- `END_AT`\n- `CREATED_AT`\n- `UPDATED_AT`", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2025-05-21", + "retirementDate": "2026-05-21", + "replacedBy": "SearchTimecards", + "guideUrl": "https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes" + }, + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchShiftsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchShiftsResponse" + } + } + } + } + } + } + }, + "/v2/labor/shifts/{id}": { + "delete": { + "tags": [ + "Labor" + ], + "summary": "DeleteShift", + "operationId": "DeleteShift", + "description": "Deletes a `Shift`.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2025-05-21", + "retirementDate": "2026-05-21", + "replacedBy": "DeleteTimecard", + "guideUrl": "https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes" + }, + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `Shift` being deleted.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteShiftResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Labor" + ], + "summary": "GetShift", + "operationId": "GetShift", + "description": "Returns a single `Shift` specified by `id`.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2025-05-21", + "retirementDate": "2026-05-21", + "replacedBy": "RetrieveTimecard", + "guideUrl": "https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes" + }, + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `Shift` being retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetShiftResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Labor" + ], + "summary": "UpdateShift", + "operationId": "UpdateShift", + "description": "Updates an existing `Shift`.\n\nWhen adding a `Break` to a `Shift`, any earlier `Break` instances in the `Shift` have\nthe `end_at` property set to a valid RFC-3339 datetime string.\n\nWhen closing a `Shift`, all `Break` instances in the `Shift` must be complete with `end_at`\nset on each `Break`.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2025-05-21", + "retirementDate": "2026-05-21", + "replacedBy": "UpdateTimecard", + "guideUrl": "https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes" + }, + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE", + "TIMECARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the object being updated.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateShiftRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateShiftResponse" + } + } + } + } + } + } + }, + "/v2/labor/team-member-wages": { + "get": { + "tags": [ + "Labor" + ], + "summary": "ListTeamMemberWages", + "operationId": "ListTeamMemberWages", + "description": "Returns a paginated list of `TeamMemberWage` instances for a business.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "Filter the returned wages to only those that are associated with the\nspecified team member.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of `TeamMemberWage` results to return per page. The number can range between\n1 and 200. The default is 200.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pointer to the next page of `EmployeeWage` results to fetch.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTeamMemberWagesResponse" + } + } + } + } + } + } + }, + "/v2/labor/team-member-wages/{id}": { + "get": { + "tags": [ + "Labor" + ], + "summary": "GetTeamMemberWage", + "operationId": "GetTeamMemberWage", + "description": "Returns a single `TeamMemberWage` specified by `id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `TeamMemberWage` being retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTeamMemberWageResponse" + } + } + } + } + } + } + }, + "/v2/labor/timecards": { + "post": { + "tags": [ + "Labor" + ], + "summary": "CreateTimecard", + "operationId": "CreateTimecard", + "description": "Creates a new `Timecard`.\n\nA `Timecard` represents a complete workday for a single team member.\nYou must provide the following values in your request to this\nendpoint:\n\n- `location_id`\n- `team_member_id`\n- `start_at`\n\nAn attempt to create a new `Timecard` can result in a `BAD_REQUEST` error when:\n- The `status` of the new `Timecard` is `OPEN` and the team member has another\ntimecard with an `OPEN` status.\n- The `start_at` date is in the future.\n- The `start_at` or `end_at` date overlaps another timecard for the same team member.\n- The `Break` instances are set in the request and a break `start_at`\nis before the `Timecard.start_at`, a break `end_at` is after\nthe `Timecard.end_at`, or both.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTimecardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTimecardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/labor/timecards/search": { + "post": { + "tags": [ + "Labor" + ], + "summary": "SearchTimecards", + "operationId": "SearchTimecards", + "description": "Returns a paginated list of `Timecard` records for a business.\nThe list to be returned can be filtered by:\n- Location IDs\n- Team member IDs\n- Timecard status (`OPEN` or `CLOSED`)\n- Timecard start\n- Timecard end\n- Workday details\n\nThe list can be sorted by:\n- `START_AT`\n- `END_AT`\n- `CREATED_AT`\n- `UPDATED_AT`", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTimecardsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTimecardsResponse" + } + } + } + } + } + } + }, + "/v2/labor/timecards/{id}": { + "delete": { + "tags": [ + "Labor" + ], + "summary": "DeleteTimecard", + "operationId": "DeleteTimecard", + "description": "Deletes a `Timecard`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `Timecard` being deleted.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteTimecardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + }, + "get": { + "tags": [ + "Labor" + ], + "summary": "RetrieveTimecard", + "operationId": "RetrieveTimecard", + "description": "Returns a single `Timecard` specified by `id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `Timecard` being retrieved.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTimecardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + }, + "put": { + "tags": [ + "Labor" + ], + "summary": "UpdateTimecard", + "operationId": "UpdateTimecard", + "description": "Updates an existing `Timecard`.\n\nWhen adding a `Break` to a `Timecard`, any earlier `Break` instances in the `Timecard` have\nthe `end_at` property set to a valid RFC-3339 datetime string.\n\nWhen closing a `Timecard`, all `Break` instances in the `Timecard` must be complete with `end_at`\nset on each `Break`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_WRITE", + "TIMECARDS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the object being updated.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTimecardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTimecardResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "VERSION_MISMATCH" + } + ] + } + }, + "/v2/labor/workweek-configs": { + "get": { + "tags": [ + "Labor" + ], + "summary": "ListWorkweekConfigs", + "operationId": "ListWorkweekConfigs", + "description": "Returns a list of `WorkweekConfig` instances for a business.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "limit", + "description": "The maximum number of `WorkweekConfigs` results to return per page.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pointer to the next page of `WorkweekConfig` results to fetch.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWorkweekConfigsResponse" + } + } + } + } + } + } + }, + "/v2/labor/workweek-configs/{id}": { + "put": { + "tags": [ + "Labor" + ], + "summary": "UpdateWorkweekConfig", + "operationId": "UpdateWorkweekConfig", + "description": "Updates a `WorkweekConfig`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "TIMECARDS_SETTINGS_WRITE", + "TIMECARDS_SETTINGS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The UUID for the `WorkweekConfig` object being updated.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkweekConfigRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkweekConfigResponse" + } + } + } + } + } + } + }, + "/v2/locations": { + "get": { + "tags": [ + "Locations" + ], + "summary": "ListLocations", + "operationId": "ListLocations", + "description": "Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api),\nincluding those with an inactive status. Locations are listed alphabetically by `name`.", + "x-release-status": "PUBLIC", + "x-unitTests": [ + { + "expectedResponse": { + "headers": {}, + "statusCode": "200", + "x-allowExtraHeaders": true, + "x-arrayCheckCount": false, + "x-arrayOrderedMatching": false, + "x-bodyMatchMode": "NONE", + "x-matchResponseSchema": true + }, + "request": { + "method": "GET", + "uri": "/v2/locations" + }, + "x-testEnabled": true, + "x-testName": "ListLocations", + "x-testShouldPass": true + } + ], + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLocationsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Locations" + ], + "summary": "CreateLocation", + "operationId": "CreateLocation", + "description": "Creates a [location](https://developer.squareup.com/docs/locations-api).\nCreating new locations allows for separate configuration of receipt layouts, item prices,\nand sales reports. Developers can use locations to separate sales activity through applications\nthat integrate with Square from sales activity elsewhere in a seller's account.\nLocations created programmatically with the Locations API last forever and\nare visible to the seller for their own management. Therefore, ensure that\neach location has a sensible and unique name.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLocationRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLocationResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + } + ] + } + }, + "/v2/locations/custom-attribute-definitions": { + "get": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "ListLocationCustomAttributeDefinitions", + "operationId": "ListLocationCustomAttributeDefinitions", + "description": "Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.\nWhen all response pages are retrieved, the results include all custom attribute definitions\nthat are visible to the requesting application, including those that are created by other\napplications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "visibility_filter", + "description": "Filters the `CustomAttributeDefinition` results by their `visibility` values.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLocationCustomAttributeDefinitionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "CreateLocationCustomAttributeDefinition", + "operationId": "CreateLocationCustomAttributeDefinition", + "description": "Creates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\nUse this endpoint to define a custom attribute that can be associated with locations.\nA custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties\nfor a custom attribute. After the definition is created, you can call\n[UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) or\n[BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes)\nto set the custom attribute for locations.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLocationCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLocationCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/locations/custom-attribute-definitions/{key}": { + "delete": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "DeleteLocationCustomAttributeDefinition", + "operationId": "DeleteLocationCustomAttributeDefinition", + "description": "Deletes a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\nDeleting a custom attribute definition also deletes the corresponding custom attribute from\nall locations.\nOnly the definition owner can delete a custom attribute definition.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteLocationCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "RetrieveLocationCustomAttributeDefinition", + "operationId": "RetrieveLocationCustomAttributeDefinition", + "description": "Retrieves a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\nTo retrieve a custom attribute definition created by another application, the `visibility`\nsetting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to retrieve. If the requesting application\nis not the definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The current version of the custom attribute definition, which is used for strongly consistent\nreads to guarantee that you receive the most up-to-date data. When included in the request,\nSquare returns the specified version or a higher version if one exists. If the specified version\nis higher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLocationCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "UpdateLocationCustomAttributeDefinition", + "operationId": "UpdateLocationCustomAttributeDefinition", + "description": "Updates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\nUse this endpoint to update the following fields: `name`, `description`, `visibility`, or the\n`schema` for a `Selection` data type.\nOnly the definition owner can update a custom attribute definition.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/locations/custom-attributes/bulk-delete": { + "post": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "BulkDeleteLocationCustomAttributes", + "operationId": "BulkDeleteLocationCustomAttributes", + "description": "Deletes [custom attributes](entity:CustomAttribute) for locations as a bulk operation.\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteLocationCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteLocationCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/locations/custom-attributes/bulk-upsert": { + "post": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "BulkUpsertLocationCustomAttributes", + "operationId": "BulkUpsertLocationCustomAttributes", + "description": "Creates or updates [custom attributes](entity:CustomAttribute) for locations as a bulk operation.\nUse this endpoint to set the value of one or more custom attributes for one or more locations.\nA custom attribute is based on a custom attribute definition in a Square seller account, which is\ncreated using the [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) endpoint.\nThis `BulkUpsertLocationCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert\nrequests and returns a map of individual upsert responses. Each upsert request has a unique ID\nand provides a location ID and custom attribute. Each upsert response is returned with the ID\nof the corresponding request.\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertLocationCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertLocationCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/locations/{location_id}": { + "get": { + "tags": [ + "Locations" + ], + "summary": "RetrieveLocation", + "operationId": "RetrieveLocation", + "description": "Retrieves details of a single location. Specify \"main\"\nas the location ID to retrieve details of the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to retrieve. Specify the string\n\"main\" to return the main location.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLocationResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "NOT_FOUND" + } + ] + }, + "put": { + "tags": [ + "Locations" + ], + "summary": "UpdateLocation", + "operationId": "UpdateLocation", + "description": "Updates a [location](https://developer.squareup.com/docs/locations-api).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + } + ] + } + }, + "/v2/locations/{location_id}/checkouts": { + "post": { + "tags": [ + "Checkout" + ], + "summary": "CreateCheckout", + "operationId": "CreateCheckout", + "description": "Links a `checkoutId` to a `checkout_page_url` that customers are\ndirected to in order to provide their payment information using a\npayment processing workflow hosted on connect.squareup.com. \n\n\nNOTE: The Checkout API has been updated with new features. \nFor more information, see [Checkout API highlights](https://developer.squareup.com/docs/checkout-api#checkout-api-highlights).", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2022-08-17", + "retirementDate": "TBD", + "replacedBy": "CreatePaymentLink", + "guideUrl": "https://developer.squareup.com/docs/migrate-from-v1/guides/v1-checkout" + }, + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE", + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the business location to associate the checkout with.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCheckoutRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCheckoutResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "AMOUNT_TOO_HIGH" + }, + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "ORDER_EXPIRED" + } + ] + } + }, + "/v2/locations/{location_id}/custom-attributes": { + "get": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "ListLocationCustomAttributes", + "operationId": "ListLocationCustomAttributes", + "description": "Lists the [custom attributes](entity:CustomAttribute) associated with a location.\nYou can use the `with_definitions` query parameter to also retrieve custom attribute definitions\nin the same call.\nWhen all response pages are retrieved, the results include all custom attributes that are\nvisible to the requesting application, including those that are owned by other applications\nand set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the target [location](entity:Location).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "visibility_filter", + "description": "Filters the `CustomAttributeDefinition` results by their `visibility` values.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request. For more\ninformation, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "with_definitions", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLocationCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/locations/{location_id}/custom-attributes/{key}": { + "delete": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "DeleteLocationCustomAttribute", + "operationId": "DeleteLocationCustomAttribute", + "description": "Deletes a [custom attribute](entity:CustomAttribute) associated with a location.\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the target [location](entity:Location).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to delete. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteLocationCustomAttributeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "RetrieveLocationCustomAttribute", + "operationId": "RetrieveLocationCustomAttribute", + "description": "Retrieves a [custom attribute](entity:CustomAttribute) associated with a location.\nYou can use the `with_definition` query parameter to also retrieve the custom attribute definition\nin the same call.\nTo retrieve a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the target [location](entity:Location).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to retrieve. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "with_definition", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of\nthe custom attribute. Set this parameter to `true` to get the name and description of the custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "version", + "description": "The current version of the custom attribute, which is used for strongly consistent reads to\nguarantee that you receive the most up-to-date data. When included in the request, Square\nreturns the specified version or a higher version if one exists. If the specified version is\nhigher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLocationCustomAttributeResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "LocationCustomAttributes" + ], + "summary": "UpsertLocationCustomAttribute", + "operationId": "UpsertLocationCustomAttribute", + "description": "Creates or updates a [custom attribute](entity:CustomAttribute) for a location.\nUse this endpoint to set the value of a custom attribute for a specified location.\nA custom attribute is based on a custom attribute definition in a Square seller account, which\nis created using the [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) endpoint.\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the target [location](entity:Location).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to create or update. This key must match the `key` of a\ncustom attribute definition in the Square seller account. If the requesting application is not\nthe definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertLocationCustomAttributeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertLocationCustomAttributeResponse" + } + } + } + } + } + } + }, + "/v2/locations/{location_id}/transactions": { + "get": { + "tags": [ + "Transactions" + ], + "summary": "ListTransactions", + "operationId": "ListTransactions", + "description": "Lists transactions for a particular location.\n\nTransactions include payment information from sales and exchanges and refund\ninformation from returns and exchanges.\n\nMax results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2019-08-15", + "retirementDate": "TBD", + "replacedBy": "SearchOrders", + "guideUrl": "https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api" + }, + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location to list transactions for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "begin_time", + "description": "The beginning of the requested reporting period, in RFC 3339 format.\n\nSee [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.\n\nDefault value: The current time minus one year.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "The end of the requested reporting period, in RFC 3339 format.\n\nSee [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.\n\nDefault value: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which results are listed in the response (`ASC` for\noldest first, `DESC` for newest first).\n\nDefault value: `DESC`", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for your original query.\n\nSee [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTransactionsResponse" + } + } + } + } + } + } + }, + "/v2/locations/{location_id}/transactions/{transaction_id}": { + "get": { + "tags": [ + "Transactions" + ], + "summary": "RetrieveTransaction", + "operationId": "RetrieveTransaction", + "description": "Retrieves details for a single transaction.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2019-08-15", + "retirementDate": "TBD", + "replacedBy": "BatchRetrieveOrders", + "guideUrl": "https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api" + }, + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the transaction's associated location.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "transaction_id", + "description": "The ID of the transaction to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTransactionResponse" + } + } + } + } + } + } + }, + "/v2/locations/{location_id}/transactions/{transaction_id}/capture": { + "post": { + "tags": [ + "Transactions" + ], + "summary": "CaptureTransaction", + "operationId": "CaptureTransaction", + "description": "Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge)\nendpoint with a `delay_capture` value of `true`.\n\n\nSee [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture)\nfor more information.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2019-08-15", + "retirementDate": "TBD", + "replacedBy": "CompletePayment", + "guideUrl": "https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api" + }, + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "transaction_id", + "description": "", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CaptureTransactionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "DELAYED_TRANSACTION_CANCELED" + }, + { + "error-code": "DELAYED_TRANSACTION_EXPIRED" + } + ] + } + }, + "/v2/locations/{location_id}/transactions/{transaction_id}/void": { + "post": { + "tags": [ + "Transactions" + ], + "summary": "VoidTransaction", + "operationId": "VoidTransaction", + "description": "Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge)\nendpoint with a `delay_capture` value of `true`.\n\n\nSee [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture)\nfor more information.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2019-08-15", + "retirementDate": "TBD", + "replacedBy": "CancelPayment", + "guideUrl": "https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api" + }, + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "transaction_id", + "description": "", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VoidTransactionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "DELAYED_TRANSACTION_CAPTURED" + }, + { + "error-code": "DELAYED_TRANSACTION_EXPIRED" + } + ] + } + }, + "/v2/loyalty/accounts": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "CreateLoyaltyAccount", + "operationId": "CreateLoyaltyAccount", + "description": "Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and a `mapping` with the `phone_number` of the buyer.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyAccountRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyAccountResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_PHONE_NUMBER" + } + ] + } + }, + "/v2/loyalty/accounts/search": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "SearchLoyaltyAccounts", + "operationId": "SearchLoyaltyAccounts", + "description": "Searches for loyalty accounts in a loyalty program.\n\nYou can search for a loyalty account using the phone number or customer ID associated with the account. To return all loyalty accounts, specify an empty `query` object or omit it entirely.\n\nSearch results are sorted by `created_at` in ascending order.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyAccountsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyAccountsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/accounts/{account_id}": { + "get": { + "tags": [ + "Loyalty" + ], + "summary": "RetrieveLoyaltyAccount", + "operationId": "RetrieveLoyaltyAccount", + "description": "Retrieves a loyalty account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "account_id", + "description": "The ID of the [loyalty account](entity:LoyaltyAccount) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLoyaltyAccountResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/accounts/{account_id}/accumulate": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "AccumulateLoyaltyPoints", + "operationId": "AccumulateLoyaltyPoints", + "description": "Adds points earned from a purchase to a [loyalty account](entity:LoyaltyAccount).\n\n- If you are using the Orders API to manage orders, provide the `order_id`. Square reads the order\nto compute the points earned from both the base loyalty program and an associated\n[loyalty promotion](entity:LoyaltyPromotion). For purchases that qualify for multiple accrual\nrules, Square computes points based on the accrual rule that grants the most points.\nFor purchases that qualify for multiple promotions, Square computes points based on the most\nrecently created promotion. A purchase must first qualify for program points to be eligible for promotion points.\n\n- If you are not using the Orders API to manage orders, provide `points` with the number of points to add.\nYou must first perform a client-side computation of the points earned from the loyalty program and\nloyalty promotion. For spend-based and visit-based programs, you can call [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints)\nto compute the points earned from the base loyalty program. For information about computing points earned from a loyalty promotion, see\n[Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "account_id", + "description": "The ID of the target [loyalty account](entity:LoyaltyAccount).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccumulateLoyaltyPointsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccumulateLoyaltyPointsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/accounts/{account_id}/adjust": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "AdjustLoyaltyPoints", + "operationId": "AdjustLoyaltyPoints", + "description": "Adds points to or subtracts points from a buyer's account.\n\nUse this endpoint only when you need to manually adjust points. Otherwise, in your application flow, you call\n[AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints)\nto add points when a buyer pays for the purchase.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "account_id", + "description": "The ID of the target [loyalty account](entity:LoyaltyAccount).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdjustLoyaltyPointsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdjustLoyaltyPointsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/events/search": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "SearchLoyaltyEvents", + "operationId": "SearchLoyaltyEvents", + "description": "Searches for loyalty events.\n\nA Square loyalty program maintains a ledger of events that occur during the lifetime of a\nbuyer's loyalty account. Each change in the point balance\n(for example, points earned, points redeemed, and points expired) is\nrecorded in the ledger. Using this endpoint, you can search the ledger for events.\n\nSearch results are sorted by `created_at` in descending order.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyEventsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyEventsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/programs": { + "get": { + "tags": [ + "Loyalty" + ], + "summary": "ListLoyaltyPrograms", + "operationId": "ListLoyaltyPrograms", + "description": "Returns a list of loyalty programs in the seller's account.\nLoyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview).\n\n\nReplaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) when used with the keyword `main`.", + "x-release-status": "DEPRECATED", + "deprecated": true, + "x-deprecation": { + "deprecationDate": "2021-05-13", + "replacedBy": "RetrieveLoyaltyProgram", + "guideUrl": "https://developer.squareup.com/docs/loyalty-api/overview#migration-notes" + }, + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLoyaltyProgramsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "UNSUPPORTED_LOYALTY_REWARD_TIER" + } + ] + } + }, + "/v2/loyalty/programs/{program_id}": { + "get": { + "tags": [ + "Loyalty" + ], + "summary": "RetrieveLoyaltyProgram", + "operationId": "RetrieveLoyaltyProgram", + "description": "Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword `main`.\n\nLoyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "program_id", + "description": "The ID of the loyalty program or the keyword `main`. Either value can be used to retrieve the single loyalty program that belongs to the seller.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLoyaltyProgramResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "UNSUPPORTED_LOYALTY_REWARD_TIER" + } + ] + } + }, + "/v2/loyalty/programs/{program_id}/calculate": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "CalculateLoyaltyPoints", + "operationId": "CalculateLoyaltyPoints", + "description": "Calculates the number of points a buyer can earn from a purchase. Applications might call this endpoint\nto display the points to the buyer.\n\n- If you are using the Orders API to manage orders, provide the `order_id` and (optional) `loyalty_account_id`.\nSquare reads the order to compute the points earned from the base loyalty program and an associated\n[loyalty promotion](entity:LoyaltyPromotion).\n\n- If you are not using the Orders API to manage orders, provide `transaction_amount_money` with the\npurchase amount. Square uses this amount to calculate the points earned from the base loyalty program,\nbut not points earned from a loyalty promotion. For spend-based and visit-based programs, the `tax_mode`\nsetting of the accrual rule indicates how taxes should be treated for loyalty points accrual.\nIf the purchase qualifies for program points, call\n[ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) and perform a client-side computation\nto calculate whether the purchase also qualifies for promotion points. For more information, see\n[Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "program_id", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram), which defines the rules for accruing points.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculateLoyaltyPointsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculateLoyaltyPointsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/programs/{program_id}/promotions": { + "get": { + "tags": [ + "Loyalty" + ], + "summary": "ListLoyaltyPromotions", + "operationId": "ListLoyaltyPromotions", + "description": "Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram).\nResults are sorted by the `created_at` date in descending order (newest to oldest).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "program_id", + "description": "The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID,\ncall [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "status", + "description": "The status to filter the results by. If a status is provided, only loyalty promotions\nwith the specified status are returned. Otherwise, all loyalty promotions associated with\nthe loyalty program are returned.", + "schema": { + "$ref": "#/components/schemas/LoyaltyPromotionStatus" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response.\nThe minimum value is 1 and the maximum value is 30. The default value is 30.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListLoyaltyPromotionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Loyalty" + ], + "summary": "CreateLoyaltyPromotion", + "operationId": "CreateLoyaltyPromotion", + "description": "Creates a loyalty promotion for a [loyalty program](entity:LoyaltyProgram). A loyalty promotion\nenables buyers to earn points in addition to those earned from the base loyalty program.\n\nThis endpoint sets the loyalty promotion to the `ACTIVE` or `SCHEDULED` status, depending on the\n`available_time` setting. A loyalty program can have a maximum of 10 loyalty promotions with an\n`ACTIVE` or `SCHEDULED` status.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "program_id", + "description": "The ID of the [loyalty program](entity:LoyaltyProgram) to associate with the promotion.\nTo get the program ID, call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram)\nusing the `main` keyword.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyPromotionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyPromotionResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/programs/{program_id}/promotions/{promotion_id}": { + "get": { + "tags": [ + "Loyalty" + ], + "summary": "RetrieveLoyaltyPromotion", + "operationId": "RetrieveLoyaltyPromotion", + "description": "Retrieves a loyalty promotion.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "promotion_id", + "description": "The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "program_id", + "description": "The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID,\ncall [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLoyaltyPromotionResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/programs/{program_id}/promotions/{promotion_id}/cancel": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "CancelLoyaltyPromotion", + "operationId": "CancelLoyaltyPromotion", + "description": "Cancels a loyalty promotion. Use this endpoint to cancel an `ACTIVE` promotion earlier than the\nend date, cancel an `ACTIVE` promotion when an end date is not specified, or cancel a `SCHEDULED` promotion.\nBecause updating a promotion is not supported, you can also use this endpoint to cancel a promotion before\nyou create a new one.\n\nThis endpoint sets the loyalty promotion to the `CANCELED` state", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "promotion_id", + "description": "The ID of the [loyalty promotion](entity:LoyaltyPromotion) to cancel. You can cancel a\npromotion that has an `ACTIVE` or `SCHEDULED` status.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "program_id", + "description": "The ID of the base [loyalty program](entity:LoyaltyProgram).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelLoyaltyPromotionResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/rewards": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "CreateLoyaltyReward", + "operationId": "CreateLoyaltyReward", + "description": "Creates a loyalty reward. In the process, the endpoint does following:\n\n- Uses the `reward_tier_id` in the request to determine the number of points\nto lock for this reward.\n- If the request includes `order_id`, it adds the reward and related discount to the order.\n\nAfter a reward is created, the points are locked and\nnot available for the buyer to redeem another reward.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyRewardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLoyaltyRewardResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/rewards/search": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "SearchLoyaltyRewards", + "operationId": "SearchLoyaltyRewards", + "description": "Searches for loyalty rewards. This endpoint accepts a request with no query filters and returns results for all loyalty accounts.\nIf you include a `query` object, `loyalty_account_id` is required and `status` is optional.\n\nIf you know a reward ID, use the\n[RetrieveLoyaltyReward](api-endpoint:Loyalty-RetrieveLoyaltyReward) endpoint.\n\nSearch results are sorted by `updated_at` in descending order.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyRewardsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchLoyaltyRewardsResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/rewards/{reward_id}": { + "delete": { + "tags": [ + "Loyalty" + ], + "summary": "DeleteLoyaltyReward", + "operationId": "DeleteLoyaltyReward", + "description": "Deletes a loyalty reward by doing the following:\n\n- Returns the loyalty points back to the loyalty account.\n- If an order ID was specified when the reward was created\n(see [CreateLoyaltyReward](api-endpoint:Loyalty-CreateLoyaltyReward)),\nit updates the order by removing the reward and related\ndiscounts.\n\nYou cannot delete a reward that has reached the terminal state (REDEEMED).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "reward_id", + "description": "The ID of the [loyalty reward](entity:LoyaltyReward) to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteLoyaltyRewardResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Loyalty" + ], + "summary": "RetrieveLoyaltyReward", + "operationId": "RetrieveLoyaltyReward", + "description": "Retrieves a loyalty reward.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_READ" + ] + } + ], + "parameters": [ + { + "name": "reward_id", + "description": "The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLoyaltyRewardResponse" + } + } + } + } + } + } + }, + "/v2/loyalty/rewards/{reward_id}/redeem": { + "post": { + "tags": [ + "Loyalty" + ], + "summary": "RedeemLoyaltyReward", + "operationId": "RedeemLoyaltyReward", + "description": "Redeems a loyalty reward.\n\nThe endpoint sets the reward to the `REDEEMED` terminal state.\n\nIf you are using your own order processing system (not using the\nOrders API), you call this endpoint after the buyer paid for the\npurchase.\n\nAfter the reward reaches the terminal state, it cannot be deleted.\nIn other words, points used for the reward cannot be returned\nto the account.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "LOYALTY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "reward_id", + "description": "The ID of the [loyalty reward](entity:LoyaltyReward) to redeem.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RedeemLoyaltyRewardRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RedeemLoyaltyRewardResponse" + } + } + } + } + } + } + }, + "/v2/merchants": { + "get": { + "tags": [ + "Merchants" + ], + "summary": "ListMerchants", + "operationId": "ListMerchants", + "description": "Provides details about the merchant associated with a given access token.\n\nThe access token used to connect your application to a Square seller is associated\nwith a single merchant. That means that `ListMerchants` returns a list\nwith a single `Merchant` object. You can specify your personal access token\nto get your own merchant information or specify an OAuth token to get the\ninformation for the merchant that granted your application access.\n\nIf you know the merchant ID, you can also use the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant)\nendpoint to retrieve the merchant information.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "The cursor generated by the previous response.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMerchantsResponse" + } + } + } + } + } + } + }, + "/v2/merchants/custom-attribute-definitions": { + "get": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "ListMerchantCustomAttributeDefinitions", + "operationId": "ListMerchantCustomAttributeDefinitions", + "description": "Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.\nWhen all response pages are retrieved, the results include all custom attribute definitions\nthat are visible to the requesting application, including those that are created by other\napplications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "visibility_filter", + "description": "Filters the `CustomAttributeDefinition` results by their `visibility` values.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMerchantCustomAttributeDefinitionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "CreateMerchantCustomAttributeDefinition", + "operationId": "CreateMerchantCustomAttributeDefinition", + "description": "Creates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\nUse this endpoint to define a custom attribute that can be associated with a merchant connecting to your application.\nA custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties\nfor a custom attribute. After the definition is created, you can call\n[UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) or\n[BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes)\nto set the custom attribute for a merchant.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMerchantCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateMerchantCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/merchants/custom-attribute-definitions/{key}": { + "delete": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "DeleteMerchantCustomAttributeDefinition", + "operationId": "DeleteMerchantCustomAttributeDefinition", + "description": "Deletes a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\nDeleting a custom attribute definition also deletes the corresponding custom attribute from\nthe merchant.\nOnly the definition owner can delete a custom attribute definition.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteMerchantCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "RetrieveMerchantCustomAttributeDefinition", + "operationId": "RetrieveMerchantCustomAttributeDefinition", + "description": "Retrieves a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\nTo retrieve a custom attribute definition created by another application, the `visibility`\nsetting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to retrieve. If the requesting application\nis not the definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "The current version of the custom attribute definition, which is used for strongly consistent\nreads to guarantee that you receive the most up-to-date data. When included in the request,\nSquare returns the specified version or a higher version if one exists. If the specified version\nis higher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveMerchantCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "UpdateMerchantCustomAttributeDefinition", + "operationId": "UpdateMerchantCustomAttributeDefinition", + "description": "Updates a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.\nUse this endpoint to update the following fields: `name`, `description`, `visibility`, or the\n`schema` for a `Selection` data type.\nOnly the definition owner can update a custom attribute definition.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMerchantCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMerchantCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/merchants/custom-attributes/bulk-delete": { + "post": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "BulkDeleteMerchantCustomAttributes", + "operationId": "BulkDeleteMerchantCustomAttributes", + "description": "Deletes [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation.\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteMerchantCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteMerchantCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/merchants/custom-attributes/bulk-upsert": { + "post": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "BulkUpsertMerchantCustomAttributes", + "operationId": "BulkUpsertMerchantCustomAttributes", + "description": "Creates or updates [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation.\nUse this endpoint to set the value of one or more custom attributes for a merchant.\nA custom attribute is based on a custom attribute definition in a Square seller account, which is\ncreated using the [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) endpoint.\nThis `BulkUpsertMerchantCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert\nrequests and returns a map of individual upsert responses. Each upsert request has a unique ID\nand provides a merchant ID and custom attribute. Each upsert response is returned with the ID\nof the corresponding request.\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertMerchantCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertMerchantCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/merchants/{merchant_id}": { + "get": { + "tags": [ + "Merchants" + ], + "summary": "RetrieveMerchant", + "operationId": "RetrieveMerchant", + "description": "Retrieves the `Merchant` object for the given `merchant_id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "merchant_id", + "description": "The ID of the merchant to retrieve. If the string \"me\" is supplied as the ID,\nthen retrieve the merchant that is currently accessible to this call.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveMerchantResponse" + } + } + } + } + } + } + }, + "/v2/merchants/{merchant_id}/custom-attributes": { + "get": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "ListMerchantCustomAttributes", + "operationId": "ListMerchantCustomAttributes", + "description": "Lists the [custom attributes](entity:CustomAttribute) associated with a merchant.\nYou can use the `with_definitions` query parameter to also retrieve custom attribute definitions\nin the same call.\nWhen all response pages are retrieved, the results include all custom attributes that are\nvisible to the requesting application, including those that are owned by other applications\nand set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "merchant_id", + "description": "The ID of the target [merchant](entity:Merchant).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "visibility_filter", + "description": "Filters the `CustomAttributeDefinition` results by their `visibility` values.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory.\nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100.\nThe default value is 20. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint.\nProvide this cursor to retrieve the next page of results for your original request. For more\ninformation, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "with_definitions", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMerchantCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/merchants/{merchant_id}/custom-attributes/{key}": { + "delete": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "DeleteMerchantCustomAttribute", + "operationId": "DeleteMerchantCustomAttribute", + "description": "Deletes a [custom attribute](entity:CustomAttribute) associated with a merchant.\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "merchant_id", + "description": "The ID of the target [merchant](entity:Merchant).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to delete. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteMerchantCustomAttributeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "RetrieveMerchantCustomAttribute", + "operationId": "RetrieveMerchantCustomAttribute", + "description": "Retrieves a [custom attribute](entity:CustomAttribute) associated with a merchant.\nYou can use the `with_definition` query parameter to also retrieve the custom attribute definition\nin the same call.\nTo retrieve a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "merchant_id", + "description": "The ID of the target [merchant](entity:Merchant).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to retrieve. This key must match the `key` of a custom\nattribute definition in the Square seller account. If the requesting application is not the\ndefinition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "with_definition", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of\nthe custom attribute. Set this parameter to `true` to get the name and description of the custom\nattribute, information about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "version", + "description": "The current version of the custom attribute, which is used for strongly consistent reads to\nguarantee that you receive the most up-to-date data. When included in the request, Square\nreturns the specified version or a higher version if one exists. If the specified version is\nhigher than the current version, Square returns a `BAD_REQUEST` error.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveMerchantCustomAttributeResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "MerchantCustomAttributes" + ], + "summary": "UpsertMerchantCustomAttribute", + "operationId": "UpsertMerchantCustomAttribute", + "description": "Creates or updates a [custom attribute](entity:CustomAttribute) for a merchant.\nUse this endpoint to set the value of a custom attribute for a specified merchant.\nA custom attribute is based on a custom attribute definition in a Square seller account, which\nis created using the [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) endpoint.\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE" + ] + } + ], + "parameters": [ + { + "name": "merchant_id", + "description": "The ID of the target [merchant](entity:Merchant).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "key", + "description": "The key of the custom attribute to create or update. This key must match the `key` of a\ncustom attribute definition in the Square seller account. If the requesting application is not\nthe definition owner, you must use the qualified key.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertMerchantCustomAttributeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertMerchantCustomAttributeResponse" + } + } + } + } + } + } + }, + "/v2/online-checkout/location-settings/{location_id}": { + "get": { + "tags": [ + "Checkout" + ], + "summary": "RetrieveLocationSettings", + "operationId": "RetrieveLocationSettings", + "description": "Retrieves the location-level settings for a Square-hosted checkout page.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location for which to retrieve settings.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveLocationSettingsResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Checkout" + ], + "summary": "UpdateLocationSettings", + "operationId": "UpdateLocationSettings", + "description": "Updates the location-level settings for a Square-hosted checkout page.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE", + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location for which to retrieve settings.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationSettingsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLocationSettingsResponse" + } + } + } + } + } + } + }, + "/v2/online-checkout/merchant-settings": { + "get": { + "tags": [ + "Checkout" + ], + "summary": "RetrieveMerchantSettings", + "operationId": "RetrieveMerchantSettings", + "description": "Retrieves the merchant-level settings for a Square-hosted checkout page.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENT_METHODS_READ", + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveMerchantSettingsResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Checkout" + ], + "summary": "UpdateMerchantSettings", + "operationId": "UpdateMerchantSettings", + "description": "Updates the merchant-level settings for a Square-hosted checkout page.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "MERCHANT_PROFILE_WRITE", + "PAYMENT_METHODS_READ", + "MERCHANT_PROFILE_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMerchantSettingsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMerchantSettingsResponse" + } + } + } + } + } + } + }, + "/v2/online-checkout/payment-links": { + "get": { + "tags": [ + "Checkout" + ], + "summary": "ListPaymentLinks", + "operationId": "ListPaymentLinks", + "description": "Lists all payment links.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nIf a cursor is not provided, the endpoint returns the first page of the results.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "A limit on the number of results to return per page. The limit is advisory and\nthe implementation might return more or less results. If the supplied limit is negative, zero, or\ngreater than the maximum limit of 1000, it is ignored.\n\nDefault value: `100`", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPaymentLinksResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Checkout" + ], + "summary": "CreatePaymentLink", + "operationId": "CreatePaymentLink", + "description": "Creates a Square-hosted checkout page. Applications can share the resulting payment link with their buyer to pay for goods and services.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE", + "ORDERS_READ", + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePaymentLinkRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePaymentLinkResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_PHONE_NUMBER" + }, + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "MISSING_REQUIRED_PARAMETER" + }, + { + "error-code": "CONFLICTING_PARAMETERS" + } + ] + } + }, + "/v2/online-checkout/payment-links/{id}": { + "delete": { + "tags": [ + "Checkout" + ], + "summary": "DeletePaymentLink", + "operationId": "DeletePaymentLink", + "description": "Deletes a payment link.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ", + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the payment link to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletePaymentLinkResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Checkout" + ], + "summary": "RetrievePaymentLink", + "operationId": "RetrievePaymentLink", + "description": "Retrieves a payment link.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of link to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrievePaymentLinkResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Checkout" + ], + "summary": "UpdatePaymentLink", + "operationId": "UpdatePaymentLink", + "description": "Updates a payment link. You can update the `payment_link` fields such as\n`description`, `checkout_options`, and `pre_populated_data`.\nYou cannot update other fields such as the `order_id`, `version`, `URL`, or `timestamp` field.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE", + "ORDERS_READ", + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "id", + "description": "The ID of the payment link to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePaymentLinkRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePaymentLinkResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_PHONE_NUMBER" + }, + { + "error-code": "INVALID_EMAIL_ADDRESS" + } + ] + } + }, + "/v2/orders": { + "post": { + "tags": [ + "Orders" + ], + "summary": "CreateOrder", + "operationId": "CreateOrder", + "description": "Creates a new [order](entity:Order) that can include information about products for\npurchase and settings to apply to the purchase.\n\nTo pay for a created order, see\n[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders).\n\nYou can modify open orders using the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderResponse" + } + } + } + } + } + } + }, + "/v2/orders/batch-retrieve": { + "post": { + "tags": [ + "Orders" + ], + "summary": "BatchRetrieveOrders", + "operationId": "BatchRetrieveOrders", + "description": "Retrieves a set of [orders](entity:Order) by their IDs.\n\nIf a given order ID does not exist, the ID is ignored instead of generating an error.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveOrdersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchRetrieveOrdersResponse" + } + } + } + } + } + } + }, + "/v2/orders/calculate": { + "post": { + "tags": [ + "Orders" + ], + "summary": "CalculateOrder", + "operationId": "CalculateOrder", + "description": "Enables applications to preview order pricing without creating an order.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculateOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CalculateOrderResponse" + } + } + } + } + } + } + }, + "/v2/orders/clone": { + "post": { + "tags": [ + "Orders" + ], + "summary": "CloneOrder", + "operationId": "CloneOrder", + "description": "Creates a new order, in the `DRAFT` state, by duplicating an existing order. The newly created order has\nonly the core fields (such as line items, taxes, and discounts) copied from the original order.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloneOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloneOrderResponse" + } + } + } + } + } + } + }, + "/v2/orders/custom-attribute-definitions": { + "get": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "ListOrderCustomAttributeDefinitions", + "operationId": "ListOrderCustomAttributeDefinitions", + "description": "Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account.\n\nWhen all response pages are retrieved, the results include all custom attribute definitions\nthat are visible to the requesting application, including those that are created by other\napplications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that\nseller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "visibility_filter", + "description": "Requests that all of the custom attributes be returned, or only those that are read-only or read-write.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint. \nProvide this cursor to retrieve the next page of results for your original request. \nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory. \nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. \nThe default value is 20.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrderCustomAttributeDefinitionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "CreateOrderCustomAttributeDefinition", + "operationId": "CreateOrderCustomAttributeDefinition", + "description": "Creates an order-related custom attribute definition. Use this endpoint to\ndefine a custom attribute that can be associated with orders.\n\nAfter creating a custom attribute definition, you can set the custom attribute for orders\nin the Square seller account.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateOrderCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/orders/custom-attribute-definitions/{key}": { + "delete": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "DeleteOrderCustomAttributeDefinition", + "operationId": "DeleteOrderCustomAttributeDefinition", + "description": "Deletes an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\n\nOnly the definition owner can delete a custom attribute definition.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteOrderCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "RetrieveOrderCustomAttributeDefinition", + "operationId": "RetrieveOrderCustomAttributeDefinition", + "description": "Retrieves an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account.\n\nTo retrieve a custom attribute definition created by another application, the `visibility`\nsetting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, include this optional field and specify the current version of the custom attribute.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveOrderCustomAttributeDefinitionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "UpdateOrderCustomAttributeDefinition", + "operationId": "UpdateOrderCustomAttributeDefinition", + "description": "Updates an order-related custom attribute definition for a Square seller account.\n\nOnly the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "key", + "description": "The key of the custom attribute definition to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderCustomAttributeDefinitionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderCustomAttributeDefinitionResponse" + } + } + } + } + } + } + }, + "/v2/orders/custom-attributes/bulk-delete": { + "post": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "BulkDeleteOrderCustomAttributes", + "operationId": "BulkDeleteOrderCustomAttributes", + "description": "Deletes order [custom attributes](entity:CustomAttribute) as a bulk operation.\n\nUse this endpoint to delete one or more custom attributes from one or more orders.\nA custom attribute is based on a custom attribute definition in a Square seller account. (To create a\ncustom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.)\n\nThis `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual delete\nrequests and returns a map of individual delete responses. Each delete request has a unique ID\nand provides an order ID and custom attribute. Each delete response is returned with the ID\nof the corresponding request.\n\nTo delete a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteOrderCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkDeleteOrderCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/orders/custom-attributes/bulk-upsert": { + "post": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "BulkUpsertOrderCustomAttributes", + "operationId": "BulkUpsertOrderCustomAttributes", + "description": "Creates or updates order [custom attributes](entity:CustomAttribute) as a bulk operation.\n\nUse this endpoint to delete one or more custom attributes from one or more orders.\nA custom attribute is based on a custom attribute definition in a Square seller account. (To create a\ncustom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.)\n\nThis `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert\nrequests and returns a map of individual upsert responses. Each upsert request has a unique ID\nand provides an order ID and custom attribute. Each upsert response is returned with the ID\nof the corresponding request.\n\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertOrderCustomAttributesRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpsertOrderCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/orders/search": { + "post": { + "tags": [ + "Orders" + ], + "summary": "SearchOrders", + "operationId": "SearchOrders", + "description": "Search all orders for one or more locations. Orders include all sales,\nreturns, and exchanges regardless of how or when they entered the Square\necosystem (such as Point of Sale, Invoices, and Connect APIs).\n\n`SearchOrders` requests need to specify which locations to search and define a\n[SearchOrdersQuery](entity:SearchOrdersQuery) object that controls\nhow to sort or filter the results. Your `SearchOrdersQuery` can:\n\n Set filter criteria.\n Set the sort order.\n Determine whether to return results as complete `Order` objects or as\n[OrderEntry](entity:OrderEntry) objects.\n\nNote that details for orders processed with Square Point of Sale while in\noffline mode might not be transmitted to Square for up to 72 hours. Offline\norders have a `created_at` value that reflects the time the order was created,\nnot the time it was subsequently transmitted to Square.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchOrdersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchOrdersResponse" + } + } + } + } + } + } + }, + "/v2/orders/{order_id}": { + "get": { + "tags": [ + "Orders" + ], + "summary": "RetrieveOrder", + "operationId": "RetrieveOrder", + "description": "Retrieves an [Order](entity:Order) by ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the order to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveOrderResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Orders" + ], + "summary": "UpdateOrder", + "operationId": "UpdateOrder", + "description": "Updates an open [order](entity:Order) by adding, replacing, or deleting\nfields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated.\n\nAn `UpdateOrder` request requires the following:\n\n- The `order_id` in the endpoint path, identifying the order to update.\n- The latest `version` of the order to update.\n- The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects)\ncontaining only the fields to update and the version to which the update is\nbeing applied.\n- If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete)\nidentifying the fields to clear.\n\nTo pay for an order, see\n[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders).", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the order to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrderResponse" + } + } + } + } + } + } + }, + "/v2/orders/{order_id}/custom-attributes": { + "get": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "ListOrderCustomAttributes", + "operationId": "ListOrderCustomAttributes", + "description": "Lists the [custom attributes](entity:CustomAttribute) associated with an order.\n\nYou can use the `with_definitions` query parameter to also retrieve custom attribute definitions\nin the same call.\n\nWhen all response pages are retrieved, the results include all custom attributes that are\nvisible to the requesting application, including those that are owned by other applications\nand set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the target [order](entity:Order).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "visibility_filter", + "description": "Requests that all of the custom attributes be returned, or only those that are read-only or read-write.", + "schema": { + "$ref": "#/components/schemas/VisibilityFilter" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "The cursor returned in the paged response from the previous call to this endpoint. \nProvide this cursor to retrieve the next page of results for your original request. \nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to return in a single paged response. This limit is advisory. \nThe response might contain more or fewer results. The minimum value is 1 and the maximum value is 100. \nThe default value is 20.\nFor more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "with_definitions", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each\ncustom attribute. Set this parameter to `true` to get the name and description of each custom attribute, \ninformation about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOrderCustomAttributesResponse" + } + } + } + } + } + } + }, + "/v2/orders/{order_id}/custom-attributes/{custom_attribute_key}": { + "delete": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "DeleteOrderCustomAttribute", + "operationId": "DeleteOrderCustomAttribute", + "description": "Deletes a [custom attribute](entity:CustomAttribute) associated with a customer profile.\n\nTo delete a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the target [order](entity:Order).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "custom_attribute_key", + "description": "The key of the custom attribute to delete. This key must match the key of an\nexisting custom attribute definition.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteOrderCustomAttributeResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "RetrieveOrderCustomAttribute", + "operationId": "RetrieveOrderCustomAttribute", + "description": "Retrieves a [custom attribute](entity:CustomAttribute) associated with an order.\n\nYou can use the `with_definition` query parameter to also retrieve the custom attribute definition\nin the same call.\n\nTo retrieve a custom attribute owned by another application, the `visibility` setting must be\n`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\nalso known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_READ" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the target [order](entity:Order).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "custom_attribute_key", + "description": "The key of the custom attribute to retrieve. This key must match the key of an\nexisting custom attribute definition.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)\ncontrol, include this optional field and specify the current version of the custom attribute.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "with_definition", + "description": "Indicates whether to return the [custom attribute definition](entity:CustomAttributeDefinition) in the `definition` field of each \ncustom attribute. Set this parameter to `true` to get the name and description of each custom attribute, \ninformation about the data type, or other definition details. The default value is `false`.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveOrderCustomAttributeResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "OrderCustomAttributes" + ], + "summary": "UpsertOrderCustomAttribute", + "operationId": "UpsertOrderCustomAttribute", + "description": "Creates or updates a [custom attribute](entity:CustomAttribute) for an order.\n\nUse this endpoint to set the value of a custom attribute for a specific order.\nA custom attribute is based on a custom attribute definition in a Square seller account. (To create a\ncustom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.)\n\nTo create or update a custom attribute owned by another application, the `visibility` setting\nmust be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes\n(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the target [order](entity:Order).", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "custom_attribute_key", + "description": "The key of the custom attribute to create or update. This key must match the key \nof an existing custom attribute definition.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertOrderCustomAttributeRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertOrderCustomAttributeResponse" + } + } + } + } + } + } + }, + "/v2/orders/{order_id}/pay": { + "post": { + "tags": [ + "Orders" + ], + "summary": "PayOrder", + "operationId": "PayOrder", + "description": "Pay for an [order](entity:Order) using one or more approved [payments](entity:Payment)\nor settle an order with a total of `0`.\n\nThe total of the `payment_ids` listed in the request must be equal to the order\ntotal. Orders with a total amount of `0` can be marked as paid by specifying an empty\narray of `payment_ids` in the request.\n\nTo be used with `PayOrder`, a payment must:\n\n- Reference the order by specifying the `order_id` when [creating the payment](api-endpoint:Payments-CreatePayment).\nAny approved payments that reference the same `order_id` not specified in the\n`payment_ids` is canceled.\n- Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture).\nUsing a delayed capture payment with `PayOrder` completes the approved payment.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE", + "ORDERS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "order_id", + "description": "The ID of the order being paid.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PayOrderResponse" + } + } + } + } + } + } + }, + "/v2/payments": { + "get": { + "tags": [ + "Payments" + ], + "summary": "ListPayments", + "operationId": "ListPayments", + "description": "Retrieves a list of payments taken by the account making the request.\n\nResults are eventually consistent, and new payments or changes to payments might take several\nseconds to appear.\n\nThe maximum results per page is 100.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "begin_time", + "description": "Indicates the start of the time range to retrieve payments for, in RFC 3339 format.\nThe range is determined using the `created_at` field for each Payment.\nInclusive. Default: The current time minus one year.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The\nrange is determined using the `created_at` field for each Payment.\n\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which results are listed by `ListPaymentsRequest.sort_field`:\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "Limit results to the location supplied. By default, results are returned\nfor the default (main) location associated with the seller.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "total", + "description": "The exact amount in the `total_money` for a payment.", + "schema": { + "type": "integer", + "format": "int64" + }, + "in": "query", + "required": false + }, + { + "name": "last_4", + "description": "The last four digits of a payment card.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "card_brand", + "description": "The brand of the payment card (for example, VISA).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to be returned in a single page.\nIt is possible to receive fewer results than the specified limit on a given page.\n\nThe default value of 100 is also the maximum allowed value. If the provided value is \ngreater than 100, it is ignored and the default value is used instead.\n\nDefault: `100`", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "is_offline_payment", + "description": "Whether the payment was taken offline or not.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "offline_begin_time", + "description": "Indicates the start of the time range for which to retrieve offline payments, in RFC 3339\nformat for timestamps. The range is determined using the\n`offline_payment_details.client_created_at` field for each Payment. If set, payments without a\nvalue set in `offline_payment_details.client_created_at` will not be returned.\n\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "offline_end_time", + "description": "Indicates the end of the time range for which to retrieve offline payments, in RFC 3339\nformat for timestamps. The range is determined using the\n`offline_payment_details.client_created_at` field for each Payment. If set, payments without a\nvalue set in `offline_payment_details.client_created_at` will not be returned.\n\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "updated_at_begin_time", + "description": "Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The\nrange is determined using the `updated_at` field for each Payment.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "updated_at_end_time", + "description": "Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The\nrange is determined using the `updated_at` field for each Payment.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_field", + "description": "The field used to sort results by. The default is `CREATED_AT`.", + "schema": { + "$ref": "#/components/schemas/ListPaymentsRequestSortField" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPaymentsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Payments" + ], + "summary": "CreatePayment", + "operationId": "CreatePayment", + "description": "Creates a payment using the provided source. You can use this endpoint \nto charge a card (credit/debit card or \nSquare gift card) or record a payment that the seller received outside of Square \n(cash payment from a buyer or a payment that an external entity \nprocessed on behalf of the seller).\n\nThe endpoint creates a \n`Payment` object and returns it in the response.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePaymentRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePaymentResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "ADDRESS_VERIFICATION_FAILURE" + }, + { + "error-code": "ALLOWABLE_PIN_TRIES_EXCEEDED" + }, + { + "error-code": "APPLE_TTP_PIN_TOKEN" + }, + { + "error-code": "BAD_EXPIRATION" + }, + { + "error-code": "CARDHOLDER_INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "CARD_DECLINED_VERIFICATION_REQUIRED" + }, + { + "error-code": "CARD_EXPIRED" + }, + { + "error-code": "CARD_NOT_SUPPORTED" + }, + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CARD_TOKEN_EXPIRED" + }, + { + "error-code": "CARD_TOKEN_USED" + }, + { + "error-code": "CHIP_INSERTION_REQUIRED" + }, + { + "error-code": "CVV_FAILURE" + }, + { + "error-code": "EXPIRATION_FAILURE" + }, + { + "error-code": "GENERIC_DECLINE" + }, + { + "error-code": "GIFT_CARD_AVAILABLE_AMOUNT" + }, + { + "error-code": "INSUFFICIENT_FUNDS" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "INVALID_ACCOUNT" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "INVALID_CARD_DATA" + }, + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "INVALID_EXPIRATION" + }, + { + "error-code": "INVALID_FEES" + }, + { + "error-code": "INVALID_LOCATION" + }, + { + "error-code": "INVALID_PHONE_NUMBER" + }, + { + "error-code": "INVALID_PIN" + }, + { + "error-code": "INVALID_POSTAL_CODE" + }, + { + "error-code": "ISSUER_INSTALLMENT_ERROR" + }, + { + "error-code": "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED" + }, + { + "error-code": "PAN_FAILURE" + }, + { + "error-code": "PAYMENT_AMOUNT_MISMATCH" + }, + { + "error-code": "PAYMENT_LIMIT_EXCEEDED" + }, + { + "error-code": "TEMPORARY_ERROR" + }, + { + "error-code": "TRANSACTION_LIMIT" + }, + { + "error-code": "VOICE_FAILURE" + } + ] + } + }, + "/v2/payments/cancel": { + "post": { + "tags": [ + "Payments" + ], + "summary": "CancelPaymentByIdempotencyKey", + "operationId": "CancelPaymentByIdempotencyKey", + "description": "Cancels (voids) a payment identified by the idempotency key that is specified in the\nrequest.\n\nUse this method when the status of a `CreatePayment` request is unknown (for example, after you send a\n`CreatePayment` request, a network error occurs and you do not get a response). In this case, you can\ndirect Square to cancel the payment using this endpoint. In the request, you provide the same\nidempotency key that you provided in your `CreatePayment` request that you want to cancel. After\ncanceling the payment, you can submit your `CreatePayment` request again.\n\nNote that if no payment with the specified idempotency key is found, no action is taken and the endpoint\nreturns successfully.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelPaymentByIdempotencyKeyRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelPaymentByIdempotencyKeyResponse" + } + } + } + } + } + } + }, + "/v2/payments/{payment_id}": { + "get": { + "tags": [ + "Payments" + ], + "summary": "GetPayment", + "operationId": "GetPayment", + "description": "Retrieves details for a specific payment.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "payment_id", + "description": "A unique ID for the desired payment.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPaymentResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Payments" + ], + "summary": "UpdatePayment", + "operationId": "UpdatePayment", + "description": "Updates a payment with the APPROVED status.\nYou can update the `amount_money` and `tip_money` using this endpoint.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "payment_id", + "description": "The ID of the payment to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePaymentRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePaymentResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "AMOUNT_TOO_HIGH" + }, + { + "error-code": "CARDHOLDER_INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "CARD_DECLINED_VERIFICATION_REQUIRED" + }, + { + "error-code": "CARD_EXPIRED" + }, + { + "error-code": "CARD_NOT_SUPPORTED" + }, + { + "error-code": "CHIP_INSERTION_REQUIRED" + }, + { + "error-code": "CVV_FAILURE" + }, + { + "error-code": "GENERIC_DECLINE" + }, + { + "error-code": "INSUFFICIENT_FUNDS" + }, + { + "error-code": "INVALID_ACCOUNT" + }, + { + "error-code": "INVALID_FEES" + }, + { + "error-code": "PAN_FAILURE" + }, + { + "error-code": "PAYMENT_LIMIT_EXCEEDED" + }, + { + "error-code": "TEMPORARY_ERROR" + }, + { + "error-code": "TRANSACTION_LIMIT" + }, + { + "error-code": "UNSUPPORTED_SOURCE_TYPE" + }, + { + "error-code": "VOICE_FAILURE" + } + ] + } + }, + "/v2/payments/{payment_id}/cancel": { + "post": { + "tags": [ + "Payments" + ], + "summary": "CancelPayment", + "operationId": "CancelPayment", + "description": "Cancels (voids) a payment. You can use this endpoint to cancel a payment with \nthe APPROVED `status`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "payment_id", + "description": "The ID of the payment to cancel.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelPaymentResponse" + } + } + } + } + } + } + }, + "/v2/payments/{payment_id}/complete": { + "post": { + "tags": [ + "Payments" + ], + "summary": "CompletePayment", + "operationId": "CompletePayment", + "description": "Completes (captures) a payment.\nBy default, payments are set to complete immediately after they are created.\n\nYou can use this endpoint to complete a payment with the APPROVED `status`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "payment_id", + "description": "The unique ID identifying the payment to be completed.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompletePaymentRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CompletePaymentResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "VERSION_MISMATCH" + } + ] + } + }, + "/v2/payouts": { + "get": { + "tags": [ + "Payouts" + ], + "summary": "ListPayouts", + "operationId": "ListPayouts", + "description": "Retrieves a list of all payouts for the default location.\nYou can filter payouts by location ID, status, time range, and order them in ascending or descending order.\nTo call this endpoint, set `PAYOUTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "location_id", + "description": "The ID of the location for which to list the payouts.\nBy default, payouts are returned for the default (main) location associated with the seller.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "status", + "description": "If provided, only payouts with the given status are returned.", + "schema": { + "$ref": "#/components/schemas/PayoutStatus" + }, + "in": "query", + "required": false + }, + { + "name": "begin_time", + "description": "The timestamp for the beginning of the payout creation time, in RFC 3339 format.\nInclusive. Default: The current time minus one year.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "The timestamp for the end of the payout creation time, in RFC 3339 format.\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which payouts are listed.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).\nIf request parameters change between requests, subsequent results may contain duplicates or missing records.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to be returned in a single page.\nIt is possible to receive fewer results than the specified limit on a given page.\nThe default value of 100 is also the maximum allowed value. If the provided value is\ngreater than 100, it is ignored and the default value is used instead.\nDefault: `100`", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPayoutsResponse" + } + } + } + } + } + } + }, + "/v2/payouts/{payout_id}": { + "get": { + "tags": [ + "Payouts" + ], + "summary": "GetPayout", + "operationId": "GetPayout", + "description": "Retrieves details of a specific payout identified by a payout ID.\nTo call this endpoint, set `PAYOUTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "payout_id", + "description": "The ID of the payout to retrieve the information for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPayoutResponse" + } + } + } + } + } + } + }, + "/v2/payouts/{payout_id}/payout-entries": { + "get": { + "tags": [ + "Payouts" + ], + "summary": "ListPayoutEntries", + "operationId": "ListPayoutEntries", + "description": "Retrieves a list of all payout entries for a specific payout.\nTo call this endpoint, set `PAYOUTS_READ` for the OAuth scope.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "payout_id", + "description": "The ID of the payout to retrieve the information for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "sort_order", + "description": "The order in which payout entries are listed.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).\nIf request parameters change between requests, subsequent results may contain duplicates or missing records.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to be returned in a single page.\nIt is possible to receive fewer results than the specified limit on a given page.\nThe default value of 100 is also the maximum allowed value. If the provided value is\ngreater than 100, it is ignored and the default value is used instead.\nDefault: `100`", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPayoutEntriesResponse" + } + } + } + } + } + } + }, + "/v2/refunds": { + "get": { + "tags": [ + "Refunds" + ], + "summary": "ListPaymentRefunds", + "operationId": "ListPaymentRefunds", + "description": "Retrieves a list of refunds for the account making the request.\n\nResults are eventually consistent, and new refunds or changes to refunds might take several\nseconds to appear.\n\nThe maximum results per page is 100.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "begin_time", + "description": "Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339 \nformat. The range is determined using the `created_at` field for each `PaymentRefund`. \n\nDefault: The current time minus one year.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "end_time", + "description": "Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339 \nformat. The range is determined using the `created_at` field for each `PaymentRefund`.\n\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "The order in which results are listed by `PaymentRefund.created_at`:\n- `ASC` - Oldest to newest.\n- `DESC` - Newest to oldest (default).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this cursor to retrieve the next set of results for the original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "location_id", + "description": "Limit results to the location supplied. By default, results are returned\nfor all locations associated with the seller.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "status", + "description": "If provided, only refunds with the given status are returned.\nFor a list of refund status values, see [PaymentRefund](entity:PaymentRefund).\n\nDefault: If omitted, refunds are returned regardless of their status.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "source_type", + "description": "If provided, only returns refunds whose payments have the indicated source type.\nCurrent values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`.\nFor information about these payment source types, see\n[Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).\n\nDefault: If omitted, refunds are returned regardless of the source type.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to be returned in a single page.\n\nIt is possible to receive fewer results than the specified limit on a given page.\n\nIf the supplied value is greater than 100, no more than 100 results are returned.\n\nDefault: 100", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + }, + { + "name": "updated_at_begin_time", + "description": "Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339\nformat. The range is determined using the `updated_at` field for each `PaymentRefund`.\n\nDefault: If omitted, the time range starts at `begin_time`.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "updated_at_end_time", + "description": "Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339\nformat. The range is determined using the `updated_at` field for each `PaymentRefund`.\n\nDefault: The current time.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "sort_field", + "description": "The field used to sort results by. The default is `CREATED_AT`.", + "schema": { + "$ref": "#/components/schemas/ListPaymentRefundsRequestSortField" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPaymentRefundsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Refunds" + ], + "summary": "RefundPayment", + "operationId": "RefundPayment", + "description": "Refunds a payment. You can refund the entire payment amount or a\nportion of it. You can use this endpoint to refund a card payment or record a \nrefund of a cash or external payment. For more information, see\n[Refund Payment](https://developer.squareup.com/docs/payments-api/refund-payments).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RefundPaymentRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RefundPaymentResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_MISMATCH" + }, + { + "error-code": "CARD_PRESENCE_REQUIRED" + }, + { + "error-code": "CARD_TOKEN_EXPIRED" + }, + { + "error-code": "CARD_TOKEN_USED" + }, + { + "error-code": "GENERIC_DECLINE" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS_FOR_REFUND" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "INVALID_CARD_DATA" + }, + { + "error-code": "INVALID_FEES" + }, + { + "error-code": "PAYMENT_NOT_REFUNDABLE" + }, + { + "error-code": "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE" + }, + { + "error-code": "REFUND_AMOUNT_INVALID" + }, + { + "error-code": "REFUND_DECLINED" + }, + { + "error-code": "REFUND_ERROR_PAYMENT_NEEDS_COMPLETION" + }, + { + "error-code": "UNSUPPORTED_CARD_BRAND" + }, + { + "error-code": "UNSUPPORTED_COUNTRY" + }, + { + "error-code": "UNSUPPORTED_CURRENCY" + }, + { + "error-code": "UNSUPPORTED_INSTRUMENT_TYPE" + }, + { + "error-code": "UNSUPPORTED_SOURCE_TYPE" + }, + { + "error-code": "VALUE_TOO_HIGH" + }, + { + "error-code": "VERSION_MISMATCH" + } + ] + } + }, + "/v2/refunds/{refund_id}": { + "get": { + "tags": [ + "Refunds" + ], + "summary": "GetPaymentRefund", + "operationId": "GetPaymentRefund", + "description": "Retrieves a specific refund using the `refund_id`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "refund_id", + "description": "The unique ID for the desired `PaymentRefund`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPaymentRefundResponse" + } + } + } + } + } + } + }, + "/v2/sites": { + "get": { + "tags": [ + "Sites" + ], + "summary": "ListSites", + "operationId": "ListSites", + "description": "Lists the Square Online sites that belong to a seller. Sites are listed in descending order by the `created_at` date.\n\n\n__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ONLINE_STORE_SITE_READ" + ] + } + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListSitesResponse" + } + } + } + } + } + } + }, + "/v2/sites/{site_id}/snippet": { + "delete": { + "tags": [ + "Snippets" + ], + "summary": "DeleteSnippet", + "operationId": "DeleteSnippet", + "description": "Removes your snippet from a Square Online site.\n\nYou can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller.\n\n\n__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ONLINE_STORE_SNIPPETS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "site_id", + "description": "The ID of the site that contains the snippet.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteSnippetResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "Snippets" + ], + "summary": "RetrieveSnippet", + "operationId": "RetrieveSnippet", + "description": "Retrieves your snippet from a Square Online site. A site can contain snippets from multiple snippet applications, but you can retrieve only the snippet that was added by your application.\n\nYou can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller.\n\n\n__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ONLINE_STORE_SNIPPETS_READ" + ] + } + ], + "parameters": [ + { + "name": "site_id", + "description": "The ID of the site that contains the snippet.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveSnippetResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Snippets" + ], + "summary": "UpsertSnippet", + "operationId": "UpsertSnippet", + "description": "Adds a snippet to a Square Online site or updates the existing snippet on the site. \nThe snippet code is appended to the end of the `head` element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site. \n\nYou can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller.\n\n\n__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "ONLINE_STORE_SNIPPETS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "site_id", + "description": "The ID of the site where you want to add or update the snippet.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertSnippetRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpsertSnippetResponse" + } + } + } + } + } + } + }, + "/v2/subscriptions": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "CreateSubscription", + "operationId": "CreateSubscription", + "description": "Enrolls a customer in a subscription.\n\nIf you provide a card on file in the request, Square charges the card for\nthe subscription. Otherwise, Square sends an invoice to the customer's email\naddress. The subscription starts immediately, unless the request includes\nthe optional `start_date`. Each individual subscription is associated with a particular location.\n\nFor more information, see [Create a subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ", + "PAYMENTS_WRITE", + "SUBSCRIPTIONS_WRITE", + "ITEMS_READ", + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSubscriptionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_MISSING_EMAIL" + }, + { + "error-code": "CUSTOMER_MISSING_NAME" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "INVALID_DATE" + } + ] + } + }, + "/v2/subscriptions/bulk-swap-plan": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "BulkSwapPlan", + "operationId": "BulkSwapPlan", + "description": "Schedules a plan variation change for all active subscriptions under a given plan\nvariation. For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations).", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_WRITE", + "SUBSCRIPTIONS_READ", + "ITEMS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkSwapPlanRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkSwapPlanResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + } + ] + } + }, + "/v2/subscriptions/search": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "SearchSubscriptions", + "operationId": "SearchSubscriptions", + "description": "Searches for subscriptions.\n\nResults are ordered chronologically by subscription creation date. If\nthe request specifies more than one location ID,\nthe endpoint orders the result\nby location ID, and then by creation date within each location. If no locations are given\nin the query, all locations are searched.\n\nYou can also optionally specify `customer_ids` to search by customer.\nIf left unset, all customers\nassociated with the specified locations are returned.\nIf the request specifies customer IDs, the endpoint orders results\nfirst by location, within location by customer ID, and within\ncustomer by subscription creation date.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchSubscriptionsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchSubscriptionsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CUSTOMER_NOT_FOUND" + } + ] + } + }, + "/v2/subscriptions/{subscription_id}": { + "get": { + "tags": [ + "Subscriptions" + ], + "summary": "RetrieveSubscription", + "operationId": "RetrieveSubscription", + "description": "Retrieves a specific subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_READ" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "include", + "description": "A query parameter to specify related information to be included in the response. \n\nThe supported query parameter values are: \n\n- `actions`: to include scheduled actions on the targeted subscription.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveSubscriptionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Subscriptions" + ], + "summary": "UpdateSubscription", + "operationId": "UpdateSubscription", + "description": "Updates a subscription by modifying or clearing `subscription` field values.\nTo clear a field, set its value to `null`.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ", + "PAYMENTS_WRITE", + "SUBSCRIPTIONS_WRITE", + "ITEMS_READ", + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriptionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CUSTOMER_NOT_FOUND" + }, + { + "error-code": "INVALID_CARD" + } + ] + } + }, + "/v2/subscriptions/{subscription_id}/actions/{action_id}": { + "delete": { + "tags": [ + "Subscriptions" + ], + "summary": "DeleteSubscriptionAction", + "operationId": "DeleteSubscriptionAction", + "description": "Deletes a scheduled action for a subscription.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription the targeted action is to act upon.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "action_id", + "description": "The ID of the targeted action to be deleted.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteSubscriptionActionResponse" + } + } + } + } + } + } + }, + "/v2/subscriptions/{subscription_id}/billing-anchor": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "ChangeBillingAnchorDate", + "operationId": "ChangeBillingAnchorDate", + "description": "Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates)\nfor a subscription.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_WRITE", + "SUBSCRIPTIONS_READ", + "ITEMS_READ" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to update the billing anchor date.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangeBillingAnchorDateRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangeBillingAnchorDateResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_DATE" + }, + { + "error-code": "INVALID_PAUSE_LENGTH" + } + ] + } + }, + "/v2/subscriptions/{subscription_id}/cancel": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "CancelSubscription", + "operationId": "CancelSubscription", + "description": "Schedules a `CANCEL` action to cancel an active subscription. This \nsets the `canceled_date` field to the end of the active billing period. After this date, \nthe subscription status changes from ACTIVE to CANCELED.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to cancel.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelSubscriptionResponse" + } + } + } + } + } + } + }, + "/v2/subscriptions/{subscription_id}/events": { + "get": { + "tags": [ + "Subscriptions" + ], + "summary": "ListSubscriptionEvents", + "operationId": "ListSubscriptionEvents", + "description": "Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "SUBSCRIPTIONS_READ" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to retrieve the events for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "cursor", + "description": "When the total number of resulting subscription events exceeds the limit of a paged response, \nspecify the cursor returned from a preceding response here to fetch the next set of results.\nIf the cursor is unset, the response contains the last page of the results.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The upper limit on the number of subscription events to return\nin a paged response.", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListSubscriptionEventsResponse" + } + } + } + } + } + } + }, + "/v2/subscriptions/{subscription_id}/pause": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "PauseSubscription", + "operationId": "PauseSubscription", + "description": "Schedules a `PAUSE` action to pause an active subscription.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ", + "PAYMENTS_WRITE", + "SUBSCRIPTIONS_WRITE", + "ITEMS_READ", + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to pause.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PauseSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PauseSubscriptionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + }, + { + "error-code": "INVALID_PAUSE_LENGTH" + }, + { + "error-code": "INVALID_DATE" + } + ] + } + }, + "/v2/subscriptions/{subscription_id}/resume": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "ResumeSubscription", + "operationId": "ResumeSubscription", + "description": "Schedules a `RESUME` action to resume a paused or a deactivated subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ", + "PAYMENTS_WRITE", + "SUBSCRIPTIONS_WRITE", + "ITEMS_READ", + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to resume.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResumeSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResumeSubscriptionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_MISSING_EMAIL" + }, + { + "error-code": "CUSTOMER_MISSING_NAME" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + }, + { + "error-code": "INVALID_CARD" + }, + { + "error-code": "INVALID_DATE" + } + ] + } + }, + "/v2/subscriptions/{subscription_id}/swap-plan": { + "post": { + "tags": [ + "Subscriptions" + ], + "summary": "SwapPlan", + "operationId": "SwapPlan", + "description": "Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. \nFor more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations).", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "CUSTOMERS_READ", + "PAYMENTS_WRITE", + "SUBSCRIPTIONS_WRITE", + "ITEMS_READ", + "ORDERS_WRITE", + "INVOICES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "The ID of the subscription to swap the subscription plan for.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwapPlanRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SwapPlanResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "CARD_PROCESSING_NOT_ENABLED" + }, + { + "error-code": "CUSTOMER_NOT_FOUND" + } + ] + } + }, + "/v2/team-members": { + "post": { + "tags": [ + "Team" + ], + "summary": "CreateTeamMember", + "operationId": "CreateTeamMember", + "description": "Creates a single `TeamMember` object. The `TeamMember` object is returned on successful creates.\nYou must provide the following values in your request to this endpoint:\n- `given_name`\n- `family_name`\n\nLearn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#createteammember).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTeamMemberRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTeamMemberResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "FORBIDDEN" + } + ] + } + }, + "/v2/team-members/bulk-create": { + "post": { + "tags": [ + "Team" + ], + "summary": "BulkCreateTeamMembers", + "operationId": "BulkCreateTeamMembers", + "description": "Creates multiple `TeamMember` objects. The created `TeamMember` objects are returned on successful creates.\nThis process is non-transactional and processes as much of the request as possible. If one of the creates in\nthe request cannot be successfully processed, the request is not marked as failed, but the body of the response\ncontains explicit error information for the failed create.\n\nLearn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateTeamMembersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateTeamMembersResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "FORBIDDEN" + } + ] + } + }, + "/v2/team-members/bulk-update": { + "post": { + "tags": [ + "Team" + ], + "summary": "BulkUpdateTeamMembers", + "operationId": "BulkUpdateTeamMembers", + "description": "Updates multiple `TeamMember` objects. The updated `TeamMember` objects are returned on successful updates.\nThis process is non-transactional and processes as much of the request as possible. If one of the updates in\nthe request cannot be successfully processed, the request is not marked as failed, but the body of the response\ncontains explicit error information for the failed update.\nLearn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateTeamMembersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateTeamMembersResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "FORBIDDEN" + } + ] + } + }, + "/v2/team-members/jobs": { + "get": { + "tags": [ + "Team" + ], + "summary": "ListJobs", + "operationId": "ListJobs", + "description": "Lists jobs in a seller account. Results are sorted by title in ascending order.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "The pagination cursor returned by the previous call to this endpoint. Provide this\ncursor to retrieve the next page of results for your original request. For more information,\nsee [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListJobsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Team" + ], + "summary": "CreateJob", + "operationId": "CreateJob", + "description": "Creates a job in a seller account. A job defines a title and tip eligibility. Note that\ncompensation is defined in a [job assignment](entity:JobAssignment) in a team member's wage setting.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateJobRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateJobResponse" + } + } + } + } + } + } + }, + "/v2/team-members/jobs/{job_id}": { + "get": { + "tags": [ + "Team" + ], + "summary": "RetrieveJob", + "operationId": "RetrieveJob", + "description": "Retrieves a specified job.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "job_id", + "description": "The ID of the job to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveJobResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Team" + ], + "summary": "UpdateJob", + "operationId": "UpdateJob", + "description": "Updates the title or tip eligibility of a job. Changes to the title propagate to all\n`JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to\ntip eligibility propagate to all `TeamMemberWage` objects that reference the job ID.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "job_id", + "description": "The ID of the job to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateJobRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateJobResponse" + } + } + } + } + } + } + }, + "/v2/team-members/search": { + "post": { + "tags": [ + "Team" + ], + "summary": "SearchTeamMembers", + "operationId": "SearchTeamMembers", + "description": "Returns a paginated list of `TeamMember` objects for a business. \nThe list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether\nthe team member is the Square account owner.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTeamMembersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTeamMembersResponse" + } + } + } + } + } + } + }, + "/v2/team-members/{team_member_id}": { + "get": { + "tags": [ + "Team" + ], + "summary": "RetrieveTeamMember", + "operationId": "RetrieveTeamMember", + "description": "Retrieves a `TeamMember` object for the given `TeamMember.id`.\nLearn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "The ID of the team member to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTeamMemberResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Team" + ], + "summary": "UpdateTeamMember", + "operationId": "UpdateTeamMember", + "description": "Updates a single `TeamMember` object. The `TeamMember` object is returned on successful updates.\nLearn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "The ID of the team member to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTeamMemberRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTeamMemberResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "INVALID_EMAIL_ADDRESS" + }, + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "FORBIDDEN" + } + ] + } + }, + "/v2/team-members/{team_member_id}/wage-setting": { + "get": { + "tags": [ + "Team" + ], + "summary": "RetrieveWageSetting", + "operationId": "RetrieveWageSetting", + "description": "Retrieves a `WageSetting` object for a team member specified\nby `TeamMember.id`. For more information, see\n[Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrievewagesetting).\n\nSquare recommends using [RetrieveTeamMember](api-endpoint:Team-RetrieveTeamMember) or [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers)\nto get this information directly from the `TeamMember.wage_setting` field.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_READ" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "The ID of the team member for which to retrieve the wage setting.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveWageSettingResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Team" + ], + "summary": "UpdateWageSetting", + "operationId": "UpdateWageSetting", + "description": "Creates or updates a `WageSetting` object. The object is created if a\n`WageSetting` with the specified `team_member_id` doesn't exist. Otherwise,\nit fully replaces the `WageSetting` object for the team member.\nThe `WageSetting` is returned on a successful update. For more information, see\n[Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting).\n\nSquare recommends using [CreateTeamMember](api-endpoint:Team-CreateTeamMember) or [UpdateTeamMember](api-endpoint:Team-UpdateTeamMember)\nto manage the `TeamMember.wage_setting` field directly.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "EMPLOYEES_WRITE" + ] + } + ], + "parameters": [ + { + "name": "team_member_id", + "description": "The ID of the team member for which to update the `WageSetting` object.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWageSettingRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWageSettingResponse" + } + } + } + } + } + } + }, + "/v2/terminals/actions": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CreateTerminalAction", + "operationId": "CreateTerminalAction", + "description": "Creates a Terminal action request and sends it to the specified device.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalActionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalActionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "IDEMPOTENCY_KEY_REUSED" + }, + { + "error-code": "INVALID_LOCATION" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "UNAUTHORIZED" + } + ] + } + }, + "/v2/terminals/actions/search": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "SearchTerminalActions", + "operationId": "SearchTerminalActions", + "description": "Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalActionsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalActionsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_CURSOR" + }, + { + "error-code": "UNKNOWN_QUERY_PARAMETER" + } + ] + } + }, + "/v2/terminals/actions/{action_id}": { + "get": { + "tags": [ + "Terminal" + ], + "summary": "GetTerminalAction", + "operationId": "GetTerminalAction", + "description": "Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 days.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "action_id", + "description": "Unique ID for the desired `TerminalAction`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTerminalActionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/terminals/actions/{action_id}/cancel": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CancelTerminalAction", + "operationId": "CancelTerminalAction", + "description": "Cancels a Terminal action request if the status of the request permits it.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "action_id", + "description": "Unique ID for the desired `TerminalAction`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelTerminalActionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "TEMPORARY_ERROR" + } + ] + } + }, + "/v2/terminals/actions/{action_id}/dismiss": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "DismissTerminalAction", + "operationId": "DismissTerminalAction", + "description": "Dismisses a Terminal action request if the status and type of the request permits it.\n\nSee [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "action_id", + "description": "Unique ID for the `TerminalAction` associated with the action to be dismissed.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DismissTerminalActionResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/terminals/checkouts": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CreateTerminalCheckout", + "operationId": "CreateTerminalCheckout", + "description": "Creates a Terminal checkout request and sends it to the specified device to take a payment\nfor the requested amount.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalCheckoutRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalCheckoutResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "IDEMPOTENCY_KEY_REUSED" + }, + { + "error-code": "INVALID_FEES" + }, + { + "error-code": "INVALID_LOCATION" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "UNAUTHORIZED" + } + ] + } + }, + "/v2/terminals/checkouts/search": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "SearchTerminalCheckouts", + "operationId": "SearchTerminalCheckouts", + "description": "Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalCheckoutsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalCheckoutsResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "INVALID_CURSOR" + }, + { + "error-code": "UNKNOWN_QUERY_PARAMETER" + } + ] + } + }, + "/v2/terminals/checkouts/{checkout_id}": { + "get": { + "tags": [ + "Terminal" + ], + "summary": "GetTerminalCheckout", + "operationId": "GetTerminalCheckout", + "description": "Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "checkout_id", + "description": "The unique ID for the desired `TerminalCheckout`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTerminalCheckoutResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/terminals/checkouts/{checkout_id}/cancel": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CancelTerminalCheckout", + "operationId": "CancelTerminalCheckout", + "description": "Cancels a Terminal checkout request if the status of the request permits it.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "checkout_id", + "description": "The unique ID for the desired `TerminalCheckout`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelTerminalCheckoutResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/terminals/checkouts/{checkout_id}/dismiss": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "DismissTerminalCheckout", + "operationId": "DismissTerminalCheckout", + "description": "Dismisses a Terminal checkout request if the status and type of the request permits it.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "checkout_id", + "description": "Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DismissTerminalCheckoutResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/terminals/refunds": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CreateTerminalRefund", + "operationId": "CreateTerminalRefund", + "description": "Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](api:Refunds).", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalRefundRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTerminalRefundResponse" + } + } + } + } + } + } + }, + "/v2/terminals/refunds/search": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "SearchTerminalRefunds", + "operationId": "SearchTerminalRefunds", + "description": "Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalRefundsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTerminalRefundsResponse" + } + } + } + } + } + } + }, + "/v2/terminals/refunds/{terminal_refund_id}": { + "get": { + "tags": [ + "Terminal" + ], + "summary": "GetTerminalRefund", + "operationId": "GetTerminalRefund", + "description": "Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_READ" + ] + } + ], + "parameters": [ + { + "name": "terminal_refund_id", + "description": "The unique ID for the desired `TerminalRefund`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTerminalRefundResponse" + } + } + } + } + } + } + }, + "/v2/terminals/refunds/{terminal_refund_id}/cancel": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "CancelTerminalRefund", + "operationId": "CancelTerminalRefund", + "description": "Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [ + "PAYMENTS_WRITE" + ] + } + ], + "parameters": [ + { + "name": "terminal_refund_id", + "description": "The unique ID for the desired `TerminalRefund`.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelTerminalRefundResponse" + } + } + } + } + } + } + }, + "/v2/terminals/refunds/{terminal_refund_id}/dismiss": { + "post": { + "tags": [ + "Terminal" + ], + "summary": "DismissTerminalRefund", + "operationId": "DismissTerminalRefund", + "description": "Dismisses a Terminal refund request if the status and type of the request permits it.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "terminal_refund_id", + "description": "Unique ID for the `TerminalRefund` associated with the refund to be dismissed.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DismissTerminalRefundResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + } + ] + } + }, + "/v2/transfer-orders": { + "post": { + "tags": [ + "TransferOrder" + ], + "summary": "CreateTransferOrder", + "operationId": "CreateTransferOrder", + "description": "Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent \nto move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. \nThe source and destination locations must be different and must belong to your Square account.\n\nIn [DRAFT](entity:TransferOrderStatus) status, you can:\n- Add or remove items\n- Modify quantities\n- Update shipping information\n- Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder)\n\nThe request requires source_location_id and destination_location_id.\nInventory levels are not affected until the order is started via \n[StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder).\n\nCommon integration points:\n- Sync with warehouse management systems\n- Automate regular stock transfers\n- Initialize transfers from inventory optimization systems\n\nCreates a [transfer_order.created](webhook:transfer_order.created) webhook event.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "INVENTORY_READ", + "INVENTORY_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTransferOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTransferOrderResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "RATE_LIMITED" + } + ] + } + }, + "/v2/transfer-orders/search": { + "post": { + "tags": [ + "TransferOrder" + ], + "summary": "SearchTransferOrders", + "operationId": "SearchTransferOrders", + "description": "Searches for transfer orders using filters. Returns a paginated list of matching\n[TransferOrder](entity:TransferOrder)s sorted by creation date.\n\nCommon search scenarios:\n- Find orders for a source [Location](entity:Location)\n- Find orders for a destination [Location](entity:Location)\n- Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus)", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTransferOrdersRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchTransferOrdersResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "RATE_LIMITED" + } + ] + } + }, + "/v2/transfer-orders/{transfer_order_id}": { + "delete": { + "tags": [ + "TransferOrder" + ], + "summary": "DeleteTransferOrder", + "operationId": "DeleteTransferOrder", + "description": "Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status.\nOnly draft orders can be deleted. Once an order is started via \n[StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted.\n\nCreates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "INVENTORY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "transfer_order_id", + "description": "The ID of the transfer order to delete", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + }, + { + "name": "version", + "description": "Version for optimistic concurrency", + "schema": { + "type": "integer", + "format": "int64" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteTransferOrderResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "RATE_LIMITED" + } + ] + }, + "get": { + "tags": [ + "TransferOrder" + ], + "summary": "RetrieveTransferOrder", + "operationId": "RetrieveTransferOrder", + "description": "Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. Returns the complete\norder details including:\n\n- Basic information (status, dates, notes)\n- Line items with ordered and received quantities\n- Source and destination [Location](entity:Location)s\n- Tracking information (if available)", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "INVENTORY_READ" + ] + } + ], + "parameters": [ + { + "name": "transfer_order_id", + "description": "The ID of the transfer order to retrieve", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveTransferOrderResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "RATE_LIMITED" + } + ] + }, + "put": { + "tags": [ + "TransferOrder" + ], + "summary": "UpdateTransferOrder", + "operationId": "UpdateTransferOrder", + "description": "Updates an existing transfer order. This endpoint supports sparse updates,\nallowing you to modify specific fields without affecting others.\n\nCreates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "INVENTORY_READ", + "INVENTORY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "transfer_order_id", + "description": "The ID of the transfer order to update", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTransferOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTransferOrderResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "VERSION_MISMATCH" + }, + { + "error-code": "RATE_LIMITED" + } + ] + } + }, + "/v2/transfer-orders/{transfer_order_id}/cancel": { + "post": { + "tags": [ + "TransferOrder" + ], + "summary": "CancelTransferOrder", + "operationId": "CancelTransferOrder", + "description": "Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or \n[PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no\nlonger be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory.\n\nCommon reasons for cancellation:\n- Items no longer needed at destination\n- Source location needs the inventory\n- Order created in error\n\nCreates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "INVENTORY_READ", + "INVENTORY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "transfer_order_id", + "description": "The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelTransferOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelTransferOrderResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "RATE_LIMITED" + } + ] + } + }, + "/v2/transfer-orders/{transfer_order_id}/receive": { + "post": { + "tags": [ + "TransferOrder" + ], + "summary": "ReceiveTransferOrder", + "operationId": "ReceiveTransferOrder", + "description": "Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a transfer order.\nThis endpoint supports partial receiving - you can receive items in multiple batches.\n\nFor each line item, you can specify:\n- Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK)\n- Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE)\n- Quantity canceled (returned to source location's inventory)\n\nThe order must be in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status.\nReceived quantities are added to the destination [Location](entity:Location)'s inventory according to their condition.\nCanceled quantities are immediately returned to the source [Location](entity:Location)'s inventory.\n\nWhen all items are either received, damaged, or canceled, the order moves to\n[COMPLETED](entity:TransferOrderStatus) status.\n\nCreates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "INVENTORY_READ", + "INVENTORY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "transfer_order_id", + "description": "The ID of the transfer order to receive items for", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReceiveTransferOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReceiveTransferOrderResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "RATE_LIMITED" + } + ] + } + }, + "/v2/transfer-orders/{transfer_order_id}/start": { + "post": { + "tags": [ + "TransferOrder" + ], + "summary": "StartTransferOrder", + "operationId": "StartTransferOrder", + "description": "Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity:TransferOrderStatus) status.\nThis decrements inventory at the source [Location](entity:Location) and marks it as in-transit.\n\nThe order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated.\nOnce started, the order can no longer be deleted, but it can be canceled via \n[CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder).\n\nCreates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "INVENTORY_READ", + "INVENTORY_WRITE" + ] + } + ], + "parameters": [ + { + "name": "transfer_order_id", + "description": "The ID of the transfer order to start. Must be in DRAFT status.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartTransferOrderRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StartTransferOrderResponse" + } + } + } + } + }, + "x-endpoint-errors": [ + { + "error-code": "BAD_REQUEST" + }, + { + "error-code": "NOT_FOUND" + }, + { + "error-code": "UNAUTHORIZED" + }, + { + "error-code": "INSUFFICIENT_PERMISSIONS" + }, + { + "error-code": "INVALID_VALUE" + }, + { + "error-code": "RATE_LIMITED" + } + ] + } + }, + "/v2/vendors/bulk-create": { + "post": { + "tags": [ + "Vendors" + ], + "summary": "BulkCreateVendors", + "operationId": "BulkCreateVendors", + "description": "Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a seller.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateVendorsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkCreateVendorsResponse" + } + } + } + } + } + } + }, + "/v2/vendors/bulk-retrieve": { + "post": { + "tags": [ + "Vendors" + ], + "summary": "BulkRetrieveVendors", + "operationId": "BulkRetrieveVendors", + "description": "Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveVendorsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRetrieveVendorsResponse" + } + } + } + } + } + } + }, + "/v2/vendors/bulk-update": { + "put": { + "tags": [ + "Vendors" + ], + "summary": "BulkUpdateVendors", + "operationId": "BulkUpdateVendors", + "description": "Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers to a seller.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateVendorsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkUpdateVendorsResponse" + } + } + } + } + } + } + }, + "/v2/vendors/create": { + "post": { + "tags": [ + "Vendors" + ], + "summary": "CreateVendor", + "operationId": "CreateVendor", + "description": "Creates a single [Vendor](entity:Vendor) object to represent a supplier to a seller.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateVendorRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateVendorResponse" + } + } + } + } + } + } + }, + "/v2/vendors/search": { + "post": { + "tags": [ + "Vendors" + ], + "summary": "SearchVendors", + "operationId": "SearchVendors", + "description": "Searches for vendors using a filter against supported [Vendor](entity:Vendor) properties and a supported sorter.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_READ" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchVendorsRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchVendorsResponse" + } + } + } + } + } + } + }, + "/v2/vendors/{vendor_id}": { + "get": { + "tags": [ + "Vendors" + ], + "summary": "RetrieveVendor", + "operationId": "RetrieveVendor", + "description": "Retrieves the vendor of a specified [Vendor](entity:Vendor) ID.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_READ" + ] + } + ], + "parameters": [ + { + "name": "vendor_id", + "description": "ID of the [Vendor](entity:Vendor) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveVendorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Vendors" + ], + "summary": "UpdateVendor", + "operationId": "UpdateVendor", + "description": "Updates an existing [Vendor](entity:Vendor) object as a supplier to a seller.", + "x-release-status": "BETA", + "security": [ + { + "oauth2": [ + "VENDOR_WRITE" + ] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateVendorRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateVendorResponse" + } + } + } + } + } + } + }, + "/v2/webhooks/event-types": { + "get": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "ListWebhookEventTypes", + "operationId": "ListWebhookEventTypes", + "description": "Lists all webhook event types that can be subscribed to.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "api_version", + "description": "The API version for which to list event types. Setting this field overrides the default version used by the application.", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWebhookEventTypesResponse" + } + } + } + } + } + } + }, + "/v2/webhooks/subscriptions": { + "get": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "ListWebhookSubscriptions", + "operationId": "ListWebhookSubscriptions", + "description": "Lists all webhook subscriptions owned by your application.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "cursor", + "description": "A pagination cursor returned by a previous call to this endpoint.\nProvide this to retrieve the next set of results for your original query.\n\nFor more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).", + "schema": { + "type": "string" + }, + "in": "query", + "required": false + }, + { + "name": "include_disabled", + "description": "Includes disabled [Subscription](entity:WebhookSubscription)s.\nBy default, all enabled [Subscription](entity:WebhookSubscription)s are returned.", + "schema": { + "type": "boolean", + "default": false + }, + "in": "query", + "required": false + }, + { + "name": "sort_order", + "description": "Sorts the returned list by when the [Subscription](entity:WebhookSubscription) was created with the specified order.\nThis field defaults to ASC.", + "schema": { + "$ref": "#/components/schemas/SortOrder" + }, + "in": "query", + "required": false + }, + { + "name": "limit", + "description": "The maximum number of results to be returned in a single page.\nIt is possible to receive fewer results than the specified limit on a given page.\nThe default value of 100 is also the maximum allowed value.\n\nDefault: 100", + "schema": { + "type": "integer" + }, + "in": "query", + "required": false + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWebhookSubscriptionsResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "CreateWebhookSubscription", + "operationId": "CreateWebhookSubscription", + "description": "Creates a webhook subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWebhookSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWebhookSubscriptionResponse" + } + } + } + } + } + } + }, + "/v2/webhooks/subscriptions/{subscription_id}": { + "delete": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "DeleteWebhookSubscription", + "operationId": "DeleteWebhookSubscription", + "description": "Deletes a webhook subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "[REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to delete.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteWebhookSubscriptionResponse" + } + } + } + } + } + }, + "get": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "RetrieveWebhookSubscription", + "operationId": "RetrieveWebhookSubscription", + "description": "Retrieves a webhook subscription identified by its ID.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "[REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to retrieve.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveWebhookSubscriptionResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "UpdateWebhookSubscription", + "operationId": "UpdateWebhookSubscription", + "description": "Updates a webhook subscription.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "[REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWebhookSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWebhookSubscriptionResponse" + } + } + } + } + } + } + }, + "/v2/webhooks/subscriptions/{subscription_id}/signature-key": { + "post": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "UpdateWebhookSubscriptionSignatureKey", + "operationId": "UpdateWebhookSubscriptionSignatureKey", + "description": "Updates a webhook subscription by replacing the existing signature key with a new one.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "[REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWebhookSubscriptionSignatureKeyRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWebhookSubscriptionSignatureKeyResponse" + } + } + } + } + } + } + }, + "/v2/webhooks/subscriptions/{subscription_id}/test": { + "post": { + "tags": [ + "WebhookSubscriptions" + ], + "summary": "TestWebhookSubscription", + "operationId": "TestWebhookSubscription", + "description": "Tests a webhook subscription by sending a test event to the notification URL.", + "x-release-status": "PUBLIC", + "security": [ + { + "oauth2": [] + } + ], + "parameters": [ + { + "name": "subscription_id", + "description": "[REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to test.", + "schema": { + "type": "string" + }, + "in": "path", + "required": true + } + ], + "requestBody": { + "required": true, + "description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestWebhookSubscriptionRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestWebhookSubscriptionResponse" + } + } + } + } + } + } + } + }, + "x-fern-global-headers": [ + { + "header": "Square-Version", + "name": "version", + "optional": true, + "env": "VERSION", + "type": "literal\u003c\"2025-10-16\"\u003e" + } + ] +} \ No newline at end of file diff --git a/.npmignore b/.npmignore index 6db0876c4..b7e5ad302 100644 --- a/.npmignore +++ b/.npmignore @@ -4,6 +4,7 @@ tests .gitignore .github .fernignore -.prettierrc.yml +biome.json tsconfig.json -yarn.lock \ No newline at end of file +yarn.lock +pnpm-lock.yaml \ No newline at end of file diff --git a/.prettierrc.yml b/.prettierrc.yml deleted file mode 100644 index 0c06786bf..000000000 --- a/.prettierrc.yml +++ /dev/null @@ -1,2 +0,0 @@ -tabWidth: 4 -printWidth: 120 diff --git a/biome.json b/biome.json new file mode 100644 index 000000000..b6890dfbc --- /dev/null +++ b/biome.json @@ -0,0 +1,69 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.2.5/schema.json", + "root": true, + "vcs": { + "enabled": false + }, + "files": { + "ignoreUnknown": true, + "includes": [ + "./**", + "!dist", + "!lib", + "!*.tsbuildinfo", + "!_tmp_*", + "!*.tmp", + "!.tmp/", + "!*.log", + "!.DS_Store", + "!Thumbs.db" + ] + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 4, + "lineWidth": 120 + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": "on" + } + } + }, + "linter": { + "rules": { + "style": { + "useNodejsImportProtocol": "off" + }, + "suspicious": { + "noAssignInExpressions": "warn", + "noUselessEscapeInString": { + "level": "warn", + "fix": "none", + "options": {} + }, + "noThenProperty": "warn", + "useIterableCallbackReturn": "warn", + "noShadowRestrictedNames": "warn", + "noTsIgnore": { + "level": "warn", + "fix": "none", + "options": {} + }, + "noConfusingVoidType": { + "level": "warn", + "fix": "none", + "options": {} + } + } + } + } +} diff --git a/jest.config.mjs b/jest.config.mjs index 5158ac4fb..6f37e7b4f 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -13,27 +13,7 @@ export default { roots: ["/tests"], testPathIgnorePatterns: ["\.browser\.(spec|test)\.[jt]sx?$", "/tests/wire/", "/tests/integration/"], setupFilesAfterEnv: [], - transformIgnorePatterns: [ - "node_modules/(?!(msw|@mswjs|@bundled-es-modules|until-async)/)", - ], - transform: { - "^.+\\.tsx?$": "ts-jest", - "^.+\\.m?jsx?$": "ts-jest", - }, - }, - { - displayName: "browser", - preset: "ts-jest", - testEnvironment: "/tests/BrowserTestEnvironment.ts", - moduleNameMapper: { - "^(\.{1,2}/.*)\.js$": "$1", - }, - roots: ["/tests"], - testMatch: ["/tests/unit/**/?(*.)+(browser).(spec|test).[jt]s?(x)"], - setupFilesAfterEnv: [], - transformIgnorePatterns: [ - "node_modules/(?!(msw|@mswjs|@bundled-es-modules|until-async)/)", - ], + transformIgnorePatterns: ["node_modules/(?!(msw|@mswjs|@bundled-es-modules|until-async)/)"], transform: { "^.+\\.tsx?$": "ts-jest", "^.+\\.m?jsx?$": "ts-jest", @@ -48,9 +28,7 @@ export default { }, roots: ["/tests/wire"], setupFilesAfterEnv: ["/tests/mock-server/setup.ts"], - transformIgnorePatterns: [ - "node_modules/(?!(msw|@mswjs|@bundled-es-modules|until-async)/)", - ], + transformIgnorePatterns: ["node_modules/(?!(msw|@mswjs|@bundled-es-modules|until-async)/)"], transform: { "^.+\\.tsx?$": "ts-jest", "^.+\\.m?jsx?$": "ts-jest", @@ -64,9 +42,7 @@ export default { "^(\.{1,2}/.*)\.js$": "$1", }, roots: ["/tests/integration"], - transformIgnorePatterns: [ - "node_modules/(?!(msw|@mswjs|@bundled-es-modules|until-async)/)", - ], + transformIgnorePatterns: ["node_modules/(?!(msw|@mswjs|@bundled-es-modules|until-async)/)"], transform: { "^.+\\.tsx?$": "ts-jest", "^.+\\.m?jsx?$": "ts-jest", @@ -75,4 +51,4 @@ export default { ], workerThreads: false, passWithNoTests: true, -}; \ No newline at end of file +}; diff --git a/legacy/exports/index.d.mts b/legacy/exports/index.d.mts index d4a3b9f49..d4327f13f 100644 --- a/legacy/exports/index.d.mts +++ b/legacy/exports/index.d.mts @@ -1 +1 @@ -export * from "square-legacy"; \ No newline at end of file +export * from "square-legacy"; diff --git a/legacy/exports/index.d.ts b/legacy/exports/index.d.ts index d4a3b9f49..d4327f13f 100644 --- a/legacy/exports/index.d.ts +++ b/legacy/exports/index.d.ts @@ -1 +1 @@ -export * from "square-legacy"; \ No newline at end of file +export * from "square-legacy"; diff --git a/legacy/exports/index.js b/legacy/exports/index.js index de8433c9d..2c71b42a5 100644 --- a/legacy/exports/index.js +++ b/legacy/exports/index.js @@ -1 +1 @@ -module.exports = require("square-legacy"); \ No newline at end of file +module.exports = require("square-legacy"); diff --git a/legacy/exports/index.mjs b/legacy/exports/index.mjs index d4a3b9f49..d4327f13f 100644 --- a/legacy/exports/index.mjs +++ b/legacy/exports/index.mjs @@ -1 +1 @@ -export * from "square-legacy"; \ No newline at end of file +export * from "square-legacy"; diff --git a/package.json b/package.json index 1fb834b6c..9129c27f8 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,24 @@ { "name": "square", - "version": "43.1.0", + "version": "43.1.2", "private": false, "repository": "github:square/square-nodejs-sdk", "license": "MIT", "main": "./index.js", "types": "./index.d.ts", "scripts": { - "format": "prettier . --write --ignore-unknown", + "format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", "build": "tsc", "prepack": "cp -rv dist/. .", - "test": "jest --selectProjects unit browser wire", + "test": "jest --selectProjects unit wire", "test:unit": "jest --selectProjects unit", - "test:browser": "jest --selectProjects browser", "test:wire": "jest --selectProjects wire", "test:integration": "jest --selectProjects integration" }, "dependencies": { - "form-data": "^4.0.0", + "form-data": "^4.0.4", "formdata-node": "^6.0.3", "node-fetch": "^2.7.0", "readable-stream": "^4.5.2", @@ -34,9 +35,9 @@ "@types/jest": "^29.5.14", "ts-jest": "^29.3.4", "jest-environment-jsdom": "^29.7.0", - "msw": "^2.8.4", + "msw": "2.11.2", "@types/node": "^18.19.70", - "prettier": "^3.4.2", + "@biomejs/biome": "2.2.5", "typescript": "~5.7.2" }, "browser": { diff --git a/reference.md b/reference.md index d6e291d65..e9fce35c1 100644 --- a/reference.md +++ b/reference.md @@ -1,7 +1,5 @@ # Reference - ## Mobile -
client.mobile.authorizationCode({ ...params }) -> Square.CreateMobileAuthorizationCodeResponse
@@ -14,8 +12,8 @@
-**Note:** This endpoint is used by the deprecated Reader SDK. -Developers should update their integration to use the [Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. +__Note:__ This endpoint is used by the deprecated Reader SDK. +Developers should update their integration to use the [Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. Generates code to authorize a mobile application to connect to a Square card reader. @@ -29,7 +27,6 @@ Authorization: Bearer ACCESS_TOKEN Replace `ACCESS_TOKEN` with a [valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). -
@@ -45,10 +42,10 @@ Replace `ACCESS_TOKEN` with a ```typescript await client.mobile.authorizationCode({ - locationId: "YOUR_LOCATION_ID", + locationId: "YOUR_LOCATION_ID" }); -``` +```
@@ -62,27 +59,27 @@ await client.mobile.authorizationCode({
-**request:** `Square.CreateMobileAuthorizationCodeRequest` - +**request:** `Square.CreateMobileAuthorizationCodeRequest` +
-**requestOptions:** `Mobile.RequestOptions` - +**requestOptions:** `Mobile.RequestOptions` +
+
## OAuth -
client.oAuth.revokeToken({ ...params }) -> Square.RevokeTokenResponse
@@ -98,9 +95,9 @@ await client.mobile.authorizationCode({ Revokes an access token generated with the OAuth flow. If an account has more than one OAuth access token for your application, this -endpoint revokes all of them, regardless of which token you specify. +endpoint revokes all of them, regardless of which token you specify. -**Important:** The `Authorization` header for this endpoint must have the +__Important:__ The `Authorization` header for this endpoint must have the following format: ``` @@ -109,7 +106,6 @@ Authorization: Client APPLICATION_SECRET Replace `APPLICATION_SECRET` with the application secret on the **OAuth** page for your application in the Developer Dashboard. -
@@ -126,10 +122,10 @@ page for your application in the Developer Dashboard. ```typescript await client.oAuth.revokeToken({ clientId: "CLIENT_ID", - accessToken: "ACCESS_TOKEN", + accessToken: "ACCESS_TOKEN" }); -``` +``` @@ -143,21 +139,22 @@ await client.oAuth.revokeToken({
-**request:** `Square.RevokeTokenRequest` - +**request:** `Square.RevokeTokenRequest` +
-**requestOptions:** `OAuth.RequestOptions` - +**requestOptions:** `OAuth.RequestOptions` +
+
@@ -178,26 +175,23 @@ Returns an OAuth access token and refresh token using the `authorization_code` or `refresh_token` grant type. When `grant_type` is `authorization_code`: - - With the [code flow](https://developer.squareup.com/docs/oauth-api/overview#code-flow), - provide `code`, `client_id`, and `client_secret`. +provide `code`, `client_id`, and `client_secret`. - With the [PKCE flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow), - provide `code`, `client_id`, and `code_verifier`. +provide `code`, `client_id`, and `code_verifier`. When `grant_type` is `refresh_token`: - - With the code flow, provide `refresh_token`, `client_id`, and `client_secret`. - The response returns the same refresh token provided in the request. +The response returns the same refresh token provided in the request. - With the PKCE flow, provide `refresh_token` and `client_id`. The response returns - a new refresh token. +a new refresh token. You can use the `scopes` parameter to limit the set of permissions authorized by the access token. You can use the `short_lived` parameter to create an access token that expires in 24 hours. -**Important:** OAuth tokens should be encrypted and stored on a secure server. +__Important:__ OAuth tokens should be encrypted and stored on a secure server. Application clients should never interact directly with OAuth tokens. - @@ -216,10 +210,10 @@ await client.oAuth.obtainToken({ clientId: "sq0idp-uaPHILoPzWZk3tlJqlML0g", clientSecret: "sq0csp-30a-4C_tVOnTh14Piza2BfTPBXyLafLPWSzY1qAjeBfM", code: "sq0cgb-l0SBqxs4uwxErTVyYOdemg", - grantType: "authorization_code", + grantType: "authorization_code" }); -``` +``` @@ -233,21 +227,22 @@ await client.oAuth.obtainToken({
-**request:** `Square.ObtainTokenRequest` - +**request:** `Square.ObtainTokenRequest` +
-**requestOptions:** `OAuth.RequestOptions` - +**requestOptions:** `OAuth.RequestOptions` +
+ @@ -268,7 +263,7 @@ Returns information about an [OAuth access token](https://developer.squareup.com Add the access token to the Authorization header of the request. -**Important:** The `Authorization` header you provide to this endpoint must have the following format: +__Important:__ The `Authorization` header you provide to this endpoint must have the following format: ``` Authorization: Bearer ACCESS_TOKEN @@ -278,7 +273,6 @@ where `ACCESS_TOKEN` is a [valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error. - @@ -294,8 +288,8 @@ If the access token is expired or not a valid access token, the endpoint returns ```typescript await client.oAuth.retrieveTokenStatus(); -``` +``` @@ -309,13 +303,14 @@ await client.oAuth.retrieveTokenStatus();
-**requestOptions:** `OAuth.RequestOptions` - +**requestOptions:** `OAuth.RequestOptions` +
+ @@ -334,8 +329,8 @@ await client.oAuth.retrieveTokenStatus(); ```typescript await client.oAuth.authorize(); -``` +``` @@ -349,19 +344,19 @@ await client.oAuth.authorize();
-**requestOptions:** `OAuth.RequestOptions` - +**requestOptions:** `OAuth.RequestOptions` +
+ ## V1Transactions -
client.v1Transactions.v1ListOrders({ ...params }) -> Square.V1Order[]
@@ -375,7 +370,6 @@ await client.oAuth.authorize();
Provides summary information for a merchant's online store orders. -
@@ -394,10 +388,10 @@ await client.v1Transactions.v1ListOrders({ locationId: "location_id", order: "DESC", limit: 1, - batchToken: "batch_token", + batchToken: "batch_token" }); -``` +``` @@ -411,21 +405,22 @@ await client.v1Transactions.v1ListOrders({
-**request:** `Square.V1ListOrdersRequest` - +**request:** `Square.V1ListOrdersRequest` +
-**requestOptions:** `V1Transactions.RequestOptions` - +**requestOptions:** `V1Transactions.RequestOptions` +
+
@@ -443,7 +438,6 @@ await client.v1Transactions.v1ListOrders({
Provides comprehensive information for a single online store order, including the order's history. -
@@ -460,10 +454,10 @@ Provides comprehensive information for a single online store order, including th ```typescript await client.v1Transactions.v1RetrieveOrder({ locationId: "location_id", - orderId: "order_id", + orderId: "order_id" }); -``` +``` @@ -477,21 +471,22 @@ await client.v1Transactions.v1RetrieveOrder({
-**request:** `Square.V1RetrieveOrderRequest` - +**request:** `Square.V1RetrieveOrderRequest` +
-**requestOptions:** `V1Transactions.RequestOptions` - +**requestOptions:** `V1Transactions.RequestOptions` +
+ @@ -509,7 +504,6 @@ await client.v1Transactions.v1RetrieveOrder({
Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: -
@@ -527,10 +521,10 @@ Updates the details of an online store order. Every update you perform on an ord await client.v1Transactions.v1UpdateOrder({ locationId: "location_id", orderId: "order_id", - action: "COMPLETE", + action: "COMPLETE" }); -``` +``` @@ -544,27 +538,27 @@ await client.v1Transactions.v1UpdateOrder({
-**request:** `Square.V1UpdateOrderRequest` - +**request:** `Square.V1UpdateOrderRequest` +
-**requestOptions:** `V1Transactions.RequestOptions` - +**requestOptions:** `V1Transactions.RequestOptions` +
+ ## ApplePay -
client.applePay.registerDomain({ ...params }) -> Square.RegisterDomainResponse
@@ -584,14 +578,13 @@ an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Apple Pay on the Web with Square for merchants using their platform. -Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The +Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association, and should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your -domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding +domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding long-lived caches that might not keep in sync with the correct file version. To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay). -
@@ -607,10 +600,10 @@ To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an ```typescript await client.applePay.registerDomain({ - domainName: "example.com", + domainName: "example.com" }); -``` +``` @@ -624,27 +617,27 @@ await client.applePay.registerDomain({
-**request:** `Square.RegisterDomainRequest` - +**request:** `Square.RegisterDomainRequest` +
-**requestOptions:** `ApplePay.RequestOptions` - +**requestOptions:** `ApplePay.RequestOptions` +
+
## BankAccounts -
client.bankAccounts.list({ ...params }) -> core.Page
@@ -658,7 +651,6 @@ await client.applePay.registerDomain({
Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. -
@@ -676,7 +668,7 @@ Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square a const response = await client.bankAccounts.list({ cursor: "cursor", limit: 1, - locationId: "location_id", + locationId: "location_id" }); for await (const item of response) { console.log(item); @@ -686,13 +678,13 @@ for await (const item of response) { let page = await client.bankAccounts.list({ cursor: "cursor", limit: 1, - locationId: "location_id", + locationId: "location_id" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -706,21 +698,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListBankAccountsRequest` - +**request:** `Square.ListBankAccountsRequest` +
-**requestOptions:** `BankAccounts.RequestOptions` - +**requestOptions:** `BankAccounts.RequestOptions` +
+
@@ -738,7 +731,6 @@ while (page.hasNextPage()) {
Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank account ID. -
@@ -754,10 +746,10 @@ Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank acc ```typescript await client.bankAccounts.getByV1Id({ - v1BankAccountId: "v1_bank_account_id", + v1BankAccountId: "v1_bank_account_id" }); -``` +``` @@ -771,21 +763,22 @@ await client.bankAccounts.getByV1Id({
-**request:** `Square.GetByV1IdBankAccountsRequest` - +**request:** `Square.GetByV1IdBankAccountsRequest` +
-**requestOptions:** `BankAccounts.RequestOptions` - +**requestOptions:** `BankAccounts.RequestOptions` +
+ @@ -804,7 +797,6 @@ await client.bankAccounts.getByV1Id({ Returns details of a [BankAccount](entity:BankAccount) linked to a Square account. - @@ -820,10 +812,10 @@ linked to a Square account. ```typescript await client.bankAccounts.get({ - bankAccountId: "bank_account_id", + bankAccountId: "bank_account_id" }); -``` +``` @@ -837,27 +829,27 @@ await client.bankAccounts.get({
-**request:** `Square.GetBankAccountsRequest` - +**request:** `Square.GetBankAccountsRequest` +
-**requestOptions:** `BankAccounts.RequestOptions` - +**requestOptions:** `BankAccounts.RequestOptions` +
+ ## Bookings -
client.bookings.list({ ...params }) -> core.Page
@@ -874,7 +866,6 @@ Retrieve a collection of bookings. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. -
@@ -896,7 +887,7 @@ const response = await client.bookings.list({ teamMemberId: "team_member_id", locationId: "location_id", startAtMin: "start_at_min", - startAtMax: "start_at_max", + startAtMax: "start_at_max" }); for await (const item of response) { console.log(item); @@ -910,13 +901,13 @@ let page = await client.bookings.list({ teamMemberId: "team_member_id", locationId: "location_id", startAtMin: "start_at_min", - startAtMax: "start_at_max", + startAtMax: "start_at_max" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -930,21 +921,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListBookingsRequest` - +**request:** `Square.ListBookingsRequest` +
-**requestOptions:** `Bookings.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
+
@@ -964,7 +956,6 @@ while (page.hasNextPage()) { Creates a booking. The required input must include the following: - - `Booking.location_id` - `Booking.start_at` - `Booking.AppointmentSegment.team_member_id` @@ -974,9 +965,8 @@ The required input must include the following: To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ -or _Appointments Premium_. - +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* +or *Appointments Premium*. @@ -992,10 +982,10 @@ or _Appointments Premium_. ```typescript await client.bookings.create({ - booking: {}, + booking: {} }); -``` +``` @@ -1009,21 +999,22 @@ await client.bookings.create({
-**request:** `Square.CreateBookingRequest` - +**request:** `Square.CreateBookingRequest` +
-**requestOptions:** `Bookings.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
+ @@ -1044,7 +1035,6 @@ Searches for availabilities for booking. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - @@ -1062,12 +1052,12 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` await client.bookings.searchAvailability({ query: { filter: { - startAtRange: {}, - }, - }, + startAtRange: {} + } + } }); -``` +``` @@ -1081,21 +1071,22 @@ await client.bookings.searchAvailability({
-**request:** `Square.SearchAvailabilityRequest` - +**request:** `Square.SearchAvailabilityRequest` +
-**requestOptions:** `Bookings.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
+ @@ -1116,7 +1107,6 @@ Bulk-Retrieves a list of bookings by booking IDs. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - @@ -1132,10 +1122,10 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` ```typescript await client.bookings.bulkRetrieveBookings({ - bookingIds: ["booking_ids"], + bookingIds: ["booking_ids"] }); -``` +``` @@ -1149,21 +1139,22 @@ await client.bookings.bulkRetrieveBookings({
-**request:** `Square.BulkRetrieveBookingsRequest` - +**request:** `Square.BulkRetrieveBookingsRequest` +
-**requestOptions:** `Bookings.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
+ @@ -1181,7 +1172,6 @@ await client.bookings.bulkRetrieveBookings({
Retrieves a seller's booking profile. -
@@ -1197,8 +1187,8 @@ Retrieves a seller's booking profile. ```typescript await client.bookings.getBusinessProfile(); -``` +``` @@ -1212,13 +1202,14 @@ await client.bookings.getBusinessProfile();
-**requestOptions:** `Bookings.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
+ @@ -1236,7 +1227,6 @@ await client.bookings.getBusinessProfile();
Retrieves a seller's location booking profile. -
@@ -1252,10 +1242,10 @@ Retrieves a seller's location booking profile. ```typescript await client.bookings.retrieveLocationBookingProfile({ - locationId: "location_id", + locationId: "location_id" }); -``` +``` @@ -1269,21 +1259,22 @@ await client.bookings.retrieveLocationBookingProfile({
-**request:** `Square.RetrieveLocationBookingProfileRequest` - +**request:** `Square.RetrieveLocationBookingProfileRequest` +
-**requestOptions:** `Bookings.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
+ @@ -1301,7 +1292,6 @@ await client.bookings.retrieveLocationBookingProfile({
Retrieves one or more team members' booking profiles. -
@@ -1317,10 +1307,10 @@ Retrieves one or more team members' booking profiles. ```typescript await client.bookings.bulkRetrieveTeamMemberBookingProfiles({ - teamMemberIds: ["team_member_ids"], + teamMemberIds: ["team_member_ids"] }); -``` +``` @@ -1334,21 +1324,22 @@ await client.bookings.bulkRetrieveTeamMemberBookingProfiles({
-**request:** `Square.BulkRetrieveTeamMemberBookingProfilesRequest` - +**request:** `Square.BulkRetrieveTeamMemberBookingProfilesRequest` +
-**requestOptions:** `Bookings.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
+ @@ -1369,7 +1360,6 @@ Retrieves a booking. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - @@ -1385,10 +1375,10 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` ```typescript await client.bookings.get({ - bookingId: "booking_id", + bookingId: "booking_id" }); -``` +``` @@ -1402,21 +1392,22 @@ await client.bookings.get({
-**request:** `Square.GetBookingsRequest` - +**request:** `Square.GetBookingsRequest` +
-**requestOptions:** `Bookings.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
+ @@ -1438,9 +1429,8 @@ Updates a booking. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ -or _Appointments Premium_. - +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* +or *Appointments Premium*. @@ -1457,10 +1447,10 @@ or _Appointments Premium_. ```typescript await client.bookings.update({ bookingId: "booking_id", - booking: {}, + booking: {} }); -``` +``` @@ -1474,21 +1464,22 @@ await client.bookings.update({
-**request:** `Square.UpdateBookingRequest` - +**request:** `Square.UpdateBookingRequest` +
-**requestOptions:** `Bookings.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
+ @@ -1510,9 +1501,8 @@ Cancels an existing booking. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ -or _Appointments Premium_. - +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* +or *Appointments Premium*. @@ -1528,10 +1518,10 @@ or _Appointments Premium_. ```typescript await client.bookings.cancel({ - bookingId: "booking_id", + bookingId: "booking_id" }); -``` +``` @@ -1545,27 +1535,27 @@ await client.bookings.cancel({
-**request:** `Square.CancelBookingRequest` - +**request:** `Square.CancelBookingRequest` +
-**requestOptions:** `Bookings.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
+ ## Cards -
client.cards.list({ ...params }) -> core.Page
@@ -1580,7 +1570,6 @@ await client.bookings.cancel({ Retrieves a list of cards owned by the account making the request. A max of 25 cards will be returned. -
@@ -1600,7 +1589,7 @@ const response = await client.cards.list({ customerId: "customer_id", includeDisabled: true, referenceId: "reference_id", - sortOrder: "DESC", + sortOrder: "DESC" }); for await (const item of response) { console.log(item); @@ -1612,13 +1601,13 @@ let page = await client.cards.list({ customerId: "customer_id", includeDisabled: true, referenceId: "reference_id", - sortOrder: "DESC", + sortOrder: "DESC" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -1632,21 +1621,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListCardsRequest` - +**request:** `Square.ListCardsRequest` +
-**requestOptions:** `Cards.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
+
@@ -1664,7 +1654,6 @@ while (page.hasNextPage()) {
Adds a card on file to an existing merchant. -
@@ -1690,14 +1679,14 @@ await client.cards.create({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US", + country: "US" }, customerId: "VDKXEEKPJN48QDG3BGGFAK05P8", - referenceId: "user-id-1", - }, + referenceId: "user-id-1" + } }); -``` +``` @@ -1711,21 +1700,22 @@ await client.cards.create({
-**request:** `Square.CreateCardRequest` - +**request:** `Square.CreateCardRequest` +
-**requestOptions:** `Cards.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
+ @@ -1743,7 +1733,6 @@ await client.cards.create({
Retrieves details for a specific Card. -
@@ -1759,10 +1748,10 @@ Retrieves details for a specific Card. ```typescript await client.cards.get({ - cardId: "card_id", + cardId: "card_id" }); -``` +``` @@ -1776,21 +1765,22 @@ await client.cards.get({
-**request:** `Square.GetCardsRequest` - +**request:** `Square.GetCardsRequest` +
-**requestOptions:** `Cards.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
+ @@ -1809,7 +1799,6 @@ await client.cards.get({ Disables the card, preventing any further updates or charges. Disabling an already disabled card is allowed but has no effect. - @@ -1825,10 +1814,10 @@ Disabling an already disabled card is allowed but has no effect. ```typescript await client.cards.disable({ - cardId: "card_id", + cardId: "card_id" }); -``` +``` @@ -1842,27 +1831,27 @@ await client.cards.disable({
-**request:** `Square.DisableCardsRequest` - +**request:** `Square.DisableCardsRequest` +
-**requestOptions:** `Cards.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
+ ## Catalog -
client.catalog.batchDelete({ ...params }) -> Square.BatchDeleteCatalogObjectsResponse
@@ -1889,7 +1878,6 @@ actually deleted. To ensure consistency, only one delete request is processed at a time per seller account. While one (batch or non-batch) delete request is being processed, other (batched and non-batched) delete requests are rejected with the `429` error code. -
@@ -1905,10 +1893,10 @@ delete requests are rejected with the `429` error code. ```typescript await client.catalog.batchDelete({ - objectIds: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"], + objectIds: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"] }); -``` +``` @@ -1922,21 +1910,22 @@ await client.catalog.batchDelete({
-**request:** `Square.BatchDeleteCatalogObjectsRequest` - +**request:** `Square.BatchDeleteCatalogObjectsRequest` +
-**requestOptions:** `Catalog.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
+
@@ -1959,7 +1948,6 @@ child information including: all of its [CatalogItemVariation](entity:CatalogItemVariation) objects, references to its [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of any [CatalogTax](entity:CatalogTax) objects that apply to it. - @@ -1976,10 +1964,10 @@ any [CatalogTax](entity:CatalogTax) objects that apply to it. ```typescript await client.catalog.batchGet({ objectIds: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"], - includeRelatedObjects: true, + includeRelatedObjects: true }); -``` +``` @@ -1993,21 +1981,22 @@ await client.catalog.batchGet({
-**request:** `Square.BatchGetCatalogObjectsRequest` - +**request:** `Square.BatchGetCatalogObjectsRequest` +
-**requestOptions:** `Catalog.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
+ @@ -2037,7 +2026,6 @@ than 10,000. To ensure consistency, only one update request is processed at a time per seller account. While one (batch or non-batch) update request is being processed, other (batched and non-batched) update requests are rejected with the `429` error code. - @@ -2054,31 +2042,24 @@ update requests are rejected with the `429` error code. ```typescript await client.catalog.batchUpsert({ idempotencyKey: "789ff020-f723-43a9-b4b5-43b5dc1fa3dc", - batches: [ - { - objects: [ - { + batches: [{ + objects: [{ type: "ITEM", - id: "id", - }, - { + id: "id" + }, { type: "ITEM", - id: "id", - }, - { + id: "id" + }, { type: "ITEM", - id: "id", - }, - { + id: "id" + }, { type: "TAX", - id: "id", - }, - ], - }, - ], + id: "id" + }] + }] }); -``` +``` @@ -2092,21 +2073,22 @@ await client.catalog.batchUpsert({
-**request:** `Square.BatchUpsertCatalogObjectsRequest` - +**request:** `Square.BatchUpsertCatalogObjectsRequest` +
-**requestOptions:** `Catalog.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
+ @@ -2125,7 +2107,6 @@ await client.catalog.batchUpsert({ Retrieves information about the Square Catalog API, such as batch size limits that can be used by the `BatchUpsertCatalogObjects` endpoint. - @@ -2141,8 +2122,8 @@ limits that can be used by the `BatchUpsertCatalogObjects` endpoint. ```typescript await client.catalog.info(); -``` +``` @@ -2156,13 +2137,14 @@ await client.catalog.info();
-**requestOptions:** `Catalog.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
+ @@ -2184,10 +2166,9 @@ Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified ty The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](entity:CatalogObjectType) values, for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". -**Important:** ListCatalog does not return deleted catalog items. To retrieve +__Important:__ ListCatalog does not return deleted catalog items. To retrieve deleted catalog items, use [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) and set the `include_deleted_objects` attribute value to `true`. - @@ -2205,7 +2186,7 @@ and set the `include_deleted_objects` attribute value to `true`. const response = await client.catalog.list({ cursor: "cursor", types: "types", - catalogVersion: BigInt("1000000"), + catalogVersion: BigInt("1000000") }); for await (const item of response) { console.log(item); @@ -2215,13 +2196,13 @@ for await (const item of response) { let page = await client.catalog.list({ cursor: "cursor", types: "types", - catalogVersion: BigInt("1000000"), + catalogVersion: BigInt("1000000") }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -2235,21 +2216,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListCatalogRequest` - +**request:** `Square.ListCatalogRequest` +
-**requestOptions:** `Catalog.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
+ @@ -2276,10 +2258,10 @@ endpoint in the following aspects: - `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. - The both endpoints have different call conventions, including the query filter formats. - - - - + + + + #### 🔌 Usage @@ -2295,13 +2277,13 @@ await client.catalog.search({ query: { prefixQuery: { attributeName: "name", - attributePrefix: "tea", - }, + attributePrefix: "tea" + } }, - limit: 100, + limit: 100 }); -``` +``` @@ -2315,21 +2297,22 @@ await client.catalog.search({
-**request:** `Square.SearchCatalogObjectsRequest` - +**request:** `Square.SearchCatalogObjectsRequest` +
-**requestOptions:** `Catalog.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
+ @@ -2356,10 +2339,10 @@ endpoint in the following aspects: - `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. - The both endpoints use different call conventions, including the query filter formats. - - - - + + + + #### 🔌 Usage @@ -2378,29 +2361,24 @@ await client.catalog.searchItems({ limit: 100, sortOrder: "ASC", productTypes: ["REGULAR"], - customAttributeFilters: [ - { + customAttributeFilters: [{ customAttributeDefinitionId: "VEGAN_DEFINITION_ID", - boolFilter: true, - }, - { + boolFilter: true + }, { customAttributeDefinitionId: "BRAND_DEFINITION_ID", - stringFilter: "Dark Horse", - }, - { + stringFilter: "Dark Horse" + }, { key: "VINTAGE", numberFilter: { min: "min", - max: "max", - }, - }, - { - customAttributeDefinitionId: "VARIETAL_DEFINITION_ID", - }, - ], + max: "max" + } + }, { + customAttributeDefinitionId: "VARIETAL_DEFINITION_ID" + }] }); -``` +``` @@ -2414,21 +2392,22 @@ await client.catalog.searchItems({
-**request:** `Square.SearchCatalogItemsRequest` - +**request:** `Square.SearchCatalogItemsRequest` +
-**requestOptions:** `Catalog.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
+ @@ -2448,7 +2427,6 @@ await client.catalog.searchItems({ Updates the [CatalogModifierList](entity:CatalogModifierList) objects that apply to the targeted [CatalogItem](entity:CatalogItem) without having to perform an upsert on the entire item. - @@ -2466,10 +2444,10 @@ to perform an upsert on the entire item. await client.catalog.updateItemModifierLists({ itemIds: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], modifierListsToEnable: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], - modifierListsToDisable: ["7WRC16CJZDVLSNDQ35PP6YAD"], + modifierListsToDisable: ["7WRC16CJZDVLSNDQ35PP6YAD"] }); -``` +``` @@ -2483,21 +2461,22 @@ await client.catalog.updateItemModifierLists({
-**request:** `Square.UpdateItemModifierListsRequest` - +**request:** `Square.UpdateItemModifierListsRequest` +
-**requestOptions:** `Catalog.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
+ @@ -2517,7 +2496,6 @@ await client.catalog.updateItemModifierLists({ Updates the [CatalogTax](entity:CatalogTax) objects that apply to the targeted [CatalogItem](entity:CatalogItem) without having to perform an upsert on the entire item. - @@ -2535,10 +2513,10 @@ upsert on the entire item. await client.catalog.updateItemTaxes({ itemIds: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], taxesToEnable: ["4WRCNHCJZDVLSNDQ35PP6YAD"], - taxesToDisable: ["AQCEGCEBBQONINDOHRGZISEX"], + taxesToDisable: ["AQCEGCEBBQONINDOHRGZISEX"] }); -``` +``` @@ -2552,27 +2530,27 @@ await client.catalog.updateItemTaxes({
-**request:** `Square.UpdateItemTaxesRequest` - +**request:** `Square.UpdateItemTaxesRequest` +
-**requestOptions:** `Catalog.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
+ ## Channels -
client.channels.list({ ...params }) -> core.Page
@@ -2585,6 +2563,7 @@ await client.catalog.updateItemTaxes({
+
@@ -2604,7 +2583,7 @@ const response = await client.channels.list({ referenceId: "reference_id", status: "ACTIVE", cursor: "cursor", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -2616,13 +2595,13 @@ let page = await client.channels.list({ referenceId: "reference_id", status: "ACTIVE", cursor: "cursor", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +```
@@ -2636,21 +2615,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListChannelsRequest` - +**request:** `Square.ListChannelsRequest` +
-**requestOptions:** `Channels.RequestOptions` - +**requestOptions:** `Channels.RequestOptions` +
+
@@ -2667,6 +2647,7 @@ while (page.hasNextPage()) {
+
@@ -2682,10 +2663,10 @@ while (page.hasNextPage()) { ```typescript await client.channels.bulkRetrieve({ - channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"], + channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"] }); -``` +``` @@ -2699,21 +2680,22 @@ await client.channels.bulkRetrieve({
-**request:** `Square.BulkRetrieveChannelsRequest` - +**request:** `Square.BulkRetrieveChannelsRequest` +
-**requestOptions:** `Channels.RequestOptions` - +**requestOptions:** `Channels.RequestOptions` +
+ @@ -2730,6 +2712,7 @@ await client.channels.bulkRetrieve({
+
@@ -2745,10 +2728,10 @@ await client.channels.bulkRetrieve({ ```typescript await client.channels.get({ - channelId: "channel_id", + channelId: "channel_id" }); -``` +``` @@ -2762,27 +2745,27 @@ await client.channels.get({
-**request:** `Square.GetChannelsRequest` - +**request:** `Square.GetChannelsRequest` +
-**requestOptions:** `Channels.RequestOptions` - +**requestOptions:** `Channels.RequestOptions` +
+ ## Customers -
client.customers.list({ ...params }) -> core.Page
@@ -2800,7 +2783,6 @@ Lists customer profiles associated with a Square account. Under normal operating conditions, newly created or updated customer profiles become available for the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated profiles can take closer to one minute or longer, especially during network incidents and outages. -
@@ -2820,7 +2802,7 @@ const response = await client.customers.list({ limit: 1, sortField: "DEFAULT", sortOrder: "DESC", - count: true, + count: true }); for await (const item of response) { console.log(item); @@ -2832,13 +2814,13 @@ let page = await client.customers.list({ limit: 1, sortField: "DEFAULT", sortOrder: "DESC", - count: true, + count: true }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -2852,21 +2834,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListCustomersRequest` - +**request:** `Square.ListCustomersRequest` +
-**requestOptions:** `Customers.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
+
@@ -2893,10 +2876,10 @@ endpoint: - `company_name` - `email_address` - `phone_number` - - - - + + + + #### 🔌 Usage @@ -2917,14 +2900,14 @@ await client.customers.create({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US", + country: "US" }, phoneNumber: "+1-212-555-4240", referenceId: "YOUR_REFERENCE_ID", - note: "a customer", + note: "a customer" }); -``` +``` @@ -2938,21 +2921,22 @@ await client.customers.create({
-**request:** `Square.CreateCustomerRequest` - +**request:** `Square.CreateCustomerRequest` +
-**requestOptions:** `Customers.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
+ @@ -2980,10 +2964,10 @@ You must provide at least one of the following values in each create request: - `company_name` - `email_address` - `phone_number` - - - - + + + + #### 🔌 Usage @@ -3006,11 +2990,11 @@ await client.customers.batchCreate({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US", + country: "US" }, phoneNumber: "+1-212-555-4240", referenceId: "YOUR_REFERENCE_ID", - note: "a customer", + note: "a customer" }, "d1689f23-b25d-4932-b2f0-aed00f5e2029": { givenName: "Marie", @@ -3022,16 +3006,16 @@ await client.customers.batchCreate({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US", + country: "US" }, phoneNumber: "+1-212-444-4240", referenceId: "YOUR_REFERENCE_ID", - note: "another customer", - }, - }, + note: "another customer" + } + } }); -``` +``` @@ -3045,21 +3029,22 @@ await client.customers.batchCreate({
-**request:** `Square.BulkCreateCustomersRequest` - +**request:** `Square.BulkCreateCustomersRequest` +
-**requestOptions:** `Customers.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
+ @@ -3079,7 +3064,6 @@ await client.customers.batchCreate({ Deletes multiple customer profiles. The endpoint takes a list of customer IDs and returns a map of responses. - @@ -3095,10 +3079,10 @@ The endpoint takes a list of customer IDs and returns a map of responses. ```typescript await client.customers.bulkDeleteCustomers({ - customerIds: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"], + customerIds: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"] }); -``` +``` @@ -3112,21 +3096,22 @@ await client.customers.bulkDeleteCustomers({
-**request:** `Square.BulkDeleteCustomersRequest` - +**request:** `Square.BulkDeleteCustomersRequest` +
-**requestOptions:** `Customers.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
+ @@ -3146,7 +3131,6 @@ await client.customers.bulkDeleteCustomers({ Retrieves multiple customer profiles. This endpoint takes a list of customer IDs and returns a map of responses. - @@ -3162,10 +3146,10 @@ This endpoint takes a list of customer IDs and returns a map of responses. ```typescript await client.customers.bulkRetrieveCustomers({ - customerIds: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"], + customerIds: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"] }); -``` +``` @@ -3179,21 +3163,22 @@ await client.customers.bulkRetrieveCustomers({
-**request:** `Square.BulkRetrieveCustomersRequest` - +**request:** `Square.BulkRetrieveCustomersRequest` +
-**requestOptions:** `Customers.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
+ @@ -3213,7 +3198,6 @@ await client.customers.bulkRetrieveCustomers({ Updates multiple customer profiles. This endpoint takes a map of individual update requests and returns a map of responses. - @@ -3233,17 +3217,17 @@ await client.customers.bulkUpdateCustomers({ "8DDA5NZVBZFGAX0V3HPF81HHE0": { emailAddress: "New.Amelia.Earhart@example.com", note: "updated customer note", - version: BigInt("2"), + version: BigInt("2") }, - N18CPRVXR5214XPBBA6BZQWF3C: { + "N18CPRVXR5214XPBBA6BZQWF3C": { givenName: "Marie", familyName: "Curie", - version: BigInt("0"), - }, - }, + version: BigInt("0") + } + } }); -``` +``` @@ -3257,21 +3241,22 @@ await client.customers.bulkUpdateCustomers({
-**request:** `Square.BulkUpdateCustomersRequest` - +**request:** `Square.BulkUpdateCustomersRequest` +
-**requestOptions:** `Customers.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
+ @@ -3297,7 +3282,6 @@ customer profiles ordered alphabetically based on `given_name` and Under normal operating conditions, newly created or updated customer profiles become available for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated profiles can take closer to one minute or longer, especially during network incidents and outages. - @@ -3318,27 +3302,27 @@ await client.customers.search({ filter: { creationSource: { values: ["THIRD_PARTY"], - rule: "INCLUDE", + rule: "INCLUDE" }, createdAt: { startAt: "2018-01-01T00:00:00-00:00", - endAt: "2018-02-01T00:00:00-00:00", + endAt: "2018-02-01T00:00:00-00:00" }, emailAddress: { - fuzzy: "example.com", + fuzzy: "example.com" }, groupIds: { - all: ["545AXB44B4XXWMVQ4W8SBT3HHF"], - }, + all: ["545AXB44B4XXWMVQ4W8SBT3HHF"] + } }, sort: { field: "CREATED_AT", - order: "ASC", - }, - }, + order: "ASC" + } + } }); -``` +``` @@ -3352,21 +3336,22 @@ await client.customers.search({
-**request:** `Square.SearchCustomersRequest` - +**request:** `Square.SearchCustomersRequest` +
-**requestOptions:** `Customers.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
+ @@ -3384,7 +3369,6 @@ await client.customers.search({
Returns details for a single customer. -
@@ -3400,10 +3384,10 @@ Returns details for a single customer. ```typescript await client.customers.get({ - customerId: "customer_id", + customerId: "customer_id" }); -``` +``` @@ -3417,21 +3401,22 @@ await client.customers.get({
-**request:** `Square.GetCustomersRequest` - +**request:** `Square.GetCustomersRequest` +
-**requestOptions:** `Customers.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
+ @@ -3452,7 +3437,6 @@ Updates a customer profile. This endpoint supports sparse updates, so only new o To add or update a field, specify the new value. To remove a field, specify `null`. To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. - @@ -3471,10 +3455,10 @@ await client.customers.update({ customerId: "customer_id", emailAddress: "New.Amelia.Earhart@example.com", note: "updated customer note", - version: BigInt("2"), + version: BigInt("2") }); -``` +``` @@ -3488,21 +3472,22 @@ await client.customers.update({
-**request:** `Square.UpdateCustomerRequest` - +**request:** `Square.UpdateCustomerRequest` +
-**requestOptions:** `Customers.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
+ @@ -3522,7 +3507,6 @@ await client.customers.update({ Deletes a customer profile from a business. To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. - @@ -3539,10 +3523,10 @@ To delete a customer profile that was created by merging existing profiles, you ```typescript await client.customers.delete({ customerId: "customer_id", - version: BigInt("1000000"), + version: BigInt("1000000") }); -``` +``` @@ -3556,27 +3540,27 @@ await client.customers.delete({
-**request:** `Square.DeleteCustomersRequest` - +**request:** `Square.DeleteCustomersRequest` +
-**requestOptions:** `Customers.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
+ ## Devices -
client.devices.list({ ...params }) -> core.Page
@@ -3591,7 +3575,6 @@ await client.customers.delete({ List devices associated with the merchant. Currently, only Terminal API devices are supported. -
@@ -3610,7 +3593,7 @@ const response = await client.devices.list({ cursor: "cursor", sortOrder: "DESC", limit: 1, - locationId: "location_id", + locationId: "location_id" }); for await (const item of response) { console.log(item); @@ -3621,13 +3604,13 @@ let page = await client.devices.list({ cursor: "cursor", sortOrder: "DESC", limit: 1, - locationId: "location_id", + locationId: "location_id" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -3641,21 +3624,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListDevicesRequest` - +**request:** `Square.ListDevicesRequest` +
-**requestOptions:** `Devices.RequestOptions` - +**requestOptions:** `Devices.RequestOptions` +
+
@@ -3673,7 +3657,6 @@ while (page.hasNextPage()) {
Retrieves Device with the associated `device_id`. -
@@ -3689,10 +3672,10 @@ Retrieves Device with the associated `device_id`. ```typescript await client.devices.get({ - deviceId: "device_id", + deviceId: "device_id" }); -``` +``` @@ -3706,27 +3689,27 @@ await client.devices.get({
-**request:** `Square.GetDevicesRequest` - +**request:** `Square.GetDevicesRequest` +
-**requestOptions:** `Devices.RequestOptions` - +**requestOptions:** `Devices.RequestOptions` +
+ ## Disputes -
client.disputes.list({ ...params }) -> core.Page
@@ -3740,7 +3723,6 @@ await client.devices.get({
Returns a list of disputes associated with a particular account. -
@@ -3758,7 +3740,7 @@ Returns a list of disputes associated with a particular account. const response = await client.disputes.list({ cursor: "cursor", states: "INQUIRY_EVIDENCE_REQUIRED", - locationId: "location_id", + locationId: "location_id" }); for await (const item of response) { console.log(item); @@ -3768,13 +3750,13 @@ for await (const item of response) { let page = await client.disputes.list({ cursor: "cursor", states: "INQUIRY_EVIDENCE_REQUIRED", - locationId: "location_id", + locationId: "location_id" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -3788,21 +3770,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListDisputesRequest` - +**request:** `Square.ListDisputesRequest` +
-**requestOptions:** `Disputes.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
+
@@ -3820,7 +3803,6 @@ while (page.hasNextPage()) {
Returns details about a specific dispute. -
@@ -3836,10 +3818,10 @@ Returns details about a specific dispute. ```typescript await client.disputes.get({ - disputeId: "dispute_id", + disputeId: "dispute_id" }); -``` +``` @@ -3853,21 +3835,22 @@ await client.disputes.get({
-**request:** `Square.GetDisputesRequest` - +**request:** `Square.GetDisputesRequest` +
-**requestOptions:** `Disputes.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
+ @@ -3889,7 +3872,6 @@ updates the dispute state to ACCEPTED. Square debits the disputed amount from the seller’s Square account. If the Square account does not have sufficient funds, Square debits the associated bank account. - @@ -3905,10 +3887,10 @@ does not have sufficient funds, Square debits the associated bank account. ```typescript await client.disputes.accept({ - disputeId: "dispute_id", + disputeId: "dispute_id" }); -``` +``` @@ -3922,21 +3904,22 @@ await client.disputes.accept({
-**request:** `Square.AcceptDisputesRequest` - +**request:** `Square.AcceptDisputesRequest` +
-**requestOptions:** `Disputes.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
+ @@ -3955,7 +3938,6 @@ await client.disputes.accept({ Uploads a file to use as evidence in a dispute challenge. The endpoint accepts HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats. - @@ -3971,10 +3953,10 @@ multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats ```typescript await client.disputes.createEvidenceFile({ - disputeId: "dispute_id", + disputeId: "dispute_id" }); -``` +``` @@ -3988,21 +3970,22 @@ await client.disputes.createEvidenceFile({
-**request:** `Square.CreateEvidenceFileDisputesRequest` - +**request:** `Square.CreateEvidenceFileDisputesRequest` +
-**requestOptions:** `Disputes.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
+ @@ -4020,7 +4003,6 @@ await client.disputes.createEvidenceFile({
Uploads text to use as evidence for a dispute challenge. -
@@ -4039,10 +4021,10 @@ await client.disputes.createEvidenceText({ disputeId: "dispute_id", idempotencyKey: "ed3ee3933d946f1514d505d173c82648", evidenceType: "TRACKING_NUMBER", - evidenceText: "1Z8888888888888888", + evidenceText: "1Z8888888888888888" }); -``` +``` @@ -4056,21 +4038,22 @@ await client.disputes.createEvidenceText({
-**request:** `Square.CreateDisputeEvidenceTextRequest` - +**request:** `Square.CreateDisputeEvidenceTextRequest` +
-**requestOptions:** `Disputes.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
+ @@ -4094,7 +4077,6 @@ using the [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenc [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText) endpoints and evidence automatically provided by Square, when available. Evidence cannot be removed from a dispute after submission. - @@ -4110,10 +4092,10 @@ a dispute after submission. ```typescript await client.disputes.submitEvidence({ - disputeId: "dispute_id", + disputeId: "dispute_id" }); -``` +``` @@ -4127,27 +4109,27 @@ await client.disputes.submitEvidence({
-**request:** `Square.SubmitEvidenceDisputesRequest` - +**request:** `Square.SubmitEvidenceDisputesRequest` +
-**requestOptions:** `Disputes.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
+ ## Employees -
client.employees.list({ ...params }) -> core.Page
@@ -4160,6 +4142,7 @@ await client.disputes.submitEvidence({
+
@@ -4178,7 +4161,7 @@ const response = await client.employees.list({ locationId: "location_id", status: "ACTIVE", limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -4189,13 +4172,13 @@ let page = await client.employees.list({ locationId: "location_id", status: "ACTIVE", limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +```
@@ -4209,21 +4192,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListEmployeesRequest` - +**request:** `Square.ListEmployeesRequest` +
-**requestOptions:** `Employees.RequestOptions` - +**requestOptions:** `Employees.RequestOptions` +
+
@@ -4240,6 +4224,7 @@ while (page.hasNextPage()) {
+
@@ -4255,10 +4240,10 @@ while (page.hasNextPage()) { ```typescript await client.employees.get({ - id: "id", + id: "id" }); -``` +``` @@ -4272,27 +4257,27 @@ await client.employees.get({
-**request:** `Square.GetEmployeesRequest` - +**request:** `Square.GetEmployeesRequest` +
-**requestOptions:** `Employees.RequestOptions` - +**requestOptions:** `Employees.RequestOptions` +
+ ## Events -
client.events.searchEvents({ ...params }) -> Square.SearchEventsResponse
@@ -4306,7 +4291,6 @@ await client.employees.get({
Search for Square API events that occur within a 28-day timeframe. -
@@ -4322,8 +4306,8 @@ Search for Square API events that occur within a 28-day timeframe. ```typescript await client.events.searchEvents(); -``` +``` @@ -4337,21 +4321,22 @@ await client.events.searchEvents();
-**request:** `Square.SearchEventsRequest` - +**request:** `Square.SearchEventsRequest` +
-**requestOptions:** `Events.RequestOptions` - +**requestOptions:** `Events.RequestOptions` +
+
@@ -4371,7 +4356,6 @@ await client.events.searchEvents(); Disables events to prevent them from being searchable. All events are disabled by default. You must enable events to make them searchable. Disabling events for a specific time period prevents them from being searchable, even if you re-enable them later. - @@ -4387,8 +4371,8 @@ Disabling events for a specific time period prevents them from being searchable, ```typescript await client.events.disableEvents(); -``` +``` @@ -4402,13 +4386,14 @@ await client.events.disableEvents();
-**requestOptions:** `Events.RequestOptions` - +**requestOptions:** `Events.RequestOptions` +
+ @@ -4426,7 +4411,6 @@ await client.events.disableEvents();
Enables events to make them searchable. Only events that occur while in the enabled state are searchable. -
@@ -4442,8 +4426,8 @@ Enables events to make them searchable. Only events that occur while in the enab ```typescript await client.events.enableEvents(); -``` +``` @@ -4457,13 +4441,14 @@ await client.events.enableEvents();
-**requestOptions:** `Events.RequestOptions` - +**requestOptions:** `Events.RequestOptions` +
+ @@ -4481,7 +4466,6 @@ await client.events.enableEvents();
Lists all event types that you can subscribe to as webhooks or query using the Events API. -
@@ -4497,10 +4481,10 @@ Lists all event types that you can subscribe to as webhooks or query using the E ```typescript await client.events.listEventTypes({ - apiVersion: "api_version", + apiVersion: "api_version" }); -``` +``` @@ -4514,27 +4498,27 @@ await client.events.listEventTypes({
-**request:** `Square.ListEventTypesRequest` - +**request:** `Square.ListEventTypesRequest` +
-**requestOptions:** `Events.RequestOptions` - +**requestOptions:** `Events.RequestOptions` +
+ ## GiftCards -
client.giftCards.list({ ...params }) -> core.Page
@@ -4547,9 +4531,8 @@ await client.events.listEventTypes({
-Lists all gift cards. You can specify optional filters to retrieve +Lists all gift cards. You can specify optional filters to retrieve a subset of the gift cards. Results are sorted by `created_at` in ascending order. -
@@ -4569,7 +4552,7 @@ const response = await client.giftCards.list({ state: "state", limit: 1, cursor: "cursor", - customerId: "customer_id", + customerId: "customer_id" }); for await (const item of response) { console.log(item); @@ -4581,13 +4564,13 @@ let page = await client.giftCards.list({ state: "state", limit: 1, cursor: "cursor", - customerId: "customer_id", + customerId: "customer_id" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +```
@@ -4601,21 +4584,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListGiftCardsRequest` - +**request:** `Square.ListGiftCardsRequest` +
-**requestOptions:** `GiftCards.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
+
@@ -4637,7 +4621,6 @@ has a `PENDING` state. To activate a gift card so that it can be redeemed for pu [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) and create an `ACTIVATE` activity with the initial balance. Alternatively, you can use [RefundPayment](api-endpoint:Refunds-RefundPayment) to refund a payment to the new gift card. - @@ -4656,11 +4639,11 @@ await client.giftCards.create({ idempotencyKey: "NC9Tm69EjbjtConu", locationId: "81FN9BNFZTKS4", giftCard: { - type: "DIGITAL", - }, + type: "DIGITAL" + } }); -``` +``` @@ -4674,21 +4657,22 @@ await client.giftCards.create({
-**request:** `Square.CreateGiftCardRequest` - +**request:** `Square.CreateGiftCardRequest` +
-**requestOptions:** `GiftCards.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
+ @@ -4706,7 +4690,6 @@ await client.giftCards.create({
Retrieves a gift card using the gift card account number (GAN). -
@@ -4722,10 +4705,10 @@ Retrieves a gift card using the gift card account number (GAN). ```typescript await client.giftCards.getFromGan({ - gan: "7783320001001635", + gan: "7783320001001635" }); -``` +``` @@ -4739,21 +4722,22 @@ await client.giftCards.getFromGan({
-**request:** `Square.GetGiftCardFromGanRequest` - +**request:** `Square.GetGiftCardFromGanRequest` +
-**requestOptions:** `GiftCards.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
+ @@ -4771,7 +4755,6 @@ await client.giftCards.getFromGan({
Retrieves a gift card using a secure payment token that represents the gift card. -
@@ -4787,10 +4770,10 @@ Retrieves a gift card using a secure payment token that represents the gift card ```typescript await client.giftCards.getFromNonce({ - nonce: "cnon:7783322135245171", + nonce: "cnon:7783322135245171" }); -``` +``` @@ -4804,21 +4787,22 @@ await client.giftCards.getFromNonce({
-**request:** `Square.GetGiftCardFromNonceRequest` - +**request:** `Square.GetGiftCardFromNonceRequest` +
-**requestOptions:** `GiftCards.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
+ @@ -4836,7 +4820,6 @@ await client.giftCards.getFromNonce({
Links a customer to a gift card, which is also referred to as adding a card on file. -
@@ -4853,10 +4836,10 @@ Links a customer to a gift card, which is also referred to as adding a card on f ```typescript await client.giftCards.linkCustomer({ giftCardId: "gift_card_id", - customerId: "GKY0FZ3V717AH8Q2D821PNT2ZW", + customerId: "GKY0FZ3V717AH8Q2D821PNT2ZW" }); -``` +``` @@ -4870,21 +4853,22 @@ await client.giftCards.linkCustomer({
-**request:** `Square.LinkCustomerToGiftCardRequest` - +**request:** `Square.LinkCustomerToGiftCardRequest` +
-**requestOptions:** `GiftCards.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
+ @@ -4902,7 +4886,6 @@ await client.giftCards.linkCustomer({
Unlinks a customer from a gift card, which is also referred to as removing a card on file. -
@@ -4919,10 +4902,10 @@ Unlinks a customer from a gift card, which is also referred to as removing a car ```typescript await client.giftCards.unlinkCustomer({ giftCardId: "gift_card_id", - customerId: "GKY0FZ3V717AH8Q2D821PNT2ZW", + customerId: "GKY0FZ3V717AH8Q2D821PNT2ZW" }); -``` +``` @@ -4936,21 +4919,22 @@ await client.giftCards.unlinkCustomer({
-**request:** `Square.UnlinkCustomerFromGiftCardRequest` - +**request:** `Square.UnlinkCustomerFromGiftCardRequest` +
-**requestOptions:** `GiftCards.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
+ @@ -4968,7 +4952,6 @@ await client.giftCards.unlinkCustomer({
Retrieves a gift card using the gift card ID. -
@@ -4984,10 +4967,10 @@ Retrieves a gift card using the gift card ID. ```typescript await client.giftCards.get({ - id: "id", + id: "id" }); -``` +``` @@ -5001,27 +4984,27 @@ await client.giftCards.get({
-**request:** `Square.GetGiftCardsRequest` - +**request:** `Square.GetGiftCardsRequest` +
-**requestOptions:** `GiftCards.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
+ ## Inventory -
client.inventory.deprecatedGetAdjustment({ ...params }) -> Square.GetInventoryAdjustmentResponse
@@ -5036,7 +5019,6 @@ await client.giftCards.get({ Deprecated version of [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) after the endpoint URL is updated to conform to the standard convention. -
@@ -5052,10 +5034,10 @@ is updated to conform to the standard convention. ```typescript await client.inventory.deprecatedGetAdjustment({ - adjustmentId: "adjustment_id", + adjustmentId: "adjustment_id" }); -``` +``` @@ -5069,21 +5051,22 @@ await client.inventory.deprecatedGetAdjustment({
-**request:** `Square.DeprecatedGetAdjustmentInventoryRequest` - +**request:** `Square.DeprecatedGetAdjustmentInventoryRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+
@@ -5102,7 +5085,6 @@ await client.inventory.deprecatedGetAdjustment({ Returns the [InventoryAdjustment](entity:InventoryAdjustment) object with the provided `adjustment_id`. - @@ -5118,10 +5100,10 @@ with the provided `adjustment_id`. ```typescript await client.inventory.getAdjustment({ - adjustmentId: "adjustment_id", + adjustmentId: "adjustment_id" }); -``` +``` @@ -5135,21 +5117,22 @@ await client.inventory.getAdjustment({
-**request:** `Square.GetAdjustmentInventoryRequest` - +**request:** `Square.GetAdjustmentInventoryRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5168,7 +5151,6 @@ await client.inventory.getAdjustment({ Deprecated version of [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) after the endpoint URL is updated to conform to the standard convention. - @@ -5185,8 +5167,7 @@ is updated to conform to the standard convention. ```typescript await client.inventory.deprecatedBatchChange({ idempotencyKey: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", - changes: [ - { + changes: [{ type: "PHYSICAL_COUNT", physicalCount: { referenceId: "1536bfbf-efed-48bf-b17d-a197141b2a92", @@ -5195,14 +5176,13 @@ await client.inventory.deprecatedBatchChange({ locationId: "C6W5YS5QM06F5", quantity: "53", teamMemberId: "LRK57NSQ5X7PUD05", - occurredAt: "2016-11-16T22:25:24.878Z", - }, - }, - ], - ignoreUnchangedCounts: true, + occurredAt: "2016-11-16T22:25:24.878Z" + } + }], + ignoreUnchangedCounts: true }); -``` +``` @@ -5216,21 +5196,22 @@ await client.inventory.deprecatedBatchChange({
-**request:** `Square.BatchChangeInventoryRequest` - +**request:** `Square.BatchChangeInventoryRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5249,7 +5230,6 @@ await client.inventory.deprecatedBatchChange({ Deprecated version of [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) after the endpoint URL is updated to conform to the standard convention. - @@ -5270,10 +5250,10 @@ await client.inventory.deprecatedBatchGetChanges({ types: ["PHYSICAL_COUNT"], states: ["IN_STOCK"], updatedAfter: "2016-11-01T00:00:00.000Z", - updatedBefore: "2016-12-01T00:00:00.000Z", + updatedBefore: "2016-12-01T00:00:00.000Z" }); -``` +``` @@ -5287,21 +5267,22 @@ await client.inventory.deprecatedBatchGetChanges({
-**request:** `Square.BatchRetrieveInventoryChangesRequest` - +**request:** `Square.BatchRetrieveInventoryChangesRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5320,7 +5301,6 @@ await client.inventory.deprecatedBatchGetChanges({ Deprecated version of [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) after the endpoint URL is updated to conform to the standard convention. - @@ -5338,10 +5318,10 @@ is updated to conform to the standard convention. await client.inventory.deprecatedBatchGetCounts({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["59TNP9SA8VGDA"], - updatedAfter: "2016-11-16T00:00:00.000Z", + updatedAfter: "2016-11-16T00:00:00.000Z" }); -``` +``` @@ -5355,21 +5335,22 @@ await client.inventory.deprecatedBatchGetCounts({
-**request:** `Square.BatchGetInventoryCountsRequest` - +**request:** `Square.BatchGetInventoryCountsRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5391,7 +5372,6 @@ 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. - @@ -5408,8 +5388,7 @@ On failure: returns a list of related errors. ```typescript await client.inventory.batchCreateChanges({ idempotencyKey: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", - changes: [ - { + changes: [{ type: "PHYSICAL_COUNT", physicalCount: { referenceId: "1536bfbf-efed-48bf-b17d-a197141b2a92", @@ -5418,14 +5397,13 @@ await client.inventory.batchCreateChanges({ locationId: "C6W5YS5QM06F5", quantity: "53", teamMemberId: "LRK57NSQ5X7PUD05", - occurredAt: "2016-11-16T22:25:24.878Z", - }, - }, - ], - ignoreUnchangedCounts: true, + occurredAt: "2016-11-16T22:25:24.878Z" + } + }], + ignoreUnchangedCounts: true }); -``` +``` @@ -5439,21 +5417,22 @@ await client.inventory.batchCreateChanges({
-**request:** `Square.BatchChangeInventoryRequest` - +**request:** `Square.BatchChangeInventoryRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5478,7 +5457,6 @@ Results are paginated and sorted in ascending order according their BatchRetrieveInventoryChanges is a catch-all query endpoint for queries that cannot be handled by other, simpler endpoints. - @@ -5499,7 +5477,7 @@ const response = await client.inventory.batchGetChanges({ types: ["PHYSICAL_COUNT"], states: ["IN_STOCK"], updatedAfter: "2016-11-01T00:00:00.000Z", - updatedBefore: "2016-12-01T00:00:00.000Z", + updatedBefore: "2016-12-01T00:00:00.000Z" }); for await (const item of response) { console.log(item); @@ -5512,13 +5490,13 @@ let page = await client.inventory.batchGetChanges({ types: ["PHYSICAL_COUNT"], states: ["IN_STOCK"], updatedAfter: "2016-11-01T00:00:00.000Z", - updatedBefore: "2016-12-01T00:00:00.000Z", + updatedBefore: "2016-12-01T00:00:00.000Z" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -5532,21 +5510,22 @@ while (page.hasNextPage()) {
-**request:** `Square.BatchRetrieveInventoryChangesRequest` - +**request:** `Square.BatchRetrieveInventoryChangesRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5574,7 +5553,6 @@ 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. - @@ -5592,7 +5570,7 @@ in response to receiving a Webhook notification. const response = await client.inventory.batchGetCounts({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["59TNP9SA8VGDA"], - updatedAfter: "2016-11-16T00:00:00.000Z", + updatedAfter: "2016-11-16T00:00:00.000Z" }); for await (const item of response) { console.log(item); @@ -5602,13 +5580,13 @@ for await (const item of response) { let page = await client.inventory.batchGetCounts({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["59TNP9SA8VGDA"], - updatedAfter: "2016-11-16T00:00:00.000Z", + updatedAfter: "2016-11-16T00:00:00.000Z" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -5622,21 +5600,22 @@ while (page.hasNextPage()) {
-**request:** `Square.BatchGetInventoryCountsRequest` - +**request:** `Square.BatchGetInventoryCountsRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5655,7 +5634,6 @@ while (page.hasNextPage()) { Deprecated version of [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) after the endpoint URL is updated to conform to the standard convention. - @@ -5671,10 +5649,10 @@ is updated to conform to the standard convention. ```typescript await client.inventory.deprecatedGetPhysicalCount({ - physicalCountId: "physical_count_id", + physicalCountId: "physical_count_id" }); -``` +``` @@ -5688,21 +5666,22 @@ await client.inventory.deprecatedGetPhysicalCount({
-**request:** `Square.DeprecatedGetPhysicalCountInventoryRequest` - +**request:** `Square.DeprecatedGetPhysicalCountInventoryRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5721,7 +5700,6 @@ await client.inventory.deprecatedGetPhysicalCount({ Returns the [InventoryPhysicalCount](entity:InventoryPhysicalCount) object with the provided `physical_count_id`. - @@ -5737,10 +5715,10 @@ object with the provided `physical_count_id`. ```typescript await client.inventory.getPhysicalCount({ - physicalCountId: "physical_count_id", + physicalCountId: "physical_count_id" }); -``` +``` @@ -5754,21 +5732,22 @@ await client.inventory.getPhysicalCount({
-**request:** `Square.GetPhysicalCountInventoryRequest` - +**request:** `Square.GetPhysicalCountInventoryRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5787,7 +5766,6 @@ await client.inventory.getPhysicalCount({ Returns the [InventoryTransfer](entity:InventoryTransfer) object with the provided `transfer_id`. - @@ -5803,10 +5781,10 @@ with the provided `transfer_id`. ```typescript await client.inventory.getTransfer({ - transferId: "transfer_id", + transferId: "transfer_id" }); -``` +``` @@ -5820,21 +5798,22 @@ await client.inventory.getTransfer({
-**request:** `Square.GetTransferInventoryRequest` - +**request:** `Square.GetTransferInventoryRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5855,7 +5834,6 @@ Retrieves the current calculated stock count for a given [CatalogObject](entity:CatalogObject) at a given set of [Location](entity:Location)s. Responses are paginated and unsorted. For more sophisticated queries, use a batch endpoint. - @@ -5873,7 +5851,7 @@ For more sophisticated queries, use a batch endpoint. const response = await client.inventory.get({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -5883,13 +5861,13 @@ for await (const item of response) { let page = await client.inventory.get({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -5903,21 +5881,22 @@ while (page.hasNextPage()) {
-**request:** `Square.GetInventoryRequest` - +**request:** `Square.GetInventoryRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ @@ -5947,7 +5926,6 @@ Results are paginated and sorted in descending order according to their There are no limits on how far back the caller can page. This endpoint can be used to display recent changes for a specific item. For more sophisticated queries, use a batch endpoint. - @@ -5965,7 +5943,7 @@ sophisticated queries, use a batch endpoint. const response = await client.inventory.changes({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -5975,13 +5953,13 @@ for await (const item of response) { let page = await client.inventory.changes({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -5995,27 +5973,27 @@ while (page.hasNextPage()) {
-**request:** `Square.ChangesInventoryRequest` - +**request:** `Square.ChangesInventoryRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
+ ## Invoices -
client.invoices.list({ ...params }) -> core.Page
@@ -6028,10 +6006,9 @@ while (page.hasNextPage()) {
-Returns a list of invoices for a given location. The response -is paginated. If truncated, the response includes a `cursor` that you +Returns a list of invoices for a given location. The response +is paginated. If truncated, the response includes a `cursor` that you use in a subsequent request to retrieve the next set of invoices. -
@@ -6049,7 +6026,7 @@ use in a subsequent request to retrieve the next set of invoices. const response = await client.invoices.list({ locationId: "location_id", cursor: "cursor", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -6059,13 +6036,13 @@ for await (const item of response) { let page = await client.invoices.list({ locationId: "location_id", cursor: "cursor", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +```
@@ -6079,21 +6056,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListInvoicesRequest` - +**request:** `Square.ListInvoicesRequest` +
-**requestOptions:** `Invoices.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
+
@@ -6110,12 +6088,11 @@ while (page.hasNextPage()) {
-Creates a draft [invoice](entity:Invoice) +Creates a draft [invoice](entity:Invoice) for an order created using the Orders API. -A draft invoice remains in your account and no action is taken. +A draft invoice remains in your account and no action is taken. You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). -
@@ -6135,22 +6112,18 @@ await client.invoices.create({ locationId: "ES0RJRZYEC39A", orderId: "CAISENgvlJ6jLWAzERDzjyHVybY", primaryRecipient: { - customerId: "JDKYHBWT1D4F8MFH63DBMEN8Y4", + customerId: "JDKYHBWT1D4F8MFH63DBMEN8Y4" }, - paymentRequests: [ - { + paymentRequests: [{ requestType: "BALANCE", dueDate: "2030-01-24", tippingEnabled: true, automaticPaymentSource: "NONE", - reminders: [ - { + reminders: [{ relativeScheduledDays: -1, - message: "Your invoice is due tomorrow", - }, - ], - }, - ], + message: "Your invoice is due tomorrow" + }] + }], deliveryMethod: "EMAIL", invoiceNumber: "inv-100", title: "Event Planning Services", @@ -6161,27 +6134,24 @@ await client.invoices.create({ squareGiftCard: false, bankAccount: false, buyNowPayLater: false, - cashAppPay: false, + cashAppPay: false }, - customFields: [ - { + customFields: [{ label: "Event Reference Number", value: "Ref. #1234", - placement: "ABOVE_LINE_ITEMS", - }, - { + placement: "ABOVE_LINE_ITEMS" + }, { label: "Terms of Service", value: "The terms of service are...", - placement: "BELOW_LINE_ITEMS", - }, - ], + placement: "BELOW_LINE_ITEMS" + }], saleOrServiceDate: "2030-01-24", - storePaymentMethodEnabled: false, + storePaymentMethodEnabled: false }, - idempotencyKey: "ce3748f9-5fc1-4762-aa12-aae5e843f1f4", + idempotencyKey: "ce3748f9-5fc1-4762-aa12-aae5e843f1f4" }); -``` +``` @@ -6195,21 +6165,22 @@ await client.invoices.create({
-**request:** `Square.CreateInvoiceRequest` - +**request:** `Square.CreateInvoiceRequest` +
-**requestOptions:** `Invoices.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
+ @@ -6226,14 +6197,13 @@ await client.invoices.create({
-Searches for invoices from a location specified in -the filter. You can optionally specify customers in the filter for whom to -retrieve invoices. In the current implementation, you can only specify one location and +Searches for invoices from a location specified in +the filter. You can optionally specify customers in the filter for whom to +retrieve invoices. In the current implementation, you can only specify one location and optionally one customer. -The response is paginated. If truncated, the response includes a `cursor` +The response is paginated. If truncated, the response includes a `cursor` that you use in a subsequent request to retrieve the next set of invoices. -
@@ -6252,17 +6222,17 @@ await client.invoices.search({ query: { filter: { locationIds: ["ES0RJRZYEC39A"], - customerIds: ["JDKYHBWT1D4F8MFH63DBMEN8Y4"], + customerIds: ["JDKYHBWT1D4F8MFH63DBMEN8Y4"] }, sort: { field: "INVOICE_SORT_DATE", - order: "DESC", - }, + order: "DESC" + } }, - limit: 100, + limit: 100 }); -``` +``` @@ -6276,21 +6246,22 @@ await client.invoices.search({
-**request:** `Square.SearchInvoicesRequest` - +**request:** `Square.SearchInvoicesRequest` +
-**requestOptions:** `Invoices.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
+ @@ -6308,7 +6279,6 @@ await client.invoices.search({
Retrieves an invoice by invoice ID. -
@@ -6324,10 +6294,10 @@ Retrieves an invoice by invoice ID. ```typescript await client.invoices.get({ - invoiceId: "invoice_id", + invoiceId: "invoice_id" }); -``` +``` @@ -6341,21 +6311,22 @@ await client.invoices.get({
-**request:** `Square.GetInvoicesRequest` - +**request:** `Square.GetInvoicesRequest` +
-**requestOptions:** `Invoices.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
+ @@ -6376,7 +6347,6 @@ Updates an invoice. This endpoint supports sparse updates, so you only need to specify the fields you want to change along with the required `version` field. Some restrictions apply to updating invoices. For example, you cannot change the `order_id` or `location_id` field. - @@ -6395,17 +6365,15 @@ await client.invoices.update({ invoiceId: "invoice_id", invoice: { version: 1, - paymentRequests: [ - { + paymentRequests: [{ uid: "2da7964f-f3d2-4f43-81e8-5aa220bf3355", - tippingEnabled: false, - }, - ], + tippingEnabled: false + }] }, - idempotencyKey: "4ee82288-0910-499e-ab4c-5d0071dad1be", + idempotencyKey: "4ee82288-0910-499e-ab4c-5d0071dad1be" }); -``` +``` @@ -6419,21 +6387,22 @@ await client.invoices.update({
-**request:** `Square.UpdateInvoiceRequest` - +**request:** `Square.UpdateInvoiceRequest` +
-**requestOptions:** `Invoices.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
+ @@ -6450,10 +6419,9 @@ await client.invoices.update({
-Deletes the specified invoice. When an invoice is deleted, the -associated order status changes to CANCELED. You can only delete a draft +Deletes the specified invoice. When an invoice is deleted, the +associated order status changes to CANCELED. You can only delete a draft invoice (you cannot delete a published invoice, including one that is scheduled for processing). -
@@ -6470,10 +6438,10 @@ invoice (you cannot delete a published invoice, including one that is scheduled ```typescript await client.invoices.delete({ invoiceId: "invoice_id", - version: 1, + version: 1 }); -``` +``` @@ -6487,21 +6455,22 @@ await client.invoices.delete({
-**request:** `Square.DeleteInvoicesRequest` - +**request:** `Square.DeleteInvoicesRequest` +
-**requestOptions:** `Invoices.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
+ @@ -6525,8 +6494,7 @@ in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF. Invoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added only to invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. -**NOTE:** When testing in the Sandbox environment, the total file size is limited to 1 KB. - +__NOTE:__ When testing in the Sandbox environment, the total file size is limited to 1 KB. @@ -6542,10 +6510,10 @@ in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. ```typescript await client.invoices.createInvoiceAttachment({ - invoiceId: "invoice_id", + invoiceId: "invoice_id" }); -``` +``` @@ -6559,21 +6527,22 @@ await client.invoices.createInvoiceAttachment({
-**request:** `Square.CreateInvoiceAttachmentRequest` - +**request:** `Square.CreateInvoiceAttachmentRequest` +
-**requestOptions:** `Invoices.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
+ @@ -6592,7 +6561,6 @@ await client.invoices.createInvoiceAttachment({ Removes an attachment from an invoice and permanently deletes the file. Attachments can be removed only from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. - @@ -6609,10 +6577,10 @@ from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. ```typescript await client.invoices.deleteInvoiceAttachment({ invoiceId: "invoice_id", - attachmentId: "attachment_id", + attachmentId: "attachment_id" }); -``` +``` @@ -6626,21 +6594,22 @@ await client.invoices.deleteInvoiceAttachment({
-**request:** `Square.DeleteInvoiceAttachmentRequest` - +**request:** `Square.DeleteInvoiceAttachmentRequest` +
-**requestOptions:** `Invoices.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
+ @@ -6657,11 +6626,10 @@ await client.invoices.deleteInvoiceAttachment({
-Cancels an invoice. The seller cannot collect payments for +Cancels an invoice. The seller cannot collect payments for the canceled invoice. You cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`. -
@@ -6678,10 +6646,10 @@ You cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID` ```typescript await client.invoices.cancel({ invoiceId: "invoice_id", - version: 0, + version: 0 }); -``` +``` @@ -6695,21 +6663,22 @@ await client.invoices.cancel({
-**request:** `Square.CancelInvoiceRequest` - +**request:** `Square.CancelInvoiceRequest` +
-**requestOptions:** `Invoices.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
+ @@ -6726,21 +6695,20 @@ await client.invoices.cancel({
-Publishes the specified draft invoice. +Publishes the specified draft invoice. -After an invoice is published, Square -follows up based on the invoice configuration. For example, Square -sends the invoice to the customer's email address, charges the customer's card on file, or does -nothing. Square also makes the invoice available on a Square-hosted invoice page. +After an invoice is published, Square +follows up based on the invoice configuration. For example, Square +sends the invoice to the customer's email address, charges the customer's card on file, or does +nothing. Square also makes the invoice available on a Square-hosted invoice page. -The invoice `status` also changes from `DRAFT` to a status -based on the invoice configuration. For example, the status changes to `UNPAID` if -Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the +The invoice `status` also changes from `DRAFT` to a status +based on the invoice configuration. For example, the status changes to `UNPAID` if +Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the invoice amount. In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ` and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. -
@@ -6758,10 +6726,10 @@ and `PAYMENTS_WRITE` are required when publishing invoices configured for card-o await client.invoices.publish({ invoiceId: "invoice_id", version: 1, - idempotencyKey: "32da42d0-1997-41b0-826b-f09464fc2c2e", + idempotencyKey: "32da42d0-1997-41b0-826b-f09464fc2c2e" }); -``` +``` @@ -6775,27 +6743,27 @@ await client.invoices.publish({
-**request:** `Square.PublishInvoiceRequest` - +**request:** `Square.PublishInvoiceRequest` +
-**requestOptions:** `Invoices.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
+ ## Labor -
client.labor.createScheduledShift({ ...params }) -> Square.CreateScheduledShiftResponse
@@ -6812,15 +6780,14 @@ Creates a scheduled shift by providing draft shift details such as job ID, team member assignment, and start and end times. The following `draft_shift_details` fields are required: - - `location_id` - `job_id` - `start_at` - `end_at` -
-
- - + + + + #### 🔌 Usage @@ -6841,12 +6808,12 @@ await client.labor.createScheduledShift({ startAt: "2019-01-25T03:11:00-05:00", endAt: "2019-01-25T13:11:00-05:00", notes: "Dont forget to prep the vegetables", - isDeleted: false, - }, - }, + isDeleted: false + } + } }); -``` +``` @@ -6860,21 +6827,22 @@ await client.labor.createScheduledShift({
-**request:** `Square.CreateScheduledShiftRequest` - +**request:** `Square.CreateScheduledShiftRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+
@@ -6897,7 +6865,6 @@ the `draft_shift_details` field as is and copies it to the `published_shift_deta The minimum `start_at` and maximum `end_at` timestamps of all shifts in a `BulkPublishScheduledShifts` request must fall within a two-week period. - @@ -6914,12 +6881,12 @@ The minimum `start_at` and maximum `end_at` timestamps of all shifts in a ```typescript await client.labor.bulkPublishScheduledShifts({ scheduledShifts: { - key: {}, + "key": {} }, - scheduledShiftNotificationAudience: "AFFECTED", + scheduledShiftNotificationAudience: "AFFECTED" }); -``` +``` @@ -6933,21 +6900,22 @@ await client.labor.bulkPublishScheduledShifts({
-**request:** `Square.BulkPublishScheduledShiftsRequest` - +**request:** `Square.BulkPublishScheduledShiftsRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+ @@ -6966,7 +6934,6 @@ await client.labor.bulkPublishScheduledShifts({ Returns a paginated list of scheduled shifts, with optional filter and sort settings. By default, results are sorted by `start_at` in ascending order. - @@ -6984,18 +6951,18 @@ By default, results are sorted by `start_at` in ascending order. await client.labor.searchScheduledShifts({ query: { filter: { - assignmentStatus: "ASSIGNED", + assignmentStatus: "ASSIGNED" }, sort: { field: "CREATED_AT", - order: "ASC", - }, + order: "ASC" + } }, limit: 2, - cursor: "xoxp-1234-5678-90123", + cursor: "xoxp-1234-5678-90123" }); -``` +``` @@ -7009,21 +6976,22 @@ await client.labor.searchScheduledShifts({
-**request:** `Square.SearchScheduledShiftsRequest` - +**request:** `Square.SearchScheduledShiftsRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+ @@ -7041,7 +7009,6 @@ await client.labor.searchScheduledShifts({
Retrieves a scheduled shift by ID. -
@@ -7057,10 +7024,10 @@ Retrieves a scheduled shift by ID. ```typescript await client.labor.retrieveScheduledShift({ - id: "id", + id: "id" }); -``` +``` @@ -7074,21 +7041,22 @@ await client.labor.retrieveScheduledShift({
-**request:** `Square.RetrieveScheduledShiftRequest` - +**request:** `Square.RetrieveScheduledShiftRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+ @@ -7110,16 +7078,15 @@ sparse updates, so only new, changed, or removed fields are required in the requ You must publish the shift to make updates public. You can make the following updates to `draft_shift_details`: - - Change the `location_id`, `job_id`, `start_at`, and `end_at` fields. - Add, change, or clear the `team_member_id` and `notes` fields. To clear these fields, - set the value to null. +set the value to null. - Change the `is_deleted` field. To delete a scheduled shift, set `is_deleted` to true and then publish the shift. - - - - + + + + #### 🔌 Usage @@ -7140,13 +7107,13 @@ await client.labor.updateScheduledShift({ startAt: "2019-03-25T03:11:00-05:00", endAt: "2019-03-25T13:18:00-05:00", notes: "Dont forget to prep the vegetables", - isDeleted: false, + isDeleted: false }, - version: 1, - }, + version: 1 + } }); -``` +``` @@ -7160,21 +7127,22 @@ await client.labor.updateScheduledShift({
-**request:** `Square.UpdateScheduledShiftRequest` - +**request:** `Square.UpdateScheduledShiftRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+ @@ -7193,7 +7161,6 @@ await client.labor.updateScheduledShift({ Publishes a scheduled shift. When a scheduled shift is published, Square keeps the `draft_shift_details` field as is and copies it to the `published_shift_details` field. - @@ -7212,10 +7179,10 @@ await client.labor.publishScheduledShift({ id: "id", idempotencyKey: "HIDSNG5KS478L", version: 2, - scheduledShiftNotificationAudience: "ALL", + scheduledShiftNotificationAudience: "ALL" }); -``` +``` @@ -7229,21 +7196,22 @@ await client.labor.publishScheduledShift({
-**request:** `Square.PublishScheduledShiftRequest` - +**request:** `Square.PublishScheduledShiftRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+ @@ -7271,18 +7239,17 @@ endpoint: - `start_at` An attempt to create a new `Timecard` can result in a `BAD_REQUEST` error when: - - The `status` of the new `Timecard` is `OPEN` and the team member has another - timecard with an `OPEN` status. +timecard with an `OPEN` status. - The `start_at` date is in the future. - The `start_at` or `end_at` date overlaps another timecard for the same team member. - The `Break` instances are set in the request and a break `start_at` is before the `Timecard.start_at`, a break `end_at` is after the `Timecard.end_at`, or both. - - - - + + + + #### 🔌 Usage @@ -7303,29 +7270,27 @@ await client.labor.createTimecard({ title: "Barista", hourlyRate: { amount: BigInt("1100"), - currency: "USD", + currency: "USD" }, - tipEligible: true, + tipEligible: true }, - breaks: [ - { + breaks: [{ startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", - isPaid: true, - }, - ], + isPaid: true + }], teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), - currency: "USD", - }, - }, + currency: "USD" + } + } }); -``` +``` @@ -7339,21 +7304,22 @@ await client.labor.createTimecard({
-**request:** `Square.CreateTimecardRequest` - +**request:** `Square.CreateTimecardRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+ @@ -7372,7 +7338,6 @@ await client.labor.createTimecard({ Returns a paginated list of `Timecard` records for a business. The list to be returned can be filtered by: - - Location IDs - Team member IDs - Timecard status (`OPEN` or `CLOSED`) @@ -7381,15 +7346,14 @@ The list to be returned can be filtered by: - Workday details The list can be sorted by: - - `START_AT` - `END_AT` - `CREATED_AT` - `UPDATED_AT` - - - - + + + + #### 🔌 Usage @@ -7406,17 +7370,17 @@ await client.labor.searchTimecards({ workday: { dateRange: { startDate: "2019-01-20", - endDate: "2019-02-03", + endDate: "2019-02-03" }, matchTimecardsBy: "START_AT", - defaultTimezone: "America/Los_Angeles", - }, - }, + defaultTimezone: "America/Los_Angeles" + } + } }, - limit: 100, + limit: 100 }); -``` +``` @@ -7430,21 +7394,22 @@ await client.labor.searchTimecards({
-**request:** `Square.SearchTimecardsRequest` - +**request:** `Square.SearchTimecardsRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+ @@ -7462,7 +7427,6 @@ await client.labor.searchTimecards({
Returns a single `Timecard` specified by `id`. -
@@ -7478,10 +7442,10 @@ Returns a single `Timecard` specified by `id`. ```typescript await client.labor.retrieveTimecard({ - id: "id", + id: "id" }); -``` +``` @@ -7495,21 +7459,22 @@ await client.labor.retrieveTimecard({
-**request:** `Square.RetrieveTimecardRequest` - +**request:** `Square.RetrieveTimecardRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+ @@ -7533,7 +7498,6 @@ the `end_at` property set to a valid RFC-3339 datetime string. When closing a `Timecard`, all `Break` instances in the `Timecard` must be complete with `end_at` set on each `Break`. - @@ -7558,32 +7522,30 @@ await client.labor.updateTimecard({ title: "Bartender", hourlyRate: { amount: BigInt("1500"), - currency: "USD", + currency: "USD" }, - tipEligible: true, + tipEligible: true }, - breaks: [ - { + breaks: [{ id: "X7GAQYVVRRG6P", startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", - isPaid: true, - }, - ], + isPaid: true + }], status: "CLOSED", version: 1, teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), - currency: "USD", - }, - }, + currency: "USD" + } + } }); -``` +``` @@ -7597,21 +7559,22 @@ await client.labor.updateTimecard({
-**request:** `Square.UpdateTimecardRequest` - +**request:** `Square.UpdateTimecardRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+ @@ -7629,7 +7592,6 @@ await client.labor.updateTimecard({
Deletes a `Timecard`. -
@@ -7645,10 +7607,10 @@ Deletes a `Timecard`. ```typescript await client.labor.deleteTimecard({ - id: "id", + id: "id" }); -``` +``` @@ -7662,27 +7624,27 @@ await client.labor.deleteTimecard({
-**request:** `Square.DeleteTimecardRequest` - +**request:** `Square.DeleteTimecardRequest` +
-**requestOptions:** `Labor.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
+ ## Locations -
client.locations.list() -> Square.ListLocationsResponse
@@ -7697,7 +7659,6 @@ await client.labor.deleteTimecard({ Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api), including those with an inactive status. Locations are listed alphabetically by `name`. -
@@ -7713,8 +7674,8 @@ including those with an inactive status. Locations are listed alphabetically by ```typescript await client.locations.list(); -``` +``` @@ -7728,13 +7689,14 @@ await client.locations.list();
-**requestOptions:** `Locations.RequestOptions` - +**requestOptions:** `Locations.RequestOptions` +
+
@@ -7758,7 +7720,6 @@ that integrate with Square from sales activity elsewhere in a seller's account. Locations created programmatically with the Locations API last forever and are visible to the seller for their own management. Therefore, ensure that each location has a sensible and unique name. - @@ -7780,13 +7741,13 @@ await client.locations.create({ addressLine1: "1234 Peachtree St. NE", locality: "Atlanta", administrativeDistrictLevel1: "GA", - postalCode: "30309", + postalCode: "30309" }, - description: "Midtown Atlanta store", - }, + description: "Midtown Atlanta store" + } }); -``` +``` @@ -7800,21 +7761,22 @@ await client.locations.create({
-**request:** `Square.CreateLocationRequest` - +**request:** `Square.CreateLocationRequest` +
-**requestOptions:** `Locations.RequestOptions` - +**requestOptions:** `Locations.RequestOptions` +
+ @@ -7833,7 +7795,6 @@ await client.locations.create({ Retrieves details of a single location. Specify "main" as the location ID to retrieve details of the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location). - @@ -7849,10 +7810,10 @@ as the location ID to retrieve details of the [main location](https://developer. ```typescript await client.locations.get({ - locationId: "location_id", + locationId: "location_id" }); -``` +``` @@ -7866,21 +7827,22 @@ await client.locations.get({
-**request:** `Square.GetLocationsRequest` - +**request:** `Square.GetLocationsRequest` +
-**requestOptions:** `Locations.RequestOptions` - +**requestOptions:** `Locations.RequestOptions` +
+ @@ -7898,7 +7860,6 @@ await client.locations.get({
Updates a [location](https://developer.squareup.com/docs/locations-api). -
@@ -7917,29 +7878,25 @@ await client.locations.update({ locationId: "location_id", location: { businessHours: { - periods: [ - { + periods: [{ dayOfWeek: "FRI", startLocalTime: "07:00", - endLocalTime: "18:00", - }, - { + endLocalTime: "18:00" + }, { dayOfWeek: "SAT", startLocalTime: "07:00", - endLocalTime: "18:00", - }, - { + endLocalTime: "18:00" + }, { dayOfWeek: "SUN", startLocalTime: "09:00", - endLocalTime: "15:00", - }, - ], + endLocalTime: "15:00" + }] }, - description: "Midtown Atlanta store - Open weekends", - }, + description: "Midtown Atlanta store - Open weekends" + } }); -``` +``` @@ -7953,21 +7910,22 @@ await client.locations.update({
-**request:** `Square.UpdateLocationRequest` - +**request:** `Square.UpdateLocationRequest` +
-**requestOptions:** `Locations.RequestOptions` - +**requestOptions:** `Locations.RequestOptions` +
+ @@ -7986,11 +7944,11 @@ await client.locations.update({ Links a `checkoutId` to a `checkout_page_url` that customers are directed to in order to provide their payment information using a -payment processing workflow hosted on connect.squareup.com. +payment processing workflow hosted on connect.squareup.com. -NOTE: The Checkout API has been updated with new features. -For more information, see [Checkout API highlights](https://developer.squareup.com/docs/checkout-api#checkout-api-highlights). +NOTE: The Checkout API has been updated with new features. +For more information, see [Checkout API highlights](https://developer.squareup.com/docs/checkout-api#checkout-api-highlights). @@ -8013,63 +7971,51 @@ await client.locations.checkouts({ locationId: "location_id", referenceId: "reference_id", customerId: "customer_id", - lineItems: [ - { + lineItems: [{ name: "Printed T Shirt", quantity: "2", - appliedTaxes: [ - { - taxUid: "38ze1696-z1e3-5628-af6d-f1e04d947fg3", - }, - ], - appliedDiscounts: [ - { - discountUid: "56ae1696-z1e3-9328-af6d-f1e04d947gd4", - }, - ], + appliedTaxes: [{ + taxUid: "38ze1696-z1e3-5628-af6d-f1e04d947fg3" + }], + appliedDiscounts: [{ + discountUid: "56ae1696-z1e3-9328-af6d-f1e04d947gd4" + }], basePriceMoney: { amount: BigInt("1500"), - currency: "USD", - }, - }, - { + currency: "USD" + } + }, { name: "Slim Jeans", quantity: "1", basePriceMoney: { amount: BigInt("2500"), - currency: "USD", - }, - }, - { + currency: "USD" + } + }, { name: "Woven Sweater", quantity: "3", basePriceMoney: { amount: BigInt("3500"), - currency: "USD", - }, - }, - ], - taxes: [ - { + currency: "USD" + } + }], + taxes: [{ uid: "38ze1696-z1e3-5628-af6d-f1e04d947fg3", type: "INCLUSIVE", percentage: "7.75", - scope: "LINE_ITEM", - }, - ], - discounts: [ - { + scope: "LINE_ITEM" + }], + discounts: [{ uid: "56ae1696-z1e3-9328-af6d-f1e04d947gd4", type: "FIXED_AMOUNT", amountMoney: { amount: BigInt("100"), - currency: "USD", + currency: "USD" }, - scope: "LINE_ITEM", - }, - ], + scope: "LINE_ITEM" + }] }, - idempotencyKey: "12ae1696-z1e3-4328-af6d-f1e04d947gd4", + idempotencyKey: "12ae1696-z1e3-4328-af6d-f1e04d947gd4" }, askForShippingAddress: true, merchantSupportEmail: "merchant+support@website.com", @@ -8082,22 +8028,20 @@ await client.locations.checkouts({ postalCode: "94103", country: "US", firstName: "Jane", - lastName: "Doe", + lastName: "Doe" }, redirectUrl: "https://merchant.website.com/order-confirm", - additionalRecipients: [ - { + additionalRecipients: [{ locationId: "057P5VYJ4A5X1", description: "Application fees", amountMoney: { amount: BigInt("60"), - currency: "USD", - }, - }, - ], + currency: "USD" + } + }] }); -``` +``` @@ -8111,27 +8055,27 @@ await client.locations.checkouts({
-**request:** `Square.CreateCheckoutRequest` - +**request:** `Square.CreateCheckoutRequest` +
-**requestOptions:** `Locations.RequestOptions` - +**requestOptions:** `Locations.RequestOptions` +
+ ## Loyalty -
client.loyalty.searchEvents({ ...params }) -> Square.SearchLoyaltyEventsResponse
@@ -8152,7 +8096,6 @@ buyer's loyalty account. Each change in the point balance recorded in the ledger. Using this endpoint, you can search the ledger for events. Search results are sorted by `created_at` in descending order. -
@@ -8171,14 +8114,14 @@ await client.loyalty.searchEvents({ query: { filter: { orderFilter: { - orderId: "PyATxhYLfsMqpVkcKJITPydgEYfZY", - }, - }, + orderId: "PyATxhYLfsMqpVkcKJITPydgEYfZY" + } + } }, - limit: 30, + limit: 30 }); -``` +``` @@ -8192,27 +8135,27 @@ await client.loyalty.searchEvents({
-**request:** `Square.SearchLoyaltyEventsRequest` - +**request:** `Square.SearchLoyaltyEventsRequest` +
-**requestOptions:** `Loyalty.RequestOptions` - +**requestOptions:** `Loyalty.RequestOptions` +
+
## Merchants -
client.merchants.list({ ...params }) -> core.Page
@@ -8235,7 +8178,6 @@ information for the merchant that granted your application access. If you know the merchant ID, you can also use the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) endpoint to retrieve the merchant information. -
@@ -8251,7 +8193,7 @@ endpoint to retrieve the merchant information. ```typescript const response = await client.merchants.list({ - cursor: 1, + cursor: 1 }); for await (const item of response) { console.log(item); @@ -8259,13 +8201,13 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.merchants.list({ - cursor: 1, + cursor: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -8279,21 +8221,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListMerchantsRequest` - +**request:** `Square.ListMerchantsRequest` +
-**requestOptions:** `Merchants.RequestOptions` - +**requestOptions:** `Merchants.RequestOptions` +
+
@@ -8311,7 +8254,6 @@ while (page.hasNextPage()) {
Retrieves the `Merchant` object for the given `merchant_id`. -
@@ -8327,10 +8269,10 @@ Retrieves the `Merchant` object for the given `merchant_id`. ```typescript await client.merchants.get({ - merchantId: "merchant_id", + merchantId: "merchant_id" }); -``` +``` @@ -8344,27 +8286,27 @@ await client.merchants.get({
-**request:** `Square.GetMerchantsRequest` - +**request:** `Square.GetMerchantsRequest` +
-**requestOptions:** `Merchants.RequestOptions` - +**requestOptions:** `Merchants.RequestOptions` +
+ ## Checkout -
client.checkout.retrieveLocationSettings({ ...params }) -> Square.RetrieveLocationSettingsResponse
@@ -8378,7 +8320,6 @@ await client.merchants.get({
Retrieves the location-level settings for a Square-hosted checkout page. -
@@ -8394,10 +8335,10 @@ Retrieves the location-level settings for a Square-hosted checkout page. ```typescript await client.checkout.retrieveLocationSettings({ - locationId: "location_id", + locationId: "location_id" }); -``` +``` @@ -8411,21 +8352,22 @@ await client.checkout.retrieveLocationSettings({
-**request:** `Square.RetrieveLocationSettingsRequest` - +**request:** `Square.RetrieveLocationSettingsRequest` +
-**requestOptions:** `Checkout.RequestOptions` - +**requestOptions:** `Checkout.RequestOptions` +
+
@@ -8443,7 +8385,6 @@ await client.checkout.retrieveLocationSettings({
Updates the location-level settings for a Square-hosted checkout page. -
@@ -8460,10 +8401,10 @@ Updates the location-level settings for a Square-hosted checkout page. ```typescript await client.checkout.updateLocationSettings({ locationId: "location_id", - locationSettings: {}, + locationSettings: {} }); -``` +``` @@ -8477,21 +8418,22 @@ await client.checkout.updateLocationSettings({
-**request:** `Square.UpdateLocationSettingsRequest` - +**request:** `Square.UpdateLocationSettingsRequest` +
-**requestOptions:** `Checkout.RequestOptions` - +**requestOptions:** `Checkout.RequestOptions` +
+ @@ -8509,7 +8451,6 @@ await client.checkout.updateLocationSettings({
Retrieves the merchant-level settings for a Square-hosted checkout page. -
@@ -8525,8 +8466,8 @@ Retrieves the merchant-level settings for a Square-hosted checkout page. ```typescript await client.checkout.retrieveMerchantSettings(); -``` +``` @@ -8540,13 +8481,14 @@ await client.checkout.retrieveMerchantSettings();
-**requestOptions:** `Checkout.RequestOptions` - +**requestOptions:** `Checkout.RequestOptions` +
+ @@ -8564,7 +8506,6 @@ await client.checkout.retrieveMerchantSettings();
Updates the merchant-level settings for a Square-hosted checkout page. -
@@ -8580,10 +8521,10 @@ Updates the merchant-level settings for a Square-hosted checkout page. ```typescript await client.checkout.updateMerchantSettings({ - merchantSettings: {}, + merchantSettings: {} }); -``` +``` @@ -8597,27 +8538,27 @@ await client.checkout.updateMerchantSettings({
-**request:** `Square.UpdateMerchantSettingsRequest` - +**request:** `Square.UpdateMerchantSettingsRequest` +
-**requestOptions:** `Checkout.RequestOptions` - +**requestOptions:** `Checkout.RequestOptions` +
+ ## Orders -
client.orders.create({ ...params }) -> Square.CreateOrderResponse
@@ -8637,7 +8578,6 @@ To pay for a created order, see [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). You can modify open orders using the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. -
@@ -8656,65 +8596,52 @@ await client.orders.create({ order: { locationId: "057P5VYJ4A5X1", referenceId: "my-order-001", - lineItems: [ - { + lineItems: [{ name: "New York Strip Steak", quantity: "1", basePriceMoney: { amount: BigInt("1599"), - currency: "USD", - }, - }, - { + currency: "USD" + } + }, { quantity: "2", catalogObjectId: "BEMYCSMIJL46OCDV4KYIKXIB", - modifiers: [ - { - catalogObjectId: "CHQX7Y4KY6N5KINJKZCFURPZ", - }, - ], - appliedDiscounts: [ - { - discountUid: "one-dollar-off", - }, - ], - }, - ], - taxes: [ - { + modifiers: [{ + catalogObjectId: "CHQX7Y4KY6N5KINJKZCFURPZ" + }], + appliedDiscounts: [{ + discountUid: "one-dollar-off" + }] + }], + taxes: [{ uid: "state-sales-tax", name: "State Sales Tax", percentage: "9", - scope: "ORDER", - }, - ], - discounts: [ - { + scope: "ORDER" + }], + discounts: [{ uid: "labor-day-sale", name: "Labor Day Sale", percentage: "5", - scope: "ORDER", - }, - { + scope: "ORDER" + }, { uid: "membership-discount", catalogObjectId: "DB7L55ZH2BGWI4H23ULIWOQ7", - scope: "ORDER", - }, - { + scope: "ORDER" + }, { uid: "one-dollar-off", name: "Sale - $1.00 off", amountMoney: { amount: BigInt("100"), - currency: "USD", + currency: "USD" }, - scope: "LINE_ITEM", - }, - ], + scope: "LINE_ITEM" + }] }, - idempotencyKey: "8193148c-9586-11e6-99f9-28cfe92138cf", + idempotencyKey: "8193148c-9586-11e6-99f9-28cfe92138cf" }); -``` +``` @@ -8728,21 +8655,22 @@ await client.orders.create({
-**request:** `Square.CreateOrderRequest` - +**request:** `Square.CreateOrderRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+
@@ -8762,7 +8690,6 @@ await client.orders.create({ Retrieves a set of [orders](entity:Order) by their IDs. If a given order ID does not exist, the ID is ignored instead of generating an error. - @@ -8779,10 +8706,10 @@ If a given order ID does not exist, the ID is ignored instead of generating an e ```typescript await client.orders.batchGet({ locationId: "057P5VYJ4A5X1", - orderIds: ["CAISEM82RcpmcFBM0TfOyiHV3es", "CAISENgvlJ6jLWAzERDzjyHVybY"], + orderIds: ["CAISEM82RcpmcFBM0TfOyiHV3es", "CAISENgvlJ6jLWAzERDzjyHVybY"] }); -``` +``` @@ -8796,21 +8723,22 @@ await client.orders.batchGet({
-**request:** `Square.BatchGetOrdersRequest` - +**request:** `Square.BatchGetOrdersRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ @@ -8828,7 +8756,6 @@ await client.orders.batchGet({
Enables applications to preview order pricing without creating an order. -
@@ -8846,35 +8773,30 @@ Enables applications to preview order pricing without creating an order. await client.orders.calculate({ order: { locationId: "D7AVYMEAPJ3A3", - lineItems: [ - { + lineItems: [{ name: "Item 1", quantity: "1", basePriceMoney: { amount: BigInt("500"), - currency: "USD", - }, - }, - { + currency: "USD" + } + }, { name: "Item 2", quantity: "2", basePriceMoney: { amount: BigInt("300"), - currency: "USD", - }, - }, - ], - discounts: [ - { + currency: "USD" + } + }], + discounts: [{ name: "50% Off", percentage: "50", - scope: "ORDER", - }, - ], - }, + scope: "ORDER" + }] + } }); -``` +``` @@ -8888,21 +8810,22 @@ await client.orders.calculate({
-**request:** `Square.CalculateOrderRequest` - +**request:** `Square.CalculateOrderRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ @@ -8921,7 +8844,6 @@ await client.orders.calculate({ Creates a new order, in the `DRAFT` state, by duplicating an existing order. The newly created order has only the core fields (such as line items, taxes, and discounts) copied from the original order. - @@ -8939,10 +8861,10 @@ only the core fields (such as line items, taxes, and discounts) copied from the await client.orders.clone({ orderId: "ZAISEM52YcpmcWAzERDOyiWS123", version: 3, - idempotencyKey: "UNIQUE_STRING", + idempotencyKey: "UNIQUE_STRING" }); -``` +``` @@ -8956,21 +8878,22 @@ await client.orders.clone({
-**request:** `Square.CloneOrderRequest` - +**request:** `Square.CloneOrderRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ @@ -8995,16 +8918,15 @@ ecosystem (such as Point of Sale, Invoices, and Connect APIs). [SearchOrdersQuery](entity:SearchOrdersQuery) object that controls how to sort or filter the results. Your `SearchOrdersQuery` can: -Set filter criteria. -Set the sort order. -Determine whether to return results as complete `Order` objects or as + Set filter criteria. + Set the sort order. + Determine whether to return results as complete `Order` objects or as [OrderEntry](entity:OrderEntry) objects. Note that details for orders processed with Square Point of Sale while in offline mode might not be transmitted to Square for up to 72 hours. Offline orders have a `created_at` value that reflects the time the order was created, not the time it was subsequently transmitted to Square. - @@ -9024,25 +8946,25 @@ await client.orders.search({ query: { filter: { stateFilter: { - states: ["COMPLETED"], + states: ["COMPLETED"] }, dateTimeFilter: { closedAt: { startAt: "2018-03-03T20:00:00+00:00", - endAt: "2019-03-04T21:54:45+00:00", - }, - }, + endAt: "2019-03-04T21:54:45+00:00" + } + } }, sort: { sortField: "CLOSED_AT", - sortOrder: "DESC", - }, + sortOrder: "DESC" + } }, limit: 3, - returnEntries: true, + returnEntries: true }); -``` +``` @@ -9056,21 +8978,22 @@ await client.orders.search({
-**request:** `Square.SearchOrdersRequest` - +**request:** `Square.SearchOrdersRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ @@ -9088,7 +9011,6 @@ await client.orders.search({
Retrieves an [Order](entity:Order) by ID. -
@@ -9104,10 +9026,10 @@ Retrieves an [Order](entity:Order) by ID. ```typescript await client.orders.get({ - orderId: "order_id", + orderId: "order_id" }); -``` +``` @@ -9121,21 +9043,22 @@ await client.orders.get({
-**request:** `Square.GetOrdersRequest` - +**request:** `Square.GetOrdersRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ @@ -9160,14 +9083,13 @@ An `UpdateOrder` request requires the following: - The `order_id` in the endpoint path, identifying the order to update. - The latest `version` of the order to update. - The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) - containing only the fields to update and the version to which the update is - being applied. +containing only the fields to update and the version to which the update is +being applied. - If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete) - identifying the fields to clear. +identifying the fields to clear. To pay for an order, see [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). - @@ -9186,24 +9108,22 @@ await client.orders.update({ orderId: "order_id", order: { locationId: "location_id", - lineItems: [ - { + lineItems: [{ uid: "cookie_uid", name: "COOKIE", quantity: "2", basePriceMoney: { amount: BigInt("200"), - currency: "USD", - }, - }, - ], - version: 1, + currency: "USD" + } + }], + version: 1 }, fieldsToClear: ["discounts"], - idempotencyKey: "UNIQUE_STRING", + idempotencyKey: "UNIQUE_STRING" }); -``` +``` @@ -9217,21 +9137,22 @@ await client.orders.update({
-**request:** `Square.UpdateOrderRequest` - +**request:** `Square.UpdateOrderRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ @@ -9258,14 +9179,14 @@ array of `payment_ids` in the request. To be used with `PayOrder`, a payment must: - Reference the order by specifying the `order_id` when [creating the payment](api-endpoint:Payments-CreatePayment). - Any approved payments that reference the same `order_id` not specified in the - `payment_ids` is canceled. +Any approved payments that reference the same `order_id` not specified in the +`payment_ids` is canceled. - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture). Using a delayed capture payment with `PayOrder` completes the approved payment. - - - - + + + + #### 🔌 Usage @@ -9279,10 +9200,10 @@ Using a delayed capture payment with `PayOrder` completes the approved payment. await client.orders.pay({ orderId: "order_id", idempotencyKey: "c043a359-7ad9-4136-82a9-c3f1d66dcbff", - paymentIds: ["EnZdNAlWCmfh6Mt5FMNST1o7taB", "0LRiVlbXVwe8ozu4KbZxd12mvaB"], + paymentIds: ["EnZdNAlWCmfh6Mt5FMNST1o7taB", "0LRiVlbXVwe8ozu4KbZxd12mvaB"] }); -``` +``` @@ -9296,27 +9217,27 @@ await client.orders.pay({
-**request:** `Square.PayOrderRequest` - +**request:** `Square.PayOrderRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
+ ## Payments -
client.payments.list({ ...params }) -> core.Page
@@ -9335,7 +9256,6 @@ Results are eventually consistent, and new payments or changes to payments might seconds to appear. The maximum results per page is 100. -
@@ -9365,7 +9285,7 @@ const response = await client.payments.list({ offlineEndTime: "offline_end_time", updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", - sortField: "CREATED_AT", + sortField: "CREATED_AT" }); for await (const item of response) { console.log(item); @@ -9387,13 +9307,13 @@ let page = await client.payments.list({ offlineEndTime: "offline_end_time", updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", - sortField: "CREATED_AT", + sortField: "CREATED_AT" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -9407,21 +9327,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListPaymentsRequest` - +**request:** `Square.ListPaymentsRequest` +
-**requestOptions:** `Payments.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
+
@@ -9438,15 +9359,14 @@ while (page.hasNextPage()) {
-Creates a payment using the provided source. You can use this endpoint -to charge a card (credit/debit card or -Square gift card) or record a payment that the seller received outside of Square -(cash payment from a buyer or a payment that an external entity +Creates a payment using the provided source. You can use this endpoint +to charge a card (credit/debit card or +Square gift card) or record a payment that the seller received outside of Square +(cash payment from a buyer or a payment that an external entity processed on behalf of the seller). -The endpoint creates a +The endpoint creates a `Payment` object and returns it in the response. -
@@ -9466,20 +9386,20 @@ await client.payments.create({ idempotencyKey: "7b0f3ec5-086a-4871-8f13-3c81b3875218", amountMoney: { amount: BigInt("1000"), - currency: "USD", + currency: "USD" }, appFeeMoney: { amount: BigInt("10"), - currency: "USD", + currency: "USD" }, autocomplete: true, customerId: "W92WH6P11H4Z77CTET0RNTGFW8", locationId: "L88917AVBK2S5", referenceId: "123456", - note: "Brief description", + note: "Brief description" }); -``` +``` @@ -9493,21 +9413,22 @@ await client.payments.create({
-**request:** `Square.CreatePaymentRequest` - +**request:** `Square.CreatePaymentRequest` +
-**requestOptions:** `Payments.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
+ @@ -9535,7 +9456,6 @@ canceling the payment, you can submit your `CreatePayment` request again. Note that if no payment with the specified idempotency key is found, no action is taken and the endpoint returns successfully. - @@ -9551,10 +9471,10 @@ returns successfully. ```typescript await client.payments.cancelByIdempotencyKey({ - idempotencyKey: "a7e36d40-d24b-11e8-b568-0800200c9a66", + idempotencyKey: "a7e36d40-d24b-11e8-b568-0800200c9a66" }); -``` +``` @@ -9568,21 +9488,22 @@ await client.payments.cancelByIdempotencyKey({
-**request:** `Square.CancelPaymentByIdempotencyKeyRequest` - +**request:** `Square.CancelPaymentByIdempotencyKeyRequest` +
-**requestOptions:** `Payments.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
+ @@ -9600,7 +9521,6 @@ await client.payments.cancelByIdempotencyKey({
Retrieves details for a specific payment. -
@@ -9616,10 +9536,10 @@ Retrieves details for a specific payment. ```typescript await client.payments.get({ - paymentId: "payment_id", + paymentId: "payment_id" }); -``` +``` @@ -9633,21 +9553,22 @@ await client.payments.get({
-**request:** `Square.GetPaymentsRequest` - +**request:** `Square.GetPaymentsRequest` +
-**requestOptions:** `Payments.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
+ @@ -9666,7 +9587,6 @@ await client.payments.get({ Updates a payment with the APPROVED status. You can update the `amount_money` and `tip_money` using this endpoint. - @@ -9686,18 +9606,18 @@ await client.payments.update({ payment: { amountMoney: { amount: BigInt("1000"), - currency: "USD", + currency: "USD" }, tipMoney: { amount: BigInt("100"), - currency: "USD", + currency: "USD" }, - versionToken: "ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o", + versionToken: "ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o" }, - idempotencyKey: "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de", + idempotencyKey: "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de" }); -``` +``` @@ -9711,21 +9631,22 @@ await client.payments.update({
-**request:** `Square.UpdatePaymentRequest` - +**request:** `Square.UpdatePaymentRequest` +
-**requestOptions:** `Payments.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
+ @@ -9742,9 +9663,8 @@ await client.payments.update({
-Cancels (voids) a payment. You can use this endpoint to cancel a payment with +Cancels (voids) a payment. You can use this endpoint to cancel a payment with the APPROVED `status`. -
@@ -9760,10 +9680,10 @@ the APPROVED `status`. ```typescript await client.payments.cancel({ - paymentId: "payment_id", + paymentId: "payment_id" }); -``` +``` @@ -9777,21 +9697,22 @@ await client.payments.cancel({
-**request:** `Square.CancelPaymentsRequest` - +**request:** `Square.CancelPaymentsRequest` +
-**requestOptions:** `Payments.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
+ @@ -9812,7 +9733,6 @@ Completes (captures) a payment. By default, payments are set to complete immediately after they are created. You can use this endpoint to complete a payment with the APPROVED `status`. - @@ -9828,10 +9748,10 @@ You can use this endpoint to complete a payment with the APPROVED `status`. ```typescript await client.payments.complete({ - paymentId: "payment_id", + paymentId: "payment_id" }); -``` +``` @@ -9845,27 +9765,27 @@ await client.payments.complete({
-**request:** `Square.CompletePaymentRequest` - +**request:** `Square.CompletePaymentRequest` +
-**requestOptions:** `Payments.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
+ ## Payouts -
client.payouts.list({ ...params }) -> core.Page
@@ -9881,7 +9801,6 @@ await client.payments.complete({ Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. -
@@ -9903,7 +9822,7 @@ const response = await client.payouts.list({ endTime: "end_time", sortOrder: "DESC", cursor: "cursor", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -9917,13 +9836,13 @@ let page = await client.payouts.list({ endTime: "end_time", sortOrder: "DESC", cursor: "cursor", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -9937,21 +9856,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListPayoutsRequest` - +**request:** `Square.ListPayoutsRequest` +
-**requestOptions:** `Payouts.RequestOptions` - +**requestOptions:** `Payouts.RequestOptions` +
+
@@ -9970,7 +9890,6 @@ while (page.hasNextPage()) { Retrieves details of a specific payout identified by a payout ID. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - @@ -9986,10 +9905,10 @@ To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. ```typescript await client.payouts.get({ - payoutId: "payout_id", + payoutId: "payout_id" }); -``` +``` @@ -10003,21 +9922,22 @@ await client.payouts.get({
-**request:** `Square.GetPayoutsRequest` - +**request:** `Square.GetPayoutsRequest` +
-**requestOptions:** `Payouts.RequestOptions` - +**requestOptions:** `Payouts.RequestOptions` +
+ @@ -10036,7 +9956,6 @@ await client.payouts.get({ Retrieves a list of all payout entries for a specific payout. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. - @@ -10055,7 +9974,7 @@ const response = await client.payouts.listEntries({ payoutId: "payout_id", sortOrder: "DESC", cursor: "cursor", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -10066,13 +9985,13 @@ let page = await client.payouts.listEntries({ payoutId: "payout_id", sortOrder: "DESC", cursor: "cursor", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -10086,27 +10005,27 @@ while (page.hasNextPage()) {
-**request:** `Square.ListEntriesPayoutsRequest` - +**request:** `Square.ListEntriesPayoutsRequest` +
-**requestOptions:** `Payouts.RequestOptions` - +**requestOptions:** `Payouts.RequestOptions` +
+ ## Refunds -
client.refunds.list({ ...params }) -> core.Page
@@ -10125,7 +10044,6 @@ Results are eventually consistent, and new refunds or changes to refunds might t seconds to appear. The maximum results per page is 100. -
@@ -10151,7 +10069,7 @@ const response = await client.refunds.list({ limit: 1, updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", - sortField: "CREATED_AT", + sortField: "CREATED_AT" }); for await (const item of response) { console.log(item); @@ -10169,13 +10087,13 @@ let page = await client.refunds.list({ limit: 1, updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", - sortField: "CREATED_AT", + sortField: "CREATED_AT" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -10189,21 +10107,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListRefundsRequest` - +**request:** `Square.ListRefundsRequest` +
-**requestOptions:** `Refunds.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
+
@@ -10221,10 +10140,9 @@ while (page.hasNextPage()) {
Refunds a payment. You can refund the entire payment amount or a -portion of it. You can use this endpoint to refund a card payment or record a +portion of it. You can use this endpoint to refund a card payment or record a refund of a cash or external payment. For more information, see [Refund Payment](https://developer.squareup.com/docs/payments-api/refund-payments). -
@@ -10243,17 +10161,17 @@ await client.refunds.refundPayment({ idempotencyKey: "9b7f2dcf-49da-4411-b23e-a2d6af21333a", amountMoney: { amount: BigInt("1000"), - currency: "USD", + currency: "USD" }, appFeeMoney: { amount: BigInt("10"), - currency: "USD", + currency: "USD" }, paymentId: "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", - reason: "Example", + reason: "Example" }); -``` +``` @@ -10267,21 +10185,22 @@ await client.refunds.refundPayment({
-**request:** `Square.RefundPaymentRequest` - +**request:** `Square.RefundPaymentRequest` +
-**requestOptions:** `Refunds.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
+ @@ -10299,7 +10218,6 @@ await client.refunds.refundPayment({
Retrieves a specific refund using the `refund_id`. -
@@ -10315,10 +10233,10 @@ Retrieves a specific refund using the `refund_id`. ```typescript await client.refunds.get({ - refundId: "refund_id", + refundId: "refund_id" }); -``` +``` @@ -10332,27 +10250,27 @@ await client.refunds.get({
-**request:** `Square.GetRefundsRequest` - +**request:** `Square.GetRefundsRequest` +
-**requestOptions:** `Refunds.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
+ ## Sites -
client.sites.list() -> Square.ListSitesResponse
@@ -10367,8 +10285,8 @@ await client.refunds.get({ Lists the Square Online sites that belong to a seller. Sites are listed in descending order by the `created_at` date. -**Note:** Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). +__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).
@@ -10384,8 +10302,8 @@ Lists the Square Online sites that belong to a seller. Sites are listed in desce ```typescript await client.sites.list(); -``` +``` @@ -10399,19 +10317,19 @@ await client.sites.list();
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
+
## Snippets -
client.snippets.get({ ...params }) -> Square.GetSnippetResponse
@@ -10428,8 +10346,8 @@ Retrieves your snippet from a Square Online site. A site can contain snippets fr You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. -**Note:** Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). +__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).
@@ -10445,10 +10363,10 @@ You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sit ```typescript await client.snippets.get({ - siteId: "site_id", + siteId: "site_id" }); -``` +``` @@ -10462,21 +10380,22 @@ await client.snippets.get({
-**request:** `Square.GetSnippetsRequest` - +**request:** `Square.GetSnippetsRequest` +
-**requestOptions:** `Snippets.RequestOptions` - +**requestOptions:** `Snippets.RequestOptions` +
+
@@ -10493,13 +10412,13 @@ await client.snippets.get({
-Adds a snippet to a Square Online site or updates the existing snippet on the site. -The snippet code is appended to the end of the `head` element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site. +Adds a snippet to a Square Online site or updates the existing snippet on the site. +The snippet code is appended to the end of the `head` element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site. You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. -**Note:** Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). +__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).
@@ -10517,11 +10436,11 @@ You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sit await client.snippets.upsert({ siteId: "site_id", snippet: { - content: "", - }, + content: "" + } }); -``` +``` @@ -10535,21 +10454,22 @@ await client.snippets.upsert({
-**request:** `Square.UpsertSnippetRequest` - +**request:** `Square.UpsertSnippetRequest` +
-**requestOptions:** `Snippets.RequestOptions` - +**requestOptions:** `Snippets.RequestOptions` +
+ @@ -10570,8 +10490,8 @@ Removes your snippet from a Square Online site. You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. -**Note:** Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). +__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). @@ -10587,10 +10507,10 @@ You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sit ```typescript await client.snippets.delete({ - siteId: "site_id", + siteId: "site_id" }); -``` +``` @@ -10604,27 +10524,27 @@ await client.snippets.delete({
-**request:** `Square.DeleteSnippetsRequest` - +**request:** `Square.DeleteSnippetsRequest` +
-**requestOptions:** `Snippets.RequestOptions` - +**requestOptions:** `Snippets.RequestOptions` +
+ ## Subscriptions -
client.subscriptions.create({ ...params }) -> Square.CreateSubscriptionResponse
@@ -10645,7 +10565,6 @@ address. The subscription starts immediately, unless the request includes the optional `start_date`. Each individual subscription is associated with a particular location. For more information, see [Create a subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription). -
@@ -10669,17 +10588,15 @@ await client.subscriptions.create({ cardId: "ccof:qy5x8hHGYsgLrp4Q4GB", timezone: "America/Los_Angeles", source: { - name: "My Application", + name: "My Application" }, - phases: [ - { + phases: [{ ordinal: BigInt("0"), - orderTemplateId: "U2NaowWxzXwpsZU697x7ZHOAnCNZY", - }, - ], + orderTemplateId: "U2NaowWxzXwpsZU697x7ZHOAnCNZY" + }] }); -``` +``` @@ -10693,21 +10610,22 @@ await client.subscriptions.create({
-**request:** `Square.CreateSubscriptionRequest` - +**request:** `Square.CreateSubscriptionRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+
@@ -10726,7 +10644,6 @@ await client.subscriptions.create({ Schedules a plan variation change for all active subscriptions under a given plan variation. For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). - @@ -10744,10 +10661,10 @@ variation. For more information, see [Swap Subscription Plan Variations](https:/ await client.subscriptions.bulkSwapPlan({ newPlanVariationId: "FQ7CDXXWSLUJRPM3GFJSJGZ7", oldPlanVariationId: "6JHXF3B2CW3YKHDV4XEM674H", - locationId: "S8GWD5R9QB376", + locationId: "S8GWD5R9QB376" }); -``` +``` @@ -10761,21 +10678,22 @@ await client.subscriptions.bulkSwapPlan({
-**request:** `Square.BulkSwapPlanRequest` - +**request:** `Square.BulkSwapPlanRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -10806,7 +10724,6 @@ associated with the specified locations are returned. If the request specifies customer IDs, the endpoint orders results first by location, within location by customer ID, and within customer by subscription creation date. - @@ -10826,12 +10743,12 @@ await client.subscriptions.search({ filter: { customerIds: ["CHFGVKYY8RSV93M5KCYTG4PN0G"], locationIds: ["S8GWD5R9QB376"], - sourceNames: ["My App"], - }, - }, + sourceNames: ["My App"] + } + } }); -``` +``` @@ -10845,21 +10762,22 @@ await client.subscriptions.search({
-**request:** `Square.SearchSubscriptionsRequest` - +**request:** `Square.SearchSubscriptionsRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -10877,7 +10795,6 @@ await client.subscriptions.search({
Retrieves a specific subscription. -
@@ -10894,10 +10811,10 @@ Retrieves a specific subscription. ```typescript await client.subscriptions.get({ subscriptionId: "subscription_id", - include: "include", + include: "include" }); -``` +``` @@ -10911,21 +10828,22 @@ await client.subscriptions.get({
-**request:** `Square.GetSubscriptionsRequest` - +**request:** `Square.GetSubscriptionsRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -10944,7 +10862,6 @@ await client.subscriptions.get({ Updates a subscription by modifying or clearing `subscription` field values. To clear a field, set its value to `null`. - @@ -10962,11 +10879,11 @@ To clear a field, set its value to `null`. await client.subscriptions.update({ subscriptionId: "subscription_id", subscription: { - cardId: "{NEW CARD ID}", - }, + cardId: "{NEW CARD ID}" + } }); -``` +``` @@ -10980,21 +10897,22 @@ await client.subscriptions.update({
-**request:** `Square.UpdateSubscriptionRequest` - +**request:** `Square.UpdateSubscriptionRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -11012,7 +10930,6 @@ await client.subscriptions.update({
Deletes a scheduled action for a subscription. -
@@ -11029,10 +10946,10 @@ Deletes a scheduled action for a subscription. ```typescript await client.subscriptions.deleteAction({ subscriptionId: "subscription_id", - actionId: "action_id", + actionId: "action_id" }); -``` +``` @@ -11046,21 +10963,22 @@ await client.subscriptions.deleteAction({
-**request:** `Square.DeleteActionSubscriptionsRequest` - +**request:** `Square.DeleteActionSubscriptionsRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -11079,7 +10997,6 @@ await client.subscriptions.deleteAction({ Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates) for a subscription. - @@ -11096,10 +11013,10 @@ for a subscription. ```typescript await client.subscriptions.changeBillingAnchorDate({ subscriptionId: "subscription_id", - monthlyBillingAnchorDate: 1, + monthlyBillingAnchorDate: 1 }); -``` +``` @@ -11113,21 +11030,22 @@ await client.subscriptions.changeBillingAnchorDate({
-**request:** `Square.ChangeBillingAnchorDateRequest` - +**request:** `Square.ChangeBillingAnchorDateRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -11144,10 +11062,9 @@ await client.subscriptions.changeBillingAnchorDate({
-Schedules a `CANCEL` action to cancel an active subscription. This -sets the `canceled_date` field to the end of the active billing period. After this date, +Schedules a `CANCEL` action to cancel an active subscription. This +sets the `canceled_date` field to the end of the active billing period. After this date, the subscription status changes from ACTIVE to CANCELED. -
@@ -11163,10 +11080,10 @@ the subscription status changes from ACTIVE to CANCELED. ```typescript await client.subscriptions.cancel({ - subscriptionId: "subscription_id", + subscriptionId: "subscription_id" }); -``` +``` @@ -11180,21 +11097,22 @@ await client.subscriptions.cancel({
-**request:** `Square.CancelSubscriptionsRequest` - +**request:** `Square.CancelSubscriptionsRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -11212,7 +11130,6 @@ await client.subscriptions.cancel({
Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. -
@@ -11230,7 +11147,7 @@ Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions const response = await client.subscriptions.listEvents({ subscriptionId: "subscription_id", cursor: "cursor", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -11240,13 +11157,13 @@ for await (const item of response) { let page = await client.subscriptions.listEvents({ subscriptionId: "subscription_id", cursor: "cursor", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -11260,21 +11177,22 @@ while (page.hasNextPage()) {
-**request:** `Square.ListEventsSubscriptionsRequest` - +**request:** `Square.ListEventsSubscriptionsRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -11292,7 +11210,6 @@ while (page.hasNextPage()) {
Schedules a `PAUSE` action to pause an active subscription. -
@@ -11308,10 +11225,10 @@ Schedules a `PAUSE` action to pause an active subscription. ```typescript await client.subscriptions.pause({ - subscriptionId: "subscription_id", + subscriptionId: "subscription_id" }); -``` +``` @@ -11325,21 +11242,22 @@ await client.subscriptions.pause({
-**request:** `Square.PauseSubscriptionRequest` - +**request:** `Square.PauseSubscriptionRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -11357,7 +11275,6 @@ await client.subscriptions.pause({
Schedules a `RESUME` action to resume a paused or a deactivated subscription. -
@@ -11373,10 +11290,10 @@ Schedules a `RESUME` action to resume a paused or a deactivated subscription. ```typescript await client.subscriptions.resume({ - subscriptionId: "subscription_id", + subscriptionId: "subscription_id" }); -``` +``` @@ -11390,21 +11307,22 @@ await client.subscriptions.resume({
-**request:** `Square.ResumeSubscriptionRequest` - +**request:** `Square.ResumeSubscriptionRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -11421,9 +11339,8 @@ await client.subscriptions.resume({
-Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. +Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). -
@@ -11441,15 +11358,13 @@ For more information, see [Swap Subscription Plan Variations](https://developer. await client.subscriptions.swapPlan({ subscriptionId: "subscription_id", newPlanVariationId: "FQ7CDXXWSLUJRPM3GFJSJGZ7", - phases: [ - { + phases: [{ ordinal: BigInt("0"), - orderTemplateId: "uhhnjH9osVv3shUADwaC0b3hNxQZY", - }, - ], + orderTemplateId: "uhhnjH9osVv3shUADwaC0b3hNxQZY" + }] }); -``` +``` @@ -11463,27 +11378,27 @@ await client.subscriptions.swapPlan({
-**request:** `Square.SwapPlanRequest` - +**request:** `Square.SwapPlanRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ ## TeamMembers -
client.teamMembers.create({ ...params }) -> Square.CreateTeamMemberResponse
@@ -11498,12 +11413,10 @@ await client.subscriptions.swapPlan({ Creates a single `TeamMember` object. The `TeamMember` object is returned on successful creates. You must provide the following values in your request to this endpoint: - - `given_name` - `family_name` Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#createteammember). -
@@ -11529,34 +11442,31 @@ await client.teamMembers.create({ phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", - locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"], + locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] }, wageSetting: { - jobAssignments: [ - { + jobAssignments: [{ payType: "SALARY", annualRate: { amount: BigInt("3000000"), - currency: "USD", + currency: "USD" }, weeklyHours: 40, - jobId: "FjS8x95cqHiMenw4f1NAUH4P", - }, - { + jobId: "FjS8x95cqHiMenw4f1NAUH4P" + }, { payType: "HOURLY", hourlyRate: { amount: BigInt("2000"), - currency: "USD", + currency: "USD" }, - jobId: "VDNpRv8da51NU8qZFC5zDWpF", - }, - ], - isOvertimeExempt: true, - }, - }, + jobId: "VDNpRv8da51NU8qZFC5zDWpF" + }], + isOvertimeExempt: true + } + } }); -``` +``` @@ -11570,21 +11480,22 @@ await client.teamMembers.create({
-**request:** `Square.CreateTeamMemberRequest` - +**request:** `Square.CreateTeamMemberRequest` +
-**requestOptions:** `TeamMembers.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
+
@@ -11607,7 +11518,6 @@ the request cannot be successfully processed, the request is not marked as faile contains explicit error information for the failed create. Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members). - @@ -11633,9 +11543,9 @@ await client.teamMembers.batchCreate({ phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", - locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"], - }, - }, + locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] + } + } }, "idempotency-key-2": { teamMember: { @@ -11645,14 +11555,14 @@ await client.teamMembers.batchCreate({ emailAddress: "jane_smith@gmail.com", phoneNumber: "+14159223334", assignedLocations: { - assignmentType: "ALL_CURRENT_AND_FUTURE_LOCATIONS", - }, - }, - }, - }, + assignmentType: "ALL_CURRENT_AND_FUTURE_LOCATIONS" + } + } + } + } }); -``` +``` @@ -11666,21 +11576,22 @@ await client.teamMembers.batchCreate({
-**request:** `Square.BatchCreateTeamMembersRequest` - +**request:** `Square.BatchCreateTeamMembersRequest` +
-**requestOptions:** `TeamMembers.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
+ @@ -11702,7 +11613,6 @@ This process is non-transactional and processes as much of the request as possib the request cannot be successfully processed, the request is not marked as failed, but the body of the response contains explicit error information for the failed update. Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members). - @@ -11729,9 +11639,9 @@ await client.teamMembers.batchUpdate({ emailAddress: "jane_smith@gmail.com", phoneNumber: "+14159223334", assignedLocations: { - assignmentType: "ALL_CURRENT_AND_FUTURE_LOCATIONS", - }, - }, + assignmentType: "ALL_CURRENT_AND_FUTURE_LOCATIONS" + } + } }, "fpgteZNMaf0qOK-a4t6P": { teamMember: { @@ -11744,14 +11654,14 @@ await client.teamMembers.batchUpdate({ phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", - locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"], - }, - }, - }, - }, + locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] + } + } + } + } }); -``` +``` @@ -11765,21 +11675,22 @@ await client.teamMembers.batchUpdate({
-**request:** `Square.BatchUpdateTeamMembersRequest` - +**request:** `Square.BatchUpdateTeamMembersRequest` +
-**requestOptions:** `TeamMembers.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
+ @@ -11796,10 +11707,9 @@ await client.teamMembers.batchUpdate({
-Returns a paginated list of `TeamMember` objects for a business. +Returns a paginated list of `TeamMember` objects for a business. The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether the team member is the Square account owner. -
@@ -11818,13 +11728,13 @@ await client.teamMembers.search({ query: { filter: { locationIds: ["0G5P3VGACMMQZ"], - status: "ACTIVE", - }, + status: "ACTIVE" + } }, - limit: 10, + limit: 10 }); -``` +``` @@ -11838,21 +11748,22 @@ await client.teamMembers.search({
-**request:** `Square.SearchTeamMembersRequest` - +**request:** `Square.SearchTeamMembersRequest` +
-**requestOptions:** `TeamMembers.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
+ @@ -11871,7 +11782,6 @@ await client.teamMembers.search({ Retrieves a `TeamMember` object for the given `TeamMember.id`. Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member). - @@ -11887,10 +11797,10 @@ Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/t ```typescript await client.teamMembers.get({ - teamMemberId: "team_member_id", + teamMemberId: "team_member_id" }); -``` +``` @@ -11904,21 +11814,22 @@ await client.teamMembers.get({
-**request:** `Square.GetTeamMembersRequest` - +**request:** `Square.GetTeamMembersRequest` +
-**requestOptions:** `TeamMembers.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
+ @@ -11937,7 +11848,6 @@ await client.teamMembers.get({ Updates a single `TeamMember` object. The `TeamMember` object is returned on successful updates. Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member). - @@ -11964,35 +11874,32 @@ await client.teamMembers.update({ phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", - locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"], + locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] }, wageSetting: { - jobAssignments: [ - { + jobAssignments: [{ payType: "SALARY", annualRate: { amount: BigInt("3000000"), - currency: "USD", + currency: "USD" }, weeklyHours: 40, - jobId: "FjS8x95cqHiMenw4f1NAUH4P", - }, - { + jobId: "FjS8x95cqHiMenw4f1NAUH4P" + }, { payType: "HOURLY", hourlyRate: { amount: BigInt("1200"), - currency: "USD", + currency: "USD" }, - jobId: "VDNpRv8da51NU8qZFC5zDWpF", - }, - ], - isOvertimeExempt: true, - }, - }, - }, + jobId: "VDNpRv8da51NU8qZFC5zDWpF" + }], + isOvertimeExempt: true + } + } + } }); -``` +``` @@ -12006,27 +11913,27 @@ await client.teamMembers.update({
-**request:** `Square.UpdateTeamMembersRequest` - +**request:** `Square.UpdateTeamMembersRequest` +
-**requestOptions:** `TeamMembers.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
+ ## Team -
client.team.listJobs({ ...params }) -> Square.ListJobsResponse
@@ -12040,7 +11947,6 @@ await client.teamMembers.update({
Lists jobs in a seller account. Results are sorted by title in ascending order. -
@@ -12056,10 +11962,10 @@ Lists jobs in a seller account. Results are sorted by title in ascending order. ```typescript await client.team.listJobs({ - cursor: "cursor", + cursor: "cursor" }); -``` +``` @@ -12073,21 +11979,22 @@ await client.team.listJobs({
-**request:** `Square.ListJobsRequest` - +**request:** `Square.ListJobsRequest` +
-**requestOptions:** `Team.RequestOptions` - +**requestOptions:** `Team.RequestOptions` +
+
@@ -12106,7 +12013,6 @@ await client.team.listJobs({ Creates a job in a seller account. A job defines a title and tip eligibility. Note that compensation is defined in a [job assignment](entity:JobAssignment) in a team member's wage setting. - @@ -12124,12 +12030,12 @@ compensation is defined in a [job assignment](entity:JobAssignment) in a team me await client.team.createJob({ job: { title: "Cashier", - isTipEligible: true, + isTipEligible: true }, - idempotencyKey: "idempotency-key-0", + idempotencyKey: "idempotency-key-0" }); -``` +``` @@ -12143,21 +12049,22 @@ await client.team.createJob({
-**request:** `Square.CreateJobRequest` - +**request:** `Square.CreateJobRequest` +
-**requestOptions:** `Team.RequestOptions` - +**requestOptions:** `Team.RequestOptions` +
+ @@ -12175,7 +12082,6 @@ await client.team.createJob({
Retrieves a specified job. -
@@ -12191,10 +12097,10 @@ Retrieves a specified job. ```typescript await client.team.retrieveJob({ - jobId: "job_id", + jobId: "job_id" }); -``` +``` @@ -12208,21 +12114,22 @@ await client.team.retrieveJob({
-**request:** `Square.RetrieveJobRequest` - +**request:** `Square.RetrieveJobRequest` +
-**requestOptions:** `Team.RequestOptions` - +**requestOptions:** `Team.RequestOptions` +
+ @@ -12242,7 +12149,6 @@ await client.team.retrieveJob({ Updates the title or tip eligibility of a job. Changes to the title propagate to all `JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID. - @@ -12261,11 +12167,11 @@ await client.team.updateJob({ jobId: "job_id", job: { title: "Cashier 1", - isTipEligible: true, - }, + isTipEligible: true + } }); -``` +``` @@ -12279,27 +12185,27 @@ await client.team.updateJob({
-**request:** `Square.UpdateJobRequest` - +**request:** `Square.UpdateJobRequest` +
-**requestOptions:** `Team.RequestOptions` - +**requestOptions:** `Team.RequestOptions` +
+ ## Terminal -
client.terminal.dismissTerminalAction({ ...params }) -> Square.DismissTerminalActionResponse
@@ -12315,7 +12221,6 @@ await client.team.updateJob({ Dismisses a Terminal action request if the status and type of the request permits it. See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details. -
@@ -12331,10 +12236,10 @@ See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/ ```typescript await client.terminal.dismissTerminalAction({ - actionId: "action_id", + actionId: "action_id" }); -``` +``` @@ -12348,21 +12253,22 @@ await client.terminal.dismissTerminalAction({
-**request:** `Square.DismissTerminalActionRequest` - +**request:** `Square.DismissTerminalActionRequest` +
-**requestOptions:** `Terminal.RequestOptions` - +**requestOptions:** `Terminal.RequestOptions` +
+
@@ -12380,7 +12286,6 @@ await client.terminal.dismissTerminalAction({
Dismisses a Terminal checkout request if the status and type of the request permits it. -
@@ -12396,10 +12301,10 @@ Dismisses a Terminal checkout request if the status and type of the request perm ```typescript await client.terminal.dismissTerminalCheckout({ - checkoutId: "checkout_id", + checkoutId: "checkout_id" }); -``` +``` @@ -12413,21 +12318,22 @@ await client.terminal.dismissTerminalCheckout({
-**request:** `Square.DismissTerminalCheckoutRequest` - +**request:** `Square.DismissTerminalCheckoutRequest` +
-**requestOptions:** `Terminal.RequestOptions` - +**requestOptions:** `Terminal.RequestOptions` +
+ @@ -12445,7 +12351,6 @@ await client.terminal.dismissTerminalCheckout({
Dismisses a Terminal refund request if the status and type of the request permits it. -
@@ -12461,10 +12366,10 @@ Dismisses a Terminal refund request if the status and type of the request permit ```typescript await client.terminal.dismissTerminalRefund({ - terminalRefundId: "terminal_refund_id", + terminalRefundId: "terminal_refund_id" }); -``` +``` @@ -12478,27 +12383,27 @@ await client.terminal.dismissTerminalRefund({
-**request:** `Square.DismissTerminalRefundRequest` - +**request:** `Square.DismissTerminalRefundRequest` +
-**requestOptions:** `Terminal.RequestOptions` - +**requestOptions:** `Terminal.RequestOptions` +
+ ## TransferOrders -
client.transferOrders.create({ ...params }) -> Square.CreateTransferOrderResponse
@@ -12511,29 +12416,26 @@ await client.terminal.dismissTerminalRefund({
-Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent -to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. +Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent +to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. The source and destination locations must be different and must belong to your Square account. In [DRAFT](entity:TransferOrderStatus) status, you can: - - Add or remove items - Modify quantities - Update shipping information - Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) The request requires source_location_id and destination_location_id. -Inventory levels are not affected until the order is started via +Inventory levels are not affected until the order is started via [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). Common integration points: - - Sync with warehouse management systems - Automate regular stock transfers - Initialize transfers from inventory optimization systems Creates a [transfer_order.created](webhook:transfer_order.created) webhook event. -
@@ -12557,20 +12459,17 @@ await client.transferOrders.create({ notes: "Example transfer order for inventory redistribution between locations", trackingNumber: "TRACK123456789", createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - lineItems: [ - { + lineItems: [{ itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - quantityOrdered: "5", - }, - { + quantityOrdered: "5" + }, { itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - quantityOrdered: "3", - }, - ], - }, + quantityOrdered: "3" + }] + } }); -``` +```
@@ -12584,21 +12483,22 @@ await client.transferOrders.create({
-**request:** `Square.CreateTransferOrderRequest` - +**request:** `Square.CreateTransferOrderRequest` +
-**requestOptions:** `TransferOrders.RequestOptions` - +**requestOptions:** `TransferOrders.RequestOptions` +
+
@@ -12619,14 +12519,13 @@ Searches for transfer orders using filters. Returns a paginated list of matching [TransferOrder](entity:TransferOrder)s sorted by creation date. Common search scenarios: - - Find orders for a source [Location](entity:Location) - Find orders for a destination [Location](entity:Location) - Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus) - - - - + + + + #### 🔌 Usage @@ -12642,15 +12541,15 @@ const response = await client.transferOrders.search({ filter: { sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], - statuses: ["STARTED", "PARTIALLY_RECEIVED"], + statuses: ["STARTED", "PARTIALLY_RECEIVED"] }, sort: { field: "UPDATED_AT", - order: "DESC", - }, + order: "DESC" + } }, cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - limit: 10, + limit: 10 }); for await (const item of response) { console.log(item); @@ -12662,21 +12561,21 @@ let page = await client.transferOrders.search({ filter: { sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], - statuses: ["STARTED", "PARTIALLY_RECEIVED"], + statuses: ["STARTED", "PARTIALLY_RECEIVED"] }, sort: { field: "UPDATED_AT", - order: "DESC", - }, + order: "DESC" + } }, cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - limit: 10, + limit: 10 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -12690,21 +12589,22 @@ while (page.hasNextPage()) {
-**request:** `Square.SearchTransferOrdersRequest` - +**request:** `Square.SearchTransferOrdersRequest` +
-**requestOptions:** `TransferOrders.RequestOptions` - +**requestOptions:** `TransferOrders.RequestOptions` +
+ @@ -12728,10 +12628,10 @@ order details including: - Line items with ordered and received quantities - Source and destination [Location](entity:Location)s - Tracking information (if available) - - - - + + + + #### 🔌 Usage @@ -12743,10 +12643,10 @@ order details including: ```typescript await client.transferOrders.get({ - transferOrderId: "transfer_order_id", + transferOrderId: "transfer_order_id" }); -``` +``` @@ -12760,21 +12660,22 @@ await client.transferOrders.get({
-**request:** `Square.GetTransferOrdersRequest` - +**request:** `Square.GetTransferOrdersRequest` +
-**requestOptions:** `TransferOrders.RequestOptions` - +**requestOptions:** `TransferOrders.RequestOptions` +
+ @@ -12795,7 +12696,6 @@ Updates an existing transfer order. This endpoint supports sparse updates, allowing you to modify specific fields without affecting others. Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - @@ -12819,25 +12719,21 @@ await client.transferOrders.update({ expectedAt: "2025-11-10T08:00:00Z", notes: "Updated: Priority transfer due to low stock at destination", trackingNumber: "TRACK987654321", - lineItems: [ - { + lineItems: [{ uid: "1", - quantityOrdered: "7", - }, - { + quantityOrdered: "7" + }, { itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", - quantityOrdered: "2", - }, - { + quantityOrdered: "2" + }, { uid: "2", - remove: true, - }, - ], + remove: true + }] }, - version: BigInt("1753109537351"), + version: BigInt("1753109537351") }); -``` +``` @@ -12851,21 +12747,22 @@ await client.transferOrders.update({
-**request:** `Square.UpdateTransferOrderRequest` - +**request:** `Square.UpdateTransferOrderRequest` +
-**requestOptions:** `TransferOrders.RequestOptions` - +**requestOptions:** `TransferOrders.RequestOptions` +
+ @@ -12883,11 +12780,10 @@ await client.transferOrders.update({
Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. -Only draft orders can be deleted. Once an order is started via +Only draft orders can be deleted. Once an order is started via [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted. Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event. -
@@ -12904,10 +12800,10 @@ Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event ```typescript await client.transferOrders.delete({ transferOrderId: "transfer_order_id", - version: BigInt("1000000"), + version: BigInt("1000000") }); -``` +``` @@ -12921,21 +12817,22 @@ await client.transferOrders.delete({
-**request:** `Square.DeleteTransferOrdersRequest` - +**request:** `Square.DeleteTransferOrdersRequest` +
-**requestOptions:** `TransferOrders.RequestOptions` - +**requestOptions:** `TransferOrders.RequestOptions` +
+ @@ -12952,18 +12849,16 @@ await client.transferOrders.delete({
-Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or +Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no longer be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory. Common reasons for cancellation: - - Items no longer needed at destination - Source location needs the inventory - Order created in error Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. -
@@ -12981,10 +12876,10 @@ Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event await client.transferOrders.cancel({ transferOrderId: "transfer_order_id", idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52", - version: BigInt("1753117449752"), + version: BigInt("1753117449752") }); -``` +``` @@ -12998,21 +12893,22 @@ await client.transferOrders.cancel({
-**request:** `Square.CancelTransferOrderRequest` - +**request:** `Square.CancelTransferOrderRequest` +
-**requestOptions:** `TransferOrders.RequestOptions` - +**requestOptions:** `TransferOrders.RequestOptions` +
+ @@ -13033,7 +12929,6 @@ Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a tr This endpoint supports partial receiving - you can receive items in multiple batches. For each line item, you can specify: - - Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK) - Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE) - Quantity canceled (returned to source location's inventory) @@ -13046,7 +12941,6 @@ When all items are either received, damaged, or canceled, the order moves to [COMPLETED](entity:TransferOrderStatus) status. Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - @@ -13065,24 +12959,21 @@ await client.transferOrders.receive({ transferOrderId: "transfer_order_id", idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_101", receipt: { - lineItems: [ - { + lineItems: [{ transferOrderLineUid: "transfer_order_line_uid", quantityReceived: "3", quantityDamaged: "1", - quantityCanceled: "1", - }, - { + quantityCanceled: "1" + }, { transferOrderLineUid: "transfer_order_line_uid", quantityReceived: "2", - quantityCanceled: "1", - }, - ], + quantityCanceled: "1" + }] }, - version: BigInt("1753118664873"), + version: BigInt("1753118664873") }); -``` +``` @@ -13096,21 +12987,22 @@ await client.transferOrders.receive({
-**request:** `Square.ReceiveTransferOrderRequest` - +**request:** `Square.ReceiveTransferOrderRequest` +
-**requestOptions:** `TransferOrders.RequestOptions` - +**requestOptions:** `TransferOrders.RequestOptions` +
+ @@ -13131,11 +13023,10 @@ Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity This decrements inventory at the source [Location](entity:Location) and marks it as in-transit. The order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated. -Once started, the order can no longer be deleted, but it can be canceled via +Once started, the order can no longer be deleted, but it can be canceled via [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - @@ -13153,10 +13044,10 @@ Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event await client.transferOrders.start({ transferOrderId: "transfer_order_id", idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_789", - version: BigInt("1753109537351"), + version: BigInt("1753109537351") }); -``` +``` @@ -13170,27 +13061,27 @@ await client.transferOrders.start({
-**request:** `Square.StartTransferOrderRequest` - +**request:** `Square.StartTransferOrderRequest` +
-**requestOptions:** `TransferOrders.RequestOptions` - +**requestOptions:** `TransferOrders.RequestOptions` +
+ ## Vendors -
client.vendors.batchCreate({ ...params }) -> Square.BatchCreateVendorsResponse
@@ -13204,7 +13095,6 @@ await client.transferOrders.start({
Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a seller. -
@@ -13229,23 +13119,21 @@ await client.vendors.batchCreate({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US", + country: "US" }, - contacts: [ - { + contacts: [{ name: "Joe Burrow", emailAddress: "joe@joesfreshseafood.com", phoneNumber: "1-212-555-4250", - ordinal: 1, - }, - ], + ordinal: 1 + }], accountNumber: "4025391", - note: "a vendor", - }, - }, + note: "a vendor" + } + } }); -``` +``` @@ -13259,21 +13147,22 @@ await client.vendors.batchCreate({
-**request:** `Square.BatchCreateVendorsRequest` - +**request:** `Square.BatchCreateVendorsRequest` +
-**requestOptions:** `Vendors.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
+
@@ -13291,7 +13180,6 @@ await client.vendors.batchCreate({
Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs. -
@@ -13307,10 +13195,10 @@ Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs. ```typescript await client.vendors.batchGet({ - vendorIds: ["INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4"], + vendorIds: ["INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4"] }); -``` +``` @@ -13324,21 +13212,22 @@ await client.vendors.batchGet({
-**request:** `Square.BatchGetVendorsRequest` - +**request:** `Square.BatchGetVendorsRequest` +
-**requestOptions:** `Vendors.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
+ @@ -13356,7 +13245,6 @@ await client.vendors.batchGet({
Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers to a seller. -
@@ -13373,16 +13261,16 @@ Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers to ```typescript await client.vendors.batchUpdate({ vendors: { - FMCYHBWT1TPL8MFH52PBMEN92A: { - vendor: {}, - }, - INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4: { - vendor: {}, + "FMCYHBWT1TPL8MFH52PBMEN92A": { + vendor: {} }, - }, + "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4": { + vendor: {} + } + } }); -``` +``` @@ -13396,21 +13284,22 @@ await client.vendors.batchUpdate({
-**request:** `Square.BatchUpdateVendorsRequest` - +**request:** `Square.BatchUpdateVendorsRequest` +
-**requestOptions:** `Vendors.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
+ @@ -13428,7 +13317,6 @@ await client.vendors.batchUpdate({
Creates a single [Vendor](entity:Vendor) object to represent a supplier to a seller. -
@@ -13453,22 +13341,20 @@ await client.vendors.create({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US", + country: "US" }, - contacts: [ - { + contacts: [{ name: "Joe Burrow", emailAddress: "joe@joesfreshseafood.com", phoneNumber: "1-212-555-4250", - ordinal: 1, - }, - ], + ordinal: 1 + }], accountNumber: "4025391", - note: "a vendor", - }, + note: "a vendor" + } }); -``` +``` @@ -13482,21 +13368,22 @@ await client.vendors.create({
-**request:** `Square.CreateVendorRequest` - +**request:** `Square.CreateVendorRequest` +
-**requestOptions:** `Vendors.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
+ @@ -13514,7 +13401,6 @@ await client.vendors.create({
Searches for vendors using a filter against supported [Vendor](entity:Vendor) properties and a supported sorter. -
@@ -13530,8 +13416,8 @@ Searches for vendors using a filter against supported [Vendor](entity:Vendor) pr ```typescript await client.vendors.search(); -``` +``` @@ -13545,21 +13431,22 @@ await client.vendors.search();
-**request:** `Square.SearchVendorsRequest` - +**request:** `Square.SearchVendorsRequest` +
-**requestOptions:** `Vendors.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
+ @@ -13577,7 +13464,6 @@ await client.vendors.search();
Retrieves the vendor of a specified [Vendor](entity:Vendor) ID. -
@@ -13593,10 +13479,10 @@ Retrieves the vendor of a specified [Vendor](entity:Vendor) ID. ```typescript await client.vendors.get({ - vendorId: "vendor_id", + vendorId: "vendor_id" }); -``` +``` @@ -13610,21 +13496,22 @@ await client.vendors.get({
-**request:** `Square.GetVendorsRequest` - +**request:** `Square.GetVendorsRequest` +
-**requestOptions:** `Vendors.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
+ @@ -13642,7 +13529,6 @@ await client.vendors.get({
Updates an existing [Vendor](entity:Vendor) object as a supplier to a seller. -
@@ -13665,12 +13551,12 @@ await client.vendors.update({ id: "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", name: "Jack's Chicken Shack", version: 1, - status: "ACTIVE", - }, - }, + status: "ACTIVE" + } + } }); -``` +``` @@ -13684,27 +13570,27 @@ await client.vendors.update({
-**request:** `Square.UpdateVendorsRequest` - +**request:** `Square.UpdateVendorsRequest` +
-**requestOptions:** `Vendors.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
+ ## Bookings CustomAttributeDefinitions -
client.bookings.customAttributeDefinitions.list({ ...params }) -> core.Page
@@ -13721,7 +13607,6 @@ Get all bookings custom attribute definitions. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. -
@@ -13738,7 +13623,7 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` ```typescript const response = await client.bookings.customAttributeDefinitions.list({ limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -13747,13 +13632,13 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.bookings.customAttributeDefinitions.list({ limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -13767,21 +13652,22 @@ while (page.hasNextPage()) {
-**request:** `Square.bookings.ListCustomAttributeDefinitionsRequest` - +**request:** `Square.bookings.ListCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+
@@ -13803,9 +13689,8 @@ Creates a bookings custom attribute definition. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ -or _Appointments Premium_. - +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* +or *Appointments Premium*. @@ -13821,10 +13706,10 @@ or _Appointments Premium_. ```typescript await client.bookings.customAttributeDefinitions.create({ - customAttributeDefinition: {}, + customAttributeDefinition: {} }); -``` +``` @@ -13838,21 +13723,22 @@ await client.bookings.customAttributeDefinitions.create({
-**request:** `Square.bookings.CreateBookingCustomAttributeDefinitionRequest` - +**request:** `Square.bookings.CreateBookingCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -13873,7 +13759,6 @@ Retrieves a bookings custom attribute definition. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - @@ -13890,10 +13775,10 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` ```typescript await client.bookings.customAttributeDefinitions.get({ key: "key", - version: 1, + version: 1 }); -``` +``` @@ -13907,21 +13792,22 @@ await client.bookings.customAttributeDefinitions.get({
-**request:** `Square.bookings.GetCustomAttributeDefinitionsRequest` - +**request:** `Square.bookings.GetCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -13943,9 +13829,8 @@ Updates a bookings custom attribute definition. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ -or _Appointments Premium_. - +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* +or *Appointments Premium*. @@ -13962,10 +13847,10 @@ or _Appointments Premium_. ```typescript await client.bookings.customAttributeDefinitions.update({ key: "key", - customAttributeDefinition: {}, + customAttributeDefinition: {} }); -``` +``` @@ -13979,21 +13864,22 @@ await client.bookings.customAttributeDefinitions.update({
-**request:** `Square.bookings.UpdateBookingCustomAttributeDefinitionRequest` - +**request:** `Square.bookings.UpdateBookingCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -14015,9 +13901,8 @@ Deletes a bookings custom attribute definition. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ -or _Appointments Premium_. - +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* +or *Appointments Premium*. @@ -14033,10 +13918,10 @@ or _Appointments Premium_. ```typescript await client.bookings.customAttributeDefinitions.delete({ - key: "key", + key: "key" }); -``` +``` @@ -14050,27 +13935,27 @@ await client.bookings.customAttributeDefinitions.delete({
-**request:** `Square.bookings.DeleteCustomAttributeDefinitionsRequest` - +**request:** `Square.bookings.DeleteCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ ## Bookings CustomAttributes -
client.bookings.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteBookingCustomAttributesResponse
@@ -14088,9 +13973,8 @@ Bulk deletes bookings custom attributes. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ -or _Appointments Premium_. - +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* +or *Appointments Premium*.
@@ -14107,14 +13991,14 @@ or _Appointments Premium_. ```typescript await client.bookings.customAttributes.batchDelete({ values: { - key: { + "key": { bookingId: "booking_id", - key: "key", - }, - }, + key: "key" + } + } }); -``` +``` @@ -14128,21 +14012,22 @@ await client.bookings.customAttributes.batchDelete({
-**request:** `Square.bookings.BulkDeleteBookingCustomAttributesRequest` - +**request:** `Square.bookings.BulkDeleteBookingCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+
@@ -14164,9 +14049,8 @@ Bulk upserts bookings custom attributes. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ -or _Appointments Premium_. - +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* +or *Appointments Premium*. @@ -14183,14 +14067,14 @@ or _Appointments Premium_. ```typescript await client.bookings.customAttributes.batchUpsert({ values: { - key: { + "key": { bookingId: "booking_id", - customAttribute: {}, - }, - }, + customAttribute: {} + } + } }); -``` +``` @@ -14204,21 +14088,22 @@ await client.bookings.customAttributes.batchUpsert({
-**request:** `Square.bookings.BulkUpsertBookingCustomAttributesRequest` - +**request:** `Square.bookings.BulkUpsertBookingCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -14239,7 +14124,6 @@ Lists a booking's custom attributes. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - @@ -14258,7 +14142,7 @@ const response = await client.bookings.customAttributes.list({ bookingId: "booking_id", limit: 1, cursor: "cursor", - withDefinitions: true, + withDefinitions: true }); for await (const item of response) { console.log(item); @@ -14269,13 +14153,13 @@ let page = await client.bookings.customAttributes.list({ bookingId: "booking_id", limit: 1, cursor: "cursor", - withDefinitions: true, + withDefinitions: true }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -14289,21 +14173,22 @@ while (page.hasNextPage()) {
-**request:** `Square.bookings.ListCustomAttributesRequest` - +**request:** `Square.bookings.ListCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -14324,7 +14209,6 @@ Retrieves a bookings custom attribute. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. - @@ -14343,10 +14227,10 @@ await client.bookings.customAttributes.get({ bookingId: "booking_id", key: "key", withDefinition: true, - version: 1, + version: 1 }); -``` +``` @@ -14360,21 +14244,22 @@ await client.bookings.customAttributes.get({
-**request:** `Square.bookings.GetCustomAttributesRequest` - +**request:** `Square.bookings.GetCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -14396,9 +14281,8 @@ Upserts a bookings custom attribute. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ -or _Appointments Premium_. - +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* +or *Appointments Premium*. @@ -14416,10 +14300,10 @@ or _Appointments Premium_. await client.bookings.customAttributes.upsert({ bookingId: "booking_id", key: "key", - customAttribute: {}, + customAttribute: {} }); -``` +``` @@ -14433,21 +14317,22 @@ await client.bookings.customAttributes.upsert({
-**request:** `Square.bookings.UpsertBookingCustomAttributeRequest` - +**request:** `Square.bookings.UpsertBookingCustomAttributeRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -14469,9 +14354,8 @@ Deletes a bookings custom attribute. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ -or _Appointments Premium_. - +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* +or *Appointments Premium*. @@ -14488,10 +14372,10 @@ or _Appointments Premium_. ```typescript await client.bookings.customAttributes.delete({ bookingId: "booking_id", - key: "key", + key: "key" }); -``` +``` @@ -14505,27 +14389,27 @@ await client.bookings.customAttributes.delete({
-**request:** `Square.bookings.DeleteCustomAttributesRequest` - +**request:** `Square.bookings.DeleteCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ ## Bookings LocationProfiles -
client.bookings.locationProfiles.list({ ...params }) -> core.Page
@@ -14539,7 +14423,6 @@ await client.bookings.customAttributes.delete({
Lists location booking profiles of a seller. -
@@ -14556,7 +14439,7 @@ Lists location booking profiles of a seller. ```typescript const response = await client.bookings.locationProfiles.list({ limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -14565,13 +14448,13 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.bookings.locationProfiles.list({ limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -14585,27 +14468,27 @@ while (page.hasNextPage()) {
-**request:** `Square.bookings.ListLocationProfilesRequest` - +**request:** `Square.bookings.ListLocationProfilesRequest` +
-**requestOptions:** `LocationProfiles.RequestOptions` - +**requestOptions:** `LocationProfiles.RequestOptions` +
+
## Bookings TeamMemberProfiles -
client.bookings.teamMemberProfiles.list({ ...params }) -> core.Page
@@ -14619,7 +14502,6 @@ while (page.hasNextPage()) {
Lists booking profiles for team members. -
@@ -14638,7 +14520,7 @@ const response = await client.bookings.teamMemberProfiles.list({ bookableOnly: true, limit: 1, cursor: "cursor", - locationId: "location_id", + locationId: "location_id" }); for await (const item of response) { console.log(item); @@ -14649,13 +14531,13 @@ let page = await client.bookings.teamMemberProfiles.list({ bookableOnly: true, limit: 1, cursor: "cursor", - locationId: "location_id", + locationId: "location_id" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -14669,21 +14551,22 @@ while (page.hasNextPage()) {
-**request:** `Square.bookings.ListTeamMemberProfilesRequest` - +**request:** `Square.bookings.ListTeamMemberProfilesRequest` +
-**requestOptions:** `TeamMemberProfiles.RequestOptions` - +**requestOptions:** `TeamMemberProfiles.RequestOptions` +
+
@@ -14701,7 +14584,6 @@ while (page.hasNextPage()) {
Retrieves a team member's booking profile. -
@@ -14717,10 +14599,10 @@ Retrieves a team member's booking profile. ```typescript await client.bookings.teamMemberProfiles.get({ - teamMemberId: "team_member_id", + teamMemberId: "team_member_id" }); -``` +``` @@ -14734,27 +14616,27 @@ await client.bookings.teamMemberProfiles.get({
-**request:** `Square.bookings.GetTeamMemberProfilesRequest` - +**request:** `Square.bookings.GetTeamMemberProfilesRequest` +
-**requestOptions:** `TeamMemberProfiles.RequestOptions` - +**requestOptions:** `TeamMemberProfiles.RequestOptions` +
+ ## CashDrawers Shifts -
client.cashDrawers.shifts.list({ ...params }) -> core.Page
@@ -14769,7 +14651,6 @@ await client.bookings.teamMemberProfiles.get({ Provides the details for all of the cash drawer shifts for a location in a date range. -
@@ -14790,7 +14671,7 @@ const response = await client.cashDrawers.shifts.list({ beginTime: "begin_time", endTime: "end_time", limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -14803,13 +14684,13 @@ let page = await client.cashDrawers.shifts.list({ beginTime: "begin_time", endTime: "end_time", limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -14823,21 +14704,22 @@ while (page.hasNextPage()) {
-**request:** `Square.cashDrawers.ListShiftsRequest` - +**request:** `Square.cashDrawers.ListShiftsRequest` +
-**requestOptions:** `Shifts.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
+
@@ -14856,7 +14738,6 @@ while (page.hasNextPage()) { Provides the summary details for a single cash drawer shift. See [ListCashDrawerShiftEvents](api-endpoint:CashDrawers-ListCashDrawerShiftEvents) for a list of cash drawer shift events. - @@ -14873,10 +14754,10 @@ Provides the summary details for a single cash drawer shift. See ```typescript await client.cashDrawers.shifts.get({ shiftId: "shift_id", - locationId: "location_id", + locationId: "location_id" }); -``` +``` @@ -14890,21 +14771,22 @@ await client.cashDrawers.shifts.get({
-**request:** `Square.cashDrawers.GetShiftsRequest` - +**request:** `Square.cashDrawers.GetShiftsRequest` +
-**requestOptions:** `Shifts.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
+ @@ -14922,7 +14804,6 @@ await client.cashDrawers.shifts.get({
Provides a paginated list of events for a single cash drawer shift. -
@@ -14941,7 +14822,7 @@ const response = await client.cashDrawers.shifts.listEvents({ shiftId: "shift_id", locationId: "location_id", limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -14952,13 +14833,13 @@ let page = await client.cashDrawers.shifts.listEvents({ shiftId: "shift_id", locationId: "location_id", limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -14972,27 +14853,27 @@ while (page.hasNextPage()) {
-**request:** `Square.cashDrawers.ListEventsShiftsRequest` - +**request:** `Square.cashDrawers.ListEventsShiftsRequest` +
-**requestOptions:** `Shifts.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
+ ## Catalog Images -
client.catalog.images.create({ ...params }) -> Square.CreateCatalogImageResponse
@@ -15011,7 +14892,6 @@ is not specified. This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. -
@@ -15027,8 +14907,8 @@ JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. ```typescript await client.catalog.images.create({}); -``` +``` @@ -15042,21 +14922,22 @@ await client.catalog.images.create({});
-**request:** `Square.catalog.CreateImagesRequest` - +**request:** `Square.catalog.CreateImagesRequest` +
-**requestOptions:** `Images.RequestOptions` - +**requestOptions:** `Images.RequestOptions` +
+
@@ -15077,7 +14958,6 @@ Uploads a new image file to replace the existing one in the specified [CatalogIm This `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. - @@ -15093,10 +14973,10 @@ JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. ```typescript await client.catalog.images.update({ - imageId: "image_id", + imageId: "image_id" }); -``` +``` @@ -15110,27 +14990,27 @@ await client.catalog.images.update({
-**request:** `Square.catalog.UpdateImagesRequest` - +**request:** `Square.catalog.UpdateImagesRequest` +
-**requestOptions:** `Images.RequestOptions` - +**requestOptions:** `Images.RequestOptions` +
+ ## Catalog Object -
client.catalog.object.upsert({ ...params }) -> Square.UpsertCatalogObjectResponse
@@ -15148,7 +15028,6 @@ Creates a new or updates the specified [CatalogObject](entity:CatalogObject). To ensure consistency, only one update request is processed at a time per seller account. While one (batch or non-batch) update request is being processed, other (batched and non-batched) update requests are rejected with the `429` error code. -
@@ -15167,11 +15046,11 @@ await client.catalog.object.upsert({ idempotencyKey: "af3d1afc-7212-4300-b463-0bfc5314a5ae", object: { type: "ITEM", - id: "id", - }, + id: "id" + } }); -``` +``` @@ -15185,21 +15064,22 @@ await client.catalog.object.upsert({
-**request:** `Square.catalog.UpsertCatalogObjectRequest` - +**request:** `Square.catalog.UpsertCatalogObjectRequest` +
-**requestOptions:** `Object_.RequestOptions` - +**requestOptions:** `Object_.RequestOptions` +
+
@@ -15223,7 +15103,6 @@ information including: [CatalogItemVariation](entity:CatalogItemVariation) children, references to its [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of any [CatalogTax](entity:CatalogTax) objects that apply to it. - @@ -15242,10 +15121,10 @@ await client.catalog.object.get({ objectId: "object_id", includeRelatedObjects: true, catalogVersion: BigInt("1000000"), - includeCategoryPathToRoot: true, + includeCategoryPathToRoot: true }); -``` +``` @@ -15259,21 +15138,22 @@ await client.catalog.object.get({
-**request:** `Square.catalog.GetObjectRequest` - +**request:** `Square.catalog.GetObjectRequest` +
-**requestOptions:** `Object_.RequestOptions` - +**requestOptions:** `Object_.RequestOptions` +
+ @@ -15300,7 +15180,6 @@ will also delete all of its To ensure consistency, only one delete request is processed at a time per seller account. While one (batch or non-batch) delete request is being processed, other (batched and non-batched) delete requests are rejected with the `429` error code. - @@ -15316,10 +15195,10 @@ delete requests are rejected with the `429` error code. ```typescript await client.catalog.object.delete({ - objectId: "object_id", + objectId: "object_id" }); -``` +``` @@ -15333,27 +15212,27 @@ await client.catalog.object.delete({
-**request:** `Square.catalog.DeleteObjectRequest` - +**request:** `Square.catalog.DeleteObjectRequest` +
-**requestOptions:** `Object_.RequestOptions` - +**requestOptions:** `Object_.RequestOptions` +
+ ## Checkout PaymentLinks -
client.checkout.paymentLinks.list({ ...params }) -> core.Page
@@ -15367,7 +15246,6 @@ await client.catalog.object.delete({
Lists all payment links. -
@@ -15384,7 +15262,7 @@ Lists all payment links. ```typescript const response = await client.checkout.paymentLinks.list({ cursor: "cursor", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -15393,13 +15271,13 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.checkout.paymentLinks.list({ cursor: "cursor", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -15413,21 +15291,22 @@ while (page.hasNextPage()) {
-**request:** `Square.checkout.ListPaymentLinksRequest` - +**request:** `Square.checkout.ListPaymentLinksRequest` +
-**requestOptions:** `PaymentLinks.RequestOptions` - +**requestOptions:** `PaymentLinks.RequestOptions` +
+
@@ -15445,7 +15324,6 @@ while (page.hasNextPage()) {
Creates a Square-hosted checkout page. Applications can share the resulting payment link with their buyer to pay for goods and services. -
@@ -15466,13 +15344,13 @@ await client.checkout.paymentLinks.create({ name: "Auto Detailing", priceMoney: { amount: BigInt("10000"), - currency: "USD", + currency: "USD" }, - locationId: "A9Y43N9ABXZBP", - }, + locationId: "A9Y43N9ABXZBP" + } }); -``` +``` @@ -15486,21 +15364,22 @@ await client.checkout.paymentLinks.create({
-**request:** `Square.checkout.CreatePaymentLinkRequest` - +**request:** `Square.checkout.CreatePaymentLinkRequest` +
-**requestOptions:** `PaymentLinks.RequestOptions` - +**requestOptions:** `PaymentLinks.RequestOptions` +
+ @@ -15518,7 +15397,6 @@ await client.checkout.paymentLinks.create({
Retrieves a payment link. -
@@ -15534,10 +15412,10 @@ Retrieves a payment link. ```typescript await client.checkout.paymentLinks.get({ - id: "id", + id: "id" }); -``` +``` @@ -15551,21 +15429,22 @@ await client.checkout.paymentLinks.get({
-**request:** `Square.checkout.GetPaymentLinksRequest` - +**request:** `Square.checkout.GetPaymentLinksRequest` +
-**requestOptions:** `PaymentLinks.RequestOptions` - +**requestOptions:** `PaymentLinks.RequestOptions` +
+ @@ -15583,9 +15462,8 @@ await client.checkout.paymentLinks.get({
Updates a payment link. You can update the `payment_link` fields such as -`description`, `checkout_options`, and `pre_populated_data`. +`description`, `checkout_options`, and `pre_populated_data`. You cannot update other fields such as the `order_id`, `version`, `URL`, or `timestamp` field. -
@@ -15605,12 +15483,12 @@ await client.checkout.paymentLinks.update({ paymentLink: { version: 1, checkoutOptions: { - askForShippingAddress: true, - }, - }, + askForShippingAddress: true + } + } }); -``` +``` @@ -15624,21 +15502,22 @@ await client.checkout.paymentLinks.update({
-**request:** `Square.checkout.UpdatePaymentLinkRequest` - +**request:** `Square.checkout.UpdatePaymentLinkRequest` +
-**requestOptions:** `PaymentLinks.RequestOptions` - +**requestOptions:** `PaymentLinks.RequestOptions` +
+ @@ -15656,7 +15535,6 @@ await client.checkout.paymentLinks.update({
Deletes a payment link. -
@@ -15672,10 +15550,10 @@ Deletes a payment link. ```typescript await client.checkout.paymentLinks.delete({ - id: "id", + id: "id" }); -``` +``` @@ -15689,27 +15567,27 @@ await client.checkout.paymentLinks.delete({
-**request:** `Square.checkout.DeletePaymentLinksRequest` - +**request:** `Square.checkout.DeletePaymentLinksRequest` +
-**requestOptions:** `PaymentLinks.RequestOptions` - +**requestOptions:** `PaymentLinks.RequestOptions` +
+ ## Customers CustomAttributeDefinitions -
client.customers.customAttributeDefinitions.list({ ...params }) -> core.Page
@@ -15728,7 +15606,6 @@ When all response pages are retrieved, the results include all custom attribute that are visible to the requesting application, including those that are created by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. -
@@ -15745,7 +15622,7 @@ seller-defined custom attributes (also known as custom fields) are always set to ```typescript const response = await client.customers.customAttributeDefinitions.list({ limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -15754,13 +15631,13 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.customers.customAttributeDefinitions.list({ limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -15774,21 +15651,22 @@ while (page.hasNextPage()) {
-**request:** `Square.customers.ListCustomAttributeDefinitionsRequest` - +**request:** `Square.customers.ListCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+
@@ -15816,7 +15694,6 @@ to set the custom attribute for customer profiles in the seller's Customer Direc Sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. - @@ -15835,15 +15712,15 @@ await client.customers.customAttributeDefinitions.create({ customAttributeDefinition: { key: "favoritemovie", schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" }, name: "Favorite Movie", description: "The favorite movie of the customer.", - visibility: "VISIBILITY_HIDDEN", - }, + visibility: "VISIBILITY_HIDDEN" + } }); -``` +``` @@ -15857,21 +15734,22 @@ await client.customers.customAttributeDefinitions.create({
-**request:** `Square.customers.CreateCustomerCustomAttributeDefinitionRequest` - +**request:** `Square.customers.CreateCustomerCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -15893,7 +15771,6 @@ Retrieves a customer-related [custom attribute definition](entity:CustomAttribut To retrieve a custom attribute definition created by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - @@ -15910,10 +15787,10 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note t ```typescript await client.customers.customAttributeDefinitions.get({ key: "key", - version: 1, + version: 1 }); -``` +``` @@ -15927,21 +15804,22 @@ await client.customers.customAttributeDefinitions.get({
-**request:** `Square.customers.GetCustomAttributeDefinitionsRequest` - +**request:** `Square.customers.GetCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -15965,7 +15843,6 @@ Use this endpoint to update the following fields: `name`, `description`, `visibi Only the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. - @@ -15984,11 +15861,11 @@ await client.customers.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: { description: "Update the description as desired.", - visibility: "VISIBILITY_READ_ONLY", - }, + visibility: "VISIBILITY_READ_ONLY" + } }); -``` +``` @@ -16002,21 +15879,22 @@ await client.customers.customAttributeDefinitions.update({
-**request:** `Square.customers.UpdateCustomerCustomAttributeDefinitionRequest` - +**request:** `Square.customers.UpdateCustomerCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -16039,7 +15917,6 @@ Deleting a custom attribute definition also deletes the corresponding custom att all customer profiles in the seller's Customer Directory. Only the definition owner can delete a custom attribute definition. - @@ -16055,10 +15932,10 @@ Only the definition owner can delete a custom attribute definition. ```typescript await client.customers.customAttributeDefinitions.delete({ - key: "key", + key: "key" }); -``` +``` @@ -16072,21 +15949,22 @@ await client.customers.customAttributeDefinitions.delete({
-**request:** `Square.customers.DeleteCustomAttributeDefinitionsRequest` - +**request:** `Square.customers.DeleteCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -16117,7 +15995,6 @@ of the corresponding request. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - @@ -16134,45 +16011,45 @@ must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attribut ```typescript await client.customers.customAttributeDefinitions.batchUpsert({ values: { - id1: { + "id1": { customerId: "N3NCVYY3WS27HF0HKANA3R9FP8", customAttribute: { key: "favoritemovie", - value: "Dune", - }, + value: "Dune" + } }, - id2: { + "id2": { customerId: "SY8EMWRNDN3TQDP2H4KS1QWMMM", customAttribute: { key: "ownsmovie", - value: false, - }, + value: false + } }, - id3: { + "id3": { customerId: "SY8EMWRNDN3TQDP2H4KS1QWMMM", customAttribute: { key: "favoritemovie", - value: "Star Wars", - }, + value: "Star Wars" + } }, - id4: { + "id4": { customerId: "N3NCVYY3WS27HF0HKANA3R9FP8", customAttribute: { key: "square:a0f1505a-2aa1-490d-91a8-8d31ff181808", - value: "10.5", - }, + value: "10.5" + } }, - id5: { + "id5": { customerId: "70548QG1HN43B05G0KCZ4MMC1G", customAttribute: { key: "sq0ids-0evKIskIGaY45fCyNL66aw:backupemail", - value: "fake-email@squareup.com", - }, - }, - }, + value: "fake-email@squareup.com" + } + } + } }); -``` +``` @@ -16186,27 +16063,27 @@ await client.customers.customAttributeDefinitions.batchUpsert({
-**request:** `Square.customers.BatchUpsertCustomerCustomAttributesRequest` - +**request:** `Square.customers.BatchUpsertCustomerCustomAttributesRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ ## Customers Groups -
client.customers.groups.list({ ...params }) -> core.Page
@@ -16220,7 +16097,6 @@ await client.customers.customAttributeDefinitions.batchUpsert({
Retrieves the list of customer groups of a business. -
@@ -16237,7 +16113,7 @@ Retrieves the list of customer groups of a business. ```typescript const response = await client.customers.groups.list({ cursor: "cursor", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -16246,13 +16122,13 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.customers.groups.list({ cursor: "cursor", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -16266,21 +16142,22 @@ while (page.hasNextPage()) {
-**request:** `Square.customers.ListGroupsRequest` - +**request:** `Square.customers.ListGroupsRequest` +
-**requestOptions:** `Groups.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
+
@@ -16300,7 +16177,6 @@ while (page.hasNextPage()) { Creates a new customer group for a business. The request must include the `name` value of the group. - @@ -16317,11 +16193,11 @@ The request must include the `name` value of the group. ```typescript await client.customers.groups.create({ group: { - name: "Loyal Customers", - }, + name: "Loyal Customers" + } }); -``` +``` @@ -16335,21 +16211,22 @@ await client.customers.groups.create({
-**request:** `Square.customers.CreateCustomerGroupRequest` - +**request:** `Square.customers.CreateCustomerGroupRequest` +
-**requestOptions:** `Groups.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
+ @@ -16367,7 +16244,6 @@ await client.customers.groups.create({
Retrieves a specific customer group as identified by the `group_id` value. -
@@ -16383,10 +16259,10 @@ Retrieves a specific customer group as identified by the `group_id` value. ```typescript await client.customers.groups.get({ - groupId: "group_id", + groupId: "group_id" }); -``` +``` @@ -16400,21 +16276,22 @@ await client.customers.groups.get({
-**request:** `Square.customers.GetGroupsRequest` - +**request:** `Square.customers.GetGroupsRequest` +
-**requestOptions:** `Groups.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
+ @@ -16432,7 +16309,6 @@ await client.customers.groups.get({
Updates a customer group as identified by the `group_id` value. -
@@ -16450,11 +16326,11 @@ Updates a customer group as identified by the `group_id` value. await client.customers.groups.update({ groupId: "group_id", group: { - name: "Loyal Customers", - }, + name: "Loyal Customers" + } }); -``` +``` @@ -16468,21 +16344,22 @@ await client.customers.groups.update({
-**request:** `Square.customers.UpdateCustomerGroupRequest` - +**request:** `Square.customers.UpdateCustomerGroupRequest` +
-**requestOptions:** `Groups.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
+ @@ -16500,7 +16377,6 @@ await client.customers.groups.update({
Deletes a customer group as identified by the `group_id` value. -
@@ -16516,10 +16392,10 @@ Deletes a customer group as identified by the `group_id` value. ```typescript await client.customers.groups.delete({ - groupId: "group_id", + groupId: "group_id" }); -``` +``` @@ -16533,21 +16409,22 @@ await client.customers.groups.delete({
-**request:** `Square.customers.DeleteGroupsRequest` - +**request:** `Square.customers.DeleteGroupsRequest` +
-**requestOptions:** `Groups.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
+ @@ -16568,7 +16445,6 @@ Adds a group membership to a customer. The customer is identified by the `customer_id` value and the customer group is identified by the `group_id` value. - @@ -16585,10 +16461,10 @@ and the customer group is identified by the `group_id` value. ```typescript await client.customers.groups.add({ customerId: "customer_id", - groupId: "group_id", + groupId: "group_id" }); -``` +``` @@ -16602,21 +16478,22 @@ await client.customers.groups.add({
-**request:** `Square.customers.AddGroupsRequest` - +**request:** `Square.customers.AddGroupsRequest` +
-**requestOptions:** `Groups.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
+ @@ -16637,7 +16514,6 @@ Removes a group membership from a customer. The customer is identified by the `customer_id` value and the customer group is identified by the `group_id` value. - @@ -16654,10 +16530,10 @@ and the customer group is identified by the `group_id` value. ```typescript await client.customers.groups.remove({ customerId: "customer_id", - groupId: "group_id", + groupId: "group_id" }); -``` +``` @@ -16671,27 +16547,27 @@ await client.customers.groups.remove({
-**request:** `Square.customers.RemoveGroupsRequest` - +**request:** `Square.customers.RemoveGroupsRequest` +
-**requestOptions:** `Groups.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
+ ## Customers Segments -
client.customers.segments.list({ ...params }) -> core.Page
@@ -16705,7 +16581,6 @@ await client.customers.groups.remove({
Retrieves the list of customer segments of a business. -
@@ -16722,7 +16597,7 @@ Retrieves the list of customer segments of a business. ```typescript const response = await client.customers.segments.list({ cursor: "cursor", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -16731,13 +16606,13 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.customers.segments.list({ cursor: "cursor", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -16751,21 +16626,22 @@ while (page.hasNextPage()) {
-**request:** `Square.customers.ListSegmentsRequest` - +**request:** `Square.customers.ListSegmentsRequest` +
-**requestOptions:** `Segments.RequestOptions` - +**requestOptions:** `Segments.RequestOptions` +
+
@@ -16783,7 +16659,6 @@ while (page.hasNextPage()) {
Retrieves a specific customer segment as identified by the `segment_id` value. -
@@ -16799,10 +16674,10 @@ Retrieves a specific customer segment as identified by the `segment_id` value. ```typescript await client.customers.segments.get({ - segmentId: "segment_id", + segmentId: "segment_id" }); -``` +``` @@ -16816,27 +16691,27 @@ await client.customers.segments.get({
-**request:** `Square.customers.GetSegmentsRequest` - +**request:** `Square.customers.GetSegmentsRequest` +
-**requestOptions:** `Segments.RequestOptions` - +**requestOptions:** `Segments.RequestOptions` +
+ ## Customers Cards -
client.customers.cards.create({ ...params }) -> Square.CreateCustomerCardResponse
@@ -16854,7 +16729,6 @@ Adds a card on file to an existing customer. As with charges, calls to `CreateCustomerCard` are idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the _first_ call. -
@@ -16878,12 +16752,12 @@ await client.customers.cards.create({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US", + country: "US" }, - cardholderName: "Amelia Earhart", + cardholderName: "Amelia Earhart" }); -``` +``` @@ -16897,21 +16771,22 @@ await client.customers.cards.create({
-**request:** `Square.customers.CreateCustomerCardRequest` - +**request:** `Square.customers.CreateCustomerCardRequest` +
-**requestOptions:** `Cards.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
+
@@ -16929,7 +16804,6 @@ await client.customers.cards.create({
Removes a card on file from a customer. -
@@ -16946,10 +16820,10 @@ Removes a card on file from a customer. ```typescript await client.customers.cards.delete({ customerId: "customer_id", - cardId: "card_id", + cardId: "card_id" }); -``` +``` @@ -16963,27 +16837,27 @@ await client.customers.cards.delete({
-**request:** `Square.customers.DeleteCardsRequest` - +**request:** `Square.customers.DeleteCardsRequest` +
-**requestOptions:** `Cards.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
+ ## Customers CustomAttributes -
client.customers.customAttributes.list({ ...params }) -> core.Page
@@ -17004,7 +16878,6 @@ in the same call. When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. -
@@ -17023,7 +16896,7 @@ const response = await client.customers.customAttributes.list({ customerId: "customer_id", limit: 1, cursor: "cursor", - withDefinitions: true, + withDefinitions: true }); for await (const item of response) { console.log(item); @@ -17034,13 +16907,13 @@ let page = await client.customers.customAttributes.list({ customerId: "customer_id", limit: 1, cursor: "cursor", - withDefinitions: true, + withDefinitions: true }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -17054,21 +16927,22 @@ while (page.hasNextPage()) {
-**request:** `Square.customers.ListCustomAttributesRequest` - +**request:** `Square.customers.ListCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+
@@ -17093,7 +16967,6 @@ in the same call. To retrieve a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - @@ -17112,10 +16985,10 @@ await client.customers.customAttributes.get({ customerId: "customer_id", key: "key", withDefinition: true, - version: 1, + version: 1 }); -``` +``` @@ -17129,21 +17002,22 @@ await client.customers.customAttributes.get({
-**request:** `Square.customers.GetCustomAttributesRequest` - +**request:** `Square.customers.GetCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -17169,7 +17043,6 @@ is created using the [CreateCustomerCustomAttributeDefinition](api-endpoint:Cust To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - @@ -17188,11 +17061,11 @@ await client.customers.customAttributes.upsert({ customerId: "customer_id", key: "key", customAttribute: { - value: "Dune", - }, + value: "Dune" + } }); -``` +``` @@ -17206,21 +17079,22 @@ await client.customers.customAttributes.upsert({
-**request:** `Square.customers.UpsertCustomerCustomAttributeRequest` - +**request:** `Square.customers.UpsertCustomerCustomAttributeRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -17242,7 +17116,6 @@ Deletes a [custom attribute](entity:CustomAttribute) associated with a customer To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - @@ -17259,10 +17132,10 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.customers.customAttributes.delete({ customerId: "customer_id", - key: "key", + key: "key" }); -``` +``` @@ -17276,27 +17149,27 @@ await client.customers.customAttributes.delete({
-**request:** `Square.customers.DeleteCustomAttributesRequest` - +**request:** `Square.customers.DeleteCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ ## Devices Codes -
client.devices.codes.list({ ...params }) -> core.Page
@@ -17310,7 +17183,6 @@ await client.customers.customAttributes.delete({
Lists all DeviceCodes associated with the merchant. -
@@ -17329,7 +17201,7 @@ const response = await client.devices.codes.list({ cursor: "cursor", locationId: "location_id", productType: "TERMINAL_API", - status: "UNKNOWN", + status: "UNKNOWN" }); for await (const item of response) { console.log(item); @@ -17340,13 +17212,13 @@ let page = await client.devices.codes.list({ cursor: "cursor", locationId: "location_id", productType: "TERMINAL_API", - status: "UNKNOWN", + status: "UNKNOWN" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -17360,21 +17232,22 @@ while (page.hasNextPage()) {
-**request:** `Square.devices.ListCodesRequest` - +**request:** `Square.devices.ListCodesRequest` +
-**requestOptions:** `Codes.RequestOptions` - +**requestOptions:** `Codes.RequestOptions` +
+
@@ -17393,7 +17266,6 @@ while (page.hasNextPage()) { Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected terminal mode. - @@ -17413,11 +17285,11 @@ await client.devices.codes.create({ deviceCode: { name: "Counter 1", productType: "TERMINAL_API", - locationId: "B5E4484SHHNYH", - }, + locationId: "B5E4484SHHNYH" + } }); -``` +``` @@ -17431,21 +17303,22 @@ await client.devices.codes.create({
-**request:** `Square.devices.CreateDeviceCodeRequest` - +**request:** `Square.devices.CreateDeviceCodeRequest` +
-**requestOptions:** `Codes.RequestOptions` - +**requestOptions:** `Codes.RequestOptions` +
+ @@ -17463,7 +17336,6 @@ await client.devices.codes.create({
Retrieves DeviceCode with the associated ID. -
@@ -17479,10 +17351,10 @@ Retrieves DeviceCode with the associated ID. ```typescript await client.devices.codes.get({ - id: "id", + id: "id" }); -``` +``` @@ -17496,27 +17368,27 @@ await client.devices.codes.get({
-**request:** `Square.devices.GetCodesRequest` - +**request:** `Square.devices.GetCodesRequest` +
-**requestOptions:** `Codes.RequestOptions` - +**requestOptions:** `Codes.RequestOptions` +
+ ## Disputes Evidence -
client.disputes.evidence.list({ ...params }) -> core.Page
@@ -17530,7 +17402,6 @@ await client.devices.codes.get({
Returns a list of evidence associated with a dispute. -
@@ -17547,7 +17418,7 @@ Returns a list of evidence associated with a dispute. ```typescript const response = await client.disputes.evidence.list({ disputeId: "dispute_id", - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -17556,13 +17427,13 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.disputes.evidence.list({ disputeId: "dispute_id", - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -17576,21 +17447,22 @@ while (page.hasNextPage()) {
-**request:** `Square.disputes.ListEvidenceRequest` - +**request:** `Square.disputes.ListEvidenceRequest` +
-**requestOptions:** `Evidence.RequestOptions` - +**requestOptions:** `Evidence.RequestOptions` +
+
@@ -17610,7 +17482,6 @@ while (page.hasNextPage()) { Returns the metadata for the evidence specified in the request URL path. You must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it. - @@ -17627,10 +17498,10 @@ You must maintain a copy of any evidence uploaded if you want to reference it la ```typescript await client.disputes.evidence.get({ disputeId: "dispute_id", - evidenceId: "evidence_id", + evidenceId: "evidence_id" }); -``` +``` @@ -17644,21 +17515,22 @@ await client.disputes.evidence.get({
-**request:** `Square.disputes.GetEvidenceRequest` - +**request:** `Square.disputes.GetEvidenceRequest` +
-**requestOptions:** `Evidence.RequestOptions` - +**requestOptions:** `Evidence.RequestOptions` +
+ @@ -17677,7 +17549,6 @@ await client.disputes.evidence.get({ Removes specified evidence from a dispute. Square does not send the bank any evidence that is removed. - @@ -17694,10 +17565,10 @@ Square does not send the bank any evidence that is removed. ```typescript await client.disputes.evidence.delete({ disputeId: "dispute_id", - evidenceId: "evidence_id", + evidenceId: "evidence_id" }); -``` +``` @@ -17711,27 +17582,27 @@ await client.disputes.evidence.delete({
-**request:** `Square.disputes.DeleteEvidenceRequest` - +**request:** `Square.disputes.DeleteEvidenceRequest` +
-**requestOptions:** `Evidence.RequestOptions` - +**requestOptions:** `Evidence.RequestOptions` +
+ ## GiftCards Activities -
client.giftCards.activities.list({ ...params }) -> core.Page
@@ -17748,7 +17619,6 @@ Lists gift card activities. By default, you get gift card activities for all gift cards in the seller's account. You can optionally specify query parameters to filter the list. For example, you can get a list of gift card activities for a gift card, for all gift cards in a specific region, or for activities within a time window. -
@@ -17771,7 +17641,7 @@ const response = await client.giftCards.activities.list({ endTime: "end_time", limit: 1, cursor: "cursor", - sortOrder: "sort_order", + sortOrder: "sort_order" }); for await (const item of response) { console.log(item); @@ -17786,13 +17656,13 @@ let page = await client.giftCards.activities.list({ endTime: "end_time", limit: 1, cursor: "cursor", - sortOrder: "sort_order", + sortOrder: "sort_order" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -17806,21 +17676,22 @@ while (page.hasNextPage()) {
-**request:** `Square.giftCards.ListActivitiesRequest` - +**request:** `Square.giftCards.ListActivitiesRequest` +
-**requestOptions:** `Activities.RequestOptions` - +**requestOptions:** `Activities.RequestOptions` +
+
@@ -17839,7 +17710,6 @@ while (page.hasNextPage()) { Creates a gift card activity to manage the balance or state of a [gift card](entity:GiftCard). For example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use. - @@ -17862,12 +17732,12 @@ await client.giftCards.activities.create({ giftCardId: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", activateActivityDetails: { orderId: "jJNGHm4gLI6XkFbwtiSLqK72KkAZY", - lineItemUid: "eIWl7X0nMuO9Ewbh0ChIx", - }, - }, + lineItemUid: "eIWl7X0nMuO9Ewbh0ChIx" + } + } }); -``` +``` @@ -17881,27 +17751,27 @@ await client.giftCards.activities.create({
-**request:** `Square.giftCards.CreateGiftCardActivityRequest` - +**request:** `Square.giftCards.CreateGiftCardActivityRequest` +
-**requestOptions:** `Activities.RequestOptions` - +**requestOptions:** `Activities.RequestOptions` +
+ ## Labor BreakTypes -
client.labor.breakTypes.list({ ...params }) -> core.Page
@@ -17915,7 +17785,6 @@ await client.giftCards.activities.create({
Returns a paginated list of `BreakType` instances for a business. -
@@ -17933,7 +17802,7 @@ Returns a paginated list of `BreakType` instances for a business. const response = await client.labor.breakTypes.list({ locationId: "location_id", limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -17943,13 +17812,13 @@ for await (const item of response) { let page = await client.labor.breakTypes.list({ locationId: "location_id", limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -17963,21 +17832,22 @@ while (page.hasNextPage()) {
-**request:** `Square.labor.ListBreakTypesRequest` - +**request:** `Square.labor.ListBreakTypesRequest` +
-**requestOptions:** `BreakTypes.RequestOptions` - +**requestOptions:** `BreakTypes.RequestOptions` +
+
@@ -18008,7 +17878,6 @@ endpoint: You can only have three `BreakType` instances per location. If you attempt to add a fourth `BreakType` for a location, an `INVALID_REQUEST_ERROR` "Exceeded limit of 3 breaks per location." is returned. - @@ -18029,11 +17898,11 @@ await client.labor.breakTypes.create({ locationId: "CGJN03P1D08GF", breakName: "Lunch Break", expectedDuration: "PT30M", - isPaid: true, - }, + isPaid: true + } }); -``` +``` @@ -18047,21 +17916,22 @@ await client.labor.breakTypes.create({
-**request:** `Square.labor.CreateBreakTypeRequest` - +**request:** `Square.labor.CreateBreakTypeRequest` +
-**requestOptions:** `BreakTypes.RequestOptions` - +**requestOptions:** `BreakTypes.RequestOptions` +
+ @@ -18079,7 +17949,6 @@ await client.labor.breakTypes.create({
Returns a single `BreakType` specified by `id`. -
@@ -18095,10 +17964,10 @@ Returns a single `BreakType` specified by `id`. ```typescript await client.labor.breakTypes.get({ - id: "id", + id: "id" }); -``` +``` @@ -18112,21 +17981,22 @@ await client.labor.breakTypes.get({
-**request:** `Square.labor.GetBreakTypesRequest` - +**request:** `Square.labor.GetBreakTypesRequest` +
-**requestOptions:** `BreakTypes.RequestOptions` - +**requestOptions:** `BreakTypes.RequestOptions` +
+ @@ -18144,7 +18014,6 @@ await client.labor.breakTypes.get({
Updates an existing `BreakType`. -
@@ -18166,11 +18035,11 @@ await client.labor.breakTypes.update({ breakName: "Lunch", expectedDuration: "PT50M", isPaid: true, - version: 1, - }, + version: 1 + } }); -``` +``` @@ -18184,21 +18053,22 @@ await client.labor.breakTypes.update({
-**request:** `Square.labor.UpdateBreakTypeRequest` - +**request:** `Square.labor.UpdateBreakTypeRequest` +
-**requestOptions:** `BreakTypes.RequestOptions` - +**requestOptions:** `BreakTypes.RequestOptions` +
+ @@ -18218,7 +18088,6 @@ await client.labor.breakTypes.update({ Deletes an existing `BreakType`. A `BreakType` can be deleted even if it is referenced from a `Shift`. - @@ -18234,10 +18103,10 @@ A `BreakType` can be deleted even if it is referenced from a `Shift`. ```typescript await client.labor.breakTypes.delete({ - id: "id", + id: "id" }); -``` +``` @@ -18251,27 +18120,27 @@ await client.labor.breakTypes.delete({
-**request:** `Square.labor.DeleteBreakTypesRequest` - +**request:** `Square.labor.DeleteBreakTypesRequest` +
-**requestOptions:** `BreakTypes.RequestOptions` - +**requestOptions:** `BreakTypes.RequestOptions` +
+ ## Labor EmployeeWages -
client.labor.employeeWages.list({ ...params }) -> core.Page
@@ -18285,7 +18154,6 @@ await client.labor.breakTypes.delete({
Returns a paginated list of `EmployeeWage` instances for a business. -
@@ -18303,7 +18171,7 @@ Returns a paginated list of `EmployeeWage` instances for a business. const response = await client.labor.employeeWages.list({ employeeId: "employee_id", limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -18313,13 +18181,13 @@ for await (const item of response) { let page = await client.labor.employeeWages.list({ employeeId: "employee_id", limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -18333,21 +18201,22 @@ while (page.hasNextPage()) {
-**request:** `Square.labor.ListEmployeeWagesRequest` - +**request:** `Square.labor.ListEmployeeWagesRequest` +
-**requestOptions:** `EmployeeWages.RequestOptions` - +**requestOptions:** `EmployeeWages.RequestOptions` +
+
@@ -18365,7 +18234,6 @@ while (page.hasNextPage()) {
Returns a single `EmployeeWage` specified by `id`. -
@@ -18381,10 +18249,10 @@ Returns a single `EmployeeWage` specified by `id`. ```typescript await client.labor.employeeWages.get({ - id: "id", + id: "id" }); -``` +``` @@ -18398,27 +18266,27 @@ await client.labor.employeeWages.get({
-**request:** `Square.labor.GetEmployeeWagesRequest` - +**request:** `Square.labor.GetEmployeeWagesRequest` +
-**requestOptions:** `EmployeeWages.RequestOptions` - +**requestOptions:** `EmployeeWages.RequestOptions` +
+ ## Labor Shifts -
client.labor.shifts.create({ ...params }) -> Square.CreateShiftResponse
@@ -18442,18 +18310,17 @@ endpoint: - `start_at` An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: - - The `status` of the new `Shift` is `OPEN` and the team member has another - shift with an `OPEN` status. +shift with an `OPEN` status. - The `start_at` date is in the future. - The `start_at` or `end_at` date overlaps another shift for the same team member. - The `Break` instances are set in the request and a break `start_at` is before the `Shift.start_at`, a break `end_at` is after the `Shift.end_at`, or both. -
-
- - + + + + #### 🔌 Usage @@ -18474,29 +18341,27 @@ await client.labor.shifts.create({ title: "Barista", hourlyRate: { amount: BigInt("1100"), - currency: "USD", + currency: "USD" }, - tipEligible: true, + tipEligible: true }, - breaks: [ - { + breaks: [{ startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", - isPaid: true, - }, - ], + isPaid: true + }], teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), - currency: "USD", - }, - }, + currency: "USD" + } + } }); -``` +``` @@ -18510,21 +18375,22 @@ await client.labor.shifts.create({
-**request:** `Square.labor.CreateShiftRequest` - +**request:** `Square.labor.CreateShiftRequest` +
-**requestOptions:** `Shifts.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
+
@@ -18543,7 +18409,6 @@ await client.labor.shifts.create({ Returns a paginated list of `Shift` records for a business. The list to be returned can be filtered by: - - Location IDs - Team member IDs - Shift status (`OPEN` or `CLOSED`) @@ -18552,15 +18417,14 @@ The list to be returned can be filtered by: - Workday details The list can be sorted by: - - `START_AT` - `END_AT` - `CREATED_AT` - `UPDATED_AT` - - - - + + + + #### 🔌 Usage @@ -18577,17 +18441,17 @@ await client.labor.shifts.search({ workday: { dateRange: { startDate: "2019-01-20", - endDate: "2019-02-03", + endDate: "2019-02-03" }, matchShiftsBy: "START_AT", - defaultTimezone: "America/Los_Angeles", - }, - }, + defaultTimezone: "America/Los_Angeles" + } + } }, - limit: 100, + limit: 100 }); -``` +``` @@ -18601,21 +18465,22 @@ await client.labor.shifts.search({
-**request:** `Square.labor.SearchShiftsRequest` - +**request:** `Square.labor.SearchShiftsRequest` +
-**requestOptions:** `Shifts.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
+ @@ -18633,7 +18498,6 @@ await client.labor.shifts.search({
Returns a single `Shift` specified by `id`. -
@@ -18649,10 +18513,10 @@ Returns a single `Shift` specified by `id`. ```typescript await client.labor.shifts.get({ - id: "id", + id: "id" }); -``` +``` @@ -18666,21 +18530,22 @@ await client.labor.shifts.get({
-**request:** `Square.labor.GetShiftsRequest` - +**request:** `Square.labor.GetShiftsRequest` +
-**requestOptions:** `Shifts.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
+ @@ -18704,7 +18569,6 @@ the `end_at` property set to a valid RFC-3339 datetime string. When closing a `Shift`, all `Break` instances in the `Shift` must be complete with `end_at` set on each `Break`. - @@ -18729,31 +18593,29 @@ await client.labor.shifts.update({ title: "Bartender", hourlyRate: { amount: BigInt("1500"), - currency: "USD", + currency: "USD" }, - tipEligible: true, + tipEligible: true }, - breaks: [ - { + breaks: [{ id: "X7GAQYVVRRG6P", startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", - isPaid: true, - }, - ], + isPaid: true + }], version: 1, teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), - currency: "USD", - }, - }, + currency: "USD" + } + } }); -``` +``` @@ -18767,21 +18629,22 @@ await client.labor.shifts.update({
-**request:** `Square.labor.UpdateShiftRequest` - +**request:** `Square.labor.UpdateShiftRequest` +
-**requestOptions:** `Shifts.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
+ @@ -18799,7 +18662,6 @@ await client.labor.shifts.update({
Deletes a `Shift`. -
@@ -18815,10 +18677,10 @@ Deletes a `Shift`. ```typescript await client.labor.shifts.delete({ - id: "id", + id: "id" }); -``` +``` @@ -18832,27 +18694,27 @@ await client.labor.shifts.delete({
-**request:** `Square.labor.DeleteShiftsRequest` - +**request:** `Square.labor.DeleteShiftsRequest` +
-**requestOptions:** `Shifts.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
+ ## Labor TeamMemberWages -
client.labor.teamMemberWages.list({ ...params }) -> core.Page
@@ -18866,7 +18728,6 @@ await client.labor.shifts.delete({
Returns a paginated list of `TeamMemberWage` instances for a business. -
@@ -18884,7 +18745,7 @@ Returns a paginated list of `TeamMemberWage` instances for a business. const response = await client.labor.teamMemberWages.list({ teamMemberId: "team_member_id", limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -18894,13 +18755,13 @@ for await (const item of response) { let page = await client.labor.teamMemberWages.list({ teamMemberId: "team_member_id", limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -18914,21 +18775,22 @@ while (page.hasNextPage()) {
-**request:** `Square.labor.ListTeamMemberWagesRequest` - +**request:** `Square.labor.ListTeamMemberWagesRequest` +
-**requestOptions:** `TeamMemberWages.RequestOptions` - +**requestOptions:** `TeamMemberWages.RequestOptions` +
+
@@ -18946,7 +18808,6 @@ while (page.hasNextPage()) {
Returns a single `TeamMemberWage` specified by `id`. -
@@ -18962,10 +18823,10 @@ Returns a single `TeamMemberWage` specified by `id`. ```typescript await client.labor.teamMemberWages.get({ - id: "id", + id: "id" }); -``` +``` @@ -18979,27 +18840,27 @@ await client.labor.teamMemberWages.get({
-**request:** `Square.labor.GetTeamMemberWagesRequest` - +**request:** `Square.labor.GetTeamMemberWagesRequest` +
-**requestOptions:** `TeamMemberWages.RequestOptions` - +**requestOptions:** `TeamMemberWages.RequestOptions` +
+ ## Labor WorkweekConfigs -
client.labor.workweekConfigs.list({ ...params }) -> core.Page
@@ -19013,7 +18874,6 @@ await client.labor.teamMemberWages.get({
Returns a list of `WorkweekConfig` instances for a business. -
@@ -19030,7 +18890,7 @@ Returns a list of `WorkweekConfig` instances for a business. ```typescript const response = await client.labor.workweekConfigs.list({ limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -19039,13 +18899,13 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.labor.workweekConfigs.list({ limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -19059,21 +18919,22 @@ while (page.hasNextPage()) {
-**request:** `Square.labor.ListWorkweekConfigsRequest` - +**request:** `Square.labor.ListWorkweekConfigsRequest` +
-**requestOptions:** `WorkweekConfigs.RequestOptions` - +**requestOptions:** `WorkweekConfigs.RequestOptions` +
+
@@ -19091,7 +18952,6 @@ while (page.hasNextPage()) {
Updates a `WorkweekConfig`. -
@@ -19111,11 +18971,11 @@ await client.labor.workweekConfigs.get({ workweekConfig: { startOfWeek: "MON", startOfDayLocalTime: "10:00", - version: 10, - }, + version: 10 + } }); -``` +``` @@ -19129,27 +18989,27 @@ await client.labor.workweekConfigs.get({
-**request:** `Square.labor.UpdateWorkweekConfigRequest` - +**request:** `Square.labor.UpdateWorkweekConfigRequest` +
-**requestOptions:** `WorkweekConfigs.RequestOptions` - +**requestOptions:** `WorkweekConfigs.RequestOptions` +
+ ## Locations CustomAttributeDefinitions -
client.locations.customAttributeDefinitions.list({ ...params }) -> core.Page
@@ -19166,7 +19026,6 @@ Lists the location-related [custom attribute definitions](entity:CustomAttribute When all response pages are retrieved, the results include all custom attribute definitions that are visible to the requesting application, including those that are created by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. -
@@ -19184,7 +19043,7 @@ applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` const response = await client.locations.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -19194,13 +19053,13 @@ for await (const item of response) { let page = await client.locations.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -19214,21 +19073,22 @@ while (page.hasNextPage()) {
-**request:** `Square.locations.ListCustomAttributeDefinitionsRequest` - +**request:** `Square.locations.ListCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+
@@ -19252,7 +19112,6 @@ for a custom attribute. After the definition is created, you can call [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) or [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) to set the custom attribute for locations. - @@ -19271,15 +19130,15 @@ await client.locations.customAttributeDefinitions.create({ customAttributeDefinition: { key: "bestseller", schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" }, name: "Bestseller", description: "Bestselling item at location", - visibility: "VISIBILITY_READ_WRITE_VALUES", - }, + visibility: "VISIBILITY_READ_WRITE_VALUES" + } }); -``` +``` @@ -19293,21 +19152,22 @@ await client.locations.customAttributeDefinitions.create({
-**request:** `Square.locations.CreateLocationCustomAttributeDefinitionRequest` - +**request:** `Square.locations.CreateLocationCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -19327,7 +19187,6 @@ await client.locations.customAttributeDefinitions.create({ Retrieves a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. To retrieve a custom attribute definition created by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - @@ -19344,10 +19203,10 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. ```typescript await client.locations.customAttributeDefinitions.get({ key: "key", - version: 1, + version: 1 }); -``` +``` @@ -19361,21 +19220,22 @@ await client.locations.customAttributeDefinitions.get({
-**request:** `Square.locations.GetCustomAttributeDefinitionsRequest` - +**request:** `Square.locations.GetCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -19396,7 +19256,6 @@ Updates a location-related [custom attribute definition](entity:CustomAttributeD Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the `schema` for a `Selection` data type. Only the definition owner can update a custom attribute definition. - @@ -19415,11 +19274,11 @@ await client.locations.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: { description: "Update the description as desired.", - visibility: "VISIBILITY_READ_ONLY", - }, + visibility: "VISIBILITY_READ_ONLY" + } }); -``` +``` @@ -19433,21 +19292,22 @@ await client.locations.customAttributeDefinitions.update({
-**request:** `Square.locations.UpdateLocationCustomAttributeDefinitionRequest` - +**request:** `Square.locations.UpdateLocationCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -19468,7 +19328,6 @@ Deletes a location-related [custom attribute definition](entity:CustomAttributeD Deleting a custom attribute definition also deletes the corresponding custom attribute from all locations. Only the definition owner can delete a custom attribute definition. - @@ -19484,10 +19343,10 @@ Only the definition owner can delete a custom attribute definition. ```typescript await client.locations.customAttributeDefinitions.delete({ - key: "key", + key: "key" }); -``` +``` @@ -19501,27 +19360,27 @@ await client.locations.customAttributeDefinitions.delete({
-**request:** `Square.locations.DeleteCustomAttributeDefinitionsRequest` - +**request:** `Square.locations.DeleteCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ ## Locations CustomAttributes -
client.locations.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteLocationCustomAttributesResponse
@@ -19537,7 +19396,6 @@ await client.locations.customAttributeDefinitions.delete({ Deletes [custom attributes](entity:CustomAttribute) for locations as a bulk operation. To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. -
@@ -19554,19 +19412,19 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.locations.customAttributes.batchDelete({ values: { - id1: { - key: "bestseller", + "id1": { + key: "bestseller" }, - id2: { - key: "bestseller", + "id2": { + key: "bestseller" }, - id3: { - key: "phone-number", - }, - }, + "id3": { + key: "phone-number" + } + } }); -``` +``` @@ -19580,21 +19438,22 @@ await client.locations.customAttributes.batchDelete({
-**request:** `Square.locations.BulkDeleteLocationCustomAttributesRequest` - +**request:** `Square.locations.BulkDeleteLocationCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+
@@ -19621,7 +19480,6 @@ and provides a location ID and custom attribute. Each upsert response is returne of the corresponding request. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. - @@ -19638,31 +19496,31 @@ must be `VISIBILITY_READ_WRITE_VALUES`. ```typescript await client.locations.customAttributes.batchUpsert({ values: { - id1: { + "id1": { locationId: "L0TBCBTB7P8RQ", customAttribute: { key: "bestseller", - value: "hot cocoa", - }, + value: "hot cocoa" + } }, - id2: { + "id2": { locationId: "L9XMD04V3STJX", customAttribute: { key: "bestseller", - value: "berry smoothie", - }, + value: "berry smoothie" + } }, - id3: { + "id3": { locationId: "L0TBCBTB7P8RQ", customAttribute: { key: "phone-number", - value: "+12223334444", - }, - }, - }, + value: "+12223334444" + } + } + } }); -``` +``` @@ -19676,21 +19534,22 @@ await client.locations.customAttributes.batchUpsert({
-**request:** `Square.locations.BulkUpsertLocationCustomAttributesRequest` - +**request:** `Square.locations.BulkUpsertLocationCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -19713,7 +19572,6 @@ in the same call. When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - @@ -19733,7 +19591,7 @@ const response = await client.locations.customAttributes.list({ visibilityFilter: "ALL", limit: 1, cursor: "cursor", - withDefinitions: true, + withDefinitions: true }); for await (const item of response) { console.log(item); @@ -19745,13 +19603,13 @@ let page = await client.locations.customAttributes.list({ visibilityFilter: "ALL", limit: 1, cursor: "cursor", - withDefinitions: true, + withDefinitions: true }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -19765,21 +19623,22 @@ while (page.hasNextPage()) {
-**request:** `Square.locations.ListCustomAttributesRequest` - +**request:** `Square.locations.ListCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -19801,7 +19660,6 @@ You can use the `with_definition` query parameter to also retrieve the custom at in the same call. To retrieve a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - @@ -19820,10 +19678,10 @@ await client.locations.customAttributes.get({ locationId: "location_id", key: "key", withDefinition: true, - version: 1, + version: 1 }); -``` +``` @@ -19837,21 +19695,22 @@ await client.locations.customAttributes.get({
-**request:** `Square.locations.GetCustomAttributesRequest` - +**request:** `Square.locations.GetCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -19874,7 +19733,6 @@ A custom attribute is based on a custom attribute definition in a Square seller is created using the [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) endpoint. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. - @@ -19893,11 +19751,11 @@ await client.locations.customAttributes.upsert({ locationId: "location_id", key: "key", customAttribute: { - value: "hot cocoa", - }, + value: "hot cocoa" + } }); -``` +``` @@ -19911,21 +19769,22 @@ await client.locations.customAttributes.upsert({
-**request:** `Square.locations.UpsertLocationCustomAttributeRequest` - +**request:** `Square.locations.UpsertLocationCustomAttributeRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -19945,7 +19804,6 @@ await client.locations.customAttributes.upsert({ Deletes a [custom attribute](entity:CustomAttribute) associated with a location. To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. - @@ -19962,10 +19820,10 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.locations.customAttributes.delete({ locationId: "location_id", - key: "key", + key: "key" }); -``` +``` @@ -19979,27 +19837,27 @@ await client.locations.customAttributes.delete({
-**request:** `Square.locations.DeleteCustomAttributesRequest` - +**request:** `Square.locations.DeleteCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ ## Locations Transactions -
client.locations.transactions.list({ ...params }) -> Square.ListTransactionsResponse
@@ -20018,7 +19876,6 @@ Transactions include payment information from sales and exchanges and refund information from returns and exchanges. Max results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50 -
@@ -20038,10 +19895,10 @@ await client.locations.transactions.list({ beginTime: "begin_time", endTime: "end_time", sortOrder: "DESC", - cursor: "cursor", + cursor: "cursor" }); -``` +``` @@ -20055,21 +19912,22 @@ await client.locations.transactions.list({
-**request:** `Square.locations.ListTransactionsRequest` - +**request:** `Square.locations.ListTransactionsRequest` +
-**requestOptions:** `Transactions.RequestOptions` - +**requestOptions:** `Transactions.RequestOptions` +
+
@@ -20087,7 +19945,6 @@ await client.locations.transactions.list({
Retrieves details for a single transaction. -
@@ -20104,10 +19961,10 @@ Retrieves details for a single transaction. ```typescript await client.locations.transactions.get({ locationId: "location_id", - transactionId: "transaction_id", + transactionId: "transaction_id" }); -``` +``` @@ -20121,21 +19978,22 @@ await client.locations.transactions.get({
-**request:** `Square.locations.GetTransactionsRequest` - +**request:** `Square.locations.GetTransactionsRequest` +
-**requestOptions:** `Transactions.RequestOptions` - +**requestOptions:** `Transactions.RequestOptions` +
+ @@ -20155,9 +20013,9 @@ await client.locations.transactions.get({ Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) endpoint with a `delay_capture` value of `true`. + See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) for more information. - @@ -20174,10 +20032,10 @@ for more information. ```typescript await client.locations.transactions.capture({ locationId: "location_id", - transactionId: "transaction_id", + transactionId: "transaction_id" }); -``` +``` @@ -20191,21 +20049,22 @@ await client.locations.transactions.capture({
-**request:** `Square.locations.CaptureTransactionsRequest` - +**request:** `Square.locations.CaptureTransactionsRequest` +
-**requestOptions:** `Transactions.RequestOptions` - +**requestOptions:** `Transactions.RequestOptions` +
+ @@ -20225,9 +20084,9 @@ await client.locations.transactions.capture({ Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) endpoint with a `delay_capture` value of `true`. + See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) for more information. - @@ -20244,10 +20103,10 @@ for more information. ```typescript await client.locations.transactions.void({ locationId: "location_id", - transactionId: "transaction_id", + transactionId: "transaction_id" }); -``` +``` @@ -20261,27 +20120,27 @@ await client.locations.transactions.void({
-**request:** `Square.locations.VoidTransactionsRequest` - +**request:** `Square.locations.VoidTransactionsRequest` +
-**requestOptions:** `Transactions.RequestOptions` - +**requestOptions:** `Transactions.RequestOptions` +
+ ## Loyalty Accounts -
client.loyalty.accounts.create({ ...params }) -> Square.CreateLoyaltyAccountResponse
@@ -20295,7 +20154,6 @@ await client.locations.transactions.void({
Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and a `mapping` with the `phone_number` of the buyer. -
@@ -20314,13 +20172,13 @@ await client.loyalty.accounts.create({ loyaltyAccount: { programId: "d619f755-2d17-41f3-990d-c04ecedd64dd", mapping: { - phoneNumber: "+14155551234", - }, + phoneNumber: "+14155551234" + } }, - idempotencyKey: "ec78c477-b1c3-4899-a209-a4e71337c996", + idempotencyKey: "ec78c477-b1c3-4899-a209-a4e71337c996" }); -``` +``` @@ -20334,21 +20192,22 @@ await client.loyalty.accounts.create({
-**request:** `Square.loyalty.CreateLoyaltyAccountRequest` - +**request:** `Square.loyalty.CreateLoyaltyAccountRequest` +
-**requestOptions:** `Accounts.RequestOptions` - +**requestOptions:** `Accounts.RequestOptions` +
+
@@ -20370,7 +20229,6 @@ Searches for loyalty accounts in a loyalty program. You can search for a loyalty account using the phone number or customer ID associated with the account. To return all loyalty accounts, specify an empty `query` object or omit it entirely. Search results are sorted by `created_at` in ascending order. - @@ -20387,16 +20245,14 @@ Search results are sorted by `created_at` in ascending order. ```typescript await client.loyalty.accounts.search({ query: { - mappings: [ - { - phoneNumber: "+14155551234", - }, - ], + mappings: [{ + phoneNumber: "+14155551234" + }] }, - limit: 10, + limit: 10 }); -``` +``` @@ -20410,21 +20266,22 @@ await client.loyalty.accounts.search({
-**request:** `Square.loyalty.SearchLoyaltyAccountsRequest` - +**request:** `Square.loyalty.SearchLoyaltyAccountsRequest` +
-**requestOptions:** `Accounts.RequestOptions` - +**requestOptions:** `Accounts.RequestOptions` +
+ @@ -20442,7 +20299,6 @@ await client.loyalty.accounts.search({
Retrieves a loyalty account. -
@@ -20458,10 +20314,10 @@ Retrieves a loyalty account. ```typescript await client.loyalty.accounts.get({ - accountId: "account_id", + accountId: "account_id" }); -``` +``` @@ -20475,21 +20331,22 @@ await client.loyalty.accounts.get({
-**request:** `Square.loyalty.GetAccountsRequest` - +**request:** `Square.loyalty.GetAccountsRequest` +
-**requestOptions:** `Accounts.RequestOptions` - +**requestOptions:** `Accounts.RequestOptions` +
+ @@ -20509,21 +20366,21 @@ await client.loyalty.accounts.get({ Adds points earned from a purchase to a [loyalty account](entity:LoyaltyAccount). - If you are using the Orders API to manage orders, provide the `order_id`. Square reads the order - to compute the points earned from both the base loyalty program and an associated - [loyalty promotion](entity:LoyaltyPromotion). For purchases that qualify for multiple accrual - rules, Square computes points based on the accrual rule that grants the most points. - For purchases that qualify for multiple promotions, Square computes points based on the most - recently created promotion. A purchase must first qualify for program points to be eligible for promotion points. +to compute the points earned from both the base loyalty program and an associated +[loyalty promotion](entity:LoyaltyPromotion). For purchases that qualify for multiple accrual +rules, Square computes points based on the accrual rule that grants the most points. +For purchases that qualify for multiple promotions, Square computes points based on the most +recently created promotion. A purchase must first qualify for program points to be eligible for promotion points. - If you are not using the Orders API to manage orders, provide `points` with the number of points to add. You must first perform a client-side computation of the points earned from the loyalty program and loyalty promotion. For spend-based and visit-based programs, you can call [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) to compute the points earned from the base loyalty program. For information about computing points earned from a loyalty promotion, see [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). - - - - + + + + #### 🔌 Usage @@ -20537,13 +20394,13 @@ to compute the points earned from the base loyalty program. For information abou await client.loyalty.accounts.accumulatePoints({ accountId: "account_id", accumulatePoints: { - orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", + orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" }, idempotencyKey: "58b90739-c3e8-4b11-85f7-e636d48d72cb", - locationId: "P034NEENMD09F", + locationId: "P034NEENMD09F" }); -``` +``` @@ -20557,21 +20414,22 @@ await client.loyalty.accounts.accumulatePoints({
-**request:** `Square.loyalty.AccumulateLoyaltyPointsRequest` - +**request:** `Square.loyalty.AccumulateLoyaltyPointsRequest` +
-**requestOptions:** `Accounts.RequestOptions` - +**requestOptions:** `Accounts.RequestOptions` +
+ @@ -20593,7 +20451,6 @@ Adds points to or subtracts points from a buyer's account. Use this endpoint only when you need to manually adjust points. Otherwise, in your application flow, you call [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) to add points when a buyer pays for the purchase. - @@ -20613,11 +20470,11 @@ await client.loyalty.accounts.adjust({ idempotencyKey: "bc29a517-3dc9-450e-aa76-fae39ee849d1", adjustPoints: { points: 10, - reason: "Complimentary points", - }, + reason: "Complimentary points" + } }); -``` +``` @@ -20631,27 +20488,27 @@ await client.loyalty.accounts.adjust({
-**request:** `Square.loyalty.AdjustLoyaltyPointsRequest` - +**request:** `Square.loyalty.AdjustLoyaltyPointsRequest` +
-**requestOptions:** `Accounts.RequestOptions` - +**requestOptions:** `Accounts.RequestOptions` +
+ ## Loyalty Programs -
client.loyalty.programs.list() -> Square.ListLoyaltyProgramsResponse
@@ -20667,8 +20524,8 @@ await client.loyalty.accounts.adjust({ Returns a list of loyalty programs in the seller's account. Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). -Replaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) when used with the keyword `main`. +Replaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) when used with the keyword `main`.
@@ -20684,8 +20541,8 @@ Replaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgr ```typescript await client.loyalty.programs.list(); -``` +``` @@ -20699,13 +20556,14 @@ await client.loyalty.programs.list();
-**requestOptions:** `Programs.RequestOptions` - +**requestOptions:** `Programs.RequestOptions` +
+
@@ -20725,7 +20583,6 @@ await client.loyalty.programs.list(); Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword `main`. Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). - @@ -20741,10 +20598,10 @@ Loyalty programs define how buyers can earn points and redeem points for rewards ```typescript await client.loyalty.programs.get({ - programId: "program_id", + programId: "program_id" }); -``` +``` @@ -20758,21 +20615,22 @@ await client.loyalty.programs.get({
-**request:** `Square.loyalty.GetProgramsRequest` - +**request:** `Square.loyalty.GetProgramsRequest` +
-**requestOptions:** `Programs.RequestOptions` - +**requestOptions:** `Programs.RequestOptions` +
+ @@ -20793,8 +20651,8 @@ Calculates the number of points a buyer can earn from a purchase. Applications m to display the points to the buyer. - If you are using the Orders API to manage orders, provide the `order_id` and (optional) `loyalty_account_id`. - Square reads the order to compute the points earned from the base loyalty program and an associated - [loyalty promotion](entity:LoyaltyPromotion). +Square reads the order to compute the points earned from the base loyalty program and an associated +[loyalty promotion](entity:LoyaltyPromotion). - If you are not using the Orders API to manage orders, provide `transaction_amount_money` with the purchase amount. Square uses this amount to calculate the points earned from the base loyalty program, @@ -20804,10 +20662,10 @@ If the purchase qualifies for program points, call [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) and perform a client-side computation to calculate whether the purchase also qualifies for promotion points. For more information, see [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). - - - - + + + + #### 🔌 Usage @@ -20821,10 +20679,10 @@ to calculate whether the purchase also qualifies for promotion points. For more await client.loyalty.programs.calculate({ programId: "program_id", orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", - loyaltyAccountId: "79b807d2-d786-46a9-933b-918028d7a8c5", + loyaltyAccountId: "79b807d2-d786-46a9-933b-918028d7a8c5" }); -``` +``` @@ -20838,27 +20696,27 @@ await client.loyalty.programs.calculate({
-**request:** `Square.loyalty.CalculateLoyaltyPointsRequest` - +**request:** `Square.loyalty.CalculateLoyaltyPointsRequest` +
-**requestOptions:** `Programs.RequestOptions` - +**requestOptions:** `Programs.RequestOptions` +
+ ## Loyalty Rewards -
client.loyalty.rewards.create({ ...params }) -> Square.CreateLoyaltyRewardResponse
@@ -20874,12 +20732,11 @@ await client.loyalty.programs.calculate({ Creates a loyalty reward. In the process, the endpoint does following: - Uses the `reward_tier_id` in the request to determine the number of points - to lock for this reward. +to lock for this reward. - If the request includes `order_id`, it adds the reward and related discount to the order. After a reward is created, the points are locked and not available for the buyer to redeem another reward. -
@@ -20898,12 +20755,12 @@ await client.loyalty.rewards.create({ reward: { loyaltyAccountId: "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", rewardTierId: "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", + orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" }, - idempotencyKey: "18c2e5ea-a620-4b1f-ad60-7b167285e451", + idempotencyKey: "18c2e5ea-a620-4b1f-ad60-7b167285e451" }); -``` +``` @@ -20917,21 +20774,22 @@ await client.loyalty.rewards.create({
-**request:** `Square.loyalty.CreateLoyaltyRewardRequest` - +**request:** `Square.loyalty.CreateLoyaltyRewardRequest` +
-**requestOptions:** `Rewards.RequestOptions` - +**requestOptions:** `Rewards.RequestOptions` +
+
@@ -20949,13 +20807,12 @@ await client.loyalty.rewards.create({
Searches for loyalty rewards. This endpoint accepts a request with no query filters and returns results for all loyalty accounts. -If you include a `query` object, `loyalty_account_id` is required and `status` is optional. +If you include a `query` object, `loyalty_account_id` is required and `status` is optional. If you know a reward ID, use the [RetrieveLoyaltyReward](api-endpoint:Loyalty-RetrieveLoyaltyReward) endpoint. Search results are sorted by `updated_at` in descending order. -
@@ -20972,12 +20829,12 @@ Search results are sorted by `updated_at` in descending order. ```typescript await client.loyalty.rewards.search({ query: { - loyaltyAccountId: "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + loyaltyAccountId: "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" }, - limit: 10, + limit: 10 }); -``` +``` @@ -20991,21 +20848,22 @@ await client.loyalty.rewards.search({
-**request:** `Square.loyalty.SearchLoyaltyRewardsRequest` - +**request:** `Square.loyalty.SearchLoyaltyRewardsRequest` +
-**requestOptions:** `Rewards.RequestOptions` - +**requestOptions:** `Rewards.RequestOptions` +
+ @@ -21023,7 +20881,6 @@ await client.loyalty.rewards.search({
Retrieves a loyalty reward. -
@@ -21039,10 +20896,10 @@ Retrieves a loyalty reward. ```typescript await client.loyalty.rewards.get({ - rewardId: "reward_id", + rewardId: "reward_id" }); -``` +``` @@ -21056,21 +20913,22 @@ await client.loyalty.rewards.get({
-**request:** `Square.loyalty.GetRewardsRequest` - +**request:** `Square.loyalty.GetRewardsRequest` +
-**requestOptions:** `Rewards.RequestOptions` - +**requestOptions:** `Rewards.RequestOptions` +
+ @@ -21091,12 +20949,11 @@ Deletes a loyalty reward by doing the following: - Returns the loyalty points back to the loyalty account. - If an order ID was specified when the reward was created - (see [CreateLoyaltyReward](api-endpoint:Loyalty-CreateLoyaltyReward)), - it updates the order by removing the reward and related - discounts. +(see [CreateLoyaltyReward](api-endpoint:Loyalty-CreateLoyaltyReward)), +it updates the order by removing the reward and related +discounts. You cannot delete a reward that has reached the terminal state (REDEEMED). - @@ -21112,10 +20969,10 @@ You cannot delete a reward that has reached the terminal state (REDEEMED). ```typescript await client.loyalty.rewards.delete({ - rewardId: "reward_id", + rewardId: "reward_id" }); -``` +``` @@ -21129,21 +20986,22 @@ await client.loyalty.rewards.delete({
-**request:** `Square.loyalty.DeleteRewardsRequest` - +**request:** `Square.loyalty.DeleteRewardsRequest` +
-**requestOptions:** `Rewards.RequestOptions` - +**requestOptions:** `Rewards.RequestOptions` +
+ @@ -21171,7 +21029,6 @@ purchase. After the reward reaches the terminal state, it cannot be deleted. In other words, points used for the reward cannot be returned to the account. - @@ -21189,10 +21046,10 @@ to the account. await client.loyalty.rewards.redeem({ rewardId: "reward_id", idempotencyKey: "98adc7f7-6963-473b-b29c-f3c9cdd7d994", - locationId: "P034NEENMD09F", + locationId: "P034NEENMD09F" }); -``` +``` @@ -21206,27 +21063,27 @@ await client.loyalty.rewards.redeem({
-**request:** `Square.loyalty.RedeemLoyaltyRewardRequest` - +**request:** `Square.loyalty.RedeemLoyaltyRewardRequest` +
-**requestOptions:** `Rewards.RequestOptions` - +**requestOptions:** `Rewards.RequestOptions` +
+ ## Loyalty Programs Promotions -
client.loyalty.programs.promotions.list({ ...params }) -> core.Page
@@ -21241,7 +21098,6 @@ await client.loyalty.rewards.redeem({ Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). Results are sorted by the `created_at` date in descending order (newest to oldest). -
@@ -21260,7 +21116,7 @@ const response = await client.loyalty.programs.promotions.list({ programId: "program_id", status: "ACTIVE", cursor: "cursor", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -21271,13 +21127,13 @@ let page = await client.loyalty.programs.promotions.list({ programId: "program_id", status: "ACTIVE", cursor: "cursor", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -21291,21 +21147,22 @@ while (page.hasNextPage()) {
-**request:** `Square.loyalty.programs.ListPromotionsRequest` - +**request:** `Square.loyalty.programs.ListPromotionsRequest` +
-**requestOptions:** `Promotions.RequestOptions` - +**requestOptions:** `Promotions.RequestOptions` +
+
@@ -21328,7 +21185,6 @@ enables buyers to earn points in addition to those earned from the base loyalty This endpoint sets the loyalty promotion to the `ACTIVE` or `SCHEDULED` status, depending on the `available_time` setting. A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. - @@ -21350,28 +21206,26 @@ await client.loyalty.programs.promotions.create({ incentive: { type: "POINTS_MULTIPLIER", pointsMultiplierData: { - multiplier: "3.0", - }, + multiplier: "3.0" + } }, availableTime: { - timePeriods: [ - "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT", - ], + timePeriods: ["BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT"] }, triggerLimit: { times: 1, - interval: "DAY", + interval: "DAY" }, minimumSpendAmountMoney: { amount: BigInt("2000"), - currency: "USD", + currency: "USD" }, - qualifyingCategoryIds: ["XTQPYLR3IIU9C44VRCB3XD12"], + qualifyingCategoryIds: ["XTQPYLR3IIU9C44VRCB3XD12"] }, - idempotencyKey: "ec78c477-b1c3-4899-a209-a4e71337c996", + idempotencyKey: "ec78c477-b1c3-4899-a209-a4e71337c996" }); -``` +``` @@ -21385,21 +21239,22 @@ await client.loyalty.programs.promotions.create({
-**request:** `Square.loyalty.programs.CreateLoyaltyPromotionRequest` - +**request:** `Square.loyalty.programs.CreateLoyaltyPromotionRequest` +
-**requestOptions:** `Promotions.RequestOptions` - +**requestOptions:** `Promotions.RequestOptions` +
+ @@ -21417,7 +21272,6 @@ await client.loyalty.programs.promotions.create({
Retrieves a loyalty promotion. -
@@ -21434,10 +21288,10 @@ Retrieves a loyalty promotion. ```typescript await client.loyalty.programs.promotions.get({ programId: "program_id", - promotionId: "promotion_id", + promotionId: "promotion_id" }); -``` +``` @@ -21451,21 +21305,22 @@ await client.loyalty.programs.promotions.get({
-**request:** `Square.loyalty.programs.GetPromotionsRequest` - +**request:** `Square.loyalty.programs.GetPromotionsRequest` +
-**requestOptions:** `Promotions.RequestOptions` - +**requestOptions:** `Promotions.RequestOptions` +
+ @@ -21488,7 +21343,6 @@ Because updating a promotion is not supported, you can also use this endpoint to you create a new one. This endpoint sets the loyalty promotion to the `CANCELED` state - @@ -21505,10 +21359,10 @@ This endpoint sets the loyalty promotion to the `CANCELED` state ```typescript await client.loyalty.programs.promotions.cancel({ programId: "program_id", - promotionId: "promotion_id", + promotionId: "promotion_id" }); -``` +``` @@ -21522,27 +21376,27 @@ await client.loyalty.programs.promotions.cancel({
-**request:** `Square.loyalty.programs.CancelPromotionsRequest` - +**request:** `Square.loyalty.programs.CancelPromotionsRequest` +
-**requestOptions:** `Promotions.RequestOptions` - +**requestOptions:** `Promotions.RequestOptions` +
+ ## Merchants CustomAttributeDefinitions -
client.merchants.customAttributeDefinitions.list({ ...params }) -> core.Page
@@ -21559,7 +21413,6 @@ Lists the merchant-related [custom attribute definitions](entity:CustomAttribute When all response pages are retrieved, the results include all custom attribute definitions that are visible to the requesting application, including those that are created by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. -
@@ -21577,7 +21430,7 @@ applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES` const response = await client.merchants.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, - cursor: "cursor", + cursor: "cursor" }); for await (const item of response) { console.log(item); @@ -21587,13 +21440,13 @@ for await (const item of response) { let page = await client.merchants.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, - cursor: "cursor", + cursor: "cursor" }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -21607,21 +21460,22 @@ while (page.hasNextPage()) {
-**request:** `Square.merchants.ListCustomAttributeDefinitionsRequest` - +**request:** `Square.merchants.ListCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+
@@ -21645,7 +21499,6 @@ for a custom attribute. After the definition is created, you can call [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) or [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) to set the custom attribute for a merchant. - @@ -21664,15 +21517,15 @@ await client.merchants.customAttributeDefinitions.create({ customAttributeDefinition: { key: "alternative_seller_name", schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" }, name: "Alternative Merchant Name", description: "This is the other name this merchant goes by.", - visibility: "VISIBILITY_READ_ONLY", - }, + visibility: "VISIBILITY_READ_ONLY" + } }); -``` +``` @@ -21686,21 +21539,22 @@ await client.merchants.customAttributeDefinitions.create({
-**request:** `Square.merchants.CreateMerchantCustomAttributeDefinitionRequest` - +**request:** `Square.merchants.CreateMerchantCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -21720,7 +21574,6 @@ await client.merchants.customAttributeDefinitions.create({ Retrieves a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. To retrieve a custom attribute definition created by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - @@ -21737,10 +21590,10 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. ```typescript await client.merchants.customAttributeDefinitions.get({ key: "key", - version: 1, + version: 1 }); -``` +``` @@ -21754,21 +21607,22 @@ await client.merchants.customAttributeDefinitions.get({
-**request:** `Square.merchants.GetCustomAttributeDefinitionsRequest` - +**request:** `Square.merchants.GetCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -21789,7 +21643,6 @@ Updates a merchant-related [custom attribute definition](entity:CustomAttributeD Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the `schema` for a `Selection` data type. Only the definition owner can update a custom attribute definition. - @@ -21808,11 +21661,11 @@ await client.merchants.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: { description: "Update the description as desired.", - visibility: "VISIBILITY_READ_ONLY", - }, + visibility: "VISIBILITY_READ_ONLY" + } }); -``` +``` @@ -21826,21 +21679,22 @@ await client.merchants.customAttributeDefinitions.update({
-**request:** `Square.merchants.UpdateMerchantCustomAttributeDefinitionRequest` - +**request:** `Square.merchants.UpdateMerchantCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -21861,7 +21715,6 @@ Deletes a merchant-related [custom attribute definition](entity:CustomAttributeD Deleting a custom attribute definition also deletes the corresponding custom attribute from the merchant. Only the definition owner can delete a custom attribute definition. - @@ -21877,10 +21730,10 @@ Only the definition owner can delete a custom attribute definition. ```typescript await client.merchants.customAttributeDefinitions.delete({ - key: "key", + key: "key" }); -``` +``` @@ -21894,27 +21747,27 @@ await client.merchants.customAttributeDefinitions.delete({
-**request:** `Square.merchants.DeleteCustomAttributeDefinitionsRequest` - +**request:** `Square.merchants.DeleteCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ ## Merchants CustomAttributes -
client.merchants.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteMerchantCustomAttributesResponse
@@ -21930,7 +21783,6 @@ await client.merchants.customAttributeDefinitions.delete({ Deletes [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation. To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. -
@@ -21947,16 +21799,16 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.merchants.customAttributes.batchDelete({ values: { - id1: { - key: "alternative_seller_name", + "id1": { + key: "alternative_seller_name" }, - id2: { - key: "has_seen_tutorial", - }, - }, + "id2": { + key: "has_seen_tutorial" + } + } }); -``` +``` @@ -21970,21 +21822,22 @@ await client.merchants.customAttributes.batchDelete({
-**request:** `Square.merchants.BulkDeleteMerchantCustomAttributesRequest` - +**request:** `Square.merchants.BulkDeleteMerchantCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+
@@ -22011,7 +21864,6 @@ and provides a merchant ID and custom attribute. Each upsert response is returne of the corresponding request. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. - @@ -22028,24 +21880,24 @@ must be `VISIBILITY_READ_WRITE_VALUES`. ```typescript await client.merchants.customAttributes.batchUpsert({ values: { - id1: { + "id1": { merchantId: "DM7VKY8Q63GNP", customAttribute: { key: "alternative_seller_name", - value: "Ultimate Sneaker Store", - }, + value: "Ultimate Sneaker Store" + } }, - id2: { + "id2": { merchantId: "DM7VKY8Q63GNP", customAttribute: { key: "has_seen_tutorial", - value: true, - }, - }, - }, + value: true + } + } + } }); -``` +``` @@ -22059,21 +21911,22 @@ await client.merchants.customAttributes.batchUpsert({
-**request:** `Square.merchants.BulkUpsertMerchantCustomAttributesRequest` - +**request:** `Square.merchants.BulkUpsertMerchantCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -22096,7 +21949,6 @@ in the same call. When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - @@ -22116,7 +21968,7 @@ const response = await client.merchants.customAttributes.list({ visibilityFilter: "ALL", limit: 1, cursor: "cursor", - withDefinitions: true, + withDefinitions: true }); for await (const item of response) { console.log(item); @@ -22128,13 +21980,13 @@ let page = await client.merchants.customAttributes.list({ visibilityFilter: "ALL", limit: 1, cursor: "cursor", - withDefinitions: true, + withDefinitions: true }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -22148,21 +22000,22 @@ while (page.hasNextPage()) {
-**request:** `Square.merchants.ListCustomAttributesRequest` - +**request:** `Square.merchants.ListCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -22184,7 +22037,6 @@ You can use the `with_definition` query parameter to also retrieve the custom at in the same call. To retrieve a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - @@ -22203,10 +22055,10 @@ await client.merchants.customAttributes.get({ merchantId: "merchant_id", key: "key", withDefinition: true, - version: 1, + version: 1 }); -``` +``` @@ -22220,21 +22072,22 @@ await client.merchants.customAttributes.get({
-**request:** `Square.merchants.GetCustomAttributesRequest` - +**request:** `Square.merchants.GetCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -22257,7 +22110,6 @@ A custom attribute is based on a custom attribute definition in a Square seller is created using the [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) endpoint. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. - @@ -22276,11 +22128,11 @@ await client.merchants.customAttributes.upsert({ merchantId: "merchant_id", key: "key", customAttribute: { - value: "Ultimate Sneaker Store", - }, + value: "Ultimate Sneaker Store" + } }); -``` +``` @@ -22294,21 +22146,22 @@ await client.merchants.customAttributes.upsert({
-**request:** `Square.merchants.UpsertMerchantCustomAttributeRequest` - +**request:** `Square.merchants.UpsertMerchantCustomAttributeRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -22328,7 +22181,6 @@ await client.merchants.customAttributes.upsert({ Deletes a [custom attribute](entity:CustomAttribute) associated with a merchant. To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. - @@ -22345,10 +22197,10 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.merchants.customAttributes.delete({ merchantId: "merchant_id", - key: "key", + key: "key" }); -``` +``` @@ -22362,27 +22214,27 @@ await client.merchants.customAttributes.delete({
-**request:** `Square.merchants.DeleteCustomAttributesRequest` - +**request:** `Square.merchants.DeleteCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ ## Orders CustomAttributeDefinitions -
client.orders.customAttributeDefinitions.list({ ...params }) -> core.Page
@@ -22401,7 +22253,6 @@ When all response pages are retrieved, the results include all custom attribute that are visible to the requesting application, including those that are created by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. -
@@ -22419,7 +22270,7 @@ seller-defined custom attributes (also known as custom fields) are always set to const response = await client.orders.customAttributeDefinitions.list({ visibilityFilter: "ALL", cursor: "cursor", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -22429,13 +22280,13 @@ for await (const item of response) { let page = await client.orders.customAttributeDefinitions.list({ visibilityFilter: "ALL", cursor: "cursor", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -22449,21 +22300,22 @@ while (page.hasNextPage()) {
-**request:** `Square.orders.ListCustomAttributeDefinitionsRequest` - +**request:** `Square.orders.ListCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+
@@ -22480,12 +22332,11 @@ while (page.hasNextPage()) {
-Creates an order-related custom attribute definition. Use this endpoint to +Creates an order-related custom attribute definition. Use this endpoint to define a custom attribute that can be associated with orders. After creating a custom attribute definition, you can set the custom attribute for orders in the Square seller account. -
@@ -22504,16 +22355,16 @@ await client.orders.customAttributeDefinitions.create({ customAttributeDefinition: { key: "cover-count", schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", + "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" }, name: "Cover count", description: "The number of people seated at a table", - visibility: "VISIBILITY_READ_WRITE_VALUES", + visibility: "VISIBILITY_READ_WRITE_VALUES" }, - idempotencyKey: "IDEMPOTENCY_KEY", + idempotencyKey: "IDEMPOTENCY_KEY" }); -``` +``` @@ -22527,21 +22378,22 @@ await client.orders.customAttributeDefinitions.create({
-**request:** `Square.orders.CreateOrderCustomAttributeDefinitionRequest` - +**request:** `Square.orders.CreateOrderCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -22563,7 +22415,6 @@ Retrieves an order-related [custom attribute definition](entity:CustomAttributeD To retrieve a custom attribute definition created by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - @@ -22580,10 +22431,10 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note t ```typescript await client.orders.customAttributeDefinitions.get({ key: "key", - version: 1, + version: 1 }); -``` +``` @@ -22597,21 +22448,22 @@ await client.orders.customAttributeDefinitions.get({
-**request:** `Square.orders.GetCustomAttributeDefinitionsRequest` - +**request:** `Square.orders.GetCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -22631,7 +22483,6 @@ await client.orders.customAttributeDefinitions.get({ Updates an order-related custom attribute definition for a Square seller account. Only the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. - @@ -22651,12 +22502,12 @@ await client.orders.customAttributeDefinitions.update({ customAttributeDefinition: { key: "cover-count", visibility: "VISIBILITY_READ_ONLY", - version: 1, + version: 1 }, - idempotencyKey: "IDEMPOTENCY_KEY", + idempotencyKey: "IDEMPOTENCY_KEY" }); -``` +``` @@ -22670,21 +22521,22 @@ await client.orders.customAttributeDefinitions.update({
-**request:** `Square.orders.UpdateOrderCustomAttributeDefinitionRequest` - +**request:** `Square.orders.UpdateOrderCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ @@ -22704,7 +22556,6 @@ await client.orders.customAttributeDefinitions.update({ Deletes an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. Only the definition owner can delete a custom attribute definition. - @@ -22720,10 +22571,10 @@ Only the definition owner can delete a custom attribute definition. ```typescript await client.orders.customAttributeDefinitions.delete({ - key: "key", + key: "key" }); -``` +``` @@ -22737,27 +22588,27 @@ await client.orders.customAttributeDefinitions.delete({
-**request:** `Square.orders.DeleteCustomAttributeDefinitionsRequest` - +**request:** `Square.orders.DeleteCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitions.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
+ ## Orders CustomAttributes -
client.orders.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteOrderCustomAttributesResponse
@@ -22773,7 +22624,7 @@ await client.orders.customAttributeDefinitions.delete({ Deletes order [custom attributes](entity:CustomAttribute) as a bulk operation. Use this endpoint to delete one or more custom attributes from one or more orders. -A custom attribute is based on a custom attribute definition in a Square seller account. (To create a +A custom attribute is based on a custom attribute definition in a Square seller account. (To create a custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.) This `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual delete @@ -22784,7 +22635,6 @@ of the corresponding request. To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. -
@@ -22803,16 +22653,16 @@ await client.orders.customAttributes.batchDelete({ values: { "cover-count": { key: "cover-count", - orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F", + orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" }, "table-number": { key: "table-number", - orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F", - }, - }, + orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + } + } }); -``` +``` @@ -22826,21 +22676,22 @@ await client.orders.customAttributes.batchDelete({
-**request:** `Square.orders.BulkDeleteOrderCustomAttributesRequest` - +**request:** `Square.orders.BulkDeleteOrderCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+
@@ -22860,7 +22711,7 @@ await client.orders.customAttributes.batchDelete({ Creates or updates order [custom attributes](entity:CustomAttribute) as a bulk operation. Use this endpoint to delete one or more custom attributes from one or more orders. -A custom attribute is based on a custom attribute definition in a Square seller account. (To create a +A custom attribute is based on a custom attribute definition in a Square seller account. (To create a custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.) This `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert @@ -22871,7 +22722,6 @@ of the corresponding request. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - @@ -22892,22 +22742,22 @@ await client.orders.customAttributes.batchUpsert({ customAttribute: { key: "cover-count", value: "6", - version: 2, + version: 2 }, - orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F", + orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" }, "table-number": { customAttribute: { key: "table-number", value: "11", - version: 4, + version: 4 }, - orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F", - }, - }, + orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + } + } }); -``` +``` @@ -22921,21 +22771,22 @@ await client.orders.customAttributes.batchUpsert({
-**request:** `Square.orders.BulkUpsertOrderCustomAttributesRequest` - +**request:** `Square.orders.BulkUpsertOrderCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -22960,7 +22811,6 @@ in the same call. When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. - @@ -22980,7 +22830,7 @@ const response = await client.orders.customAttributes.list({ visibilityFilter: "ALL", cursor: "cursor", limit: 1, - withDefinitions: true, + withDefinitions: true }); for await (const item of response) { console.log(item); @@ -22992,13 +22842,13 @@ let page = await client.orders.customAttributes.list({ visibilityFilter: "ALL", cursor: "cursor", limit: 1, - withDefinitions: true, + withDefinitions: true }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -23012,21 +22862,22 @@ while (page.hasNextPage()) {
-**request:** `Square.orders.ListCustomAttributesRequest` - +**request:** `Square.orders.ListCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -23051,7 +22902,6 @@ in the same call. To retrieve a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - @@ -23070,10 +22920,10 @@ await client.orders.customAttributes.get({ orderId: "order_id", customAttributeKey: "custom_attribute_key", version: 1, - withDefinition: true, + withDefinition: true }); -``` +``` @@ -23087,21 +22937,22 @@ await client.orders.customAttributes.get({
-**request:** `Square.orders.GetCustomAttributesRequest` - +**request:** `Square.orders.GetCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -23127,7 +22978,6 @@ custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api- To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - @@ -23148,11 +22998,11 @@ await client.orders.customAttributes.upsert({ customAttribute: { key: "table-number", value: "42", - version: 1, - }, + version: 1 + } }); -``` +``` @@ -23166,21 +23016,22 @@ await client.orders.customAttributes.upsert({
-**request:** `Square.orders.UpsertOrderCustomAttributeRequest` - +**request:** `Square.orders.UpsertOrderCustomAttributeRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ @@ -23202,7 +23053,6 @@ Deletes a [custom attribute](entity:CustomAttribute) associated with a customer To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. - @@ -23219,10 +23069,10 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.orders.customAttributes.delete({ orderId: "order_id", - customAttributeKey: "custom_attribute_key", + customAttributeKey: "custom_attribute_key" }); -``` +``` @@ -23236,27 +23086,27 @@ await client.orders.customAttributes.delete({
-**request:** `Square.orders.DeleteCustomAttributesRequest` - +**request:** `Square.orders.DeleteCustomAttributesRequest` +
-**requestOptions:** `CustomAttributes.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
+ ## TeamMembers WageSetting -
client.teamMembers.wageSetting.get({ ...params }) -> Square.GetWageSettingResponse
@@ -23275,7 +23125,6 @@ by `TeamMember.id`. For more information, see Square recommends using [RetrieveTeamMember](api-endpoint:Team-RetrieveTeamMember) or [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) to get this information directly from the `TeamMember.wage_setting` field. -
@@ -23291,10 +23140,10 @@ to get this information directly from the `TeamMember.wage_setting` field. ```typescript await client.teamMembers.wageSetting.get({ - teamMemberId: "team_member_id", + teamMemberId: "team_member_id" }); -``` +``` @@ -23308,21 +23157,22 @@ await client.teamMembers.wageSetting.get({
-**request:** `Square.teamMembers.GetWageSettingRequest` - +**request:** `Square.teamMembers.GetWageSettingRequest` +
-**requestOptions:** `WageSetting.RequestOptions` - +**requestOptions:** `WageSetting.RequestOptions` +
+
@@ -23347,7 +23197,6 @@ The `WageSetting` is returned on a successful update. For more information, see Square recommends using [CreateTeamMember](api-endpoint:Team-CreateTeamMember) or [UpdateTeamMember](api-endpoint:Team-UpdateTeamMember) to manage the `TeamMember.wage_setting` field directly. - @@ -23365,30 +23214,27 @@ to manage the `TeamMember.wage_setting` field directly. await client.teamMembers.wageSetting.update({ teamMemberId: "team_member_id", wageSetting: { - jobAssignments: [ - { + jobAssignments: [{ jobTitle: "Manager", payType: "SALARY", annualRate: { amount: BigInt("3000000"), - currency: "USD", + currency: "USD" }, - weeklyHours: 40, - }, - { + weeklyHours: 40 + }, { jobTitle: "Cashier", payType: "HOURLY", hourlyRate: { amount: BigInt("2000"), - currency: "USD", - }, - }, - ], - isOvertimeExempt: true, - }, + currency: "USD" + } + }], + isOvertimeExempt: true + } }); -``` +``` @@ -23402,27 +23248,27 @@ await client.teamMembers.wageSetting.update({
-**request:** `Square.teamMembers.UpdateWageSettingRequest` - +**request:** `Square.teamMembers.UpdateWageSettingRequest` +
-**requestOptions:** `WageSetting.RequestOptions` - +**requestOptions:** `WageSetting.RequestOptions` +
+ ## Terminal Actions -
client.terminal.actions.create({ ...params }) -> Square.CreateTerminalActionResponse
@@ -23436,7 +23282,6 @@ await client.teamMembers.wageSetting.update({
Creates a Terminal action request and sends it to the specified device. -
@@ -23459,12 +23304,12 @@ await client.terminal.actions.create({ type: "SAVE_CARD", saveCardOptions: { customerId: "{{CUSTOMER_ID}}", - referenceId: "user-id-1", - }, - }, + referenceId: "user-id-1" + } + } }); -``` +``` @@ -23478,21 +23323,22 @@ await client.terminal.actions.create({
-**request:** `Square.terminal.CreateTerminalActionRequest` - +**request:** `Square.terminal.CreateTerminalActionRequest` +
-**requestOptions:** `Actions.RequestOptions` - +**requestOptions:** `Actions.RequestOptions` +
+
@@ -23510,7 +23356,6 @@ await client.terminal.actions.create({
Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days. -
@@ -23529,17 +23374,17 @@ await client.terminal.actions.search({ query: { filter: { createdAt: { - startAt: "2022-04-01T00:00:00.000Z", - }, + startAt: "2022-04-01T00:00:00.000Z" + } }, sort: { - sortOrder: "DESC", - }, + sortOrder: "DESC" + } }, - limit: 2, + limit: 2 }); -``` +``` @@ -23553,21 +23398,22 @@ await client.terminal.actions.search({
-**request:** `Square.terminal.SearchTerminalActionsRequest` - +**request:** `Square.terminal.SearchTerminalActionsRequest` +
-**requestOptions:** `Actions.RequestOptions` - +**requestOptions:** `Actions.RequestOptions` +
+ @@ -23585,7 +23431,6 @@ await client.terminal.actions.search({
Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 days. -
@@ -23601,10 +23446,10 @@ Retrieves a Terminal action request by `action_id`. Terminal action requests are ```typescript await client.terminal.actions.get({ - actionId: "action_id", + actionId: "action_id" }); -``` +``` @@ -23618,21 +23463,22 @@ await client.terminal.actions.get({
-**request:** `Square.terminal.GetActionsRequest` - +**request:** `Square.terminal.GetActionsRequest` +
-**requestOptions:** `Actions.RequestOptions` - +**requestOptions:** `Actions.RequestOptions` +
+ @@ -23650,7 +23496,6 @@ await client.terminal.actions.get({
Cancels a Terminal action request if the status of the request permits it. -
@@ -23666,10 +23511,10 @@ Cancels a Terminal action request if the status of the request permits it. ```typescript await client.terminal.actions.cancel({ - actionId: "action_id", + actionId: "action_id" }); -``` +``` @@ -23683,27 +23528,27 @@ await client.terminal.actions.cancel({
-**request:** `Square.terminal.CancelActionsRequest` - +**request:** `Square.terminal.CancelActionsRequest` +
-**requestOptions:** `Actions.RequestOptions` - +**requestOptions:** `Actions.RequestOptions` +
+ ## Terminal Checkouts -
client.terminal.checkouts.create({ ...params }) -> Square.CreateTerminalCheckoutResponse
@@ -23718,7 +23563,6 @@ await client.terminal.actions.cancel({ Creates a Terminal checkout request and sends it to the specified device to take a payment for the requested amount. -
@@ -23738,17 +23582,17 @@ await client.terminal.checkouts.create({ checkout: { amountMoney: { amount: BigInt("2610"), - currency: "USD", + currency: "USD" }, referenceId: "id11572", note: "A brief note", deviceOptions: { - deviceId: "dbb5d83a-7838-11ea-bc55-0242ac130003", - }, - }, + deviceId: "dbb5d83a-7838-11ea-bc55-0242ac130003" + } + } }); -``` +``` @@ -23762,21 +23606,22 @@ await client.terminal.checkouts.create({
-**request:** `Square.terminal.CreateTerminalCheckoutRequest` - +**request:** `Square.terminal.CreateTerminalCheckoutRequest` +
-**requestOptions:** `Checkouts.RequestOptions` - +**requestOptions:** `Checkouts.RequestOptions` +
+
@@ -23794,7 +23639,6 @@ await client.terminal.checkouts.create({
Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days. -
@@ -23812,13 +23656,13 @@ Returns a filtered list of Terminal checkout requests created by the application await client.terminal.checkouts.search({ query: { filter: { - status: "COMPLETED", - }, + status: "COMPLETED" + } }, - limit: 2, + limit: 2 }); -``` +``` @@ -23832,21 +23676,22 @@ await client.terminal.checkouts.search({
-**request:** `Square.terminal.SearchTerminalCheckoutsRequest` - +**request:** `Square.terminal.SearchTerminalCheckoutsRequest` +
-**requestOptions:** `Checkouts.RequestOptions` - +**requestOptions:** `Checkouts.RequestOptions` +
+ @@ -23864,7 +23709,6 @@ await client.terminal.checkouts.search({
Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days. -
@@ -23880,10 +23724,10 @@ Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout reques ```typescript await client.terminal.checkouts.get({ - checkoutId: "checkout_id", + checkoutId: "checkout_id" }); -``` +``` @@ -23897,21 +23741,22 @@ await client.terminal.checkouts.get({
-**request:** `Square.terminal.GetCheckoutsRequest` - +**request:** `Square.terminal.GetCheckoutsRequest` +
-**requestOptions:** `Checkouts.RequestOptions` - +**requestOptions:** `Checkouts.RequestOptions` +
+ @@ -23929,7 +23774,6 @@ await client.terminal.checkouts.get({
Cancels a Terminal checkout request if the status of the request permits it. -
@@ -23945,10 +23789,10 @@ Cancels a Terminal checkout request if the status of the request permits it. ```typescript await client.terminal.checkouts.cancel({ - checkoutId: "checkout_id", + checkoutId: "checkout_id" }); -``` +``` @@ -23962,27 +23806,27 @@ await client.terminal.checkouts.cancel({
-**request:** `Square.terminal.CancelCheckoutsRequest` - +**request:** `Square.terminal.CancelCheckoutsRequest` +
-**requestOptions:** `Checkouts.RequestOptions` - +**requestOptions:** `Checkouts.RequestOptions` +
+ ## Terminal Refunds -
client.terminal.refunds.create({ ...params }) -> Square.CreateTerminalRefundResponse
@@ -23996,7 +23840,6 @@ await client.terminal.checkouts.cancel({
Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](api:Refunds). -
@@ -24017,14 +23860,14 @@ await client.terminal.refunds.create({ paymentId: "5O5OvgkcNUhl7JBuINflcjKqUzXZY", amountMoney: { amount: BigInt("111"), - currency: "CAD", + currency: "CAD" }, reason: "Returning items", - deviceId: "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", - }, + deviceId: "f72dfb8e-4d65-4e56-aade-ec3fb8d33291" + } }); -``` +``` @@ -24038,21 +23881,22 @@ await client.terminal.refunds.create({
-**request:** `Square.terminal.CreateTerminalRefundRequest` - +**request:** `Square.terminal.CreateTerminalRefundRequest` +
-**requestOptions:** `Refunds.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
+
@@ -24070,7 +23914,6 @@ await client.terminal.refunds.create({
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days. -
@@ -24088,13 +23931,13 @@ Retrieves a filtered list of Interac Terminal refund requests created by the sel await client.terminal.refunds.search({ query: { filter: { - status: "COMPLETED", - }, + status: "COMPLETED" + } }, - limit: 1, + limit: 1 }); -``` +``` @@ -24108,21 +23951,22 @@ await client.terminal.refunds.search({
-**request:** `Square.terminal.SearchTerminalRefundsRequest` - +**request:** `Square.terminal.SearchTerminalRefundsRequest` +
-**requestOptions:** `Refunds.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
+ @@ -24140,7 +23984,6 @@ await client.terminal.refunds.search({
Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days. -
@@ -24156,10 +23999,10 @@ Retrieves an Interac Terminal refund object by ID. Terminal refund objects are a ```typescript await client.terminal.refunds.get({ - terminalRefundId: "terminal_refund_id", + terminalRefundId: "terminal_refund_id" }); -``` +``` @@ -24173,21 +24016,22 @@ await client.terminal.refunds.get({
-**request:** `Square.terminal.GetRefundsRequest` - +**request:** `Square.terminal.GetRefundsRequest` +
-**requestOptions:** `Refunds.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
+ @@ -24205,7 +24049,6 @@ await client.terminal.refunds.get({
Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. -
@@ -24221,10 +24064,10 @@ Cancels an Interac Terminal refund request by refund request ID if the status of ```typescript await client.terminal.refunds.cancel({ - terminalRefundId: "terminal_refund_id", + terminalRefundId: "terminal_refund_id" }); -``` +``` @@ -24238,27 +24081,27 @@ await client.terminal.refunds.cancel({
-**request:** `Square.terminal.CancelRefundsRequest` - +**request:** `Square.terminal.CancelRefundsRequest` +
-**requestOptions:** `Refunds.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
+ ## Webhooks EventTypes -
client.webhooks.eventTypes.list({ ...params }) -> Square.ListWebhookEventTypesResponse
@@ -24272,7 +24115,6 @@ await client.terminal.refunds.cancel({
Lists all webhook event types that can be subscribed to. -
@@ -24288,10 +24130,10 @@ Lists all webhook event types that can be subscribed to. ```typescript await client.webhooks.eventTypes.list({ - apiVersion: "api_version", + apiVersion: "api_version" }); -``` +``` @@ -24305,27 +24147,27 @@ await client.webhooks.eventTypes.list({
-**request:** `Square.webhooks.ListEventTypesRequest` - +**request:** `Square.webhooks.ListEventTypesRequest` +
-**requestOptions:** `EventTypes.RequestOptions` - +**requestOptions:** `EventTypes.RequestOptions` +
+
## Webhooks Subscriptions -
client.webhooks.subscriptions.list({ ...params }) -> core.Page
@@ -24339,7 +24181,6 @@ await client.webhooks.eventTypes.list({
Lists all webhook subscriptions owned by your application. -
@@ -24358,7 +24199,7 @@ const response = await client.webhooks.subscriptions.list({ cursor: "cursor", includeDisabled: true, sortOrder: "DESC", - limit: 1, + limit: 1 }); for await (const item of response) { console.log(item); @@ -24369,13 +24210,13 @@ let page = await client.webhooks.subscriptions.list({ cursor: "cursor", includeDisabled: true, sortOrder: "DESC", - limit: 1, + limit: 1 }); while (page.hasNextPage()) { page = page.getNextPage(); } -``` +``` @@ -24389,21 +24230,22 @@ while (page.hasNextPage()) {
-**request:** `Square.webhooks.ListSubscriptionsRequest` - +**request:** `Square.webhooks.ListSubscriptionsRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+
@@ -24421,7 +24263,6 @@ while (page.hasNextPage()) {
Creates a webhook subscription. -
@@ -24442,11 +24283,11 @@ await client.webhooks.subscriptions.create({ name: "Example Webhook Subscription", eventTypes: ["payment.created", "payment.updated"], notificationUrl: "https://example-webhook-url.com", - apiVersion: "2021-12-15", - }, + apiVersion: "2021-12-15" + } }); -``` +``` @@ -24460,21 +24301,22 @@ await client.webhooks.subscriptions.create({
-**request:** `Square.webhooks.CreateWebhookSubscriptionRequest` - +**request:** `Square.webhooks.CreateWebhookSubscriptionRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -24492,7 +24334,6 @@ await client.webhooks.subscriptions.create({
Retrieves a webhook subscription identified by its ID. -
@@ -24508,10 +24349,10 @@ Retrieves a webhook subscription identified by its ID. ```typescript await client.webhooks.subscriptions.get({ - subscriptionId: "subscription_id", + subscriptionId: "subscription_id" }); -``` +``` @@ -24525,21 +24366,22 @@ await client.webhooks.subscriptions.get({
-**request:** `Square.webhooks.GetSubscriptionsRequest` - +**request:** `Square.webhooks.GetSubscriptionsRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -24557,7 +24399,6 @@ await client.webhooks.subscriptions.get({
Updates a webhook subscription. -
@@ -24576,11 +24417,11 @@ await client.webhooks.subscriptions.update({ subscriptionId: "subscription_id", subscription: { name: "Updated Example Webhook Subscription", - enabled: false, - }, + enabled: false + } }); -``` +``` @@ -24594,21 +24435,22 @@ await client.webhooks.subscriptions.update({
-**request:** `Square.webhooks.UpdateWebhookSubscriptionRequest` - +**request:** `Square.webhooks.UpdateWebhookSubscriptionRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -24626,7 +24468,6 @@ await client.webhooks.subscriptions.update({
Deletes a webhook subscription. -
@@ -24642,10 +24483,10 @@ Deletes a webhook subscription. ```typescript await client.webhooks.subscriptions.delete({ - subscriptionId: "subscription_id", + subscriptionId: "subscription_id" }); -``` +``` @@ -24659,21 +24500,22 @@ await client.webhooks.subscriptions.delete({
-**request:** `Square.webhooks.DeleteSubscriptionsRequest` - +**request:** `Square.webhooks.DeleteSubscriptionsRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -24691,7 +24533,6 @@ await client.webhooks.subscriptions.delete({
Updates a webhook subscription by replacing the existing signature key with a new one. -
@@ -24708,10 +24549,10 @@ Updates a webhook subscription by replacing the existing signature key with a ne ```typescript await client.webhooks.subscriptions.updateSignatureKey({ subscriptionId: "subscription_id", - idempotencyKey: "ed80ae6b-0654-473b-bbab-a39aee89a60d", + idempotencyKey: "ed80ae6b-0654-473b-bbab-a39aee89a60d" }); -``` +``` @@ -24725,21 +24566,22 @@ await client.webhooks.subscriptions.updateSignatureKey({
-**request:** `Square.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest` - +**request:** `Square.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ @@ -24757,7 +24599,6 @@ await client.webhooks.subscriptions.updateSignatureKey({
Tests a webhook subscription by sending a test event to the notification URL. -
@@ -24774,10 +24615,10 @@ Tests a webhook subscription by sending a test event to the notification URL. ```typescript await client.webhooks.subscriptions.test({ subscriptionId: "subscription_id", - eventType: "payment.created", + eventType: "payment.created" }); -``` +``` @@ -24791,21 +24632,22 @@ await client.webhooks.subscriptions.test({
-**request:** `Square.webhooks.TestWebhookSubscriptionRequest` - +**request:** `Square.webhooks.TestWebhookSubscriptionRequest` +
-**requestOptions:** `Subscriptions.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
+ diff --git a/src/BaseClient.ts b/src/BaseClient.ts new file mode 100644 index 000000000..ce40dc1c4 --- /dev/null +++ b/src/BaseClient.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "./core"; +import type * as environments from "./environments"; + +export interface BaseClientOptions { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-10-16"; + /** Additional headers to include in requests. */ + headers?: Record | null | undefined>; + /** The default maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The default number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + fetcher?: core.FetchFunction; +} + +export interface BaseRequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-10-16"; + /** Additional query string parameters to include in the request. */ + queryParams?: Record; + /** Additional headers to include in the request. */ + headers?: Record | null | undefined>; +} diff --git a/src/Client.ts b/src/Client.ts index dfc978661..3c07b4fa0 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,19 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "./environments"; -import * as core from "./core"; -import { mergeHeaders } from "./core/headers"; -import { Mobile } from "./api/resources/mobile/client/Client"; -import { OAuth } from "./api/resources/oAuth/client/Client"; -import { V1Transactions } from "./api/resources/v1Transactions/client/Client"; import { ApplePay } from "./api/resources/applePay/client/Client"; import { BankAccounts } from "./api/resources/bankAccounts/client/Client"; import { Bookings } from "./api/resources/bookings/client/Client"; import { Cards } from "./api/resources/cards/client/Client"; +import { CashDrawers } from "./api/resources/cashDrawers/client/Client"; import { Catalog } from "./api/resources/catalog/client/Client"; import { Channels } from "./api/resources/channels/client/Client"; +import { Checkout } from "./api/resources/checkout/client/Client"; import { Customers } from "./api/resources/customers/client/Client"; import { Devices } from "./api/resources/devices/client/Client"; import { Disputes } from "./api/resources/disputes/client/Client"; @@ -26,7 +20,8 @@ import { Labor } from "./api/resources/labor/client/Client"; import { Locations } from "./api/resources/locations/client/Client"; import { Loyalty } from "./api/resources/loyalty/client/Client"; import { Merchants } from "./api/resources/merchants/client/Client"; -import { Checkout } from "./api/resources/checkout/client/Client"; +import { Mobile } from "./api/resources/mobile/client/Client"; +import { OAuth } from "./api/resources/oAuth/client/Client"; import { Orders } from "./api/resources/orders/client/Client"; import { Payments } from "./api/resources/payments/client/Client"; import { Payouts } from "./api/resources/payouts/client/Client"; @@ -34,39 +29,21 @@ import { Refunds } from "./api/resources/refunds/client/Client"; import { Sites } from "./api/resources/sites/client/Client"; import { Snippets } from "./api/resources/snippets/client/Client"; import { Subscriptions } from "./api/resources/subscriptions/client/Client"; -import { TeamMembers } from "./api/resources/teamMembers/client/Client"; import { Team } from "./api/resources/team/client/Client"; +import { TeamMembers } from "./api/resources/teamMembers/client/Client"; import { Terminal } from "./api/resources/terminal/client/Client"; import { TransferOrders } from "./api/resources/transferOrders/client/Client"; +import { V1Transactions } from "./api/resources/v1Transactions/client/Client"; import { Vendors } from "./api/resources/vendors/client/Client"; -import { CashDrawers } from "./api/resources/cashDrawers/client/Client"; import { Webhooks } from "./api/resources/webhooks/client/Client"; +import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient"; +import * as core from "./core"; +import { mergeHeaders } from "./core/headers"; export declare namespace SquareClient { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } - - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface Options extends BaseClientOptions {} + + export interface RequestOptions extends BaseRequestOptions {} } export class SquareClient { @@ -116,8 +93,8 @@ export class SquareClient { "Square-Version": _options?.version ?? "2025-10-16", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "square", - "X-Fern-SDK-Version": "43.1.0", - "User-Agent": "square/43.1.0", + "X-Fern-SDK-Version": "43.1.2", + "User-Agent": "square/43.1.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/index.ts b/src/api/index.ts index 3ce0a3e38..3e15e2907 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./resources"; +export * from "./types"; diff --git a/src/api/resources/applePay/client/Client.ts b/src/api/resources/applePay/client/Client.ts index c22f1f0b2..e7f7b4fc3 100644 --- a/src/api/resources/applePay/client/Client.ts +++ b/src/api/resources/applePay/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace ApplePay { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class ApplePay { @@ -78,6 +56,14 @@ export class ApplePay { request: Square.RegisterDomainRequest, requestOptions?: ApplePay.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -86,22 +72,16 @@ export class ApplePay { "v2/apple-pay/domains", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.RegisterDomainRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -143,7 +123,7 @@ export class ApplePay { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/applePay/client/index.ts b/src/api/resources/applePay/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/applePay/client/index.ts +++ b/src/api/resources/applePay/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/applePay/client/requests/RegisterDomainRequest.ts b/src/api/resources/applePay/client/requests/RegisterDomainRequest.ts index d2aa825f6..53e20f46e 100644 --- a/src/api/resources/applePay/client/requests/RegisterDomainRequest.ts +++ b/src/api/resources/applePay/client/requests/RegisterDomainRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/applePay/client/requests/index.ts b/src/api/resources/applePay/client/requests/index.ts index 11c98648b..626d59ba4 100644 --- a/src/api/resources/applePay/client/requests/index.ts +++ b/src/api/resources/applePay/client/requests/index.ts @@ -1 +1 @@ -export { type RegisterDomainRequest } from "./RegisterDomainRequest"; +export type { RegisterDomainRequest } from "./RegisterDomainRequest"; diff --git a/src/api/resources/bankAccounts/client/Client.ts b/src/api/resources/bankAccounts/client/Client.ts index 6604d5b6f..9deeecd86 100644 --- a/src/api/resources/bankAccounts/client/Client.ts +++ b/src/api/resources/bankAccounts/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace BankAccounts { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class BankAccounts { @@ -67,14 +45,22 @@ export class BankAccounts { const { cursor, limit, locationId } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -83,18 +69,10 @@ export class BankAccounts { "v2/bank-accounts", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -169,6 +147,14 @@ export class BankAccounts { requestOptions?: BankAccounts.RequestOptions, ): Promise> { const { v1BankAccountId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -177,16 +163,10 @@ export class BankAccounts { `v2/bank-accounts/by-v1-id/${encodeURIComponent(v1BankAccountId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -253,6 +233,14 @@ export class BankAccounts { requestOptions?: BankAccounts.RequestOptions, ): Promise> { const { bankAccountId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -261,16 +249,10 @@ export class BankAccounts { `v2/bank-accounts/${encodeURIComponent(bankAccountId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -314,7 +296,7 @@ export class BankAccounts { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bankAccounts/client/index.ts b/src/api/resources/bankAccounts/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/bankAccounts/client/index.ts +++ b/src/api/resources/bankAccounts/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/bankAccounts/client/requests/GetBankAccountsRequest.ts b/src/api/resources/bankAccounts/client/requests/GetBankAccountsRequest.ts index 2e0fe1f5c..fd0ed195e 100644 --- a/src/api/resources/bankAccounts/client/requests/GetBankAccountsRequest.ts +++ b/src/api/resources/bankAccounts/client/requests/GetBankAccountsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetBankAccountsRequest { - /** - * Square-issued ID of the desired `BankAccount`. - */ + /** Square-issued ID of the desired `BankAccount`. */ bankAccountId: string; } diff --git a/src/api/resources/bankAccounts/client/requests/GetByV1IdBankAccountsRequest.ts b/src/api/resources/bankAccounts/client/requests/GetByV1IdBankAccountsRequest.ts index f567ca2bf..7eb6fa97c 100644 --- a/src/api/resources/bankAccounts/client/requests/GetByV1IdBankAccountsRequest.ts +++ b/src/api/resources/bankAccounts/client/requests/GetByV1IdBankAccountsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts b/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts index e7aa36957..37f1757c6 100644 --- a/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts +++ b/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/bankAccounts/client/requests/index.ts b/src/api/resources/bankAccounts/client/requests/index.ts index 15a87c836..f20aad70e 100644 --- a/src/api/resources/bankAccounts/client/requests/index.ts +++ b/src/api/resources/bankAccounts/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type ListBankAccountsRequest } from "./ListBankAccountsRequest"; -export { type GetByV1IdBankAccountsRequest } from "./GetByV1IdBankAccountsRequest"; -export { type GetBankAccountsRequest } from "./GetBankAccountsRequest"; +export type { GetBankAccountsRequest } from "./GetBankAccountsRequest"; +export type { GetByV1IdBankAccountsRequest } from "./GetByV1IdBankAccountsRequest"; +export type { ListBankAccountsRequest } from "./ListBankAccountsRequest"; diff --git a/src/api/resources/bookings/client/Client.ts b/src/api/resources/bookings/client/Client.ts index 995525cbb..d665a96a1 100644 --- a/src/api/resources/bookings/client/Client.ts +++ b/src/api/resources/bookings/client/Client.ts @@ -1,43 +1,21 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { CustomAttributeDefinitions } from "../resources/customAttributeDefinitions/client/Client"; import { CustomAttributes } from "../resources/customAttributes/client/Client"; import { LocationProfiles } from "../resources/locationProfiles/client/Client"; import { TeamMemberProfiles } from "../resources/teamMemberProfiles/client/Client"; export declare namespace Bookings { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Bookings { @@ -96,26 +74,34 @@ export class Bookings { const { limit, cursor, customerId, teamMemberId, locationId, startAtMin, startAtMax } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (customerId !== undefined) { - _queryParams["customer_id"] = customerId; + _queryParams.customer_id = customerId; } if (teamMemberId !== undefined) { - _queryParams["team_member_id"] = teamMemberId; + _queryParams.team_member_id = teamMemberId; } if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } if (startAtMin !== undefined) { - _queryParams["start_at_min"] = startAtMin; + _queryParams.start_at_min = startAtMin; } if (startAtMax !== undefined) { - _queryParams["start_at_max"] = startAtMax; + _queryParams.start_at_max = startAtMax; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -124,18 +110,10 @@ export class Bookings { "v2/bookings", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -222,6 +200,14 @@ export class Bookings { request: Square.CreateBookingRequest, requestOptions?: Bookings.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -230,22 +216,16 @@ export class Bookings { "v2/bookings", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -315,6 +295,14 @@ export class Bookings { request: Square.SearchAvailabilityRequest, requestOptions?: Bookings.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -323,22 +311,16 @@ export class Bookings { "v2/bookings/availability/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchAvailabilityRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -406,6 +388,14 @@ export class Bookings { request: Square.BulkRetrieveBookingsRequest, requestOptions?: Bookings.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -414,22 +404,16 @@ export class Bookings { "v2/bookings/bulk-retrieve", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkRetrieveBookingsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -487,6 +471,14 @@ export class Bookings { private async __getBusinessProfile( requestOptions?: Bookings.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -495,16 +487,10 @@ export class Bookings { "v2/bookings/business-booking-profile", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -570,6 +556,14 @@ export class Bookings { requestOptions?: Bookings.RequestOptions, ): Promise> { const { locationId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -578,16 +572,10 @@ export class Bookings { `v2/bookings/location-booking-profiles/${encodeURIComponent(locationId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -654,6 +642,14 @@ export class Bookings { request: Square.BulkRetrieveTeamMemberBookingProfilesRequest, requestOptions?: Bookings.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -662,22 +658,16 @@ export class Bookings { "v2/bookings/team-member-booking-profiles/bulk-retrieve", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkRetrieveTeamMemberBookingProfilesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -746,6 +736,14 @@ export class Bookings { requestOptions?: Bookings.RequestOptions, ): Promise> { const { bookingId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -754,16 +752,10 @@ export class Bookings { `v2/bookings/${encodeURIComponent(bookingId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -834,6 +826,14 @@ export class Bookings { requestOptions?: Bookings.RequestOptions, ): Promise> { const { bookingId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -842,22 +842,16 @@ export class Bookings { `v2/bookings/${encodeURIComponent(bookingId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateBookingRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -927,6 +921,14 @@ export class Bookings { requestOptions?: Bookings.RequestOptions, ): Promise> { const { bookingId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -935,22 +937,16 @@ export class Bookings { `v2/bookings/${encodeURIComponent(bookingId)}/cancel`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CancelBookingRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -994,7 +990,7 @@ export class Bookings { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bookings/client/index.ts b/src/api/resources/bookings/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/bookings/client/index.ts +++ b/src/api/resources/bookings/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts b/src/api/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts index fb06a42b6..e08ce18f1 100644 --- a/src/api/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts +++ b/src/api/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts b/src/api/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts index f0d8d22fe..60da96685 100644 --- a/src/api/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts +++ b/src/api/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/bookings/client/requests/CancelBookingRequest.ts b/src/api/resources/bookings/client/requests/CancelBookingRequest.ts index df9e2f50c..35e1aa1e1 100644 --- a/src/api/resources/bookings/client/requests/CancelBookingRequest.ts +++ b/src/api/resources/bookings/client/requests/CancelBookingRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,9 +7,7 @@ * } */ export interface CancelBookingRequest { - /** - * The ID of the [Booking](entity:Booking) object representing the to-be-cancelled booking. - */ + /** The ID of the [Booking](entity:Booking) object representing the to-be-cancelled booking. */ bookingId: string; /** A unique key to make this request an idempotent operation. */ idempotencyKey?: string | null; diff --git a/src/api/resources/bookings/client/requests/CreateBookingRequest.ts b/src/api/resources/bookings/client/requests/CreateBookingRequest.ts index f02b87e0c..78e01e34f 100644 --- a/src/api/resources/bookings/client/requests/CreateBookingRequest.ts +++ b/src/api/resources/bookings/client/requests/CreateBookingRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/bookings/client/requests/GetBookingsRequest.ts b/src/api/resources/bookings/client/requests/GetBookingsRequest.ts index f30022de8..39a9b25da 100644 --- a/src/api/resources/bookings/client/requests/GetBookingsRequest.ts +++ b/src/api/resources/bookings/client/requests/GetBookingsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetBookingsRequest { - /** - * The ID of the [Booking](entity:Booking) object representing the to-be-retrieved booking. - */ + /** The ID of the [Booking](entity:Booking) object representing the to-be-retrieved booking. */ bookingId: string; } diff --git a/src/api/resources/bookings/client/requests/ListBookingsRequest.ts b/src/api/resources/bookings/client/requests/ListBookingsRequest.ts index f8d24958d..ffd74d7f2 100644 --- a/src/api/resources/bookings/client/requests/ListBookingsRequest.ts +++ b/src/api/resources/bookings/client/requests/ListBookingsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -15,32 +13,18 @@ * } */ export interface ListBookingsRequest { - /** - * The maximum number of results per page to return in a paged response. - */ + /** The maximum number of results per page to return in a paged response. */ limit?: number | null; - /** - * The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. - */ + /** The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. */ cursor?: string | null; - /** - * The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. - */ + /** The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. */ customerId?: string | null; - /** - * The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. - */ + /** The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. */ teamMemberId?: string | null; - /** - * The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. - */ + /** The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. */ locationId?: string | null; - /** - * The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. - */ + /** The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. */ startAtMin?: string | null; - /** - * The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used. - */ + /** The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used. */ startAtMax?: string | null; } diff --git a/src/api/resources/bookings/client/requests/RetrieveLocationBookingProfileRequest.ts b/src/api/resources/bookings/client/requests/RetrieveLocationBookingProfileRequest.ts index c53c91d78..fffd057eb 100644 --- a/src/api/resources/bookings/client/requests/RetrieveLocationBookingProfileRequest.ts +++ b/src/api/resources/bookings/client/requests/RetrieveLocationBookingProfileRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface RetrieveLocationBookingProfileRequest { - /** - * The ID of the location to retrieve the booking profile. - */ + /** The ID of the location to retrieve the booking profile. */ locationId: string; } diff --git a/src/api/resources/bookings/client/requests/SearchAvailabilityRequest.ts b/src/api/resources/bookings/client/requests/SearchAvailabilityRequest.ts index 50bc2efd8..15d46cd19 100644 --- a/src/api/resources/bookings/client/requests/SearchAvailabilityRequest.ts +++ b/src/api/resources/bookings/client/requests/SearchAvailabilityRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/bookings/client/requests/UpdateBookingRequest.ts b/src/api/resources/bookings/client/requests/UpdateBookingRequest.ts index 3ed17fbab..709aa34bb 100644 --- a/src/api/resources/bookings/client/requests/UpdateBookingRequest.ts +++ b/src/api/resources/bookings/client/requests/UpdateBookingRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -12,9 +10,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateBookingRequest { - /** - * The ID of the [Booking](entity:Booking) object representing the to-be-updated booking. - */ + /** The ID of the [Booking](entity:Booking) object representing the to-be-updated booking. */ bookingId: string; /** A unique key to make this request an idempotent operation. */ idempotencyKey?: string | null; diff --git a/src/api/resources/bookings/client/requests/index.ts b/src/api/resources/bookings/client/requests/index.ts index 3c416a42f..74bd1af69 100644 --- a/src/api/resources/bookings/client/requests/index.ts +++ b/src/api/resources/bookings/client/requests/index.ts @@ -1,9 +1,9 @@ -export { type ListBookingsRequest } from "./ListBookingsRequest"; -export { type CreateBookingRequest } from "./CreateBookingRequest"; -export { type SearchAvailabilityRequest } from "./SearchAvailabilityRequest"; -export { type BulkRetrieveBookingsRequest } from "./BulkRetrieveBookingsRequest"; -export { type RetrieveLocationBookingProfileRequest } from "./RetrieveLocationBookingProfileRequest"; -export { type BulkRetrieveTeamMemberBookingProfilesRequest } from "./BulkRetrieveTeamMemberBookingProfilesRequest"; -export { type GetBookingsRequest } from "./GetBookingsRequest"; -export { type UpdateBookingRequest } from "./UpdateBookingRequest"; -export { type CancelBookingRequest } from "./CancelBookingRequest"; +export type { BulkRetrieveBookingsRequest } from "./BulkRetrieveBookingsRequest"; +export type { BulkRetrieveTeamMemberBookingProfilesRequest } from "./BulkRetrieveTeamMemberBookingProfilesRequest"; +export type { CancelBookingRequest } from "./CancelBookingRequest"; +export type { CreateBookingRequest } from "./CreateBookingRequest"; +export type { GetBookingsRequest } from "./GetBookingsRequest"; +export type { ListBookingsRequest } from "./ListBookingsRequest"; +export type { RetrieveLocationBookingProfileRequest } from "./RetrieveLocationBookingProfileRequest"; +export type { SearchAvailabilityRequest } from "./SearchAvailabilityRequest"; +export type { UpdateBookingRequest } from "./UpdateBookingRequest"; diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts index c73c8d222..2dddf6eb6 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace CustomAttributeDefinitions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class CustomAttributeDefinitions { @@ -69,11 +47,19 @@ export class CustomAttributeDefinitions { const { limit, cursor } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -82,18 +68,10 @@ export class CustomAttributeDefinitions { "v2/bookings/custom-attribute-definitions", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -178,6 +156,14 @@ export class CustomAttributeDefinitions { request: Square.bookings.CreateBookingCustomAttributeDefinitionRequest, requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -186,22 +172,16 @@ export class CustomAttributeDefinitions { "v2/bookings/custom-attribute-definitions", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.bookings.CreateBookingCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -273,9 +253,17 @@ export class CustomAttributeDefinitions { const { key, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -284,17 +272,10 @@ export class CustomAttributeDefinitions { `v2/bookings/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -367,6 +348,14 @@ export class CustomAttributeDefinitions { requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -375,22 +364,16 @@ export class CustomAttributeDefinitions { `v2/bookings/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.bookings.UpdateBookingCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -462,6 +445,14 @@ export class CustomAttributeDefinitions { requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -470,16 +461,10 @@ export class CustomAttributeDefinitions { `v2/bookings/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -523,7 +508,7 @@ export class CustomAttributeDefinitions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/index.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/index.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts index 9ca4428e5..7ff733005 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts index 6a1b34cf1..a9c9d9ec5 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteCustomAttributeDefinitionsRequest { - /** - * The key of the custom attribute definition to delete. - */ + /** The key of the custom attribute definition to delete. */ key: string; } diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index e4c05d712..3de83fd32 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index ded39f5a0..b059525c5 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts index ec3f3cb5a..8de5fe948 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -12,9 +10,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateBookingCustomAttributeDefinitionRequest { - /** - * The key of the custom attribute definition to update. - */ + /** The key of the custom attribute definition to update. */ key: string; /** * The custom attribute definition that contains the fields to update. Only the following fields can be updated: diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/index.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/index.ts index 0dd526820..c8988a76b 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; -export { type CreateBookingCustomAttributeDefinitionRequest } from "./CreateBookingCustomAttributeDefinitionRequest"; -export { type GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; -export { type UpdateBookingCustomAttributeDefinitionRequest } from "./UpdateBookingCustomAttributeDefinitionRequest"; -export { type DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; +export type { CreateBookingCustomAttributeDefinitionRequest } from "./CreateBookingCustomAttributeDefinitionRequest"; +export type { DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; +export type { GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; +export type { ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; +export type { UpdateBookingCustomAttributeDefinitionRequest } from "./UpdateBookingCustomAttributeDefinitionRequest"; diff --git a/src/api/resources/bookings/resources/customAttributes/client/Client.ts b/src/api/resources/bookings/resources/customAttributes/client/Client.ts index a96a72a7f..aeb13ce67 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/Client.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace CustomAttributes { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class CustomAttributes { @@ -76,6 +54,14 @@ export class CustomAttributes { request: Square.bookings.BulkDeleteBookingCustomAttributesRequest, requestOptions?: CustomAttributes.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -84,22 +70,16 @@ export class CustomAttributes { "v2/bookings/custom-attributes/bulk-delete", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.bookings.BulkDeleteBookingCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -175,6 +155,14 @@ export class CustomAttributes { request: Square.bookings.BulkUpsertBookingCustomAttributesRequest, requestOptions?: CustomAttributes.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -183,22 +171,16 @@ export class CustomAttributes { "v2/bookings/custom-attributes/bulk-upsert", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.bookings.BulkUpsertBookingCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -269,14 +251,22 @@ export class CustomAttributes { const { bookingId, limit, cursor, withDefinitions } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (withDefinitions !== undefined) { - _queryParams["with_definitions"] = withDefinitions?.toString() ?? null; + _queryParams.with_definitions = withDefinitions?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -285,18 +275,10 @@ export class CustomAttributes { `v2/bookings/${encodeURIComponent(bookingId)}/custom-attributes`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -381,13 +363,21 @@ export class CustomAttributes { const { bookingId, key, withDefinition, version } = request; const _queryParams: Record = {}; if (withDefinition !== undefined) { - _queryParams["with_definition"] = withDefinition?.toString() ?? null; + _queryParams.with_definition = withDefinition?.toString() ?? null; } if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -396,17 +386,10 @@ export class CustomAttributes { `v2/bookings/${encodeURIComponent(bookingId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -480,6 +463,14 @@ export class CustomAttributes { requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { bookingId, key, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -488,22 +479,16 @@ export class CustomAttributes { `v2/bookings/${encodeURIComponent(bookingId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.bookings.UpsertBookingCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -576,6 +561,14 @@ export class CustomAttributes { requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { bookingId, key } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -584,16 +577,10 @@ export class CustomAttributes { `v2/bookings/${encodeURIComponent(bookingId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -637,7 +624,7 @@ export class CustomAttributes { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bookings/resources/customAttributes/client/index.ts b/src/api/resources/bookings/resources/customAttributes/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/index.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts index dd626b7a9..3afec6d52 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts index fca36bbb3..f444c119e 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts index 1e6be8d91..d7deb9550 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface DeleteCustomAttributesRequest { - /** - * The ID of the target [booking](entity:Booking). - */ + /** The ID of the target [booking](entity:Booking). */ bookingId: string; /** * The key of the custom attribute to delete. This key must match the `key` of a custom diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index 2dc919041..ee94bb88f 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -12,9 +10,7 @@ * } */ export interface GetCustomAttributesRequest { - /** - * The ID of the target [booking](entity:Booking). - */ + /** The ID of the target [booking](entity:Booking). */ bookingId: string; /** * The key of the custom attribute to retrieve. This key must match the `key` of a custom diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index bab55c3f7..7d3da5f77 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -12,9 +10,7 @@ * } */ export interface ListCustomAttributesRequest { - /** - * The ID of the target [booking](entity:Booking). - */ + /** The ID of the target [booking](entity:Booking). */ bookingId: string; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts index b65cfb25c..ad652461e 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -13,9 +11,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpsertBookingCustomAttributeRequest { - /** - * The ID of the target [booking](entity:Booking). - */ + /** The ID of the target [booking](entity:Booking). */ bookingId: string; /** * The key of the custom attribute to create or update. This key must match the `key` of a diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/index.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/index.ts index 3e49e8cbc..7080551b5 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/index.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/index.ts @@ -1,6 +1,6 @@ -export { type BulkDeleteBookingCustomAttributesRequest } from "./BulkDeleteBookingCustomAttributesRequest"; -export { type BulkUpsertBookingCustomAttributesRequest } from "./BulkUpsertBookingCustomAttributesRequest"; -export { type ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; -export { type GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; -export { type UpsertBookingCustomAttributeRequest } from "./UpsertBookingCustomAttributeRequest"; -export { type DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; +export type { BulkDeleteBookingCustomAttributesRequest } from "./BulkDeleteBookingCustomAttributesRequest"; +export type { BulkUpsertBookingCustomAttributesRequest } from "./BulkUpsertBookingCustomAttributesRequest"; +export type { DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; +export type { GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; +export type { ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; +export type { UpsertBookingCustomAttributeRequest } from "./UpsertBookingCustomAttributeRequest"; diff --git a/src/api/resources/bookings/resources/index.ts b/src/api/resources/bookings/resources/index.ts index f4f82dee8..a409142bf 100644 --- a/src/api/resources/bookings/resources/index.ts +++ b/src/api/resources/bookings/resources/index.ts @@ -1,8 +1,8 @@ export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * as customAttributes from "./customAttributes"; -export * as locationProfiles from "./locationProfiles"; -export * as teamMemberProfiles from "./teamMemberProfiles"; export * from "./customAttributeDefinitions/client/requests"; +export * as customAttributes from "./customAttributes"; export * from "./customAttributes/client/requests"; +export * as locationProfiles from "./locationProfiles"; export * from "./locationProfiles/client/requests"; +export * as teamMemberProfiles from "./teamMemberProfiles"; export * from "./teamMemberProfiles/client/requests"; diff --git a/src/api/resources/bookings/resources/locationProfiles/client/Client.ts b/src/api/resources/bookings/resources/locationProfiles/client/Client.ts index 09dd6d406..0ddf47472 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/Client.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace LocationProfiles { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class LocationProfiles { @@ -66,11 +44,19 @@ export class LocationProfiles { const { limit, cursor } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -79,18 +65,10 @@ export class LocationProfiles { "v2/bookings/location-booking-profiles", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -145,7 +123,7 @@ export class LocationProfiles { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bookings/resources/locationProfiles/client/index.ts b/src/api/resources/bookings/resources/locationProfiles/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/index.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts b/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts index 03d1b8bfc..78b960681 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface ListLocationProfilesRequest { - /** - * The maximum number of results to return in a paged response. - */ + /** The maximum number of results to return in a paged response. */ limit?: number | null; - /** - * The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. - */ + /** The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. */ cursor?: string | null; } diff --git a/src/api/resources/bookings/resources/locationProfiles/client/requests/index.ts b/src/api/resources/bookings/resources/locationProfiles/client/requests/index.ts index f3f432a40..07a32c892 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/requests/index.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/requests/index.ts @@ -1 +1 @@ -export { type ListLocationProfilesRequest } from "./ListLocationProfilesRequest"; +export type { ListLocationProfilesRequest } from "./ListLocationProfilesRequest"; diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts index d0f230f5f..d7a36c1f3 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace TeamMemberProfiles { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class TeamMemberProfiles { @@ -68,17 +46,25 @@ export class TeamMemberProfiles { const { bookableOnly, limit, cursor, locationId } = request; const _queryParams: Record = {}; if (bookableOnly !== undefined) { - _queryParams["bookable_only"] = bookableOnly?.toString() ?? null; + _queryParams.bookable_only = bookableOnly?.toString() ?? null; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -87,18 +73,10 @@ export class TeamMemberProfiles { "v2/bookings/team-member-booking-profiles", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -175,6 +153,14 @@ export class TeamMemberProfiles { requestOptions?: TeamMemberProfiles.RequestOptions, ): Promise> { const { teamMemberId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -183,16 +169,10 @@ export class TeamMemberProfiles { `v2/bookings/team-member-booking-profiles/${encodeURIComponent(teamMemberId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -236,7 +216,7 @@ export class TeamMemberProfiles { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/index.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/index.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/GetTeamMemberProfilesRequest.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/GetTeamMemberProfilesRequest.ts index 8c0e22128..421b3fef4 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/GetTeamMemberProfilesRequest.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/GetTeamMemberProfilesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetTeamMemberProfilesRequest { - /** - * The ID of the team member to retrieve. - */ + /** The ID of the team member to retrieve. */ teamMemberId: string; } diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts index bb7d124ab..bcc3be659 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -12,20 +10,12 @@ * } */ export interface ListTeamMemberProfilesRequest { - /** - * Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). - */ + /** Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). */ bookableOnly?: boolean | null; - /** - * The maximum number of results to return in a paged response. - */ + /** The maximum number of results to return in a paged response. */ limit?: number | null; - /** - * The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. - */ + /** The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. */ cursor?: string | null; - /** - * Indicates whether to include only team members enabled at the given location in the returned result. - */ + /** Indicates whether to include only team members enabled at the given location in the returned result. */ locationId?: string | null; } diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/index.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/index.ts index 4a2788242..83f7a2633 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/index.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type ListTeamMemberProfilesRequest } from "./ListTeamMemberProfilesRequest"; -export { type GetTeamMemberProfilesRequest } from "./GetTeamMemberProfilesRequest"; +export type { GetTeamMemberProfilesRequest } from "./GetTeamMemberProfilesRequest"; +export type { ListTeamMemberProfilesRequest } from "./ListTeamMemberProfilesRequest"; diff --git a/src/api/resources/cards/client/Client.ts b/src/api/resources/cards/client/Client.ts index c11419162..79ef686a7 100644 --- a/src/api/resources/cards/client/Client.ts +++ b/src/api/resources/cards/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; -import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Cards { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Cards { @@ -68,23 +46,31 @@ export class Cards { const { cursor, customerId, includeDisabled, referenceId, sortOrder } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (customerId !== undefined) { - _queryParams["customer_id"] = customerId; + _queryParams.customer_id = customerId; } if (includeDisabled !== undefined) { - _queryParams["include_disabled"] = includeDisabled?.toString() ?? null; + _queryParams.include_disabled = includeDisabled?.toString() ?? null; } if (referenceId !== undefined) { - _queryParams["reference_id"] = referenceId; + _queryParams.reference_id = referenceId; } if (sortOrder !== undefined) { - _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -93,18 +79,10 @@ export class Cards { "v2/cards", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -192,6 +170,14 @@ export class Cards { request: Square.CreateCardRequest, requestOptions?: Cards.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -200,22 +186,16 @@ export class Cards { "v2/cards", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateCardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -279,6 +259,14 @@ export class Cards { requestOptions?: Cards.RequestOptions, ): Promise> { const { cardId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -287,16 +275,10 @@ export class Cards { `v2/cards/${encodeURIComponent(cardId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -361,6 +343,14 @@ export class Cards { requestOptions?: Cards.RequestOptions, ): Promise> { const { cardId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -369,16 +359,10 @@ export class Cards { `v2/cards/${encodeURIComponent(cardId)}/disable`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -420,7 +404,7 @@ export class Cards { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/cards/client/index.ts b/src/api/resources/cards/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/cards/client/index.ts +++ b/src/api/resources/cards/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/cards/client/requests/CreateCardRequest.ts b/src/api/resources/cards/client/requests/CreateCardRequest.ts index 54ac6b9bf..f4b61e20b 100644 --- a/src/api/resources/cards/client/requests/CreateCardRequest.ts +++ b/src/api/resources/cards/client/requests/CreateCardRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/cards/client/requests/DisableCardsRequest.ts b/src/api/resources/cards/client/requests/DisableCardsRequest.ts index 7a96d92d9..795af52c2 100644 --- a/src/api/resources/cards/client/requests/DisableCardsRequest.ts +++ b/src/api/resources/cards/client/requests/DisableCardsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DisableCardsRequest { - /** - * Unique ID for the desired Card. - */ + /** Unique ID for the desired Card. */ cardId: string; } diff --git a/src/api/resources/cards/client/requests/GetCardsRequest.ts b/src/api/resources/cards/client/requests/GetCardsRequest.ts index c5d067993..3e93aa5ea 100644 --- a/src/api/resources/cards/client/requests/GetCardsRequest.ts +++ b/src/api/resources/cards/client/requests/GetCardsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetCardsRequest { - /** - * Unique ID for the desired Card. - */ + /** Unique ID for the desired Card. */ cardId: string; } diff --git a/src/api/resources/cards/client/requests/ListCardsRequest.ts b/src/api/resources/cards/client/requests/ListCardsRequest.ts index ae1540aa5..420f88299 100644 --- a/src/api/resources/cards/client/requests/ListCardsRequest.ts +++ b/src/api/resources/cards/client/requests/ListCardsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -32,9 +30,7 @@ export interface ListCardsRequest { * By default, all enabled cards owned by the merchant are returned. */ includeDisabled?: boolean | null; - /** - * Limit results to cards associated with the reference_id supplied. - */ + /** Limit results to cards associated with the reference_id supplied. */ referenceId?: string | null; /** * Sorts the returned list by when the card was created with the specified order. diff --git a/src/api/resources/cards/client/requests/index.ts b/src/api/resources/cards/client/requests/index.ts index 5fb9592cd..3c2f33758 100644 --- a/src/api/resources/cards/client/requests/index.ts +++ b/src/api/resources/cards/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type ListCardsRequest } from "./ListCardsRequest"; -export { type CreateCardRequest } from "./CreateCardRequest"; -export { type GetCardsRequest } from "./GetCardsRequest"; -export { type DisableCardsRequest } from "./DisableCardsRequest"; +export type { CreateCardRequest } from "./CreateCardRequest"; +export type { DisableCardsRequest } from "./DisableCardsRequest"; +export type { GetCardsRequest } from "./GetCardsRequest"; +export type { ListCardsRequest } from "./ListCardsRequest"; diff --git a/src/api/resources/cashDrawers/client/Client.ts b/src/api/resources/cashDrawers/client/Client.ts index bc71ccec3..ec292f95d 100644 --- a/src/api/resources/cashDrawers/client/Client.ts +++ b/src/api/resources/cashDrawers/client/Client.ts @@ -1,23 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; -import * as core from "../../../../core"; +import type { BaseClientOptions } from "../../../../BaseClient"; import { Shifts } from "../resources/shifts/client/Client"; export declare namespace CashDrawers { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} } export class CashDrawers { diff --git a/src/api/resources/cashDrawers/resources/shifts/client/Client.ts b/src/api/resources/cashDrawers/resources/shifts/client/Client.ts index 090764a15..75eae1bfd 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/Client.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Shifts { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Shifts { @@ -70,25 +48,33 @@ export class Shifts { ): Promise> => { const { locationId, sortOrder, beginTime, endTime, limit, cursor } = request; const _queryParams: Record = {}; - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; if (sortOrder !== undefined) { - _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (beginTime !== undefined) { - _queryParams["begin_time"] = beginTime; + _queryParams.begin_time = beginTime; } if (endTime !== undefined) { - _queryParams["end_time"] = endTime; + _queryParams.end_time = endTime; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -97,18 +83,10 @@ export class Shifts { "v2/cash-drawers/shifts", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -188,7 +166,15 @@ export class Shifts { ): Promise> { const { shiftId, locationId } = request; const _queryParams: Record = {}; - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -197,17 +183,10 @@ export class Shifts { `v2/cash-drawers/shifts/${encodeURIComponent(shiftId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -274,13 +253,21 @@ export class Shifts { ): Promise> => { const { shiftId, locationId, limit, cursor } = request; const _queryParams: Record = {}; - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -289,18 +276,10 @@ export class Shifts { `v2/cash-drawers/shifts/${encodeURIComponent(shiftId)}/events`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -355,7 +334,7 @@ export class Shifts { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/cashDrawers/resources/shifts/client/index.ts b/src/api/resources/cashDrawers/resources/shifts/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/index.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/cashDrawers/resources/shifts/client/requests/GetShiftsRequest.ts b/src/api/resources/cashDrawers/resources/shifts/client/requests/GetShiftsRequest.ts index 3f84d4aac..4c3f1e321 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/requests/GetShiftsRequest.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/requests/GetShiftsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface GetShiftsRequest { - /** - * The shift ID. - */ + /** The shift ID. */ shiftId: string; - /** - * The ID of the location to retrieve cash drawer shifts from. - */ + /** The ID of the location to retrieve cash drawer shifts from. */ locationId: string; } diff --git a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts index 69d274f2b..0bd695b2d 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -12,21 +10,15 @@ * } */ export interface ListEventsShiftsRequest { - /** - * The shift ID. - */ + /** The shift ID. */ shiftId: string; - /** - * The ID of the location to list cash drawer shifts for. - */ + /** The ID of the location to list cash drawer shifts for. */ locationId: string; /** * Number of resources to be returned in a page of results (200 by * default, 1000 max). */ limit?: number | null; - /** - * Opaque cursor for fetching the next page of results. - */ + /** Opaque cursor for fetching the next page of results. */ cursor?: string | null; } diff --git a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts index 711f5a9cf..996b2695f 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -16,30 +14,22 @@ import * as Square from "../../../../../../index"; * } */ export interface ListShiftsRequest { - /** - * The ID of the location to query for a list of cash drawer shifts. - */ + /** The ID of the location to query for a list of cash drawer shifts. */ locationId: string; /** * The order in which cash drawer shifts are listed in the response, * based on their opened_at field. Default value: ASC */ sortOrder?: Square.SortOrder | null; - /** - * The inclusive start time of the query on opened_at, in ISO 8601 format. - */ + /** The inclusive start time of the query on opened_at, in ISO 8601 format. */ beginTime?: string | null; - /** - * The exclusive end date of the query on opened_at, in ISO 8601 format. - */ + /** The exclusive end date of the query on opened_at, in ISO 8601 format. */ endTime?: string | null; /** * Number of cash drawer shift events in a page of results (200 by * default, 1000 max). */ limit?: number | null; - /** - * Opaque cursor for fetching the next page of results. - */ + /** Opaque cursor for fetching the next page of results. */ cursor?: string | null; } diff --git a/src/api/resources/cashDrawers/resources/shifts/client/requests/index.ts b/src/api/resources/cashDrawers/resources/shifts/client/requests/index.ts index c69b4133d..467468a6e 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/requests/index.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type ListShiftsRequest } from "./ListShiftsRequest"; -export { type GetShiftsRequest } from "./GetShiftsRequest"; -export { type ListEventsShiftsRequest } from "./ListEventsShiftsRequest"; +export type { GetShiftsRequest } from "./GetShiftsRequest"; +export type { ListEventsShiftsRequest } from "./ListEventsShiftsRequest"; +export type { ListShiftsRequest } from "./ListShiftsRequest"; diff --git a/src/api/resources/catalog/client/Client.ts b/src/api/resources/catalog/client/Client.ts index 72b4c7b28..233a00a5a 100644 --- a/src/api/resources/catalog/client/Client.ts +++ b/src/api/resources/catalog/client/Client.ts @@ -1,41 +1,19 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { Images } from "../resources/images/client/Client"; import { Object_ } from "../resources/object/client/Client"; export declare namespace Catalog { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Catalog { @@ -90,6 +68,14 @@ export class Catalog { request: Square.BatchDeleteCatalogObjectsRequest, requestOptions?: Catalog.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -98,22 +84,16 @@ export class Catalog { "v2/catalog/batch-delete", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchDeleteCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -182,6 +162,14 @@ export class Catalog { request: Square.BatchGetCatalogObjectsRequest, requestOptions?: Catalog.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -190,22 +178,16 @@ export class Catalog { "v2/catalog/batch-retrieve", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchGetCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -295,6 +277,14 @@ export class Catalog { request: Square.BatchUpsertCatalogObjectsRequest, requestOptions?: Catalog.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -303,22 +293,16 @@ export class Catalog { "v2/catalog/batch-upsert", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchUpsertCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -375,6 +359,14 @@ export class Catalog { private async __info( requestOptions?: Catalog.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -383,16 +375,10 @@ export class Catalog { "v2/catalog/info", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -462,14 +448,22 @@ export class Catalog { const { cursor, types, catalogVersion } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (types !== undefined) { - _queryParams["types"] = types; + _queryParams.types = types; } if (catalogVersion !== undefined) { - _queryParams["catalog_version"] = catalogVersion?.toString() ?? null; + _queryParams.catalog_version = catalogVersion?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -478,18 +472,10 @@ export class Catalog { "v2/catalog/list", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -579,6 +565,14 @@ export class Catalog { request: Square.SearchCatalogObjectsRequest = {}, requestOptions?: Catalog.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -587,22 +581,16 @@ export class Catalog { "v2/catalog/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -695,6 +683,14 @@ export class Catalog { request: Square.SearchCatalogItemsRequest = {}, requestOptions?: Catalog.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -703,22 +699,16 @@ export class Catalog { "v2/catalog/search-catalog-items", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchCatalogItemsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -787,6 +777,14 @@ export class Catalog { request: Square.UpdateItemModifierListsRequest, requestOptions?: Catalog.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -795,22 +793,16 @@ export class Catalog { "v2/catalog/update-item-modifier-lists", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateItemModifierListsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -879,6 +871,14 @@ export class Catalog { request: Square.UpdateItemTaxesRequest, requestOptions?: Catalog.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -887,22 +887,16 @@ export class Catalog { "v2/catalog/update-item-taxes", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateItemTaxesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -946,7 +940,7 @@ export class Catalog { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/catalog/client/index.ts b/src/api/resources/catalog/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/catalog/client/index.ts +++ b/src/api/resources/catalog/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts b/src/api/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts index 5928375f6..e86f61042 100644 --- a/src/api/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts +++ b/src/api/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts b/src/api/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts index be6a46943..64bb23e96 100644 --- a/src/api/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts +++ b/src/api/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts b/src/api/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts index 07bb27415..2e6f983e3 100644 --- a/src/api/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts +++ b/src/api/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/catalog/client/requests/ListCatalogRequest.ts b/src/api/resources/catalog/client/requests/ListCatalogRequest.ts index def3b3f15..789229961 100644 --- a/src/api/resources/catalog/client/requests/ListCatalogRequest.ts +++ b/src/api/resources/catalog/client/requests/ListCatalogRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/catalog/client/requests/SearchCatalogItemsRequest.ts b/src/api/resources/catalog/client/requests/SearchCatalogItemsRequest.ts index 040e6a65f..66571563f 100644 --- a/src/api/resources/catalog/client/requests/SearchCatalogItemsRequest.ts +++ b/src/api/resources/catalog/client/requests/SearchCatalogItemsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts b/src/api/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts index 93c4054a5..5b0cd9e39 100644 --- a/src/api/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts +++ b/src/api/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts b/src/api/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts index 993504615..77303ad19 100644 --- a/src/api/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts +++ b/src/api/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/catalog/client/requests/UpdateItemTaxesRequest.ts b/src/api/resources/catalog/client/requests/UpdateItemTaxesRequest.ts index 45b6420c6..348d677bc 100644 --- a/src/api/resources/catalog/client/requests/UpdateItemTaxesRequest.ts +++ b/src/api/resources/catalog/client/requests/UpdateItemTaxesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/catalog/client/requests/index.ts b/src/api/resources/catalog/client/requests/index.ts index 14d4621a0..550909f08 100644 --- a/src/api/resources/catalog/client/requests/index.ts +++ b/src/api/resources/catalog/client/requests/index.ts @@ -1,8 +1,8 @@ -export { type BatchDeleteCatalogObjectsRequest } from "./BatchDeleteCatalogObjectsRequest"; -export { type BatchGetCatalogObjectsRequest } from "./BatchGetCatalogObjectsRequest"; -export { type BatchUpsertCatalogObjectsRequest } from "./BatchUpsertCatalogObjectsRequest"; -export { type ListCatalogRequest } from "./ListCatalogRequest"; -export { type SearchCatalogObjectsRequest } from "./SearchCatalogObjectsRequest"; -export { type SearchCatalogItemsRequest } from "./SearchCatalogItemsRequest"; -export { type UpdateItemModifierListsRequest } from "./UpdateItemModifierListsRequest"; -export { type UpdateItemTaxesRequest } from "./UpdateItemTaxesRequest"; +export type { BatchDeleteCatalogObjectsRequest } from "./BatchDeleteCatalogObjectsRequest"; +export type { BatchGetCatalogObjectsRequest } from "./BatchGetCatalogObjectsRequest"; +export type { BatchUpsertCatalogObjectsRequest } from "./BatchUpsertCatalogObjectsRequest"; +export type { ListCatalogRequest } from "./ListCatalogRequest"; +export type { SearchCatalogItemsRequest } from "./SearchCatalogItemsRequest"; +export type { SearchCatalogObjectsRequest } from "./SearchCatalogObjectsRequest"; +export type { UpdateItemModifierListsRequest } from "./UpdateItemModifierListsRequest"; +export type { UpdateItemTaxesRequest } from "./UpdateItemTaxesRequest"; diff --git a/src/api/resources/catalog/resources/images/client/Client.ts b/src/api/resources/catalog/resources/images/client/Client.ts index dedc2fcf4..f3af25ea8 100644 --- a/src/api/resources/catalog/resources/images/client/Client.ts +++ b/src/api/resources/catalog/resources/images/client/Client.ts @@ -1,40 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; -import { toJson } from "../../../../../../core/json"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import { toJson } from "../../../../../../core/json"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Images { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Images { @@ -56,6 +34,7 @@ export class Images { * @param {Images.RequestOptions} requestOptions - Request-specific configuration. * * @example + * import { createReadStream } from "fs"; * await client.catalog.images.create({}) */ public create( @@ -87,6 +66,15 @@ export class Images { } const _maybeEncodedRequest = await _request.getRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + ..._maybeEncodedRequest.headers, + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -95,20 +83,13 @@ export class Images { "v2/catalog/images", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - ..._maybeEncodedRequest.headers, - }), - requestOptions?.headers, - ), + headers: _headers, + queryParameters: requestOptions?.queryParams, requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -159,6 +140,7 @@ export class Images { * @param {Images.RequestOptions} requestOptions - Request-specific configuration. * * @example + * import { createReadStream } from "fs"; * await client.catalog.images.update({ * imageId: "image_id" * }) @@ -192,6 +174,15 @@ export class Images { } const _maybeEncodedRequest = await _request.getRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + ..._maybeEncodedRequest.headers, + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -200,20 +191,13 @@ export class Images { `v2/catalog/images/${encodeURIComponent(request.imageId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - ..._maybeEncodedRequest.headers, - }), - requestOptions?.headers, - ), + headers: _headers, + queryParameters: requestOptions?.queryParams, requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -255,7 +239,7 @@ export class Images { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/catalog/resources/images/client/index.ts b/src/api/resources/catalog/resources/images/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/catalog/resources/images/client/index.ts +++ b/src/api/resources/catalog/resources/images/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/catalog/resources/images/client/requests/CreateImagesRequest.ts b/src/api/resources/catalog/resources/images/client/requests/CreateImagesRequest.ts index 50d490319..959ebc4d2 100644 --- a/src/api/resources/catalog/resources/images/client/requests/CreateImagesRequest.ts +++ b/src/api/resources/catalog/resources/images/client/requests/CreateImagesRequest.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; -import * as fs from "fs"; +import type * as fs from "fs"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/catalog/resources/images/client/requests/UpdateImagesRequest.ts b/src/api/resources/catalog/resources/images/client/requests/UpdateImagesRequest.ts index ad56e6e59..ce4aba4af 100644 --- a/src/api/resources/catalog/resources/images/client/requests/UpdateImagesRequest.ts +++ b/src/api/resources/catalog/resources/images/client/requests/UpdateImagesRequest.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; -import * as fs from "fs"; +import type * as fs from "fs"; +import type * as Square from "../../../../../../index"; /** * @example @@ -12,9 +10,7 @@ import * as fs from "fs"; * } */ export interface UpdateImagesRequest { - /** - * The ID of the `CatalogImage` object to update the encapsulated image file. - */ + /** The ID of the `CatalogImage` object to update the encapsulated image file. */ imageId: string; request?: Square.UpdateCatalogImageRequest; imageFile?: File | fs.ReadStream | Blob | undefined; diff --git a/src/api/resources/catalog/resources/images/client/requests/index.ts b/src/api/resources/catalog/resources/images/client/requests/index.ts index ebbd407bb..ec7e38ae9 100644 --- a/src/api/resources/catalog/resources/images/client/requests/index.ts +++ b/src/api/resources/catalog/resources/images/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type CreateImagesRequest } from "./CreateImagesRequest"; -export { type UpdateImagesRequest } from "./UpdateImagesRequest"; +export type { CreateImagesRequest } from "./CreateImagesRequest"; +export type { UpdateImagesRequest } from "./UpdateImagesRequest"; diff --git a/src/api/resources/catalog/resources/index.ts b/src/api/resources/catalog/resources/index.ts index cbcd61155..842612441 100644 --- a/src/api/resources/catalog/resources/index.ts +++ b/src/api/resources/catalog/resources/index.ts @@ -1,4 +1,4 @@ export * as images from "./images"; -export * as object from "./object"; export * from "./images/client/requests"; +export * as object from "./object"; export * from "./object/client/requests"; diff --git a/src/api/resources/catalog/resources/object/client/Client.ts b/src/api/resources/catalog/resources/object/client/Client.ts index 51bb3c6c5..b6beb0ff3 100644 --- a/src/api/resources/catalog/resources/object/client/Client.ts +++ b/src/api/resources/catalog/resources/object/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Object_ { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Object_ { @@ -73,6 +51,14 @@ export class Object_ { request: Square.catalog.UpsertCatalogObjectRequest, requestOptions?: Object_.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -81,22 +67,16 @@ export class Object_ { "v2/catalog/object", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.catalog.UpsertCatalogObjectRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -171,17 +151,25 @@ export class Object_ { const { objectId, includeRelatedObjects, catalogVersion, includeCategoryPathToRoot } = request; const _queryParams: Record = {}; if (includeRelatedObjects !== undefined) { - _queryParams["include_related_objects"] = includeRelatedObjects?.toString() ?? null; + _queryParams.include_related_objects = includeRelatedObjects?.toString() ?? null; } if (catalogVersion !== undefined) { - _queryParams["catalog_version"] = catalogVersion?.toString() ?? null; + _queryParams.catalog_version = catalogVersion?.toString() ?? null; } if (includeCategoryPathToRoot !== undefined) { - _queryParams["include_category_path_to_root"] = includeCategoryPathToRoot?.toString() ?? null; + _queryParams.include_category_path_to_root = includeCategoryPathToRoot?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -190,17 +178,10 @@ export class Object_ { `v2/catalog/object/${encodeURIComponent(objectId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -275,6 +256,14 @@ export class Object_ { requestOptions?: Object_.RequestOptions, ): Promise> { const { objectId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -283,16 +272,10 @@ export class Object_ { `v2/catalog/object/${encodeURIComponent(objectId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -336,7 +319,7 @@ export class Object_ { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/catalog/resources/object/client/index.ts b/src/api/resources/catalog/resources/object/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/catalog/resources/object/client/index.ts +++ b/src/api/resources/catalog/resources/object/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/catalog/resources/object/client/requests/DeleteObjectRequest.ts b/src/api/resources/catalog/resources/object/client/requests/DeleteObjectRequest.ts index 5553a8a35..f34c339f7 100644 --- a/src/api/resources/catalog/resources/object/client/requests/DeleteObjectRequest.ts +++ b/src/api/resources/catalog/resources/object/client/requests/DeleteObjectRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts b/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts index a39970258..5d3887af9 100644 --- a/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts +++ b/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -12,9 +10,7 @@ * } */ export interface GetObjectRequest { - /** - * The object ID of any type of catalog objects to be retrieved. - */ + /** The object ID of any type of catalog objects to be retrieved. */ objectId: string; /** * If `true`, the response will include additional objects that are related to the diff --git a/src/api/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts b/src/api/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts index 071efb170..bec15210f 100644 --- a/src/api/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts +++ b/src/api/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/catalog/resources/object/client/requests/index.ts b/src/api/resources/catalog/resources/object/client/requests/index.ts index a974f1464..11c1281ff 100644 --- a/src/api/resources/catalog/resources/object/client/requests/index.ts +++ b/src/api/resources/catalog/resources/object/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type UpsertCatalogObjectRequest } from "./UpsertCatalogObjectRequest"; -export { type GetObjectRequest } from "./GetObjectRequest"; -export { type DeleteObjectRequest } from "./DeleteObjectRequest"; +export type { DeleteObjectRequest } from "./DeleteObjectRequest"; +export type { GetObjectRequest } from "./GetObjectRequest"; +export type { UpsertCatalogObjectRequest } from "./UpsertCatalogObjectRequest"; diff --git a/src/api/resources/channels/client/Client.ts b/src/api/resources/channels/client/Client.ts index 42016aa0d..58129e0b1 100644 --- a/src/api/resources/channels/client/Client.ts +++ b/src/api/resources/channels/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; -import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Channels { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Channels { @@ -67,26 +45,34 @@ export class Channels { const { referenceType, referenceId, status, cursor, limit } = request; const _queryParams: Record = {}; if (referenceType !== undefined) { - _queryParams["reference_type"] = serializers.ReferenceType.jsonOrThrow(referenceType, { + _queryParams.reference_type = serializers.ReferenceType.jsonOrThrow(referenceType, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (referenceId !== undefined) { - _queryParams["reference_id"] = referenceId; + _queryParams.reference_id = referenceId; } if (status !== undefined) { - _queryParams["status"] = serializers.ChannelStatus.jsonOrThrow(status, { + _queryParams.status = serializers.ChannelStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -95,18 +81,10 @@ export class Channels { "v2/channels", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -180,6 +158,14 @@ export class Channels { request: Square.BulkRetrieveChannelsRequest, requestOptions?: Channels.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -188,22 +174,16 @@ export class Channels { "v2/channels/bulk-retrieve", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkRetrieveChannelsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -267,6 +247,14 @@ export class Channels { requestOptions?: Channels.RequestOptions, ): Promise> { const { channelId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -275,16 +263,10 @@ export class Channels { `v2/channels/${encodeURIComponent(channelId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -326,7 +308,7 @@ export class Channels { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/channels/client/index.ts b/src/api/resources/channels/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/channels/client/index.ts +++ b/src/api/resources/channels/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts b/src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts index 42c908fd0..72ec81ea6 100644 --- a/src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts +++ b/src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/channels/client/requests/GetChannelsRequest.ts b/src/api/resources/channels/client/requests/GetChannelsRequest.ts index eb452888a..89ae4b7f7 100644 --- a/src/api/resources/channels/client/requests/GetChannelsRequest.ts +++ b/src/api/resources/channels/client/requests/GetChannelsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetChannelsRequest { - /** - * A channel id - */ + /** A channel id */ channelId: string; } diff --git a/src/api/resources/channels/client/requests/ListChannelsRequest.ts b/src/api/resources/channels/client/requests/ListChannelsRequest.ts index 52e45208d..c27ecb486 100644 --- a/src/api/resources/channels/client/requests/ListChannelsRequest.ts +++ b/src/api/resources/channels/client/requests/ListChannelsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -15,21 +13,13 @@ import * as Square from "../../../../index"; * } */ export interface ListChannelsRequest { - /** - * Type of reference associated to channel - */ + /** Type of reference associated to channel */ referenceType?: Square.ReferenceType | null; - /** - * id of reference associated to channel - */ + /** id of reference associated to channel */ referenceId?: string | null; - /** - * Status of channel - */ + /** Status of channel */ status?: Square.ChannelStatus | null; - /** - * Cursor to fetch the next result - */ + /** Cursor to fetch the next result */ cursor?: string | null; /** * Maximum number of results to return. diff --git a/src/api/resources/channels/client/requests/index.ts b/src/api/resources/channels/client/requests/index.ts index 8255049a1..5e5f4c64a 100644 --- a/src/api/resources/channels/client/requests/index.ts +++ b/src/api/resources/channels/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type ListChannelsRequest } from "./ListChannelsRequest"; -export { type BulkRetrieveChannelsRequest } from "./BulkRetrieveChannelsRequest"; -export { type GetChannelsRequest } from "./GetChannelsRequest"; +export type { BulkRetrieveChannelsRequest } from "./BulkRetrieveChannelsRequest"; +export type { GetChannelsRequest } from "./GetChannelsRequest"; +export type { ListChannelsRequest } from "./ListChannelsRequest"; diff --git a/src/api/resources/checkout/client/Client.ts b/src/api/resources/checkout/client/Client.ts index 80aca7915..00938035d 100644 --- a/src/api/resources/checkout/client/Client.ts +++ b/src/api/resources/checkout/client/Client.ts @@ -1,40 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { PaymentLinks } from "../resources/paymentLinks/client/Client"; export declare namespace Checkout { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Checkout { @@ -72,6 +50,14 @@ export class Checkout { requestOptions?: Checkout.RequestOptions, ): Promise> { const { locationId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -80,16 +66,10 @@ export class Checkout { `v2/online-checkout/location-settings/${encodeURIComponent(locationId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -156,6 +136,14 @@ export class Checkout { requestOptions?: Checkout.RequestOptions, ): Promise> { const { locationId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -164,22 +152,16 @@ export class Checkout { `v2/online-checkout/location-settings/${encodeURIComponent(locationId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateLocationSettingsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -239,6 +221,14 @@ export class Checkout { private async __retrieveMerchantSettings( requestOptions?: Checkout.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -247,16 +237,10 @@ export class Checkout { "v2/online-checkout/merchant-settings", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -321,6 +305,14 @@ export class Checkout { request: Square.UpdateMerchantSettingsRequest, requestOptions?: Checkout.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -329,22 +321,16 @@ export class Checkout { "v2/online-checkout/merchant-settings", ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateMerchantSettingsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -388,7 +374,7 @@ export class Checkout { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/checkout/client/index.ts b/src/api/resources/checkout/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/checkout/client/index.ts +++ b/src/api/resources/checkout/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/checkout/client/requests/RetrieveLocationSettingsRequest.ts b/src/api/resources/checkout/client/requests/RetrieveLocationSettingsRequest.ts index 71ce84a90..01f3b4124 100644 --- a/src/api/resources/checkout/client/requests/RetrieveLocationSettingsRequest.ts +++ b/src/api/resources/checkout/client/requests/RetrieveLocationSettingsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface RetrieveLocationSettingsRequest { - /** - * The ID of the location for which to retrieve settings. - */ + /** The ID of the location for which to retrieve settings. */ locationId: string; } diff --git a/src/api/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts b/src/api/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts index e94cf5f0c..762c6ea9b 100644 --- a/src/api/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts +++ b/src/api/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -12,9 +10,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateLocationSettingsRequest { - /** - * The ID of the location for which to retrieve settings. - */ + /** The ID of the location for which to retrieve settings. */ locationId: string; /** Describe your updates using the `location_settings` object. Make sure it contains only the fields that have changed. */ locationSettings: Square.CheckoutLocationSettings; diff --git a/src/api/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts b/src/api/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts index d46b43bda..6430f9b80 100644 --- a/src/api/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts +++ b/src/api/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/checkout/client/requests/index.ts b/src/api/resources/checkout/client/requests/index.ts index ff86d69a5..760953527 100644 --- a/src/api/resources/checkout/client/requests/index.ts +++ b/src/api/resources/checkout/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type RetrieveLocationSettingsRequest } from "./RetrieveLocationSettingsRequest"; -export { type UpdateLocationSettingsRequest } from "./UpdateLocationSettingsRequest"; -export { type UpdateMerchantSettingsRequest } from "./UpdateMerchantSettingsRequest"; +export type { RetrieveLocationSettingsRequest } from "./RetrieveLocationSettingsRequest"; +export type { UpdateLocationSettingsRequest } from "./UpdateLocationSettingsRequest"; +export type { UpdateMerchantSettingsRequest } from "./UpdateMerchantSettingsRequest"; diff --git a/src/api/resources/checkout/resources/paymentLinks/client/Client.ts b/src/api/resources/checkout/resources/paymentLinks/client/Client.ts index 0cab603d1..5e232fc75 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/Client.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace PaymentLinks { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class PaymentLinks { @@ -66,11 +44,19 @@ export class PaymentLinks { const { cursor, limit } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -79,18 +65,10 @@ export class PaymentLinks { "v2/online-checkout/payment-links", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -174,6 +152,14 @@ export class PaymentLinks { request: Square.checkout.CreatePaymentLinkRequest = {}, requestOptions?: PaymentLinks.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -182,22 +168,16 @@ export class PaymentLinks { "v2/online-checkout/payment-links", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.checkout.CreatePaymentLinkRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -263,6 +243,14 @@ export class PaymentLinks { requestOptions?: PaymentLinks.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -271,16 +259,10 @@ export class PaymentLinks { `v2/online-checkout/payment-links/${encodeURIComponent(id)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -354,6 +336,14 @@ export class PaymentLinks { requestOptions?: PaymentLinks.RequestOptions, ): Promise> { const { id, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -362,22 +352,16 @@ export class PaymentLinks { `v2/online-checkout/payment-links/${encodeURIComponent(id)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.checkout.UpdatePaymentLinkRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -443,6 +427,14 @@ export class PaymentLinks { requestOptions?: PaymentLinks.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -451,16 +443,10 @@ export class PaymentLinks { `v2/online-checkout/payment-links/${encodeURIComponent(id)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -504,7 +490,7 @@ export class PaymentLinks { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/checkout/resources/paymentLinks/client/index.ts b/src/api/resources/checkout/resources/paymentLinks/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/index.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts index 3aff25717..49046088f 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/DeletePaymentLinksRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/DeletePaymentLinksRequest.ts index 97f225007..46598a462 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/DeletePaymentLinksRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/DeletePaymentLinksRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeletePaymentLinksRequest { - /** - * The ID of the payment link to delete. - */ + /** The ID of the payment link to delete. */ id: string; } diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/GetPaymentLinksRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/GetPaymentLinksRequest.ts index d25d871be..9e606f67d 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/GetPaymentLinksRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/GetPaymentLinksRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetPaymentLinksRequest { - /** - * The ID of link to retrieve. - */ + /** The ID of link to retrieve. */ id: string; } diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts index ebcb3acd2..325710fc8 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts index 52118ba6c..1d106ba96 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -17,9 +15,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdatePaymentLinkRequest { - /** - * The ID of the payment link to update. - */ + /** The ID of the payment link to update. */ id: string; /** * The `payment_link` object describing the updates to apply. diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/index.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/index.ts index f201fa065..07f94c75f 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/index.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type ListPaymentLinksRequest } from "./ListPaymentLinksRequest"; -export { type CreatePaymentLinkRequest } from "./CreatePaymentLinkRequest"; -export { type GetPaymentLinksRequest } from "./GetPaymentLinksRequest"; -export { type UpdatePaymentLinkRequest } from "./UpdatePaymentLinkRequest"; -export { type DeletePaymentLinksRequest } from "./DeletePaymentLinksRequest"; +export type { CreatePaymentLinkRequest } from "./CreatePaymentLinkRequest"; +export type { DeletePaymentLinksRequest } from "./DeletePaymentLinksRequest"; +export type { GetPaymentLinksRequest } from "./GetPaymentLinksRequest"; +export type { ListPaymentLinksRequest } from "./ListPaymentLinksRequest"; +export type { UpdatePaymentLinkRequest } from "./UpdatePaymentLinkRequest"; diff --git a/src/api/resources/customers/client/Client.ts b/src/api/resources/customers/client/Client.ts index 90c71fbaa..81b4131d6 100644 --- a/src/api/resources/customers/client/Client.ts +++ b/src/api/resources/customers/client/Client.ts @@ -1,44 +1,22 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; -import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; +import { Cards } from "../resources/cards/client/Client"; import { CustomAttributeDefinitions } from "../resources/customAttributeDefinitions/client/Client"; +import { CustomAttributes } from "../resources/customAttributes/client/Client"; import { Groups } from "../resources/groups/client/Client"; import { Segments } from "../resources/segments/client/Client"; -import { Cards } from "../resources/cards/client/Client"; -import { CustomAttributes } from "../resources/customAttributes/client/Client"; export declare namespace Customers { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Customers { @@ -103,26 +81,34 @@ export class Customers { const { cursor, limit, sortField, sortOrder, count } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (sortField !== undefined) { - _queryParams["sort_field"] = serializers.CustomerSortField.jsonOrThrow(sortField, { + _queryParams.sort_field = serializers.CustomerSortField.jsonOrThrow(sortField, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (sortOrder !== undefined) { - _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (count !== undefined) { - _queryParams["count"] = count?.toString() ?? null; + _queryParams.count = count?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -131,18 +117,10 @@ export class Customers { "v2/customers", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -238,6 +216,14 @@ export class Customers { request: Square.CreateCustomerRequest = {}, requestOptions?: Customers.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -246,22 +232,16 @@ export class Customers { "v2/customers", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateCustomerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -367,6 +347,14 @@ export class Customers { request: Square.BulkCreateCustomersRequest, requestOptions?: Customers.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -375,22 +363,16 @@ export class Customers { "v2/customers/bulk-create", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkCreateCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -455,6 +437,14 @@ export class Customers { request: Square.BulkDeleteCustomersRequest, requestOptions?: Customers.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -463,22 +453,16 @@ export class Customers { "v2/customers/bulk-delete", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkDeleteCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -543,6 +527,14 @@ export class Customers { request: Square.BulkRetrieveCustomersRequest, requestOptions?: Customers.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -551,22 +543,16 @@ export class Customers { "v2/customers/bulk-retrieve", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkRetrieveCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -642,6 +628,14 @@ export class Customers { request: Square.BulkUpdateCustomersRequest, requestOptions?: Customers.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -650,22 +644,16 @@ export class Customers { "v2/customers/bulk-update", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkUpdateCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -758,6 +746,14 @@ export class Customers { request: Square.SearchCustomersRequest = {}, requestOptions?: Customers.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -766,22 +762,16 @@ export class Customers { "v2/customers/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -845,6 +835,14 @@ export class Customers { requestOptions?: Customers.RequestOptions, ): Promise> { const { customerId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -853,16 +851,10 @@ export class Customers { `v2/customers/${encodeURIComponent(customerId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -932,6 +924,14 @@ export class Customers { requestOptions?: Customers.RequestOptions, ): Promise> { const { customerId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -940,22 +940,16 @@ export class Customers { `v2/customers/${encodeURIComponent(customerId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateCustomerRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1024,9 +1018,17 @@ export class Customers { const { customerId, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -1035,17 +1037,10 @@ export class Customers { `v2/customers/${encodeURIComponent(customerId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1089,7 +1084,7 @@ export class Customers { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/client/index.ts b/src/api/resources/customers/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/customers/client/index.ts +++ b/src/api/resources/customers/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/customers/client/requests/BulkCreateCustomersRequest.ts b/src/api/resources/customers/client/requests/BulkCreateCustomersRequest.ts index 95a024d18..844c36522 100644 --- a/src/api/resources/customers/client/requests/BulkCreateCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/BulkCreateCustomersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/customers/client/requests/BulkDeleteCustomersRequest.ts b/src/api/resources/customers/client/requests/BulkDeleteCustomersRequest.ts index 125111848..db897b451 100644 --- a/src/api/resources/customers/client/requests/BulkDeleteCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/BulkDeleteCustomersRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts b/src/api/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts index 99a7568c7..9ca779f0f 100644 --- a/src/api/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/customers/client/requests/BulkUpdateCustomersRequest.ts b/src/api/resources/customers/client/requests/BulkUpdateCustomersRequest.ts index 2af49f166..76409fde8 100644 --- a/src/api/resources/customers/client/requests/BulkUpdateCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/BulkUpdateCustomersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/customers/client/requests/CreateCustomerRequest.ts b/src/api/resources/customers/client/requests/CreateCustomerRequest.ts index 3aeb62979..0326055ed 100644 --- a/src/api/resources/customers/client/requests/CreateCustomerRequest.ts +++ b/src/api/resources/customers/client/requests/CreateCustomerRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts b/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts index 7e0dc540a..c32e263c4 100644 --- a/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface DeleteCustomersRequest { - /** - * The ID of the customer to delete. - */ + /** The ID of the customer to delete. */ customerId: string; /** * The current version of the customer profile. diff --git a/src/api/resources/customers/client/requests/GetCustomersRequest.ts b/src/api/resources/customers/client/requests/GetCustomersRequest.ts index 5e5f54091..6ceee6583 100644 --- a/src/api/resources/customers/client/requests/GetCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/GetCustomersRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetCustomersRequest { - /** - * The ID of the customer to retrieve. - */ + /** The ID of the customer to retrieve. */ customerId: string; } diff --git a/src/api/resources/customers/client/requests/ListCustomersRequest.ts b/src/api/resources/customers/client/requests/ListCustomersRequest.ts index c10f2c512..35aa50e56 100644 --- a/src/api/resources/customers/client/requests/ListCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/ListCustomersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/customers/client/requests/SearchCustomersRequest.ts b/src/api/resources/customers/client/requests/SearchCustomersRequest.ts index 898381ffd..fcb3917d7 100644 --- a/src/api/resources/customers/client/requests/SearchCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/SearchCustomersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/customers/client/requests/UpdateCustomerRequest.ts b/src/api/resources/customers/client/requests/UpdateCustomerRequest.ts index 8aae7b1ec..fc9a8eba8 100644 --- a/src/api/resources/customers/client/requests/UpdateCustomerRequest.ts +++ b/src/api/resources/customers/client/requests/UpdateCustomerRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -14,9 +12,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateCustomerRequest { - /** - * The ID of the customer to update. - */ + /** The ID of the customer to update. */ customerId: string; /** * The given name (that is, the first name) associated with the customer profile. diff --git a/src/api/resources/customers/client/requests/index.ts b/src/api/resources/customers/client/requests/index.ts index 01de7b583..a43a19c18 100644 --- a/src/api/resources/customers/client/requests/index.ts +++ b/src/api/resources/customers/client/requests/index.ts @@ -1,10 +1,10 @@ -export { type ListCustomersRequest } from "./ListCustomersRequest"; -export { type CreateCustomerRequest } from "./CreateCustomerRequest"; -export { type BulkCreateCustomersRequest } from "./BulkCreateCustomersRequest"; -export { type BulkDeleteCustomersRequest } from "./BulkDeleteCustomersRequest"; -export { type BulkRetrieveCustomersRequest } from "./BulkRetrieveCustomersRequest"; -export { type BulkUpdateCustomersRequest } from "./BulkUpdateCustomersRequest"; -export { type SearchCustomersRequest } from "./SearchCustomersRequest"; -export { type GetCustomersRequest } from "./GetCustomersRequest"; -export { type UpdateCustomerRequest } from "./UpdateCustomerRequest"; -export { type DeleteCustomersRequest } from "./DeleteCustomersRequest"; +export type { BulkCreateCustomersRequest } from "./BulkCreateCustomersRequest"; +export type { BulkDeleteCustomersRequest } from "./BulkDeleteCustomersRequest"; +export type { BulkRetrieveCustomersRequest } from "./BulkRetrieveCustomersRequest"; +export type { BulkUpdateCustomersRequest } from "./BulkUpdateCustomersRequest"; +export type { CreateCustomerRequest } from "./CreateCustomerRequest"; +export type { DeleteCustomersRequest } from "./DeleteCustomersRequest"; +export type { GetCustomersRequest } from "./GetCustomersRequest"; +export type { ListCustomersRequest } from "./ListCustomersRequest"; +export type { SearchCustomersRequest } from "./SearchCustomersRequest"; +export type { UpdateCustomerRequest } from "./UpdateCustomerRequest"; diff --git a/src/api/resources/customers/resources/cards/client/Client.ts b/src/api/resources/customers/resources/cards/client/Client.ts index 5758d6dca..3bc24cc2c 100644 --- a/src/api/resources/customers/resources/cards/client/Client.ts +++ b/src/api/resources/customers/resources/cards/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Cards { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Cards { @@ -80,6 +58,14 @@ export class Cards { requestOptions?: Cards.RequestOptions, ): Promise> { const { customerId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -88,22 +74,16 @@ export class Cards { `v2/customers/${encodeURIComponent(customerId)}/cards`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.CreateCustomerCardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -170,6 +150,14 @@ export class Cards { requestOptions?: Cards.RequestOptions, ): Promise> { const { customerId, cardId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -178,16 +166,10 @@ export class Cards { `v2/customers/${encodeURIComponent(customerId)}/cards/${encodeURIComponent(cardId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -231,7 +213,7 @@ export class Cards { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/resources/cards/client/index.ts b/src/api/resources/customers/resources/cards/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/customers/resources/cards/client/index.ts +++ b/src/api/resources/customers/resources/cards/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts b/src/api/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts index 05226b95c..e394cc7ff 100644 --- a/src/api/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts +++ b/src/api/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -21,9 +19,7 @@ import * as Square from "../../../../../../index"; * } */ export interface CreateCustomerCardRequest { - /** - * The Square ID of the customer profile the card is linked to. - */ + /** The Square ID of the customer profile the card is linked to. */ customerId: string; /** * A card nonce representing the credit card to link to the customer. diff --git a/src/api/resources/customers/resources/cards/client/requests/DeleteCardsRequest.ts b/src/api/resources/customers/resources/cards/client/requests/DeleteCardsRequest.ts index b21e54b56..6abffd498 100644 --- a/src/api/resources/customers/resources/cards/client/requests/DeleteCardsRequest.ts +++ b/src/api/resources/customers/resources/cards/client/requests/DeleteCardsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface DeleteCardsRequest { - /** - * The ID of the customer that the card on file belongs to. - */ + /** The ID of the customer that the card on file belongs to. */ customerId: string; - /** - * The ID of the card on file to delete. - */ + /** The ID of the card on file to delete. */ cardId: string; } diff --git a/src/api/resources/customers/resources/cards/client/requests/index.ts b/src/api/resources/customers/resources/cards/client/requests/index.ts index f9b2da688..b30438186 100644 --- a/src/api/resources/customers/resources/cards/client/requests/index.ts +++ b/src/api/resources/customers/resources/cards/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type CreateCustomerCardRequest } from "./CreateCustomerCardRequest"; -export { type DeleteCardsRequest } from "./DeleteCardsRequest"; +export type { CreateCustomerCardRequest } from "./CreateCustomerCardRequest"; +export type { DeleteCardsRequest } from "./DeleteCardsRequest"; diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts index 20e37876d..46b93cb36 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace CustomAttributeDefinitions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class CustomAttributeDefinitions { @@ -71,11 +49,19 @@ export class CustomAttributeDefinitions { const { limit, cursor } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -84,18 +70,10 @@ export class CustomAttributeDefinitions { "v2/customers/custom-attribute-definitions", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -192,6 +170,14 @@ export class CustomAttributeDefinitions { request: Square.customers.CreateCustomerCustomAttributeDefinitionRequest, requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -200,22 +186,16 @@ export class CustomAttributeDefinitions { "v2/customers/custom-attribute-definitions", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.CreateCustomerCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -288,9 +268,17 @@ export class CustomAttributeDefinitions { const { key, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -299,17 +287,10 @@ export class CustomAttributeDefinitions { `v2/customers/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -385,6 +366,14 @@ export class CustomAttributeDefinitions { requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -393,22 +382,16 @@ export class CustomAttributeDefinitions { `v2/customers/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.UpdateCustomerCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -479,6 +462,14 @@ export class CustomAttributeDefinitions { requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -487,16 +478,10 @@ export class CustomAttributeDefinitions { `v2/customers/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -610,6 +595,14 @@ export class CustomAttributeDefinitions { request: Square.customers.BatchUpsertCustomerCustomAttributesRequest, requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -618,22 +611,16 @@ export class CustomAttributeDefinitions { "v2/customers/custom-attributes/bulk-upsert", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.BatchUpsertCustomerCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -677,7 +664,7 @@ export class CustomAttributeDefinitions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/index.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/index.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts index a4550a3fe..df09804dd 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts index 33e0d7815..ecdb0b4aa 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts index 6a1b34cf1..a9c9d9ec5 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteCustomAttributeDefinitionsRequest { - /** - * The key of the custom attribute definition to delete. - */ + /** The key of the custom attribute definition to delete. */ key: string; } diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index e4c05d712..3de83fd32 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index ded39f5a0..b059525c5 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts index 1a6d65104..a279ad36a 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,9 +13,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateCustomerCustomAttributeDefinitionRequest { - /** - * The key of the custom attribute definition to update. - */ + /** The key of the custom attribute definition to update. */ key: string; /** * The custom attribute definition that contains the fields to update. This endpoint diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts index 5ad73b714..f83a54385 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,6 +1,6 @@ -export { type ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; -export { type CreateCustomerCustomAttributeDefinitionRequest } from "./CreateCustomerCustomAttributeDefinitionRequest"; -export { type GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; -export { type UpdateCustomerCustomAttributeDefinitionRequest } from "./UpdateCustomerCustomAttributeDefinitionRequest"; -export { type DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; -export { type BatchUpsertCustomerCustomAttributesRequest } from "./BatchUpsertCustomerCustomAttributesRequest"; +export type { BatchUpsertCustomerCustomAttributesRequest } from "./BatchUpsertCustomerCustomAttributesRequest"; +export type { CreateCustomerCustomAttributeDefinitionRequest } from "./CreateCustomerCustomAttributeDefinitionRequest"; +export type { DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; +export type { GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; +export type { ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; +export type { UpdateCustomerCustomAttributeDefinitionRequest } from "./UpdateCustomerCustomAttributeDefinitionRequest"; diff --git a/src/api/resources/customers/resources/customAttributes/client/Client.ts b/src/api/resources/customers/resources/customAttributes/client/Client.ts index 1f255afb0..f606603fb 100644 --- a/src/api/resources/customers/resources/customAttributes/client/Client.ts +++ b/src/api/resources/customers/resources/customAttributes/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace CustomAttributes { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class CustomAttributes { @@ -75,14 +53,22 @@ export class CustomAttributes { const { customerId, limit, cursor, withDefinitions } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (withDefinitions !== undefined) { - _queryParams["with_definitions"] = withDefinitions?.toString() ?? null; + _queryParams.with_definitions = withDefinitions?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -91,18 +77,10 @@ export class CustomAttributes { `v2/customers/${encodeURIComponent(customerId)}/custom-attributes`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -191,13 +169,21 @@ export class CustomAttributes { const { customerId, key, withDefinition, version } = request; const _queryParams: Record = {}; if (withDefinition !== undefined) { - _queryParams["with_definition"] = withDefinition?.toString() ?? null; + _queryParams.with_definition = withDefinition?.toString() ?? null; } if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -206,17 +192,10 @@ export class CustomAttributes { `v2/customers/${encodeURIComponent(customerId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -294,6 +273,14 @@ export class CustomAttributes { requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { customerId, key, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -302,22 +289,16 @@ export class CustomAttributes { `v2/customers/${encodeURIComponent(customerId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.UpsertCustomerCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -388,6 +369,14 @@ export class CustomAttributes { requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { customerId, key } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -396,16 +385,10 @@ export class CustomAttributes { `v2/customers/${encodeURIComponent(customerId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -449,7 +432,7 @@ export class CustomAttributes { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/resources/customAttributes/client/index.ts b/src/api/resources/customers/resources/customAttributes/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/customers/resources/customAttributes/client/index.ts +++ b/src/api/resources/customers/resources/customAttributes/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts b/src/api/resources/customers/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts index fd96e16a6..45be858bf 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface DeleteCustomAttributesRequest { - /** - * The ID of the target [customer profile](entity:Customer). - */ + /** The ID of the target [customer profile](entity:Customer). */ customerId: string; /** * The key of the custom attribute to delete. This key must match the `key` of a custom diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index dec991b8a..d92b68b07 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -12,9 +10,7 @@ * } */ export interface GetCustomAttributesRequest { - /** - * The ID of the target [customer profile](entity:Customer). - */ + /** The ID of the target [customer profile](entity:Customer). */ customerId: string; /** * The key of the custom attribute to retrieve. This key must match the `key` of a custom diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index 61d16f54a..7811b43bf 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -12,9 +10,7 @@ * } */ export interface ListCustomAttributesRequest { - /** - * The ID of the target [customer profile](entity:Customer). - */ + /** The ID of the target [customer profile](entity:Customer). */ customerId: string; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts b/src/api/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts index c9728624d..baa5c49f5 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,9 +13,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpsertCustomerCustomAttributeRequest { - /** - * The ID of the target [customer profile](entity:Customer). - */ + /** The ID of the target [customer profile](entity:Customer). */ customerId: string; /** * The key of the custom attribute to create or update. This key must match the `key` of a diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/index.ts b/src/api/resources/customers/resources/customAttributes/client/requests/index.ts index db9a23463..48ae5a3cb 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/index.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; -export { type GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; -export { type UpsertCustomerCustomAttributeRequest } from "./UpsertCustomerCustomAttributeRequest"; -export { type DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; +export type { DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; +export type { GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; +export type { ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; +export type { UpsertCustomerCustomAttributeRequest } from "./UpsertCustomerCustomAttributeRequest"; diff --git a/src/api/resources/customers/resources/groups/client/Client.ts b/src/api/resources/customers/resources/groups/client/Client.ts index 12c75283d..9dc0c30d1 100644 --- a/src/api/resources/customers/resources/groups/client/Client.ts +++ b/src/api/resources/customers/resources/groups/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Groups { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Groups { @@ -66,11 +44,19 @@ export class Groups { const { cursor, limit } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -79,18 +65,10 @@ export class Groups { "v2/customers/groups", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -168,6 +146,14 @@ export class Groups { request: Square.customers.CreateCustomerGroupRequest, requestOptions?: Groups.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -176,22 +162,16 @@ export class Groups { "v2/customers/groups", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.CreateCustomerGroupRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -255,6 +235,14 @@ export class Groups { requestOptions?: Groups.RequestOptions, ): Promise> { const { groupId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -263,16 +251,10 @@ export class Groups { `v2/customers/groups/${encodeURIComponent(groupId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -341,6 +323,14 @@ export class Groups { requestOptions?: Groups.RequestOptions, ): Promise> { const { groupId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -349,22 +339,16 @@ export class Groups { `v2/customers/groups/${encodeURIComponent(groupId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.UpdateCustomerGroupRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -430,6 +414,14 @@ export class Groups { requestOptions?: Groups.RequestOptions, ): Promise> { const { groupId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -438,16 +430,10 @@ export class Groups { `v2/customers/groups/${encodeURIComponent(groupId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -517,6 +503,14 @@ export class Groups { requestOptions?: Groups.RequestOptions, ): Promise> { const { customerId, groupId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -525,16 +519,10 @@ export class Groups { `v2/customers/${encodeURIComponent(customerId)}/groups/${encodeURIComponent(groupId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -604,6 +592,14 @@ export class Groups { requestOptions?: Groups.RequestOptions, ): Promise> { const { customerId, groupId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -612,16 +608,10 @@ export class Groups { `v2/customers/${encodeURIComponent(customerId)}/groups/${encodeURIComponent(groupId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -665,7 +655,7 @@ export class Groups { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/resources/groups/client/index.ts b/src/api/resources/customers/resources/groups/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/customers/resources/groups/client/index.ts +++ b/src/api/resources/customers/resources/groups/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/customers/resources/groups/client/requests/AddGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/AddGroupsRequest.ts index df2f570ea..fbcec87d4 100644 --- a/src/api/resources/customers/resources/groups/client/requests/AddGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/AddGroupsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface AddGroupsRequest { - /** - * The ID of the customer to add to a group. - */ + /** The ID of the customer to add to a group. */ customerId: string; - /** - * The ID of the customer group to add the customer to. - */ + /** The ID of the customer group to add the customer to. */ groupId: string; } diff --git a/src/api/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts b/src/api/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts index 4bbad8d1a..9a4521c2f 100644 --- a/src/api/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/customers/resources/groups/client/requests/DeleteGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/DeleteGroupsRequest.ts index 42f86baa1..65ede93bb 100644 --- a/src/api/resources/customers/resources/groups/client/requests/DeleteGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/DeleteGroupsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteGroupsRequest { - /** - * The ID of the customer group to delete. - */ + /** The ID of the customer group to delete. */ groupId: string; } diff --git a/src/api/resources/customers/resources/groups/client/requests/GetGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/GetGroupsRequest.ts index 2ee379d62..dc11c0b6b 100644 --- a/src/api/resources/customers/resources/groups/client/requests/GetGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/GetGroupsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetGroupsRequest { - /** - * The ID of the customer group to retrieve. - */ + /** The ID of the customer group to retrieve. */ groupId: string; } diff --git a/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts index 8f5ce9765..41097252d 100644 --- a/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/customers/resources/groups/client/requests/RemoveGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/RemoveGroupsRequest.ts index 5404edfa6..8ddc34ab1 100644 --- a/src/api/resources/customers/resources/groups/client/requests/RemoveGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/RemoveGroupsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface RemoveGroupsRequest { - /** - * The ID of the customer to remove from the group. - */ + /** The ID of the customer to remove from the group. */ customerId: string; - /** - * The ID of the customer group to remove the customer from. - */ + /** The ID of the customer group to remove the customer from. */ groupId: string; } diff --git a/src/api/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts b/src/api/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts index d1655a132..e735b6a4a 100644 --- a/src/api/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -14,9 +12,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateCustomerGroupRequest { - /** - * The ID of the customer group to update. - */ + /** The ID of the customer group to update. */ groupId: string; /** The `CustomerGroup` object including all the updates you want to make. */ group: Square.CustomerGroup; diff --git a/src/api/resources/customers/resources/groups/client/requests/index.ts b/src/api/resources/customers/resources/groups/client/requests/index.ts index 8b20adcd7..2cc28237c 100644 --- a/src/api/resources/customers/resources/groups/client/requests/index.ts +++ b/src/api/resources/customers/resources/groups/client/requests/index.ts @@ -1,7 +1,7 @@ -export { type ListGroupsRequest } from "./ListGroupsRequest"; -export { type CreateCustomerGroupRequest } from "./CreateCustomerGroupRequest"; -export { type GetGroupsRequest } from "./GetGroupsRequest"; -export { type UpdateCustomerGroupRequest } from "./UpdateCustomerGroupRequest"; -export { type DeleteGroupsRequest } from "./DeleteGroupsRequest"; -export { type AddGroupsRequest } from "./AddGroupsRequest"; -export { type RemoveGroupsRequest } from "./RemoveGroupsRequest"; +export type { AddGroupsRequest } from "./AddGroupsRequest"; +export type { CreateCustomerGroupRequest } from "./CreateCustomerGroupRequest"; +export type { DeleteGroupsRequest } from "./DeleteGroupsRequest"; +export type { GetGroupsRequest } from "./GetGroupsRequest"; +export type { ListGroupsRequest } from "./ListGroupsRequest"; +export type { RemoveGroupsRequest } from "./RemoveGroupsRequest"; +export type { UpdateCustomerGroupRequest } from "./UpdateCustomerGroupRequest"; diff --git a/src/api/resources/customers/resources/index.ts b/src/api/resources/customers/resources/index.ts index 7cd096b80..432928b2b 100644 --- a/src/api/resources/customers/resources/index.ts +++ b/src/api/resources/customers/resources/index.ts @@ -1,10 +1,10 @@ -export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * as groups from "./groups"; -export * as segments from "./segments"; export * as cards from "./cards"; -export * as customAttributes from "./customAttributes"; +export * from "./cards/client/requests"; +export * as customAttributeDefinitions from "./customAttributeDefinitions"; export * from "./customAttributeDefinitions/client/requests"; +export * as customAttributes from "./customAttributes"; +export * from "./customAttributes/client/requests"; +export * as groups from "./groups"; export * from "./groups/client/requests"; +export * as segments from "./segments"; export * from "./segments/client/requests"; -export * from "./cards/client/requests"; -export * from "./customAttributes/client/requests"; diff --git a/src/api/resources/customers/resources/segments/client/Client.ts b/src/api/resources/customers/resources/segments/client/Client.ts index 8417890ef..ea8750007 100644 --- a/src/api/resources/customers/resources/segments/client/Client.ts +++ b/src/api/resources/customers/resources/segments/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Segments { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Segments { @@ -66,11 +44,19 @@ export class Segments { const { cursor, limit } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -79,18 +65,10 @@ export class Segments { "v2/customers/segments", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -167,6 +145,14 @@ export class Segments { requestOptions?: Segments.RequestOptions, ): Promise> { const { segmentId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -175,16 +161,10 @@ export class Segments { `v2/customers/segments/${encodeURIComponent(segmentId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -228,7 +208,7 @@ export class Segments { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/resources/segments/client/index.ts b/src/api/resources/customers/resources/segments/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/customers/resources/segments/client/index.ts +++ b/src/api/resources/customers/resources/segments/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/customers/resources/segments/client/requests/GetSegmentsRequest.ts b/src/api/resources/customers/resources/segments/client/requests/GetSegmentsRequest.ts index e8c325079..4a3b61d81 100644 --- a/src/api/resources/customers/resources/segments/client/requests/GetSegmentsRequest.ts +++ b/src/api/resources/customers/resources/segments/client/requests/GetSegmentsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetSegmentsRequest { - /** - * The Square-issued ID of the customer segment. - */ + /** The Square-issued ID of the customer segment. */ segmentId: string; } diff --git a/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts b/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts index 4ee529a9f..9f1c9e014 100644 --- a/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts +++ b/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/customers/resources/segments/client/requests/index.ts b/src/api/resources/customers/resources/segments/client/requests/index.ts index f5fa9bba2..49fa315c0 100644 --- a/src/api/resources/customers/resources/segments/client/requests/index.ts +++ b/src/api/resources/customers/resources/segments/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type ListSegmentsRequest } from "./ListSegmentsRequest"; -export { type GetSegmentsRequest } from "./GetSegmentsRequest"; +export type { GetSegmentsRequest } from "./GetSegmentsRequest"; +export type { ListSegmentsRequest } from "./ListSegmentsRequest"; diff --git a/src/api/resources/devices/client/Client.ts b/src/api/resources/devices/client/Client.ts index b84a26b5b..94aabd793 100644 --- a/src/api/resources/devices/client/Client.ts +++ b/src/api/resources/devices/client/Client.ts @@ -1,40 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; -import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { Codes } from "../resources/codes/client/Client"; export declare namespace Devices { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Devices { @@ -73,20 +51,28 @@ export class Devices { const { cursor, sortOrder, limit, locationId } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (sortOrder !== undefined) { - _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -95,18 +81,10 @@ export class Devices { "v2/devices", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -181,6 +159,14 @@ export class Devices { requestOptions?: Devices.RequestOptions, ): Promise> { const { deviceId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -189,16 +175,10 @@ export class Devices { `v2/devices/${encodeURIComponent(deviceId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -240,7 +220,7 @@ export class Devices { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/devices/client/index.ts b/src/api/resources/devices/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/devices/client/index.ts +++ b/src/api/resources/devices/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/devices/client/requests/GetDevicesRequest.ts b/src/api/resources/devices/client/requests/GetDevicesRequest.ts index cce78e0b7..7a4188633 100644 --- a/src/api/resources/devices/client/requests/GetDevicesRequest.ts +++ b/src/api/resources/devices/client/requests/GetDevicesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetDevicesRequest { - /** - * The unique ID for the desired `Device`. - */ + /** The unique ID for the desired `Device`. */ deviceId: string; } diff --git a/src/api/resources/devices/client/requests/ListDevicesRequest.ts b/src/api/resources/devices/client/requests/ListDevicesRequest.ts index 299bd9ec4..05091c3a4 100644 --- a/src/api/resources/devices/client/requests/ListDevicesRequest.ts +++ b/src/api/resources/devices/client/requests/ListDevicesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -26,12 +24,8 @@ export interface ListDevicesRequest { * - `DESC` - Newest to oldest (default). */ sortOrder?: Square.SortOrder | null; - /** - * The number of results to return in a single page. - */ + /** The number of results to return in a single page. */ limit?: number | null; - /** - * If present, only returns devices at the target location. - */ + /** If present, only returns devices at the target location. */ locationId?: string | null; } diff --git a/src/api/resources/devices/client/requests/index.ts b/src/api/resources/devices/client/requests/index.ts index cb037fcfd..21537e6a1 100644 --- a/src/api/resources/devices/client/requests/index.ts +++ b/src/api/resources/devices/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type ListDevicesRequest } from "./ListDevicesRequest"; -export { type GetDevicesRequest } from "./GetDevicesRequest"; +export type { GetDevicesRequest } from "./GetDevicesRequest"; +export type { ListDevicesRequest } from "./ListDevicesRequest"; diff --git a/src/api/resources/devices/resources/codes/client/Client.ts b/src/api/resources/devices/resources/codes/client/Client.ts index 84c30d8f6..a0aa1006e 100644 --- a/src/api/resources/devices/resources/codes/client/Client.ts +++ b/src/api/resources/devices/resources/codes/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Codes { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Codes { @@ -68,23 +46,31 @@ export class Codes { const { cursor, locationId, productType, status } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } if (productType !== undefined) { - _queryParams["product_type"] = serializers.ProductType.jsonOrThrow(productType, { + _queryParams.product_type = serializers.ProductType.jsonOrThrow(productType, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (status !== undefined) { - _queryParams["status"] = serializers.DeviceCodeStatus.jsonOrThrow(status, { + _queryParams.status = serializers.DeviceCodeStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -93,18 +79,10 @@ export class Codes { "v2/devices/codes", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -184,6 +162,14 @@ export class Codes { request: Square.devices.CreateDeviceCodeRequest, requestOptions?: Codes.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -192,22 +178,16 @@ export class Codes { "v2/devices/codes", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.devices.CreateDeviceCodeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -271,6 +251,14 @@ export class Codes { requestOptions?: Codes.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -279,16 +267,10 @@ export class Codes { `v2/devices/codes/${encodeURIComponent(id)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -330,7 +312,7 @@ export class Codes { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/devices/resources/codes/client/index.ts b/src/api/resources/devices/resources/codes/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/devices/resources/codes/client/index.ts +++ b/src/api/resources/devices/resources/codes/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts b/src/api/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts index 2e6a6d4fe..e420b2480 100644 --- a/src/api/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts +++ b/src/api/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/devices/resources/codes/client/requests/GetCodesRequest.ts b/src/api/resources/devices/resources/codes/client/requests/GetCodesRequest.ts index 9ccf97ae6..815afde79 100644 --- a/src/api/resources/devices/resources/codes/client/requests/GetCodesRequest.ts +++ b/src/api/resources/devices/resources/codes/client/requests/GetCodesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetCodesRequest { - /** - * The unique identifier for the device code. - */ + /** The unique identifier for the device code. */ id: string; } diff --git a/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts b/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts index c7e5d8399..c6c51891b 100644 --- a/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts +++ b/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/devices/resources/codes/client/requests/index.ts b/src/api/resources/devices/resources/codes/client/requests/index.ts index 884d772bf..6df00210e 100644 --- a/src/api/resources/devices/resources/codes/client/requests/index.ts +++ b/src/api/resources/devices/resources/codes/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type ListCodesRequest } from "./ListCodesRequest"; -export { type CreateDeviceCodeRequest } from "./CreateDeviceCodeRequest"; -export { type GetCodesRequest } from "./GetCodesRequest"; +export type { CreateDeviceCodeRequest } from "./CreateDeviceCodeRequest"; +export type { GetCodesRequest } from "./GetCodesRequest"; +export type { ListCodesRequest } from "./ListCodesRequest"; diff --git a/src/api/resources/disputes/client/Client.ts b/src/api/resources/disputes/client/Client.ts index 905d9ad14..dd39c093f 100644 --- a/src/api/resources/disputes/client/Client.ts +++ b/src/api/resources/disputes/client/Client.ts @@ -1,41 +1,19 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; -import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as errors from "../../../../errors/index"; import { toJson } from "../../../../core/json"; +import * as environments from "../../../../environments"; +import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { Evidence } from "../resources/evidence/client/Client"; export declare namespace Disputes { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Disputes { @@ -72,17 +50,25 @@ export class Disputes { const { cursor, states, locationId } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (states !== undefined) { - _queryParams["states"] = serializers.DisputeState.jsonOrThrow(states, { + _queryParams.states = serializers.DisputeState.jsonOrThrow(states, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -91,18 +77,10 @@ export class Disputes { "v2/disputes", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -177,6 +155,14 @@ export class Disputes { requestOptions?: Disputes.RequestOptions, ): Promise> { const { disputeId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -185,16 +171,10 @@ export class Disputes { `v2/disputes/${encodeURIComponent(disputeId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -262,6 +242,14 @@ export class Disputes { requestOptions?: Disputes.RequestOptions, ): Promise> { const { disputeId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -270,16 +258,10 @@ export class Disputes { `v2/disputes/${encodeURIComponent(disputeId)}/accept`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -330,6 +312,7 @@ export class Disputes { * @param {Disputes.RequestOptions} requestOptions - Request-specific configuration. * * @example + * import { createReadStream } from "fs"; * await client.disputes.createEvidenceFile({ * disputeId: "dispute_id" * }) @@ -363,6 +346,15 @@ export class Disputes { } const _maybeEncodedRequest = await _request.getRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + ..._maybeEncodedRequest.headers, + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -371,20 +363,13 @@ export class Disputes { `v2/disputes/${encodeURIComponent(request.disputeId)}/evidence-files`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - ..._maybeEncodedRequest.headers, - }), - requestOptions?.headers, - ), + headers: _headers, + queryParameters: requestOptions?.queryParams, requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -453,6 +438,14 @@ export class Disputes { requestOptions?: Disputes.RequestOptions, ): Promise> { const { disputeId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -461,22 +454,16 @@ export class Disputes { `v2/disputes/${encodeURIComponent(disputeId)}/evidence-text`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateDisputeEvidenceTextRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -548,6 +535,14 @@ export class Disputes { requestOptions?: Disputes.RequestOptions, ): Promise> { const { disputeId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -556,16 +551,10 @@ export class Disputes { `v2/disputes/${encodeURIComponent(disputeId)}/submit-evidence`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -609,7 +598,7 @@ export class Disputes { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/disputes/client/index.ts b/src/api/resources/disputes/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/disputes/client/index.ts +++ b/src/api/resources/disputes/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/disputes/client/requests/AcceptDisputesRequest.ts b/src/api/resources/disputes/client/requests/AcceptDisputesRequest.ts index e7b39024c..42e043c84 100644 --- a/src/api/resources/disputes/client/requests/AcceptDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/AcceptDisputesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface AcceptDisputesRequest { - /** - * The ID of the dispute you want to accept. - */ + /** The ID of the dispute you want to accept. */ disputeId: string; } diff --git a/src/api/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts b/src/api/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts index dd6bf19e1..f9e15a387 100644 --- a/src/api/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts +++ b/src/api/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -14,9 +12,7 @@ import * as Square from "../../../../index"; * } */ export interface CreateDisputeEvidenceTextRequest { - /** - * The ID of the dispute for which you want to upload evidence. - */ + /** The ID of the dispute for which you want to upload evidence. */ disputeId: string; /** A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). */ idempotencyKey: string; diff --git a/src/api/resources/disputes/client/requests/CreateEvidenceFileDisputesRequest.ts b/src/api/resources/disputes/client/requests/CreateEvidenceFileDisputesRequest.ts index bd5c4e399..4b4ba3df1 100644 --- a/src/api/resources/disputes/client/requests/CreateEvidenceFileDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/CreateEvidenceFileDisputesRequest.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; -import * as fs from "fs"; +import type * as fs from "fs"; +import type * as Square from "../../../../index"; /** * @example @@ -12,9 +10,7 @@ import * as fs from "fs"; * } */ export interface CreateEvidenceFileDisputesRequest { - /** - * The ID of the dispute for which you want to upload evidence. - */ + /** The ID of the dispute for which you want to upload evidence. */ disputeId: string; request?: Square.CreateDisputeEvidenceFileRequest; imageFile?: File | fs.ReadStream | Blob | undefined; diff --git a/src/api/resources/disputes/client/requests/GetDisputesRequest.ts b/src/api/resources/disputes/client/requests/GetDisputesRequest.ts index 8ce67be68..d23c028fc 100644 --- a/src/api/resources/disputes/client/requests/GetDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/GetDisputesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetDisputesRequest { - /** - * The ID of the dispute you want more details about. - */ + /** The ID of the dispute you want more details about. */ disputeId: string; } diff --git a/src/api/resources/disputes/client/requests/ListDisputesRequest.ts b/src/api/resources/disputes/client/requests/ListDisputesRequest.ts index 228295073..978ff3bfc 100644 --- a/src/api/resources/disputes/client/requests/ListDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/ListDisputesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -19,9 +17,7 @@ export interface ListDisputesRequest { * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). */ cursor?: string | null; - /** - * The dispute states used to filter the result. If not specified, the endpoint returns all disputes. - */ + /** The dispute states used to filter the result. If not specified, the endpoint returns all disputes. */ states?: Square.DisputeState | null; /** * The ID of the location for which to return a list of disputes. diff --git a/src/api/resources/disputes/client/requests/SubmitEvidenceDisputesRequest.ts b/src/api/resources/disputes/client/requests/SubmitEvidenceDisputesRequest.ts index 260395581..eff36ce6a 100644 --- a/src/api/resources/disputes/client/requests/SubmitEvidenceDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/SubmitEvidenceDisputesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface SubmitEvidenceDisputesRequest { - /** - * The ID of the dispute for which you want to submit evidence. - */ + /** The ID of the dispute for which you want to submit evidence. */ disputeId: string; } diff --git a/src/api/resources/disputes/client/requests/index.ts b/src/api/resources/disputes/client/requests/index.ts index 9be21844e..fcf52770b 100644 --- a/src/api/resources/disputes/client/requests/index.ts +++ b/src/api/resources/disputes/client/requests/index.ts @@ -1,6 +1,6 @@ -export { type ListDisputesRequest } from "./ListDisputesRequest"; -export { type GetDisputesRequest } from "./GetDisputesRequest"; -export { type AcceptDisputesRequest } from "./AcceptDisputesRequest"; -export { type CreateEvidenceFileDisputesRequest } from "./CreateEvidenceFileDisputesRequest"; -export { type CreateDisputeEvidenceTextRequest } from "./CreateDisputeEvidenceTextRequest"; -export { type SubmitEvidenceDisputesRequest } from "./SubmitEvidenceDisputesRequest"; +export type { AcceptDisputesRequest } from "./AcceptDisputesRequest"; +export type { CreateDisputeEvidenceTextRequest } from "./CreateDisputeEvidenceTextRequest"; +export type { CreateEvidenceFileDisputesRequest } from "./CreateEvidenceFileDisputesRequest"; +export type { GetDisputesRequest } from "./GetDisputesRequest"; +export type { ListDisputesRequest } from "./ListDisputesRequest"; +export type { SubmitEvidenceDisputesRequest } from "./SubmitEvidenceDisputesRequest"; diff --git a/src/api/resources/disputes/resources/evidence/client/Client.ts b/src/api/resources/disputes/resources/evidence/client/Client.ts index d8d7bfb9c..419b97be0 100644 --- a/src/api/resources/disputes/resources/evidence/client/Client.ts +++ b/src/api/resources/disputes/resources/evidence/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Evidence { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Evidence { @@ -66,8 +44,16 @@ export class Evidence { const { disputeId, cursor } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -76,18 +62,10 @@ export class Evidence { `v2/disputes/${encodeURIComponent(disputeId)}/evidence`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -167,6 +145,14 @@ export class Evidence { requestOptions?: Evidence.RequestOptions, ): Promise> { const { disputeId, evidenceId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -175,16 +161,10 @@ export class Evidence { `v2/disputes/${encodeURIComponent(disputeId)}/evidence/${encodeURIComponent(evidenceId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -252,6 +232,14 @@ export class Evidence { requestOptions?: Evidence.RequestOptions, ): Promise> { const { disputeId, evidenceId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -260,16 +248,10 @@ export class Evidence { `v2/disputes/${encodeURIComponent(disputeId)}/evidence/${encodeURIComponent(evidenceId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -313,7 +295,7 @@ export class Evidence { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/disputes/resources/evidence/client/index.ts b/src/api/resources/disputes/resources/evidence/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/disputes/resources/evidence/client/index.ts +++ b/src/api/resources/disputes/resources/evidence/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/disputes/resources/evidence/client/requests/DeleteEvidenceRequest.ts b/src/api/resources/disputes/resources/evidence/client/requests/DeleteEvidenceRequest.ts index 0695d4de6..2b2b0652b 100644 --- a/src/api/resources/disputes/resources/evidence/client/requests/DeleteEvidenceRequest.ts +++ b/src/api/resources/disputes/resources/evidence/client/requests/DeleteEvidenceRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface DeleteEvidenceRequest { - /** - * The ID of the dispute from which you want to remove evidence. - */ + /** The ID of the dispute from which you want to remove evidence. */ disputeId: string; - /** - * The ID of the evidence you want to remove. - */ + /** The ID of the evidence you want to remove. */ evidenceId: string; } diff --git a/src/api/resources/disputes/resources/evidence/client/requests/GetEvidenceRequest.ts b/src/api/resources/disputes/resources/evidence/client/requests/GetEvidenceRequest.ts index 9272744c7..e9f0eb1b3 100644 --- a/src/api/resources/disputes/resources/evidence/client/requests/GetEvidenceRequest.ts +++ b/src/api/resources/disputes/resources/evidence/client/requests/GetEvidenceRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface GetEvidenceRequest { - /** - * The ID of the dispute from which you want to retrieve evidence metadata. - */ + /** The ID of the dispute from which you want to retrieve evidence metadata. */ disputeId: string; - /** - * The ID of the evidence to retrieve. - */ + /** The ID of the evidence to retrieve. */ evidenceId: string; } diff --git a/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts b/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts index b7dcdf22a..80d042153 100644 --- a/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts +++ b/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface ListEvidenceRequest { - /** - * The ID of the dispute. - */ + /** The ID of the dispute. */ disputeId: string; /** * A pagination cursor returned by a previous call to this endpoint. diff --git a/src/api/resources/disputes/resources/evidence/client/requests/index.ts b/src/api/resources/disputes/resources/evidence/client/requests/index.ts index 854770a17..75bfa4fe2 100644 --- a/src/api/resources/disputes/resources/evidence/client/requests/index.ts +++ b/src/api/resources/disputes/resources/evidence/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type ListEvidenceRequest } from "./ListEvidenceRequest"; -export { type GetEvidenceRequest } from "./GetEvidenceRequest"; -export { type DeleteEvidenceRequest } from "./DeleteEvidenceRequest"; +export type { DeleteEvidenceRequest } from "./DeleteEvidenceRequest"; +export type { GetEvidenceRequest } from "./GetEvidenceRequest"; +export type { ListEvidenceRequest } from "./ListEvidenceRequest"; diff --git a/src/api/resources/employees/client/Client.ts b/src/api/resources/employees/client/Client.ts index 2c3743bfd..30bafad14 100644 --- a/src/api/resources/employees/client/Client.ts +++ b/src/api/resources/employees/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; -import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Employees { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Employees { @@ -68,20 +46,28 @@ export class Employees { const { locationId, status, limit, cursor } = request; const _queryParams: Record = {}; if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } if (status !== undefined) { - _queryParams["status"] = serializers.EmployeeStatus.jsonOrThrow(status, { + _queryParams.status = serializers.EmployeeStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -90,18 +76,10 @@ export class Employees { "v2/employees", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -176,6 +154,14 @@ export class Employees { requestOptions?: Employees.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -184,16 +170,10 @@ export class Employees { `v2/employees/${encodeURIComponent(id)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -235,7 +215,7 @@ export class Employees { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/employees/client/index.ts b/src/api/resources/employees/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/employees/client/index.ts +++ b/src/api/resources/employees/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/employees/client/requests/GetEmployeesRequest.ts b/src/api/resources/employees/client/requests/GetEmployeesRequest.ts index 3d3796dad..ba24c5056 100644 --- a/src/api/resources/employees/client/requests/GetEmployeesRequest.ts +++ b/src/api/resources/employees/client/requests/GetEmployeesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetEmployeesRequest { - /** - * UUID for the employee that was requested. - */ + /** UUID for the employee that was requested. */ id: string; } diff --git a/src/api/resources/employees/client/requests/ListEmployeesRequest.ts b/src/api/resources/employees/client/requests/ListEmployeesRequest.ts index 1a727fa8e..56f0f5881 100644 --- a/src/api/resources/employees/client/requests/ListEmployeesRequest.ts +++ b/src/api/resources/employees/client/requests/ListEmployeesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -14,20 +12,12 @@ import * as Square from "../../../../index"; * } */ export interface ListEmployeesRequest { - /** - * - */ + /** */ locationId?: string | null; - /** - * Specifies the EmployeeStatus to filter the employee by. - */ + /** Specifies the EmployeeStatus to filter the employee by. */ status?: Square.EmployeeStatus | null; - /** - * The number of employees to be returned on each page. - */ + /** The number of employees to be returned on each page. */ limit?: number | null; - /** - * The token required to retrieve the specified page of results. - */ + /** The token required to retrieve the specified page of results. */ cursor?: string | null; } diff --git a/src/api/resources/employees/client/requests/index.ts b/src/api/resources/employees/client/requests/index.ts index 9557dae81..725670c0f 100644 --- a/src/api/resources/employees/client/requests/index.ts +++ b/src/api/resources/employees/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type ListEmployeesRequest } from "./ListEmployeesRequest"; -export { type GetEmployeesRequest } from "./GetEmployeesRequest"; +export type { GetEmployeesRequest } from "./GetEmployeesRequest"; +export type { ListEmployeesRequest } from "./ListEmployeesRequest"; diff --git a/src/api/resources/events/client/Client.ts b/src/api/resources/events/client/Client.ts index 11aeda797..795386992 100644 --- a/src/api/resources/events/client/Client.ts +++ b/src/api/resources/events/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Events { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Events { @@ -63,6 +41,14 @@ export class Events { request: Square.SearchEventsRequest = {}, requestOptions?: Events.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -71,22 +57,16 @@ export class Events { "v2/events", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchEventsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -146,6 +126,14 @@ export class Events { private async __disableEvents( requestOptions?: Events.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -154,16 +142,10 @@ export class Events { "v2/events/disable", ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -219,6 +201,14 @@ export class Events { private async __enableEvents( requestOptions?: Events.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -227,16 +217,10 @@ export class Events { "v2/events/enable", ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -302,9 +286,17 @@ export class Events { const { apiVersion } = request; const _queryParams: Record = {}; if (apiVersion !== undefined) { - _queryParams["api_version"] = apiVersion; + _queryParams.api_version = apiVersion; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -313,17 +305,10 @@ export class Events { "v2/events/types", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -365,7 +350,7 @@ export class Events { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/events/client/index.ts b/src/api/resources/events/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/events/client/index.ts +++ b/src/api/resources/events/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/events/client/requests/ListEventTypesRequest.ts b/src/api/resources/events/client/requests/ListEventTypesRequest.ts index dacf1b022..4b8cfb8d4 100644 --- a/src/api/resources/events/client/requests/ListEventTypesRequest.ts +++ b/src/api/resources/events/client/requests/ListEventTypesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface ListEventTypesRequest { - /** - * The API version for which to list event types. Setting this field overrides the default version used by the application. - */ + /** The API version for which to list event types. Setting this field overrides the default version used by the application. */ apiVersion?: string | null; } diff --git a/src/api/resources/events/client/requests/SearchEventsRequest.ts b/src/api/resources/events/client/requests/SearchEventsRequest.ts index e63d21d15..8c2c65a7b 100644 --- a/src/api/resources/events/client/requests/SearchEventsRequest.ts +++ b/src/api/resources/events/client/requests/SearchEventsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/events/client/requests/index.ts b/src/api/resources/events/client/requests/index.ts index d6a20d449..07d2f52ca 100644 --- a/src/api/resources/events/client/requests/index.ts +++ b/src/api/resources/events/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type SearchEventsRequest } from "./SearchEventsRequest"; -export { type ListEventTypesRequest } from "./ListEventTypesRequest"; +export type { ListEventTypesRequest } from "./ListEventTypesRequest"; +export type { SearchEventsRequest } from "./SearchEventsRequest"; diff --git a/src/api/resources/giftCards/client/Client.ts b/src/api/resources/giftCards/client/Client.ts index 4276c4951..ebaa93582 100644 --- a/src/api/resources/giftCards/client/Client.ts +++ b/src/api/resources/giftCards/client/Client.ts @@ -1,40 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { Activities } from "../resources/activities/client/Client"; export declare namespace GiftCards { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class GiftCards { @@ -76,20 +54,28 @@ export class GiftCards { const { type: type_, state, limit, cursor, customerId } = request; const _queryParams: Record = {}; if (type_ !== undefined) { - _queryParams["type"] = type_; + _queryParams.type = type_; } if (state !== undefined) { - _queryParams["state"] = state; + _queryParams.state = state; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (customerId !== undefined) { - _queryParams["customer_id"] = customerId; + _queryParams.customer_id = customerId; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -98,18 +84,10 @@ export class GiftCards { "v2/gift-cards", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -191,6 +169,14 @@ export class GiftCards { request: Square.CreateGiftCardRequest, requestOptions?: GiftCards.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -199,22 +185,16 @@ export class GiftCards { "v2/gift-cards", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateGiftCardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -277,6 +257,14 @@ export class GiftCards { request: Square.GetGiftCardFromGanRequest, requestOptions?: GiftCards.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -285,22 +273,16 @@ export class GiftCards { "v2/gift-cards/from-gan", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.GetGiftCardFromGanRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -363,6 +345,14 @@ export class GiftCards { request: Square.GetGiftCardFromNonceRequest, requestOptions?: GiftCards.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -371,22 +361,16 @@ export class GiftCards { "v2/gift-cards/from-nonce", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.GetGiftCardFromNonceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -451,6 +435,14 @@ export class GiftCards { requestOptions?: GiftCards.RequestOptions, ): Promise> { const { giftCardId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -459,22 +451,16 @@ export class GiftCards { `v2/gift-cards/${encodeURIComponent(giftCardId)}/link-customer`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.LinkCustomerToGiftCardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -541,6 +527,14 @@ export class GiftCards { requestOptions?: GiftCards.RequestOptions, ): Promise> { const { giftCardId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -549,22 +543,16 @@ export class GiftCards { `v2/gift-cards/${encodeURIComponent(giftCardId)}/unlink-customer`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UnlinkCustomerFromGiftCardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -630,6 +618,14 @@ export class GiftCards { requestOptions?: GiftCards.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -638,16 +634,10 @@ export class GiftCards { `v2/gift-cards/${encodeURIComponent(id)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -689,7 +679,7 @@ export class GiftCards { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/giftCards/client/index.ts b/src/api/resources/giftCards/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/giftCards/client/index.ts +++ b/src/api/resources/giftCards/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/giftCards/client/requests/CreateGiftCardRequest.ts b/src/api/resources/giftCards/client/requests/CreateGiftCardRequest.ts index a31b388cc..1d142cc82 100644 --- a/src/api/resources/giftCards/client/requests/CreateGiftCardRequest.ts +++ b/src/api/resources/giftCards/client/requests/CreateGiftCardRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts b/src/api/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts index 2685a3d48..3cde30fa2 100644 --- a/src/api/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts +++ b/src/api/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts b/src/api/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts index ee98164d0..7a146fb08 100644 --- a/src/api/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts +++ b/src/api/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/giftCards/client/requests/GetGiftCardsRequest.ts b/src/api/resources/giftCards/client/requests/GetGiftCardsRequest.ts index 7d36ea9f8..86ea77a28 100644 --- a/src/api/resources/giftCards/client/requests/GetGiftCardsRequest.ts +++ b/src/api/resources/giftCards/client/requests/GetGiftCardsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetGiftCardsRequest { - /** - * The ID of the gift card to retrieve. - */ + /** The ID of the gift card to retrieve. */ id: string; } diff --git a/src/api/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts b/src/api/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts index 65406b42f..84157fd07 100644 --- a/src/api/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts +++ b/src/api/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface LinkCustomerToGiftCardRequest { - /** - * The ID of the gift card to be linked. - */ + /** The ID of the gift card to be linked. */ giftCardId: string; /** The ID of the customer to link to the gift card. */ customerId: string; diff --git a/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts b/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts index 6d23cec0d..8e5ff2b93 100644 --- a/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts +++ b/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -36,8 +34,6 @@ export interface ListGiftCardsRequest { * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). */ cursor?: string | null; - /** - * If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. - */ + /** If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. */ customerId?: string | null; } diff --git a/src/api/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts b/src/api/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts index b4c49c798..9e1940ffe 100644 --- a/src/api/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts +++ b/src/api/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface UnlinkCustomerFromGiftCardRequest { - /** - * The ID of the gift card to be unlinked. - */ + /** The ID of the gift card to be unlinked. */ giftCardId: string; /** The ID of the customer to unlink from the gift card. */ customerId: string; diff --git a/src/api/resources/giftCards/client/requests/index.ts b/src/api/resources/giftCards/client/requests/index.ts index 0b6147fc9..800994359 100644 --- a/src/api/resources/giftCards/client/requests/index.ts +++ b/src/api/resources/giftCards/client/requests/index.ts @@ -1,7 +1,7 @@ -export { type ListGiftCardsRequest } from "./ListGiftCardsRequest"; -export { type CreateGiftCardRequest } from "./CreateGiftCardRequest"; -export { type GetGiftCardFromGanRequest } from "./GetGiftCardFromGanRequest"; -export { type GetGiftCardFromNonceRequest } from "./GetGiftCardFromNonceRequest"; -export { type LinkCustomerToGiftCardRequest } from "./LinkCustomerToGiftCardRequest"; -export { type UnlinkCustomerFromGiftCardRequest } from "./UnlinkCustomerFromGiftCardRequest"; -export { type GetGiftCardsRequest } from "./GetGiftCardsRequest"; +export type { CreateGiftCardRequest } from "./CreateGiftCardRequest"; +export type { GetGiftCardFromGanRequest } from "./GetGiftCardFromGanRequest"; +export type { GetGiftCardFromNonceRequest } from "./GetGiftCardFromNonceRequest"; +export type { GetGiftCardsRequest } from "./GetGiftCardsRequest"; +export type { LinkCustomerToGiftCardRequest } from "./LinkCustomerToGiftCardRequest"; +export type { ListGiftCardsRequest } from "./ListGiftCardsRequest"; +export type { UnlinkCustomerFromGiftCardRequest } from "./UnlinkCustomerFromGiftCardRequest"; diff --git a/src/api/resources/giftCards/resources/activities/client/Client.ts b/src/api/resources/giftCards/resources/activities/client/Client.ts index d7ac9af25..c07d18707 100644 --- a/src/api/resources/giftCards/resources/activities/client/Client.ts +++ b/src/api/resources/giftCards/resources/activities/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Activities { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Activities { @@ -75,29 +53,37 @@ export class Activities { const { giftCardId, type: type_, locationId, beginTime, endTime, limit, cursor, sortOrder } = request; const _queryParams: Record = {}; if (giftCardId !== undefined) { - _queryParams["gift_card_id"] = giftCardId; + _queryParams.gift_card_id = giftCardId; } if (type_ !== undefined) { - _queryParams["type"] = type_; + _queryParams.type = type_; } if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } if (beginTime !== undefined) { - _queryParams["begin_time"] = beginTime; + _queryParams.begin_time = beginTime; } if (endTime !== undefined) { - _queryParams["end_time"] = endTime; + _queryParams.end_time = endTime; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (sortOrder !== undefined) { - _queryParams["sort_order"] = sortOrder; + _queryParams.sort_order = sortOrder; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -106,18 +92,10 @@ export class Activities { "v2/gift-cards/activities", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -203,6 +181,14 @@ export class Activities { request: Square.giftCards.CreateGiftCardActivityRequest, requestOptions?: Activities.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -211,22 +197,16 @@ export class Activities { "v2/gift-cards/activities", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.giftCards.CreateGiftCardActivityRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -268,7 +248,7 @@ export class Activities { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/giftCards/resources/activities/client/index.ts b/src/api/resources/giftCards/resources/activities/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/giftCards/resources/activities/client/index.ts +++ b/src/api/resources/giftCards/resources/activities/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts b/src/api/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts index dba2fc080..403a8cec6 100644 --- a/src/api/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts +++ b/src/api/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts b/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts index 88a40604c..e1b411e5c 100644 --- a/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts +++ b/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/giftCards/resources/activities/client/requests/index.ts b/src/api/resources/giftCards/resources/activities/client/requests/index.ts index 9c2bd6210..ce856ef9d 100644 --- a/src/api/resources/giftCards/resources/activities/client/requests/index.ts +++ b/src/api/resources/giftCards/resources/activities/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type ListActivitiesRequest } from "./ListActivitiesRequest"; -export { type CreateGiftCardActivityRequest } from "./CreateGiftCardActivityRequest"; +export type { CreateGiftCardActivityRequest } from "./CreateGiftCardActivityRequest"; +export type { ListActivitiesRequest } from "./ListActivitiesRequest"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 84c19b91c..92b50160e 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,69 +1,69 @@ -export * as mobile from "./mobile"; -export * as oAuth from "./oAuth"; -export * as v1Transactions from "./v1Transactions"; export * as applePay from "./applePay"; +export * from "./applePay/client/requests"; export * as bankAccounts from "./bankAccounts"; +export * from "./bankAccounts/client/requests"; export * as bookings from "./bookings"; +export * from "./bookings/client/requests"; export * as cards from "./cards"; +export * from "./cards/client/requests"; +export * as cashDrawers from "./cashDrawers"; export * as catalog from "./catalog"; +export * from "./catalog/client/requests"; export * as channels from "./channels"; +export * from "./channels/client/requests"; +export * as checkout from "./checkout"; +export * from "./checkout/client/requests"; export * as customers from "./customers"; +export * from "./customers/client/requests"; export * as devices from "./devices"; +export * from "./devices/client/requests"; export * as disputes from "./disputes"; +export * from "./disputes/client/requests"; export * as employees from "./employees"; +export * from "./employees/client/requests"; export * as events from "./events"; +export * from "./events/client/requests"; export * as giftCards from "./giftCards"; +export * from "./giftCards/client/requests"; export * as inventory from "./inventory"; +export * from "./inventory/client/requests"; export * as invoices from "./invoices"; +export * from "./invoices/client/requests"; export * as labor from "./labor"; +export * from "./labor/client/requests"; export * as locations from "./locations"; +export * from "./locations/client/requests"; export * as loyalty from "./loyalty"; +export * from "./loyalty/client/requests"; export * as merchants from "./merchants"; -export * as checkout from "./checkout"; -export * as orders from "./orders"; -export * as payments from "./payments"; -export * as payouts from "./payouts"; -export * as refunds from "./refunds"; -export * as sites from "./sites"; -export * as snippets from "./snippets"; -export * as subscriptions from "./subscriptions"; -export * as teamMembers from "./teamMembers"; -export * as team from "./team"; -export * as terminal from "./terminal"; -export * as transferOrders from "./transferOrders"; -export * as vendors from "./vendors"; -export * as cashDrawers from "./cashDrawers"; -export * as webhooks from "./webhooks"; +export * from "./merchants/client/requests"; +export * as mobile from "./mobile"; export * from "./mobile/client/requests"; +export * as oAuth from "./oAuth"; export * from "./oAuth/client/requests"; -export * from "./v1Transactions/client/requests"; -export * from "./applePay/client/requests"; -export * from "./bankAccounts/client/requests"; -export * from "./bookings/client/requests"; -export * from "./cards/client/requests"; -export * from "./catalog/client/requests"; -export * from "./channels/client/requests"; -export * from "./customers/client/requests"; -export * from "./devices/client/requests"; -export * from "./disputes/client/requests"; -export * from "./employees/client/requests"; -export * from "./events/client/requests"; -export * from "./giftCards/client/requests"; -export * from "./inventory/client/requests"; -export * from "./invoices/client/requests"; -export * from "./labor/client/requests"; -export * from "./locations/client/requests"; -export * from "./loyalty/client/requests"; -export * from "./merchants/client/requests"; -export * from "./checkout/client/requests"; +export * as orders from "./orders"; export * from "./orders/client/requests"; +export * as payments from "./payments"; export * from "./payments/client/requests"; +export * as payouts from "./payouts"; export * from "./payouts/client/requests"; +export * as refunds from "./refunds"; export * from "./refunds/client/requests"; +export * as sites from "./sites"; +export * as snippets from "./snippets"; export * from "./snippets/client/requests"; +export * as subscriptions from "./subscriptions"; export * from "./subscriptions/client/requests"; -export * from "./teamMembers/client/requests"; +export * as team from "./team"; export * from "./team/client/requests"; +export * as teamMembers from "./teamMembers"; +export * from "./teamMembers/client/requests"; +export * as terminal from "./terminal"; export * from "./terminal/client/requests"; +export * as transferOrders from "./transferOrders"; export * from "./transferOrders/client/requests"; +export * as v1Transactions from "./v1Transactions"; +export * from "./v1Transactions/client/requests"; +export * as vendors from "./vendors"; export * from "./vendors/client/requests"; +export * as webhooks from "./webhooks"; diff --git a/src/api/resources/inventory/client/Client.ts b/src/api/resources/inventory/client/Client.ts index 71bd63bff..44a35bcbd 100644 --- a/src/api/resources/inventory/client/Client.ts +++ b/src/api/resources/inventory/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Inventory { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Inventory { @@ -67,6 +45,14 @@ export class Inventory { requestOptions?: Inventory.RequestOptions, ): Promise> { const { adjustmentId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -75,16 +61,10 @@ export class Inventory { `v2/inventory/adjustment/${encodeURIComponent(adjustmentId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -151,6 +131,14 @@ export class Inventory { requestOptions?: Inventory.RequestOptions, ): Promise> { const { adjustmentId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -159,16 +147,10 @@ export class Inventory { `v2/inventory/adjustments/${encodeURIComponent(adjustmentId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -247,6 +229,14 @@ export class Inventory { request: Square.BatchChangeInventoryRequest, requestOptions?: Inventory.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -255,22 +245,16 @@ export class Inventory { "v2/inventory/batch-change", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchChangeInventoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -339,6 +323,14 @@ export class Inventory { request: Square.BatchRetrieveInventoryChangesRequest, requestOptions?: Inventory.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -347,22 +339,16 @@ export class Inventory { "v2/inventory/batch-retrieve-changes", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchRetrieveInventoryChangesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -430,6 +416,14 @@ export class Inventory { request: Square.BatchGetInventoryCountsRequest, requestOptions?: Inventory.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -438,22 +432,16 @@ export class Inventory { "v2/inventory/batch-retrieve-counts", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchGetInventoryCountsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -535,6 +523,14 @@ export class Inventory { request: Square.BatchChangeInventoryRequest, requestOptions?: Inventory.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -543,22 +539,16 @@ export class Inventory { "v2/inventory/changes/batch-create", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchChangeInventoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -632,6 +622,14 @@ export class Inventory { async ( request: Square.BatchRetrieveInventoryChangesRequest, ): Promise> => { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -640,23 +638,16 @@ export class Inventory { "v2/inventory/changes/batch-retrieve", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchRetrieveInventoryChangesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -741,6 +732,14 @@ export class Inventory { async ( request: Square.BatchGetInventoryCountsRequest, ): Promise> => { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -749,23 +748,16 @@ export class Inventory { "v2/inventory/counts/batch-retrieve", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchGetInventoryCountsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -843,6 +835,14 @@ export class Inventory { requestOptions?: Inventory.RequestOptions, ): Promise> { const { physicalCountId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -851,16 +851,10 @@ export class Inventory { `v2/inventory/physical-count/${encodeURIComponent(physicalCountId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -927,6 +921,14 @@ export class Inventory { requestOptions?: Inventory.RequestOptions, ): Promise> { const { physicalCountId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -935,16 +937,10 @@ export class Inventory { `v2/inventory/physical-counts/${encodeURIComponent(physicalCountId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1011,6 +1007,14 @@ export class Inventory { requestOptions?: Inventory.RequestOptions, ): Promise> { const { transferId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -1019,16 +1023,10 @@ export class Inventory { `v2/inventory/transfers/${encodeURIComponent(transferId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1098,11 +1096,19 @@ export class Inventory { const { catalogObjectId, locationIds, cursor } = request; const _queryParams: Record = {}; if (locationIds !== undefined) { - _queryParams["location_ids"] = locationIds; + _queryParams.location_ids = locationIds; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -1111,18 +1117,10 @@ export class Inventory { `v2/inventory/${encodeURIComponent(catalogObjectId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1212,11 +1210,19 @@ export class Inventory { const { catalogObjectId, locationIds, cursor } = request; const _queryParams: Record = {}; if (locationIds !== undefined) { - _queryParams["location_ids"] = locationIds; + _queryParams.location_ids = locationIds; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -1225,18 +1231,10 @@ export class Inventory { `v2/inventory/${encodeURIComponent(catalogObjectId)}/changes`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1291,7 +1289,7 @@ export class Inventory { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/inventory/client/index.ts b/src/api/resources/inventory/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/inventory/client/index.ts +++ b/src/api/resources/inventory/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts b/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts index 4be1ccbc5..14891ac79 100644 --- a/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,9 +9,7 @@ * } */ export interface ChangesInventoryRequest { - /** - * ID of the [CatalogObject](entity:CatalogObject) to retrieve. - */ + /** ID of the [CatalogObject](entity:CatalogObject) to retrieve. */ catalogObjectId: string; /** * The [Location](entity:Location) IDs to look up as a comma-separated diff --git a/src/api/resources/inventory/client/requests/DeprecatedGetAdjustmentInventoryRequest.ts b/src/api/resources/inventory/client/requests/DeprecatedGetAdjustmentInventoryRequest.ts index c9473a53c..64cfe0b60 100644 --- a/src/api/resources/inventory/client/requests/DeprecatedGetAdjustmentInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/DeprecatedGetAdjustmentInventoryRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeprecatedGetAdjustmentInventoryRequest { - /** - * ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. - */ + /** ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. */ adjustmentId: string; } diff --git a/src/api/resources/inventory/client/requests/DeprecatedGetPhysicalCountInventoryRequest.ts b/src/api/resources/inventory/client/requests/DeprecatedGetPhysicalCountInventoryRequest.ts index d9de48c2a..5674c5b69 100644 --- a/src/api/resources/inventory/client/requests/DeprecatedGetPhysicalCountInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/DeprecatedGetPhysicalCountInventoryRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/inventory/client/requests/GetAdjustmentInventoryRequest.ts b/src/api/resources/inventory/client/requests/GetAdjustmentInventoryRequest.ts index c65aa9ca8..3aa3090e2 100644 --- a/src/api/resources/inventory/client/requests/GetAdjustmentInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/GetAdjustmentInventoryRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetAdjustmentInventoryRequest { - /** - * ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. - */ + /** ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. */ adjustmentId: string; } diff --git a/src/api/resources/inventory/client/requests/GetInventoryRequest.ts b/src/api/resources/inventory/client/requests/GetInventoryRequest.ts index c4cb90342..a16313278 100644 --- a/src/api/resources/inventory/client/requests/GetInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/GetInventoryRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,9 +9,7 @@ * } */ export interface GetInventoryRequest { - /** - * ID of the [CatalogObject](entity:CatalogObject) to retrieve. - */ + /** ID of the [CatalogObject](entity:CatalogObject) to retrieve. */ catalogObjectId: string; /** * The [Location](entity:Location) IDs to look up as a comma-separated diff --git a/src/api/resources/inventory/client/requests/GetPhysicalCountInventoryRequest.ts b/src/api/resources/inventory/client/requests/GetPhysicalCountInventoryRequest.ts index cfc96a4c6..1c1d7cd68 100644 --- a/src/api/resources/inventory/client/requests/GetPhysicalCountInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/GetPhysicalCountInventoryRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/inventory/client/requests/GetTransferInventoryRequest.ts b/src/api/resources/inventory/client/requests/GetTransferInventoryRequest.ts index c09664a30..50fc548e1 100644 --- a/src/api/resources/inventory/client/requests/GetTransferInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/GetTransferInventoryRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetTransferInventoryRequest { - /** - * ID of the [InventoryTransfer](entity:InventoryTransfer) to retrieve. - */ + /** ID of the [InventoryTransfer](entity:InventoryTransfer) to retrieve. */ transferId: string; } diff --git a/src/api/resources/inventory/client/requests/index.ts b/src/api/resources/inventory/client/requests/index.ts index b1ea5cc1f..30b02fc9c 100644 --- a/src/api/resources/inventory/client/requests/index.ts +++ b/src/api/resources/inventory/client/requests/index.ts @@ -1,7 +1,7 @@ -export { type DeprecatedGetAdjustmentInventoryRequest } from "./DeprecatedGetAdjustmentInventoryRequest"; -export { type GetAdjustmentInventoryRequest } from "./GetAdjustmentInventoryRequest"; -export { type DeprecatedGetPhysicalCountInventoryRequest } from "./DeprecatedGetPhysicalCountInventoryRequest"; -export { type GetPhysicalCountInventoryRequest } from "./GetPhysicalCountInventoryRequest"; -export { type GetTransferInventoryRequest } from "./GetTransferInventoryRequest"; -export { type GetInventoryRequest } from "./GetInventoryRequest"; -export { type ChangesInventoryRequest } from "./ChangesInventoryRequest"; +export type { ChangesInventoryRequest } from "./ChangesInventoryRequest"; +export type { DeprecatedGetAdjustmentInventoryRequest } from "./DeprecatedGetAdjustmentInventoryRequest"; +export type { DeprecatedGetPhysicalCountInventoryRequest } from "./DeprecatedGetPhysicalCountInventoryRequest"; +export type { GetAdjustmentInventoryRequest } from "./GetAdjustmentInventoryRequest"; +export type { GetInventoryRequest } from "./GetInventoryRequest"; +export type { GetPhysicalCountInventoryRequest } from "./GetPhysicalCountInventoryRequest"; +export type { GetTransferInventoryRequest } from "./GetTransferInventoryRequest"; diff --git a/src/api/resources/invoices/client/Client.ts b/src/api/resources/invoices/client/Client.ts index acd3f9d89..5376de06c 100644 --- a/src/api/resources/invoices/client/Client.ts +++ b/src/api/resources/invoices/client/Client.ts @@ -1,40 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; -import * as errors from "../../../../errors/index"; import { toJson } from "../../../../core/json"; +import * as environments from "../../../../environments"; +import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Invoices { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Invoices { @@ -67,13 +45,21 @@ export class Invoices { async (request: Square.ListInvoicesRequest): Promise> => { const { locationId, cursor, limit } = request; const _queryParams: Record = {}; - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -82,18 +68,10 @@ export class Invoices { "v2/invoices", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -211,6 +189,14 @@ export class Invoices { request: Square.CreateInvoiceRequest, requestOptions?: Invoices.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -219,22 +205,16 @@ export class Invoices { "v2/invoices", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateInvoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -313,6 +293,14 @@ export class Invoices { request: Square.SearchInvoicesRequest, requestOptions?: Invoices.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -321,22 +309,16 @@ export class Invoices { "v2/invoices/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchInvoicesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -400,6 +382,14 @@ export class Invoices { requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -408,16 +398,10 @@ export class Invoices { `v2/invoices/${encodeURIComponent(invoiceId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -492,6 +476,14 @@ export class Invoices { requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -500,22 +492,16 @@ export class Invoices { `v2/invoices/${encodeURIComponent(invoiceId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateInvoiceRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -584,9 +570,17 @@ export class Invoices { const { invoiceId, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -595,17 +589,10 @@ export class Invoices { `v2/invoices/${encodeURIComponent(invoiceId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -660,6 +647,7 @@ export class Invoices { * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example + * import { createReadStream } from "fs"; * await client.invoices.createInvoiceAttachment({ * invoiceId: "invoice_id" * }) @@ -693,6 +681,15 @@ export class Invoices { } const _maybeEncodedRequest = await _request.getRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + ..._maybeEncodedRequest.headers, + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -701,20 +698,13 @@ export class Invoices { `v2/invoices/${encodeURIComponent(request.invoiceId)}/attachments`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - ..._maybeEncodedRequest.headers, - }), - requestOptions?.headers, - ), + headers: _headers, + queryParameters: requestOptions?.queryParams, requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -782,6 +772,14 @@ export class Invoices { requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId, attachmentId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -790,16 +788,10 @@ export class Invoices { `v2/invoices/${encodeURIComponent(invoiceId)}/attachments/${encodeURIComponent(attachmentId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -869,6 +861,14 @@ export class Invoices { requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -877,22 +877,16 @@ export class Invoices { `v2/invoices/${encodeURIComponent(invoiceId)}/cancel`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CancelInvoiceRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -973,6 +967,14 @@ export class Invoices { requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -981,22 +983,16 @@ export class Invoices { `v2/invoices/${encodeURIComponent(invoiceId)}/publish`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.PublishInvoiceRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1040,7 +1036,7 @@ export class Invoices { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/invoices/client/index.ts b/src/api/resources/invoices/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/invoices/client/index.ts +++ b/src/api/resources/invoices/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/invoices/client/requests/CancelInvoiceRequest.ts b/src/api/resources/invoices/client/requests/CancelInvoiceRequest.ts index 57766ffa7..79b61b825 100644 --- a/src/api/resources/invoices/client/requests/CancelInvoiceRequest.ts +++ b/src/api/resources/invoices/client/requests/CancelInvoiceRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface CancelInvoiceRequest { - /** - * The ID of the [invoice](entity:Invoice) to cancel. - */ + /** The ID of the [invoice](entity:Invoice) to cancel. */ invoiceId: string; /** * The version of the [invoice](entity:Invoice) to cancel. diff --git a/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts b/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts index da5fcfc6f..a0d66240e 100644 --- a/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts +++ b/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; -import * as fs from "fs"; +import type * as fs from "fs"; +import type * as Square from "../../../../index"; /** * @example @@ -12,9 +10,7 @@ import * as fs from "fs"; * } */ export interface CreateInvoiceAttachmentRequest { - /** - * The ID of the [invoice](entity:Invoice) to attach the file to. - */ + /** The ID of the [invoice](entity:Invoice) to attach the file to. */ invoiceId: string; request?: Square.CreateInvoiceAttachmentRequestData; imageFile?: File | fs.ReadStream | Blob | undefined; diff --git a/src/api/resources/invoices/client/requests/CreateInvoiceRequest.ts b/src/api/resources/invoices/client/requests/CreateInvoiceRequest.ts index 32296308a..48da4aa74 100644 --- a/src/api/resources/invoices/client/requests/CreateInvoiceRequest.ts +++ b/src/api/resources/invoices/client/requests/CreateInvoiceRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/invoices/client/requests/DeleteInvoiceAttachmentRequest.ts b/src/api/resources/invoices/client/requests/DeleteInvoiceAttachmentRequest.ts index 56926b013..f1852641c 100644 --- a/src/api/resources/invoices/client/requests/DeleteInvoiceAttachmentRequest.ts +++ b/src/api/resources/invoices/client/requests/DeleteInvoiceAttachmentRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface DeleteInvoiceAttachmentRequest { - /** - * The ID of the [invoice](entity:Invoice) to delete the attachment from. - */ + /** The ID of the [invoice](entity:Invoice) to delete the attachment from. */ invoiceId: string; - /** - * The ID of the [attachment](entity:InvoiceAttachment) to delete. - */ + /** The ID of the [attachment](entity:InvoiceAttachment) to delete. */ attachmentId: string; } diff --git a/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts b/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts index 97e237452..6f36aafcf 100644 --- a/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts +++ b/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface DeleteInvoicesRequest { - /** - * The ID of the invoice to delete. - */ + /** The ID of the invoice to delete. */ invoiceId: string; /** * The version of the [invoice](entity:Invoice) to delete. diff --git a/src/api/resources/invoices/client/requests/GetInvoicesRequest.ts b/src/api/resources/invoices/client/requests/GetInvoicesRequest.ts index 8f288b53f..5342763ee 100644 --- a/src/api/resources/invoices/client/requests/GetInvoicesRequest.ts +++ b/src/api/resources/invoices/client/requests/GetInvoicesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetInvoicesRequest { - /** - * The ID of the invoice to retrieve. - */ + /** The ID of the invoice to retrieve. */ invoiceId: string; } diff --git a/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts b/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts index 501cde386..f07c3a973 100644 --- a/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts +++ b/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,9 +9,7 @@ * } */ export interface ListInvoicesRequest { - /** - * The ID of the location for which to list invoices. - */ + /** The ID of the location for which to list invoices. */ locationId: string; /** * A pagination cursor returned by a previous call to this endpoint. diff --git a/src/api/resources/invoices/client/requests/PublishInvoiceRequest.ts b/src/api/resources/invoices/client/requests/PublishInvoiceRequest.ts index d6c52757a..9c5866162 100644 --- a/src/api/resources/invoices/client/requests/PublishInvoiceRequest.ts +++ b/src/api/resources/invoices/client/requests/PublishInvoiceRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,9 +9,7 @@ * } */ export interface PublishInvoiceRequest { - /** - * The ID of the invoice to publish. - */ + /** The ID of the invoice to publish. */ invoiceId: string; /** * The version of the [invoice](entity:Invoice) to publish. diff --git a/src/api/resources/invoices/client/requests/SearchInvoicesRequest.ts b/src/api/resources/invoices/client/requests/SearchInvoicesRequest.ts index a33ce5a75..34bf2062e 100644 --- a/src/api/resources/invoices/client/requests/SearchInvoicesRequest.ts +++ b/src/api/resources/invoices/client/requests/SearchInvoicesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/invoices/client/requests/UpdateInvoiceRequest.ts b/src/api/resources/invoices/client/requests/UpdateInvoiceRequest.ts index a84529af0..928fd6d32 100644 --- a/src/api/resources/invoices/client/requests/UpdateInvoiceRequest.ts +++ b/src/api/resources/invoices/client/requests/UpdateInvoiceRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -19,9 +17,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateInvoiceRequest { - /** - * The ID of the invoice to update. - */ + /** The ID of the invoice to update. */ invoiceId: string; /** * The invoice fields to add, change, or clear. Fields can be cleared using diff --git a/src/api/resources/invoices/client/requests/index.ts b/src/api/resources/invoices/client/requests/index.ts index d6b0b4452..71c00300b 100644 --- a/src/api/resources/invoices/client/requests/index.ts +++ b/src/api/resources/invoices/client/requests/index.ts @@ -1,10 +1,10 @@ -export { type ListInvoicesRequest } from "./ListInvoicesRequest"; -export { type CreateInvoiceRequest } from "./CreateInvoiceRequest"; -export { type SearchInvoicesRequest } from "./SearchInvoicesRequest"; -export { type GetInvoicesRequest } from "./GetInvoicesRequest"; -export { type UpdateInvoiceRequest } from "./UpdateInvoiceRequest"; -export { type DeleteInvoicesRequest } from "./DeleteInvoicesRequest"; -export { type CreateInvoiceAttachmentRequest } from "./CreateInvoiceAttachmentRequest"; -export { type DeleteInvoiceAttachmentRequest } from "./DeleteInvoiceAttachmentRequest"; -export { type CancelInvoiceRequest } from "./CancelInvoiceRequest"; -export { type PublishInvoiceRequest } from "./PublishInvoiceRequest"; +export type { CancelInvoiceRequest } from "./CancelInvoiceRequest"; +export type { CreateInvoiceAttachmentRequest } from "./CreateInvoiceAttachmentRequest"; +export type { CreateInvoiceRequest } from "./CreateInvoiceRequest"; +export type { DeleteInvoiceAttachmentRequest } from "./DeleteInvoiceAttachmentRequest"; +export type { DeleteInvoicesRequest } from "./DeleteInvoicesRequest"; +export type { GetInvoicesRequest } from "./GetInvoicesRequest"; +export type { ListInvoicesRequest } from "./ListInvoicesRequest"; +export type { PublishInvoiceRequest } from "./PublishInvoiceRequest"; +export type { SearchInvoicesRequest } from "./SearchInvoicesRequest"; +export type { UpdateInvoiceRequest } from "./UpdateInvoiceRequest"; diff --git a/src/api/resources/labor/client/Client.ts b/src/api/resources/labor/client/Client.ts index c30f736c2..a464da0ce 100644 --- a/src/api/resources/labor/client/Client.ts +++ b/src/api/resources/labor/client/Client.ts @@ -1,13 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { BreakTypes } from "../resources/breakTypes/client/Client"; import { EmployeeWages } from "../resources/employeeWages/client/Client"; import { Shifts } from "../resources/shifts/client/Client"; @@ -15,30 +14,9 @@ import { TeamMemberWages } from "../resources/teamMemberWages/client/Client"; import { WorkweekConfigs } from "../resources/workweekConfigs/client/Client"; export declare namespace Labor { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Labor { @@ -113,6 +91,14 @@ export class Labor { request: Square.CreateScheduledShiftRequest, requestOptions?: Labor.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -121,22 +107,16 @@ export class Labor { "v2/labor/scheduled-shifts", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateScheduledShiftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -207,6 +187,14 @@ export class Labor { request: Square.BulkPublishScheduledShiftsRequest, requestOptions?: Labor.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -215,22 +203,16 @@ export class Labor { "v2/labor/scheduled-shifts/bulk-publish", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkPublishScheduledShiftsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -306,6 +288,14 @@ export class Labor { request: Square.SearchScheduledShiftsRequest = {}, requestOptions?: Labor.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -314,22 +304,16 @@ export class Labor { "v2/labor/scheduled-shifts/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchScheduledShiftsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -395,6 +379,14 @@ export class Labor { requestOptions?: Labor.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -403,16 +395,10 @@ export class Labor { `v2/labor/scheduled-shifts/${encodeURIComponent(id)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -499,6 +485,14 @@ export class Labor { requestOptions?: Labor.RequestOptions, ): Promise> { const { id, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -507,22 +501,16 @@ export class Labor { `v2/labor/scheduled-shifts/${encodeURIComponent(id)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateScheduledShiftRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -592,6 +580,14 @@ export class Labor { requestOptions?: Labor.RequestOptions, ): Promise> { const { id, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -600,22 +596,16 @@ export class Labor { `v2/labor/scheduled-shifts/${encodeURIComponent(id)}/publish`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.PublishScheduledShiftRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -723,6 +713,14 @@ export class Labor { request: Square.CreateTimecardRequest, requestOptions?: Labor.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -731,22 +729,16 @@ export class Labor { "v2/labor/timecards", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateTimecardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -834,6 +826,14 @@ export class Labor { request: Square.SearchTimecardsRequest = {}, requestOptions?: Labor.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -842,22 +842,16 @@ export class Labor { "v2/labor/timecards/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchTimecardsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -921,6 +915,14 @@ export class Labor { requestOptions?: Labor.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -929,16 +931,10 @@ export class Labor { `v2/labor/timecards/${encodeURIComponent(id)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1037,6 +1033,14 @@ export class Labor { requestOptions?: Labor.RequestOptions, ): Promise> { const { id, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -1045,22 +1049,16 @@ export class Labor { `v2/labor/timecards/${encodeURIComponent(id)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateTimecardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1124,6 +1122,14 @@ export class Labor { requestOptions?: Labor.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -1132,16 +1138,10 @@ export class Labor { `v2/labor/timecards/${encodeURIComponent(id)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1183,7 +1183,7 @@ export class Labor { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/client/index.ts b/src/api/resources/labor/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/labor/client/index.ts +++ b/src/api/resources/labor/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts b/src/api/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts index a2082ab1d..14e0a2f04 100644 --- a/src/api/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts +++ b/src/api/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/labor/client/requests/CreateScheduledShiftRequest.ts b/src/api/resources/labor/client/requests/CreateScheduledShiftRequest.ts index b17585939..d13dc516f 100644 --- a/src/api/resources/labor/client/requests/CreateScheduledShiftRequest.ts +++ b/src/api/resources/labor/client/requests/CreateScheduledShiftRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/labor/client/requests/CreateTimecardRequest.ts b/src/api/resources/labor/client/requests/CreateTimecardRequest.ts index 1e70da741..e1538b5a9 100644 --- a/src/api/resources/labor/client/requests/CreateTimecardRequest.ts +++ b/src/api/resources/labor/client/requests/CreateTimecardRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/labor/client/requests/DeleteTimecardRequest.ts b/src/api/resources/labor/client/requests/DeleteTimecardRequest.ts index cb6ec0223..cd097d193 100644 --- a/src/api/resources/labor/client/requests/DeleteTimecardRequest.ts +++ b/src/api/resources/labor/client/requests/DeleteTimecardRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteTimecardRequest { - /** - * The UUID for the `Timecard` being deleted. - */ + /** The UUID for the `Timecard` being deleted. */ id: string; } diff --git a/src/api/resources/labor/client/requests/PublishScheduledShiftRequest.ts b/src/api/resources/labor/client/requests/PublishScheduledShiftRequest.ts index 4d3be81fb..be5aedc65 100644 --- a/src/api/resources/labor/client/requests/PublishScheduledShiftRequest.ts +++ b/src/api/resources/labor/client/requests/PublishScheduledShiftRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -14,9 +12,7 @@ import * as Square from "../../../../index"; * } */ export interface PublishScheduledShiftRequest { - /** - * The ID of the scheduled shift to publish. - */ + /** The ID of the scheduled shift to publish. */ id: string; /** * A unique identifier for the `PublishScheduledShift` request, used to ensure the diff --git a/src/api/resources/labor/client/requests/RetrieveScheduledShiftRequest.ts b/src/api/resources/labor/client/requests/RetrieveScheduledShiftRequest.ts index d12a8f15b..992dae070 100644 --- a/src/api/resources/labor/client/requests/RetrieveScheduledShiftRequest.ts +++ b/src/api/resources/labor/client/requests/RetrieveScheduledShiftRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface RetrieveScheduledShiftRequest { - /** - * The ID of the scheduled shift to retrieve. - */ + /** The ID of the scheduled shift to retrieve. */ id: string; } diff --git a/src/api/resources/labor/client/requests/RetrieveTimecardRequest.ts b/src/api/resources/labor/client/requests/RetrieveTimecardRequest.ts index 99e58768d..b44f5e28c 100644 --- a/src/api/resources/labor/client/requests/RetrieveTimecardRequest.ts +++ b/src/api/resources/labor/client/requests/RetrieveTimecardRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface RetrieveTimecardRequest { - /** - * The UUID for the `Timecard` being retrieved. - */ + /** The UUID for the `Timecard` being retrieved. */ id: string; } diff --git a/src/api/resources/labor/client/requests/SearchScheduledShiftsRequest.ts b/src/api/resources/labor/client/requests/SearchScheduledShiftsRequest.ts index ff557cd35..5a8ab3c0b 100644 --- a/src/api/resources/labor/client/requests/SearchScheduledShiftsRequest.ts +++ b/src/api/resources/labor/client/requests/SearchScheduledShiftsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/labor/client/requests/SearchTimecardsRequest.ts b/src/api/resources/labor/client/requests/SearchTimecardsRequest.ts index 7cb06c2dc..5830fd2c1 100644 --- a/src/api/resources/labor/client/requests/SearchTimecardsRequest.ts +++ b/src/api/resources/labor/client/requests/SearchTimecardsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/labor/client/requests/UpdateScheduledShiftRequest.ts b/src/api/resources/labor/client/requests/UpdateScheduledShiftRequest.ts index 748947023..22ba81fae 100644 --- a/src/api/resources/labor/client/requests/UpdateScheduledShiftRequest.ts +++ b/src/api/resources/labor/client/requests/UpdateScheduledShiftRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -23,9 +21,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateScheduledShiftRequest { - /** - * The ID of the scheduled shift to update. - */ + /** The ID of the scheduled shift to update. */ id: string; /** * The scheduled shift with any updates in the `draft_shift_details` field. diff --git a/src/api/resources/labor/client/requests/UpdateTimecardRequest.ts b/src/api/resources/labor/client/requests/UpdateTimecardRequest.ts index c9ffafaae..a9babe1f7 100644 --- a/src/api/resources/labor/client/requests/UpdateTimecardRequest.ts +++ b/src/api/resources/labor/client/requests/UpdateTimecardRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -40,9 +38,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateTimecardRequest { - /** - * The ID of the object being updated. - */ + /** The ID of the object being updated. */ id: string; /** The updated `Timecard` object. */ timecard: Square.Timecard; diff --git a/src/api/resources/labor/client/requests/index.ts b/src/api/resources/labor/client/requests/index.ts index 8b8e6d675..87988c2d7 100644 --- a/src/api/resources/labor/client/requests/index.ts +++ b/src/api/resources/labor/client/requests/index.ts @@ -1,11 +1,11 @@ -export { type CreateScheduledShiftRequest } from "./CreateScheduledShiftRequest"; -export { type BulkPublishScheduledShiftsRequest } from "./BulkPublishScheduledShiftsRequest"; -export { type SearchScheduledShiftsRequest } from "./SearchScheduledShiftsRequest"; -export { type RetrieveScheduledShiftRequest } from "./RetrieveScheduledShiftRequest"; -export { type UpdateScheduledShiftRequest } from "./UpdateScheduledShiftRequest"; -export { type PublishScheduledShiftRequest } from "./PublishScheduledShiftRequest"; -export { type CreateTimecardRequest } from "./CreateTimecardRequest"; -export { type SearchTimecardsRequest } from "./SearchTimecardsRequest"; -export { type RetrieveTimecardRequest } from "./RetrieveTimecardRequest"; -export { type UpdateTimecardRequest } from "./UpdateTimecardRequest"; -export { type DeleteTimecardRequest } from "./DeleteTimecardRequest"; +export type { BulkPublishScheduledShiftsRequest } from "./BulkPublishScheduledShiftsRequest"; +export type { CreateScheduledShiftRequest } from "./CreateScheduledShiftRequest"; +export type { CreateTimecardRequest } from "./CreateTimecardRequest"; +export type { DeleteTimecardRequest } from "./DeleteTimecardRequest"; +export type { PublishScheduledShiftRequest } from "./PublishScheduledShiftRequest"; +export type { RetrieveScheduledShiftRequest } from "./RetrieveScheduledShiftRequest"; +export type { RetrieveTimecardRequest } from "./RetrieveTimecardRequest"; +export type { SearchScheduledShiftsRequest } from "./SearchScheduledShiftsRequest"; +export type { SearchTimecardsRequest } from "./SearchTimecardsRequest"; +export type { UpdateScheduledShiftRequest } from "./UpdateScheduledShiftRequest"; +export type { UpdateTimecardRequest } from "./UpdateTimecardRequest"; diff --git a/src/api/resources/labor/resources/breakTypes/client/Client.ts b/src/api/resources/labor/resources/breakTypes/client/Client.ts index 40c6efed1..3b518d6bc 100644 --- a/src/api/resources/labor/resources/breakTypes/client/Client.ts +++ b/src/api/resources/labor/resources/breakTypes/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace BreakTypes { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class BreakTypes { @@ -67,14 +45,22 @@ export class BreakTypes { const { locationId, limit, cursor } = request; const _queryParams: Record = {}; if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -83,18 +69,10 @@ export class BreakTypes { "v2/labor/break-types", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -187,6 +165,14 @@ export class BreakTypes { request: Square.labor.CreateBreakTypeRequest, requestOptions?: BreakTypes.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -195,22 +181,16 @@ export class BreakTypes { "v2/labor/break-types", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.CreateBreakTypeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -274,6 +254,14 @@ export class BreakTypes { requestOptions?: BreakTypes.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -282,16 +270,10 @@ export class BreakTypes { `v2/labor/break-types/${encodeURIComponent(id)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -362,6 +344,14 @@ export class BreakTypes { requestOptions?: BreakTypes.RequestOptions, ): Promise> { const { id, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -370,22 +360,16 @@ export class BreakTypes { `v2/labor/break-types/${encodeURIComponent(id)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.UpdateBreakTypeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -451,6 +435,14 @@ export class BreakTypes { requestOptions?: BreakTypes.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -459,16 +451,10 @@ export class BreakTypes { `v2/labor/break-types/${encodeURIComponent(id)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -510,7 +496,7 @@ export class BreakTypes { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/resources/breakTypes/client/index.ts b/src/api/resources/labor/resources/breakTypes/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/labor/resources/breakTypes/client/index.ts +++ b/src/api/resources/labor/resources/breakTypes/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts index f79298188..35f5f0e55 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/DeleteBreakTypesRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/DeleteBreakTypesRequest.ts index 43a446e81..516adf92b 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/DeleteBreakTypesRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/DeleteBreakTypesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteBreakTypesRequest { - /** - * The UUID for the `BreakType` being deleted. - */ + /** The UUID for the `BreakType` being deleted. */ id: string; } diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/GetBreakTypesRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/GetBreakTypesRequest.ts index b3151b750..7686e88db 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/GetBreakTypesRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/GetBreakTypesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetBreakTypesRequest { - /** - * The UUID for the `BreakType` being retrieved. - */ + /** The UUID for the `BreakType` being retrieved. */ id: string; } diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts index f8d653dfc..e0514c25f 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -21,8 +19,6 @@ export interface ListBreakTypesRequest { * and 200. The default is 200. */ limit?: number | null; - /** - * A pointer to the next page of `BreakType` results to fetch. - */ + /** A pointer to the next page of `BreakType` results to fetch. */ cursor?: string | null; } diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts index 57ed0b0f5..ec23fb7e9 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -18,9 +16,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateBreakTypeRequest { - /** - * The UUID for the `BreakType` being updated. - */ + /** The UUID for the `BreakType` being updated. */ id: string; /** The updated `BreakType`. */ breakType: Square.BreakType; diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/index.ts b/src/api/resources/labor/resources/breakTypes/client/requests/index.ts index 12addd0f2..859da800c 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/index.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type ListBreakTypesRequest } from "./ListBreakTypesRequest"; -export { type CreateBreakTypeRequest } from "./CreateBreakTypeRequest"; -export { type GetBreakTypesRequest } from "./GetBreakTypesRequest"; -export { type UpdateBreakTypeRequest } from "./UpdateBreakTypeRequest"; -export { type DeleteBreakTypesRequest } from "./DeleteBreakTypesRequest"; +export type { CreateBreakTypeRequest } from "./CreateBreakTypeRequest"; +export type { DeleteBreakTypesRequest } from "./DeleteBreakTypesRequest"; +export type { GetBreakTypesRequest } from "./GetBreakTypesRequest"; +export type { ListBreakTypesRequest } from "./ListBreakTypesRequest"; +export type { UpdateBreakTypeRequest } from "./UpdateBreakTypeRequest"; diff --git a/src/api/resources/labor/resources/employeeWages/client/Client.ts b/src/api/resources/labor/resources/employeeWages/client/Client.ts index 9335b4cf0..5421e04ea 100644 --- a/src/api/resources/labor/resources/employeeWages/client/Client.ts +++ b/src/api/resources/labor/resources/employeeWages/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace EmployeeWages { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class EmployeeWages { @@ -67,14 +45,22 @@ export class EmployeeWages { const { employeeId, limit, cursor } = request; const _queryParams: Record = {}; if (employeeId !== undefined) { - _queryParams["employee_id"] = employeeId; + _queryParams.employee_id = employeeId; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -83,18 +69,10 @@ export class EmployeeWages { "v2/labor/employee-wages", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -171,6 +149,14 @@ export class EmployeeWages { requestOptions?: EmployeeWages.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -179,16 +165,10 @@ export class EmployeeWages { `v2/labor/employee-wages/${encodeURIComponent(id)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -230,7 +210,7 @@ export class EmployeeWages { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/resources/employeeWages/client/index.ts b/src/api/resources/labor/resources/employeeWages/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/labor/resources/employeeWages/client/index.ts +++ b/src/api/resources/labor/resources/employeeWages/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/labor/resources/employeeWages/client/requests/GetEmployeeWagesRequest.ts b/src/api/resources/labor/resources/employeeWages/client/requests/GetEmployeeWagesRequest.ts index 9e73a6b6a..7f1595af5 100644 --- a/src/api/resources/labor/resources/employeeWages/client/requests/GetEmployeeWagesRequest.ts +++ b/src/api/resources/labor/resources/employeeWages/client/requests/GetEmployeeWagesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetEmployeeWagesRequest { - /** - * The UUID for the `EmployeeWage` being retrieved. - */ + /** The UUID for the `EmployeeWage` being retrieved. */ id: string; } diff --git a/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts b/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts index 24a7da1d0..ac1eb9e4a 100644 --- a/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts +++ b/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,17 +9,13 @@ * } */ export interface ListEmployeeWagesRequest { - /** - * Filter the returned wages to only those that are associated with the specified employee. - */ + /** Filter the returned wages to only those that are associated with the specified employee. */ employeeId?: string | null; /** * The maximum number of `EmployeeWage` results to return per page. The number can range between * 1 and 200. The default is 200. */ limit?: number | null; - /** - * A pointer to the next page of `EmployeeWage` results to fetch. - */ + /** A pointer to the next page of `EmployeeWage` results to fetch. */ cursor?: string | null; } diff --git a/src/api/resources/labor/resources/employeeWages/client/requests/index.ts b/src/api/resources/labor/resources/employeeWages/client/requests/index.ts index eb9a9e67e..acf0ca130 100644 --- a/src/api/resources/labor/resources/employeeWages/client/requests/index.ts +++ b/src/api/resources/labor/resources/employeeWages/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type ListEmployeeWagesRequest } from "./ListEmployeeWagesRequest"; -export { type GetEmployeeWagesRequest } from "./GetEmployeeWagesRequest"; +export type { GetEmployeeWagesRequest } from "./GetEmployeeWagesRequest"; +export type { ListEmployeeWagesRequest } from "./ListEmployeeWagesRequest"; diff --git a/src/api/resources/labor/resources/index.ts b/src/api/resources/labor/resources/index.ts index e0b60d0eb..986244b5c 100644 --- a/src/api/resources/labor/resources/index.ts +++ b/src/api/resources/labor/resources/index.ts @@ -1,10 +1,10 @@ export * as breakTypes from "./breakTypes"; -export * as employeeWages from "./employeeWages"; -export * as shifts from "./shifts"; -export * as teamMemberWages from "./teamMemberWages"; -export * as workweekConfigs from "./workweekConfigs"; export * from "./breakTypes/client/requests"; +export * as employeeWages from "./employeeWages"; export * from "./employeeWages/client/requests"; +export * as shifts from "./shifts"; export * from "./shifts/client/requests"; +export * as teamMemberWages from "./teamMemberWages"; export * from "./teamMemberWages/client/requests"; +export * as workweekConfigs from "./workweekConfigs"; export * from "./workweekConfigs/client/requests"; diff --git a/src/api/resources/labor/resources/shifts/client/Client.ts b/src/api/resources/labor/resources/shifts/client/Client.ts index 51b3518ce..4c0e0f45d 100644 --- a/src/api/resources/labor/resources/shifts/client/Client.ts +++ b/src/api/resources/labor/resources/shifts/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Shifts { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Shifts { @@ -108,6 +86,14 @@ export class Shifts { request: Square.labor.CreateShiftRequest, requestOptions?: Shifts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -116,22 +102,16 @@ export class Shifts { "v2/labor/shifts", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.CreateShiftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -219,6 +199,14 @@ export class Shifts { request: Square.labor.SearchShiftsRequest = {}, requestOptions?: Shifts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -227,22 +215,16 @@ export class Shifts { "v2/labor/shifts/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.SearchShiftsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -306,6 +288,14 @@ export class Shifts { requestOptions?: Shifts.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -314,16 +304,10 @@ export class Shifts { `v2/labor/shifts/${encodeURIComponent(id)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -421,6 +405,14 @@ export class Shifts { requestOptions?: Shifts.RequestOptions, ): Promise> { const { id, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -429,22 +421,16 @@ export class Shifts { `v2/labor/shifts/${encodeURIComponent(id)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.UpdateShiftRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -508,6 +494,14 @@ export class Shifts { requestOptions?: Shifts.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -516,16 +510,10 @@ export class Shifts { `v2/labor/shifts/${encodeURIComponent(id)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -567,7 +555,7 @@ export class Shifts { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/resources/shifts/client/index.ts b/src/api/resources/labor/resources/shifts/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/labor/resources/shifts/client/index.ts +++ b/src/api/resources/labor/resources/shifts/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts b/src/api/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts index 6c258c04a..26d309ccf 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/labor/resources/shifts/client/requests/DeleteShiftsRequest.ts b/src/api/resources/labor/resources/shifts/client/requests/DeleteShiftsRequest.ts index 9a05ba1f5..c4f2cf615 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/DeleteShiftsRequest.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/DeleteShiftsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteShiftsRequest { - /** - * The UUID for the `Shift` being deleted. - */ + /** The UUID for the `Shift` being deleted. */ id: string; } diff --git a/src/api/resources/labor/resources/shifts/client/requests/GetShiftsRequest.ts b/src/api/resources/labor/resources/shifts/client/requests/GetShiftsRequest.ts index eca608527..cc8521615 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/GetShiftsRequest.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/GetShiftsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetShiftsRequest { - /** - * The UUID for the `Shift` being retrieved. - */ + /** The UUID for the `Shift` being retrieved. */ id: string; } diff --git a/src/api/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts b/src/api/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts index 17caa5167..e9142fba8 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts b/src/api/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts index e14a46844..85ffac0dd 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -39,9 +37,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateShiftRequest { - /** - * The ID of the object being updated. - */ + /** The ID of the object being updated. */ id: string; /** The updated `Shift` object. */ shift: Square.Shift; diff --git a/src/api/resources/labor/resources/shifts/client/requests/index.ts b/src/api/resources/labor/resources/shifts/client/requests/index.ts index 49df3318e..69d9129c3 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/index.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type CreateShiftRequest } from "./CreateShiftRequest"; -export { type SearchShiftsRequest } from "./SearchShiftsRequest"; -export { type GetShiftsRequest } from "./GetShiftsRequest"; -export { type UpdateShiftRequest } from "./UpdateShiftRequest"; -export { type DeleteShiftsRequest } from "./DeleteShiftsRequest"; +export type { CreateShiftRequest } from "./CreateShiftRequest"; +export type { DeleteShiftsRequest } from "./DeleteShiftsRequest"; +export type { GetShiftsRequest } from "./GetShiftsRequest"; +export type { SearchShiftsRequest } from "./SearchShiftsRequest"; +export type { UpdateShiftRequest } from "./UpdateShiftRequest"; diff --git a/src/api/resources/labor/resources/teamMemberWages/client/Client.ts b/src/api/resources/labor/resources/teamMemberWages/client/Client.ts index 7d903d3c5..b276a6957 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/Client.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace TeamMemberWages { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class TeamMemberWages { @@ -67,14 +45,22 @@ export class TeamMemberWages { const { teamMemberId, limit, cursor } = request; const _queryParams: Record = {}; if (teamMemberId !== undefined) { - _queryParams["team_member_id"] = teamMemberId; + _queryParams.team_member_id = teamMemberId; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -83,18 +69,10 @@ export class TeamMemberWages { "v2/labor/team-member-wages", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -171,6 +149,14 @@ export class TeamMemberWages { requestOptions?: TeamMemberWages.RequestOptions, ): Promise> { const { id } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -179,16 +165,10 @@ export class TeamMemberWages { `v2/labor/team-member-wages/${encodeURIComponent(id)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -232,7 +212,7 @@ export class TeamMemberWages { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/resources/teamMemberWages/client/index.ts b/src/api/resources/labor/resources/teamMemberWages/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/index.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/labor/resources/teamMemberWages/client/requests/GetTeamMemberWagesRequest.ts b/src/api/resources/labor/resources/teamMemberWages/client/requests/GetTeamMemberWagesRequest.ts index 6e5e5f0ce..43618c7fe 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/requests/GetTeamMemberWagesRequest.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/requests/GetTeamMemberWagesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetTeamMemberWagesRequest { - /** - * The UUID for the `TeamMemberWage` being retrieved. - */ + /** The UUID for the `TeamMemberWage` being retrieved. */ id: string; } diff --git a/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts b/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts index 4bdcfeb7a..d9c6201ff 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -21,8 +19,6 @@ export interface ListTeamMemberWagesRequest { * 1 and 200. The default is 200. */ limit?: number | null; - /** - * A pointer to the next page of `EmployeeWage` results to fetch. - */ + /** A pointer to the next page of `EmployeeWage` results to fetch. */ cursor?: string | null; } diff --git a/src/api/resources/labor/resources/teamMemberWages/client/requests/index.ts b/src/api/resources/labor/resources/teamMemberWages/client/requests/index.ts index 97313ff47..99d3ac556 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/requests/index.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type ListTeamMemberWagesRequest } from "./ListTeamMemberWagesRequest"; -export { type GetTeamMemberWagesRequest } from "./GetTeamMemberWagesRequest"; +export type { GetTeamMemberWagesRequest } from "./GetTeamMemberWagesRequest"; +export type { ListTeamMemberWagesRequest } from "./ListTeamMemberWagesRequest"; diff --git a/src/api/resources/labor/resources/workweekConfigs/client/Client.ts b/src/api/resources/labor/resources/workweekConfigs/client/Client.ts index deab7baab..a20cf11f0 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/Client.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace WorkweekConfigs { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class WorkweekConfigs { @@ -66,11 +44,19 @@ export class WorkweekConfigs { const { limit, cursor } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -79,18 +65,10 @@ export class WorkweekConfigs { "v2/labor/workweek-configs", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -172,6 +150,14 @@ export class WorkweekConfigs { requestOptions?: WorkweekConfigs.RequestOptions, ): Promise> { const { id, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -180,22 +166,16 @@ export class WorkweekConfigs { `v2/labor/workweek-configs/${encodeURIComponent(id)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.UpdateWorkweekConfigRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -239,7 +219,7 @@ export class WorkweekConfigs { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/resources/workweekConfigs/client/index.ts b/src/api/resources/labor/resources/workweekConfigs/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/index.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts b/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts index 2f8a70af2..fbd301c1d 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface ListWorkweekConfigsRequest { - /** - * The maximum number of `WorkweekConfigs` results to return per page. - */ + /** The maximum number of `WorkweekConfigs` results to return per page. */ limit?: number | null; - /** - * A pointer to the next page of `WorkweekConfig` results to fetch. - */ + /** A pointer to the next page of `WorkweekConfig` results to fetch. */ cursor?: string | null; } diff --git a/src/api/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts b/src/api/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts index b9a85bb7c..ef4ef8609 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -16,9 +14,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateWorkweekConfigRequest { - /** - * The UUID for the `WorkweekConfig` object being updated. - */ + /** The UUID for the `WorkweekConfig` object being updated. */ id: string; /** The updated `WorkweekConfig` object. */ workweekConfig: Square.WorkweekConfig; diff --git a/src/api/resources/labor/resources/workweekConfigs/client/requests/index.ts b/src/api/resources/labor/resources/workweekConfigs/client/requests/index.ts index 04fe60b23..384958493 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/requests/index.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type ListWorkweekConfigsRequest } from "./ListWorkweekConfigsRequest"; -export { type UpdateWorkweekConfigRequest } from "./UpdateWorkweekConfigRequest"; +export type { ListWorkweekConfigsRequest } from "./ListWorkweekConfigsRequest"; +export type { UpdateWorkweekConfigRequest } from "./UpdateWorkweekConfigRequest"; diff --git a/src/api/resources/locations/client/Client.ts b/src/api/resources/locations/client/Client.ts index 77b9640d7..f08f4ef7d 100644 --- a/src/api/resources/locations/client/Client.ts +++ b/src/api/resources/locations/client/Client.ts @@ -1,42 +1,20 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { CustomAttributeDefinitions } from "../resources/customAttributeDefinitions/client/Client"; import { CustomAttributes } from "../resources/customAttributes/client/Client"; import { Transactions } from "../resources/transactions/client/Client"; export declare namespace Locations { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Locations { @@ -77,6 +55,14 @@ export class Locations { private async __list( requestOptions?: Locations.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -85,16 +71,10 @@ export class Locations { "v2/locations", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -172,6 +152,14 @@ export class Locations { request: Square.CreateLocationRequest = {}, requestOptions?: Locations.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -180,22 +168,16 @@ export class Locations { "v2/locations", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateLocationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -260,6 +242,14 @@ export class Locations { requestOptions?: Locations.RequestOptions, ): Promise> { const { locationId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -268,16 +258,10 @@ export class Locations { `v2/locations/${encodeURIComponent(locationId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -359,6 +343,14 @@ export class Locations { requestOptions?: Locations.RequestOptions, ): Promise> { const { locationId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -367,22 +359,16 @@ export class Locations { `v2/locations/${encodeURIComponent(locationId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateLocationRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -526,6 +512,14 @@ export class Locations { requestOptions?: Locations.RequestOptions, ): Promise> { const { locationId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -534,22 +528,16 @@ export class Locations { `v2/locations/${encodeURIComponent(locationId)}/checkouts`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateCheckoutRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -593,7 +581,7 @@ export class Locations { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/locations/client/index.ts b/src/api/resources/locations/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/locations/client/index.ts +++ b/src/api/resources/locations/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/locations/client/requests/CreateCheckoutRequest.ts b/src/api/resources/locations/client/requests/CreateCheckoutRequest.ts index b7371e9d4..eec4693bf 100644 --- a/src/api/resources/locations/client/requests/CreateCheckoutRequest.ts +++ b/src/api/resources/locations/client/requests/CreateCheckoutRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -85,9 +83,7 @@ import * as Square from "../../../../index"; * } */ export interface CreateCheckoutRequest { - /** - * The ID of the business location to associate the checkout with. - */ + /** The ID of the business location to associate the checkout with. */ locationId: string; /** * A unique string that identifies this checkout among others you have created. It can be diff --git a/src/api/resources/locations/client/requests/CreateLocationRequest.ts b/src/api/resources/locations/client/requests/CreateLocationRequest.ts index d51a6483b..2b153ae44 100644 --- a/src/api/resources/locations/client/requests/CreateLocationRequest.ts +++ b/src/api/resources/locations/client/requests/CreateLocationRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/locations/client/requests/GetLocationsRequest.ts b/src/api/resources/locations/client/requests/GetLocationsRequest.ts index 06f3a0e38..20dd966df 100644 --- a/src/api/resources/locations/client/requests/GetLocationsRequest.ts +++ b/src/api/resources/locations/client/requests/GetLocationsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/locations/client/requests/UpdateLocationRequest.ts b/src/api/resources/locations/client/requests/UpdateLocationRequest.ts index 328c18b39..409853cc8 100644 --- a/src/api/resources/locations/client/requests/UpdateLocationRequest.ts +++ b/src/api/resources/locations/client/requests/UpdateLocationRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -29,9 +27,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateLocationRequest { - /** - * The ID of the location to update. - */ + /** The ID of the location to update. */ locationId: string; /** The `Location` object with only the fields to update. */ location?: Square.Location; diff --git a/src/api/resources/locations/client/requests/index.ts b/src/api/resources/locations/client/requests/index.ts index 4b7f7c91c..a262c7106 100644 --- a/src/api/resources/locations/client/requests/index.ts +++ b/src/api/resources/locations/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type CreateLocationRequest } from "./CreateLocationRequest"; -export { type GetLocationsRequest } from "./GetLocationsRequest"; -export { type UpdateLocationRequest } from "./UpdateLocationRequest"; -export { type CreateCheckoutRequest } from "./CreateCheckoutRequest"; +export type { CreateCheckoutRequest } from "./CreateCheckoutRequest"; +export type { CreateLocationRequest } from "./CreateLocationRequest"; +export type { GetLocationsRequest } from "./GetLocationsRequest"; +export type { UpdateLocationRequest } from "./UpdateLocationRequest"; diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts index dfb270ca4..21ffce932 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace CustomAttributeDefinitions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class CustomAttributeDefinitions { @@ -70,17 +48,25 @@ export class CustomAttributeDefinitions { const { visibilityFilter, limit, cursor } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -89,18 +75,10 @@ export class CustomAttributeDefinitions { "v2/locations/custom-attribute-definitions", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -193,6 +171,14 @@ export class CustomAttributeDefinitions { request: Square.locations.CreateLocationCustomAttributeDefinitionRequest, requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -201,22 +187,16 @@ export class CustomAttributeDefinitions { "v2/locations/custom-attribute-definitions", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.locations.CreateLocationCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -287,9 +267,17 @@ export class CustomAttributeDefinitions { const { key, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -298,17 +286,10 @@ export class CustomAttributeDefinitions { `v2/locations/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -381,6 +362,14 @@ export class CustomAttributeDefinitions { requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -389,22 +378,16 @@ export class CustomAttributeDefinitions { `v2/locations/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.locations.UpdateLocationCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -473,6 +456,14 @@ export class CustomAttributeDefinitions { requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -481,16 +472,10 @@ export class CustomAttributeDefinitions { `v2/locations/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -534,7 +519,7 @@ export class CustomAttributeDefinitions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/index.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/index.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts index 8c308f4b0..b041fa196 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts index 6a1b34cf1..a9c9d9ec5 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteCustomAttributeDefinitionsRequest { - /** - * The key of the custom attribute definition to delete. - */ + /** The key of the custom attribute definition to delete. */ key: string; } diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index e4c05d712..3de83fd32 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index 4818482a3..94eb07f3c 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -13,9 +11,7 @@ import * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributeDefinitionsRequest { - /** - * Filters the `CustomAttributeDefinition` results by their `visibility` values. - */ + /** Filters the `CustomAttributeDefinition` results by their `visibility` values. */ visibilityFilter?: Square.VisibilityFilter | null; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts index b1178a8df..5f84b4424 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,9 +13,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateLocationCustomAttributeDefinitionRequest { - /** - * The key of the custom attribute definition to update. - */ + /** The key of the custom attribute definition to update. */ key: string; /** * The custom attribute definition that contains the fields to update. This endpoint diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/index.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/index.ts index 04a383e3e..eca4ca7ca 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; -export { type CreateLocationCustomAttributeDefinitionRequest } from "./CreateLocationCustomAttributeDefinitionRequest"; -export { type GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; -export { type UpdateLocationCustomAttributeDefinitionRequest } from "./UpdateLocationCustomAttributeDefinitionRequest"; -export { type DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; +export type { CreateLocationCustomAttributeDefinitionRequest } from "./CreateLocationCustomAttributeDefinitionRequest"; +export type { DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; +export type { GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; +export type { ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; +export type { UpdateLocationCustomAttributeDefinitionRequest } from "./UpdateLocationCustomAttributeDefinitionRequest"; diff --git a/src/api/resources/locations/resources/customAttributes/client/Client.ts b/src/api/resources/locations/resources/customAttributes/client/Client.ts index 9ce72fa20..5772254cd 100644 --- a/src/api/resources/locations/resources/customAttributes/client/Client.ts +++ b/src/api/resources/locations/resources/customAttributes/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace CustomAttributes { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class CustomAttributes { @@ -77,6 +55,14 @@ export class CustomAttributes { request: Square.locations.BulkDeleteLocationCustomAttributesRequest, requestOptions?: CustomAttributes.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -85,22 +71,16 @@ export class CustomAttributes { "v2/locations/custom-attributes/bulk-delete", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.locations.BulkDeleteLocationCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -196,6 +176,14 @@ export class CustomAttributes { request: Square.locations.BulkUpsertLocationCustomAttributesRequest, requestOptions?: CustomAttributes.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -204,22 +192,16 @@ export class CustomAttributes { "v2/locations/custom-attributes/bulk-upsert", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.locations.BulkUpsertLocationCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -293,20 +275,28 @@ export class CustomAttributes { const { locationId, visibilityFilter, limit, cursor, withDefinitions } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (withDefinitions !== undefined) { - _queryParams["with_definitions"] = withDefinitions?.toString() ?? null; + _queryParams.with_definitions = withDefinitions?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -315,18 +305,10 @@ export class CustomAttributes { `v2/locations/${encodeURIComponent(locationId)}/custom-attributes`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -412,13 +394,21 @@ export class CustomAttributes { const { locationId, key, withDefinition, version } = request; const _queryParams: Record = {}; if (withDefinition !== undefined) { - _queryParams["with_definition"] = withDefinition?.toString() ?? null; + _queryParams.with_definition = withDefinition?.toString() ?? null; } if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -427,17 +417,10 @@ export class CustomAttributes { `v2/locations/${encodeURIComponent(locationId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -512,6 +495,14 @@ export class CustomAttributes { requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { locationId, key, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -520,22 +511,16 @@ export class CustomAttributes { `v2/locations/${encodeURIComponent(locationId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.locations.UpsertLocationCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -604,6 +589,14 @@ export class CustomAttributes { requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { locationId, key } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -612,16 +605,10 @@ export class CustomAttributes { `v2/locations/${encodeURIComponent(locationId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -665,7 +652,7 @@ export class CustomAttributes { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/locations/resources/customAttributes/client/index.ts b/src/api/resources/locations/resources/customAttributes/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/locations/resources/customAttributes/client/index.ts +++ b/src/api/resources/locations/resources/customAttributes/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts index b7bca236d..9fc9280eb 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts index c45d120fb..9167da5e4 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts index 466967e90..02f487a4a 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface DeleteCustomAttributesRequest { - /** - * The ID of the target [location](entity:Location). - */ + /** The ID of the target [location](entity:Location). */ locationId: string; /** * The key of the custom attribute to delete. This key must match the `key` of a custom diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index 7ca5414a6..a1ea2b5c4 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -12,9 +10,7 @@ * } */ export interface GetCustomAttributesRequest { - /** - * The ID of the target [location](entity:Location). - */ + /** The ID of the target [location](entity:Location). */ locationId: string; /** * The key of the custom attribute to retrieve. This key must match the `key` of a custom diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index a7f35f860..589ef7707 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,13 +13,9 @@ import * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributesRequest { - /** - * The ID of the target [location](entity:Location). - */ + /** The ID of the target [location](entity:Location). */ locationId: string; - /** - * Filters the `CustomAttributeDefinition` results by their `visibility` values. - */ + /** Filters the `CustomAttributeDefinition` results by their `visibility` values. */ visibilityFilter?: Square.VisibilityFilter | null; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts index fd3393039..03bca5dd6 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,9 +13,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpsertLocationCustomAttributeRequest { - /** - * The ID of the target [location](entity:Location). - */ + /** The ID of the target [location](entity:Location). */ locationId: string; /** * The key of the custom attribute to create or update. This key must match the `key` of a diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/index.ts b/src/api/resources/locations/resources/customAttributes/client/requests/index.ts index 5fa631d1f..fdc993cf1 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/index.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/index.ts @@ -1,6 +1,6 @@ -export { type BulkDeleteLocationCustomAttributesRequest } from "./BulkDeleteLocationCustomAttributesRequest"; -export { type BulkUpsertLocationCustomAttributesRequest } from "./BulkUpsertLocationCustomAttributesRequest"; -export { type ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; -export { type GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; -export { type UpsertLocationCustomAttributeRequest } from "./UpsertLocationCustomAttributeRequest"; -export { type DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; +export type { BulkDeleteLocationCustomAttributesRequest } from "./BulkDeleteLocationCustomAttributesRequest"; +export type { BulkUpsertLocationCustomAttributesRequest } from "./BulkUpsertLocationCustomAttributesRequest"; +export type { DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; +export type { GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; +export type { ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; +export type { UpsertLocationCustomAttributeRequest } from "./UpsertLocationCustomAttributeRequest"; diff --git a/src/api/resources/locations/resources/index.ts b/src/api/resources/locations/resources/index.ts index 6322f4066..dc016dabd 100644 --- a/src/api/resources/locations/resources/index.ts +++ b/src/api/resources/locations/resources/index.ts @@ -1,6 +1,6 @@ export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * as customAttributes from "./customAttributes"; -export * as transactions from "./transactions"; export * from "./customAttributeDefinitions/client/requests"; +export * as customAttributes from "./customAttributes"; export * from "./customAttributes/client/requests"; +export * as transactions from "./transactions"; export * from "./transactions/client/requests"; diff --git a/src/api/resources/locations/resources/transactions/client/Client.ts b/src/api/resources/locations/resources/transactions/client/Client.ts index 6fbea9efd..560a79ed0 100644 --- a/src/api/resources/locations/resources/transactions/client/Client.ts +++ b/src/api/resources/locations/resources/transactions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Transactions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Transactions { @@ -77,24 +55,32 @@ export class Transactions { const { locationId, beginTime, endTime, sortOrder, cursor } = request; const _queryParams: Record = {}; if (beginTime !== undefined) { - _queryParams["begin_time"] = beginTime; + _queryParams.begin_time = beginTime; } if (endTime !== undefined) { - _queryParams["end_time"] = endTime; + _queryParams.end_time = endTime; } if (sortOrder !== undefined) { - _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -103,17 +89,10 @@ export class Transactions { `v2/locations/${encodeURIComponent(locationId)}/transactions`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -180,6 +159,14 @@ export class Transactions { requestOptions?: Transactions.RequestOptions, ): Promise> { const { locationId, transactionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -188,16 +175,10 @@ export class Transactions { `v2/locations/${encodeURIComponent(locationId)}/transactions/${encodeURIComponent(transactionId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -269,6 +250,14 @@ export class Transactions { requestOptions?: Transactions.RequestOptions, ): Promise> { const { locationId, transactionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -277,16 +266,10 @@ export class Transactions { `v2/locations/${encodeURIComponent(locationId)}/transactions/${encodeURIComponent(transactionId)}/capture`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -358,6 +341,14 @@ export class Transactions { requestOptions?: Transactions.RequestOptions, ): Promise> { const { locationId, transactionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -366,16 +357,10 @@ export class Transactions { `v2/locations/${encodeURIComponent(locationId)}/transactions/${encodeURIComponent(transactionId)}/void`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -419,7 +404,7 @@ export class Transactions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/locations/resources/transactions/client/index.ts b/src/api/resources/locations/resources/transactions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/locations/resources/transactions/client/index.ts +++ b/src/api/resources/locations/resources/transactions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/locations/resources/transactions/client/requests/CaptureTransactionsRequest.ts b/src/api/resources/locations/resources/transactions/client/requests/CaptureTransactionsRequest.ts index cf21b4087..1ca6b5728 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/CaptureTransactionsRequest.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/CaptureTransactionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface CaptureTransactionsRequest { - /** - * - */ + /** */ locationId: string; - /** - * - */ + /** */ transactionId: string; } diff --git a/src/api/resources/locations/resources/transactions/client/requests/GetTransactionsRequest.ts b/src/api/resources/locations/resources/transactions/client/requests/GetTransactionsRequest.ts index fb2c20d13..b231673f7 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/GetTransactionsRequest.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/GetTransactionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface GetTransactionsRequest { - /** - * The ID of the transaction's associated location. - */ + /** The ID of the transaction's associated location. */ locationId: string; - /** - * The ID of the transaction to retrieve. - */ + /** The ID of the transaction to retrieve. */ transactionId: string; } diff --git a/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts b/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts index 9a850cf0b..1f5e88b31 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,9 +13,7 @@ import * as Square from "../../../../../../index"; * } */ export interface ListTransactionsRequest { - /** - * The ID of the location to list transactions for. - */ + /** The ID of the location to list transactions for. */ locationId: string; /** * The beginning of the requested reporting period, in RFC 3339 format. diff --git a/src/api/resources/locations/resources/transactions/client/requests/VoidTransactionsRequest.ts b/src/api/resources/locations/resources/transactions/client/requests/VoidTransactionsRequest.ts index 6c73f8655..1e192d64f 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/VoidTransactionsRequest.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/VoidTransactionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface VoidTransactionsRequest { - /** - * - */ + /** */ locationId: string; - /** - * - */ + /** */ transactionId: string; } diff --git a/src/api/resources/locations/resources/transactions/client/requests/index.ts b/src/api/resources/locations/resources/transactions/client/requests/index.ts index 71ae1bc2c..c2e4f05af 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/index.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type ListTransactionsRequest } from "./ListTransactionsRequest"; -export { type GetTransactionsRequest } from "./GetTransactionsRequest"; -export { type CaptureTransactionsRequest } from "./CaptureTransactionsRequest"; -export { type VoidTransactionsRequest } from "./VoidTransactionsRequest"; +export type { CaptureTransactionsRequest } from "./CaptureTransactionsRequest"; +export type { GetTransactionsRequest } from "./GetTransactionsRequest"; +export type { ListTransactionsRequest } from "./ListTransactionsRequest"; +export type { VoidTransactionsRequest } from "./VoidTransactionsRequest"; diff --git a/src/api/resources/loyalty/client/Client.ts b/src/api/resources/loyalty/client/Client.ts index 30c776228..768f57069 100644 --- a/src/api/resources/loyalty/client/Client.ts +++ b/src/api/resources/loyalty/client/Client.ts @@ -1,42 +1,20 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { Accounts } from "../resources/accounts/client/Client"; import { Programs } from "../resources/programs/client/Client"; import { Rewards } from "../resources/rewards/client/Client"; export declare namespace Loyalty { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Loyalty { @@ -97,6 +75,14 @@ export class Loyalty { request: Square.SearchLoyaltyEventsRequest = {}, requestOptions?: Loyalty.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -105,22 +91,16 @@ export class Loyalty { "v2/loyalty/events/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchLoyaltyEventsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -162,7 +142,7 @@ export class Loyalty { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/loyalty/client/index.ts b/src/api/resources/loyalty/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/loyalty/client/index.ts +++ b/src/api/resources/loyalty/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts b/src/api/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts index 2b1bc0f10..63a3e0ead 100644 --- a/src/api/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts +++ b/src/api/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/client/requests/index.ts b/src/api/resources/loyalty/client/requests/index.ts index 119b5f36e..7f957a88e 100644 --- a/src/api/resources/loyalty/client/requests/index.ts +++ b/src/api/resources/loyalty/client/requests/index.ts @@ -1 +1 @@ -export { type SearchLoyaltyEventsRequest } from "./SearchLoyaltyEventsRequest"; +export type { SearchLoyaltyEventsRequest } from "./SearchLoyaltyEventsRequest"; diff --git a/src/api/resources/loyalty/resources/accounts/client/Client.ts b/src/api/resources/loyalty/resources/accounts/client/Client.ts index 009ca17ba..fcfd25e01 100644 --- a/src/api/resources/loyalty/resources/accounts/client/Client.ts +++ b/src/api/resources/loyalty/resources/accounts/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Accounts { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Accounts { @@ -71,6 +49,14 @@ export class Accounts { request: Square.loyalty.CreateLoyaltyAccountRequest, requestOptions?: Accounts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -79,22 +65,16 @@ export class Accounts { "v2/loyalty/accounts", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.CreateLoyaltyAccountRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -166,6 +146,14 @@ export class Accounts { request: Square.loyalty.SearchLoyaltyAccountsRequest = {}, requestOptions?: Accounts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -174,22 +162,16 @@ export class Accounts { "v2/loyalty/accounts/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.SearchLoyaltyAccountsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -253,6 +235,14 @@ export class Accounts { requestOptions?: Accounts.RequestOptions, ): Promise> { const { accountId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -261,16 +251,10 @@ export class Accounts { `v2/loyalty/accounts/${encodeURIComponent(accountId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -354,6 +338,14 @@ export class Accounts { requestOptions?: Accounts.RequestOptions, ): Promise> { const { accountId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -362,22 +354,16 @@ export class Accounts { `v2/loyalty/accounts/${encodeURIComponent(accountId)}/accumulate`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.AccumulateLoyaltyPointsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -452,6 +438,14 @@ export class Accounts { requestOptions?: Accounts.RequestOptions, ): Promise> { const { accountId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -460,22 +454,16 @@ export class Accounts { `v2/loyalty/accounts/${encodeURIComponent(accountId)}/adjust`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.AdjustLoyaltyPointsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -519,7 +507,7 @@ export class Accounts { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/loyalty/resources/accounts/client/index.ts b/src/api/resources/loyalty/resources/accounts/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/loyalty/resources/accounts/client/index.ts +++ b/src/api/resources/loyalty/resources/accounts/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts b/src/api/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts index 88c4285f2..b89c2408b 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -16,9 +14,7 @@ import * as Square from "../../../../../../index"; * } */ export interface AccumulateLoyaltyPointsRequest { - /** - * The ID of the target [loyalty account](entity:LoyaltyAccount). - */ + /** The ID of the target [loyalty account](entity:LoyaltyAccount). */ accountId: string; /** * The points to add to the account. diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts b/src/api/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts index 6243e046b..42b70d986 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -16,9 +14,7 @@ import * as Square from "../../../../../../index"; * } */ export interface AdjustLoyaltyPointsRequest { - /** - * The ID of the target [loyalty account](entity:LoyaltyAccount). - */ + /** The ID of the target [loyalty account](entity:LoyaltyAccount). */ accountId: string; /** * A unique string that identifies this `AdjustLoyaltyPoints` request. diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts b/src/api/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts index b9301ffc1..ca19890f9 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/GetAccountsRequest.ts b/src/api/resources/loyalty/resources/accounts/client/requests/GetAccountsRequest.ts index 1037dbb90..da5330105 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/GetAccountsRequest.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/GetAccountsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetAccountsRequest { - /** - * The ID of the [loyalty account](entity:LoyaltyAccount) to retrieve. - */ + /** The ID of the [loyalty account](entity:LoyaltyAccount) to retrieve. */ accountId: string; } diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts b/src/api/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts index b5b095842..18f5178f2 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/index.ts b/src/api/resources/loyalty/resources/accounts/client/requests/index.ts index d6efd2ba6..ad84fb2f2 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/index.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type CreateLoyaltyAccountRequest } from "./CreateLoyaltyAccountRequest"; -export { type SearchLoyaltyAccountsRequest } from "./SearchLoyaltyAccountsRequest"; -export { type GetAccountsRequest } from "./GetAccountsRequest"; -export { type AccumulateLoyaltyPointsRequest } from "./AccumulateLoyaltyPointsRequest"; -export { type AdjustLoyaltyPointsRequest } from "./AdjustLoyaltyPointsRequest"; +export type { AccumulateLoyaltyPointsRequest } from "./AccumulateLoyaltyPointsRequest"; +export type { AdjustLoyaltyPointsRequest } from "./AdjustLoyaltyPointsRequest"; +export type { CreateLoyaltyAccountRequest } from "./CreateLoyaltyAccountRequest"; +export type { GetAccountsRequest } from "./GetAccountsRequest"; +export type { SearchLoyaltyAccountsRequest } from "./SearchLoyaltyAccountsRequest"; diff --git a/src/api/resources/loyalty/resources/index.ts b/src/api/resources/loyalty/resources/index.ts index e335fa8c9..98cded2c5 100644 --- a/src/api/resources/loyalty/resources/index.ts +++ b/src/api/resources/loyalty/resources/index.ts @@ -1,6 +1,6 @@ export * as accounts from "./accounts"; -export * as programs from "./programs"; -export * as rewards from "./rewards"; export * from "./accounts/client/requests"; +export * as programs from "./programs"; export * from "./programs/client/requests"; +export * as rewards from "./rewards"; export * from "./rewards/client/requests"; diff --git a/src/api/resources/loyalty/resources/programs/client/Client.ts b/src/api/resources/loyalty/resources/programs/client/Client.ts index 4a12dc254..b114c0214 100644 --- a/src/api/resources/loyalty/resources/programs/client/Client.ts +++ b/src/api/resources/loyalty/resources/programs/client/Client.ts @@ -1,40 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; import { Promotions } from "../resources/promotions/client/Client"; export declare namespace Programs { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Programs { @@ -70,6 +48,14 @@ export class Programs { private async __list( requestOptions?: Programs.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -78,16 +64,10 @@ export class Programs { "v2/loyalty/programs", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -153,6 +133,14 @@ export class Programs { requestOptions?: Programs.RequestOptions, ): Promise> { const { programId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -161,16 +149,10 @@ export class Programs { `v2/loyalty/programs/${encodeURIComponent(programId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -252,6 +234,14 @@ export class Programs { requestOptions?: Programs.RequestOptions, ): Promise> { const { programId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -260,22 +250,16 @@ export class Programs { `v2/loyalty/programs/${encodeURIComponent(programId)}/calculate`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.CalculateLoyaltyPointsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -319,7 +303,7 @@ export class Programs { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/loyalty/resources/programs/client/index.ts b/src/api/resources/loyalty/resources/programs/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/loyalty/resources/programs/client/index.ts +++ b/src/api/resources/loyalty/resources/programs/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts b/src/api/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts index ce71619a8..08b80f283 100644 --- a/src/api/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -13,9 +11,7 @@ import * as Square from "../../../../../../index"; * } */ export interface CalculateLoyaltyPointsRequest { - /** - * The ID of the [loyalty program](entity:LoyaltyProgram), which defines the rules for accruing points. - */ + /** The ID of the [loyalty program](entity:LoyaltyProgram), which defines the rules for accruing points. */ programId: string; /** * The [order](entity:Order) ID for which to calculate the points. diff --git a/src/api/resources/loyalty/resources/programs/client/requests/GetProgramsRequest.ts b/src/api/resources/loyalty/resources/programs/client/requests/GetProgramsRequest.ts index 21b4fcc20..a5d13b262 100644 --- a/src/api/resources/loyalty/resources/programs/client/requests/GetProgramsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/client/requests/GetProgramsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetProgramsRequest { - /** - * The ID of the loyalty program or the keyword `main`. Either value can be used to retrieve the single loyalty program that belongs to the seller. - */ + /** The ID of the loyalty program or the keyword `main`. Either value can be used to retrieve the single loyalty program that belongs to the seller. */ programId: string; } diff --git a/src/api/resources/loyalty/resources/programs/client/requests/index.ts b/src/api/resources/loyalty/resources/programs/client/requests/index.ts index c6b8d4f6f..5fb0fee97 100644 --- a/src/api/resources/loyalty/resources/programs/client/requests/index.ts +++ b/src/api/resources/loyalty/resources/programs/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type GetProgramsRequest } from "./GetProgramsRequest"; -export { type CalculateLoyaltyPointsRequest } from "./CalculateLoyaltyPointsRequest"; +export type { CalculateLoyaltyPointsRequest } from "./CalculateLoyaltyPointsRequest"; +export type { GetProgramsRequest } from "./GetProgramsRequest"; diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts index 6bdb8c8c6..f1f3a5877 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient"; import * as core from "../../../../../../../../core"; -import * as Square from "../../../../../../../index"; -import * as serializers from "../../../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers"; +import * as environments from "../../../../../../../../environments"; import * as errors from "../../../../../../../../errors/index"; +import * as serializers from "../../../../../../../../serialization/index"; +import type * as Square from "../../../../../../../index"; export declare namespace Promotions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Promotions { @@ -69,17 +47,25 @@ export class Promotions { const { programId, status, cursor, limit } = request; const _queryParams: Record = {}; if (status !== undefined) { - _queryParams["status"] = serializers.LoyaltyPromotionStatus.jsonOrThrow(status, { + _queryParams.status = serializers.LoyaltyPromotionStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -88,18 +74,10 @@ export class Promotions { `v2/loyalty/programs/${encodeURIComponent(programId)}/promotions`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -203,6 +181,14 @@ export class Promotions { requestOptions?: Promotions.RequestOptions, ): Promise> { const { programId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -211,22 +197,16 @@ export class Promotions { `v2/loyalty/programs/${encodeURIComponent(programId)}/promotions`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.programs.CreateLoyaltyPromotionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -293,6 +273,14 @@ export class Promotions { requestOptions?: Promotions.RequestOptions, ): Promise> { const { programId, promotionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -301,16 +289,10 @@ export class Promotions { `v2/loyalty/programs/${encodeURIComponent(programId)}/promotions/${encodeURIComponent(promotionId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -382,6 +364,14 @@ export class Promotions { requestOptions?: Promotions.RequestOptions, ): Promise> { const { programId, promotionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -390,16 +380,10 @@ export class Promotions { `v2/loyalty/programs/${encodeURIComponent(programId)}/promotions/${encodeURIComponent(promotionId)}/cancel`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -443,7 +427,7 @@ export class Promotions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/index.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/index.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts index 419b7deb7..956f0ec81 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface CancelPromotionsRequest { - /** - * The ID of the base [loyalty program](entity:LoyaltyProgram). - */ + /** The ID of the base [loyalty program](entity:LoyaltyProgram). */ programId: string; /** * The ID of the [loyalty promotion](entity:LoyaltyPromotion) to cancel. You can cancel a diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts index 7e69310f0..2f8efa85b 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../../../index"; +import type * as Square from "../../../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts index df500e557..34a64d737 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -15,8 +13,6 @@ export interface GetPromotionsRequest { * call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword. */ programId: string; - /** - * The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve. - */ + /** The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve. */ promotionId: string; } diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts index 46d676b3a..5bd9b1d60 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../../../index"; +import type * as Square from "../../../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/index.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/index.ts index 123564dd0..a9acf1162 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/index.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type ListPromotionsRequest } from "./ListPromotionsRequest"; -export { type CreateLoyaltyPromotionRequest } from "./CreateLoyaltyPromotionRequest"; -export { type GetPromotionsRequest } from "./GetPromotionsRequest"; -export { type CancelPromotionsRequest } from "./CancelPromotionsRequest"; +export type { CancelPromotionsRequest } from "./CancelPromotionsRequest"; +export type { CreateLoyaltyPromotionRequest } from "./CreateLoyaltyPromotionRequest"; +export type { GetPromotionsRequest } from "./GetPromotionsRequest"; +export type { ListPromotionsRequest } from "./ListPromotionsRequest"; diff --git a/src/api/resources/loyalty/resources/rewards/client/Client.ts b/src/api/resources/loyalty/resources/rewards/client/Client.ts index 70f50658a..b5daabae4 100644 --- a/src/api/resources/loyalty/resources/rewards/client/Client.ts +++ b/src/api/resources/loyalty/resources/rewards/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Rewards { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Rewards { @@ -77,6 +55,14 @@ export class Rewards { request: Square.loyalty.CreateLoyaltyRewardRequest, requestOptions?: Rewards.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -85,22 +71,16 @@ export class Rewards { "v2/loyalty/rewards", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.CreateLoyaltyRewardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -172,6 +152,14 @@ export class Rewards { request: Square.loyalty.SearchLoyaltyRewardsRequest = {}, requestOptions?: Rewards.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -180,22 +168,16 @@ export class Rewards { "v2/loyalty/rewards/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.SearchLoyaltyRewardsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -259,6 +241,14 @@ export class Rewards { requestOptions?: Rewards.RequestOptions, ): Promise> { const { rewardId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -267,16 +257,10 @@ export class Rewards { `v2/loyalty/rewards/${encodeURIComponent(rewardId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -350,6 +334,14 @@ export class Rewards { requestOptions?: Rewards.RequestOptions, ): Promise> { const { rewardId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -358,16 +350,10 @@ export class Rewards { `v2/loyalty/rewards/${encodeURIComponent(rewardId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -445,6 +431,14 @@ export class Rewards { requestOptions?: Rewards.RequestOptions, ): Promise> { const { rewardId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -453,22 +447,16 @@ export class Rewards { `v2/loyalty/rewards/${encodeURIComponent(rewardId)}/redeem`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.RedeemLoyaltyRewardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -512,7 +500,7 @@ export class Rewards { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/loyalty/resources/rewards/client/index.ts b/src/api/resources/loyalty/resources/rewards/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/loyalty/resources/rewards/client/index.ts +++ b/src/api/resources/loyalty/resources/rewards/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts b/src/api/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts index ae271caac..5ecdf572d 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/DeleteRewardsRequest.ts b/src/api/resources/loyalty/resources/rewards/client/requests/DeleteRewardsRequest.ts index 4d0f60bd3..db7d0ce7f 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/DeleteRewardsRequest.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/DeleteRewardsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteRewardsRequest { - /** - * The ID of the [loyalty reward](entity:LoyaltyReward) to delete. - */ + /** The ID of the [loyalty reward](entity:LoyaltyReward) to delete. */ rewardId: string; } diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/GetRewardsRequest.ts b/src/api/resources/loyalty/resources/rewards/client/requests/GetRewardsRequest.ts index 4eaaed693..1111b67f5 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/GetRewardsRequest.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/GetRewardsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetRewardsRequest { - /** - * The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve. - */ + /** The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve. */ rewardId: string; } diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts b/src/api/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts index ee713cc43..3e949fbd2 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,9 +9,7 @@ * } */ export interface RedeemLoyaltyRewardRequest { - /** - * The ID of the [loyalty reward](entity:LoyaltyReward) to redeem. - */ + /** The ID of the [loyalty reward](entity:LoyaltyReward) to redeem. */ rewardId: string; /** * A unique string that identifies this `RedeemLoyaltyReward` request. diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts b/src/api/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts index 17ef09df2..3fcb045d9 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/index.ts b/src/api/resources/loyalty/resources/rewards/client/requests/index.ts index 387da86cf..76fc2265b 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/index.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type CreateLoyaltyRewardRequest } from "./CreateLoyaltyRewardRequest"; -export { type SearchLoyaltyRewardsRequest } from "./SearchLoyaltyRewardsRequest"; -export { type GetRewardsRequest } from "./GetRewardsRequest"; -export { type DeleteRewardsRequest } from "./DeleteRewardsRequest"; -export { type RedeemLoyaltyRewardRequest } from "./RedeemLoyaltyRewardRequest"; +export type { CreateLoyaltyRewardRequest } from "./CreateLoyaltyRewardRequest"; +export type { DeleteRewardsRequest } from "./DeleteRewardsRequest"; +export type { GetRewardsRequest } from "./GetRewardsRequest"; +export type { RedeemLoyaltyRewardRequest } from "./RedeemLoyaltyRewardRequest"; +export type { SearchLoyaltyRewardsRequest } from "./SearchLoyaltyRewardsRequest"; diff --git a/src/api/resources/merchants/client/Client.ts b/src/api/resources/merchants/client/Client.ts index cd995f488..edd1ec618 100644 --- a/src/api/resources/merchants/client/Client.ts +++ b/src/api/resources/merchants/client/Client.ts @@ -1,41 +1,19 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { CustomAttributeDefinitions } from "../resources/customAttributeDefinitions/client/Client"; import { CustomAttributes } from "../resources/customAttributes/client/Client"; export declare namespace Merchants { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Merchants { @@ -86,8 +64,16 @@ export class Merchants { const { cursor } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor?.toString() ?? null; + _queryParams.cursor = cursor?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -96,18 +82,10 @@ export class Merchants { "v2/merchants", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -182,6 +160,14 @@ export class Merchants { requestOptions?: Merchants.RequestOptions, ): Promise> { const { merchantId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -190,16 +176,10 @@ export class Merchants { `v2/merchants/${encodeURIComponent(merchantId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -241,7 +221,7 @@ export class Merchants { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/merchants/client/index.ts b/src/api/resources/merchants/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/merchants/client/index.ts +++ b/src/api/resources/merchants/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/merchants/client/requests/GetMerchantsRequest.ts b/src/api/resources/merchants/client/requests/GetMerchantsRequest.ts index 9c1ccaa5d..e9c7bfafa 100644 --- a/src/api/resources/merchants/client/requests/GetMerchantsRequest.ts +++ b/src/api/resources/merchants/client/requests/GetMerchantsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts b/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts index a7cbfe78b..4384cd6a0 100644 --- a/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts +++ b/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface ListMerchantsRequest { - /** - * The cursor generated by the previous response. - */ + /** The cursor generated by the previous response. */ cursor?: number | null; } diff --git a/src/api/resources/merchants/client/requests/index.ts b/src/api/resources/merchants/client/requests/index.ts index 0569efc51..e6af5de78 100644 --- a/src/api/resources/merchants/client/requests/index.ts +++ b/src/api/resources/merchants/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type ListMerchantsRequest } from "./ListMerchantsRequest"; -export { type GetMerchantsRequest } from "./GetMerchantsRequest"; +export type { GetMerchantsRequest } from "./GetMerchantsRequest"; +export type { ListMerchantsRequest } from "./ListMerchantsRequest"; diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts index c7507644c..98aa33482 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace CustomAttributeDefinitions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class CustomAttributeDefinitions { @@ -70,17 +48,25 @@ export class CustomAttributeDefinitions { const { visibilityFilter, limit, cursor } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -89,18 +75,10 @@ export class CustomAttributeDefinitions { "v2/merchants/custom-attribute-definitions", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -193,6 +171,14 @@ export class CustomAttributeDefinitions { request: Square.merchants.CreateMerchantCustomAttributeDefinitionRequest, requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -201,22 +187,16 @@ export class CustomAttributeDefinitions { "v2/merchants/custom-attribute-definitions", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.merchants.CreateMerchantCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -287,9 +267,17 @@ export class CustomAttributeDefinitions { const { key, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -298,17 +286,10 @@ export class CustomAttributeDefinitions { `v2/merchants/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -381,6 +362,14 @@ export class CustomAttributeDefinitions { requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -389,22 +378,16 @@ export class CustomAttributeDefinitions { `v2/merchants/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.merchants.UpdateMerchantCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -473,6 +456,14 @@ export class CustomAttributeDefinitions { requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -481,16 +472,10 @@ export class CustomAttributeDefinitions { `v2/merchants/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -534,7 +519,7 @@ export class CustomAttributeDefinitions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/index.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/index.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts index 572fe7378..59e348b65 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts index 6a1b34cf1..a9c9d9ec5 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteCustomAttributeDefinitionsRequest { - /** - * The key of the custom attribute definition to delete. - */ + /** The key of the custom attribute definition to delete. */ key: string; } diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index e4c05d712..3de83fd32 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index 4818482a3..94eb07f3c 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -13,9 +11,7 @@ import * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributeDefinitionsRequest { - /** - * Filters the `CustomAttributeDefinition` results by their `visibility` values. - */ + /** Filters the `CustomAttributeDefinition` results by their `visibility` values. */ visibilityFilter?: Square.VisibilityFilter | null; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts index 16bfd1215..fa6bc87f8 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,9 +13,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateMerchantCustomAttributeDefinitionRequest { - /** - * The key of the custom attribute definition to update. - */ + /** The key of the custom attribute definition to update. */ key: string; /** * The custom attribute definition that contains the fields to update. This endpoint diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/index.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/index.ts index eb8078803..2eb218115 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; -export { type CreateMerchantCustomAttributeDefinitionRequest } from "./CreateMerchantCustomAttributeDefinitionRequest"; -export { type GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; -export { type UpdateMerchantCustomAttributeDefinitionRequest } from "./UpdateMerchantCustomAttributeDefinitionRequest"; -export { type DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; +export type { CreateMerchantCustomAttributeDefinitionRequest } from "./CreateMerchantCustomAttributeDefinitionRequest"; +export type { DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; +export type { GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; +export type { ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; +export type { UpdateMerchantCustomAttributeDefinitionRequest } from "./UpdateMerchantCustomAttributeDefinitionRequest"; diff --git a/src/api/resources/merchants/resources/customAttributes/client/Client.ts b/src/api/resources/merchants/resources/customAttributes/client/Client.ts index e3b7177ca..f220bfa60 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/Client.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace CustomAttributes { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class CustomAttributes { @@ -74,6 +52,14 @@ export class CustomAttributes { request: Square.merchants.BulkDeleteMerchantCustomAttributesRequest, requestOptions?: CustomAttributes.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -82,22 +68,16 @@ export class CustomAttributes { "v2/merchants/custom-attributes/bulk-delete", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.merchants.BulkDeleteMerchantCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -186,6 +166,14 @@ export class CustomAttributes { request: Square.merchants.BulkUpsertMerchantCustomAttributesRequest, requestOptions?: CustomAttributes.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -194,22 +182,16 @@ export class CustomAttributes { "v2/merchants/custom-attributes/bulk-upsert", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.merchants.BulkUpsertMerchantCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -283,20 +265,28 @@ export class CustomAttributes { const { merchantId, visibilityFilter, limit, cursor, withDefinitions } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (withDefinitions !== undefined) { - _queryParams["with_definitions"] = withDefinitions?.toString() ?? null; + _queryParams.with_definitions = withDefinitions?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -305,18 +295,10 @@ export class CustomAttributes { `v2/merchants/${encodeURIComponent(merchantId)}/custom-attributes`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -402,13 +384,21 @@ export class CustomAttributes { const { merchantId, key, withDefinition, version } = request; const _queryParams: Record = {}; if (withDefinition !== undefined) { - _queryParams["with_definition"] = withDefinition?.toString() ?? null; + _queryParams.with_definition = withDefinition?.toString() ?? null; } if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -417,17 +407,10 @@ export class CustomAttributes { `v2/merchants/${encodeURIComponent(merchantId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -502,6 +485,14 @@ export class CustomAttributes { requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { merchantId, key, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -510,22 +501,16 @@ export class CustomAttributes { `v2/merchants/${encodeURIComponent(merchantId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.merchants.UpsertMerchantCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -594,6 +579,14 @@ export class CustomAttributes { requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { merchantId, key } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -602,16 +595,10 @@ export class CustomAttributes { `v2/merchants/${encodeURIComponent(merchantId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -655,7 +642,7 @@ export class CustomAttributes { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/merchants/resources/customAttributes/client/index.ts b/src/api/resources/merchants/resources/customAttributes/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/index.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts index 08cb2ddaf..891f56741 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts index 2c267173d..c9c06a5f6 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts index ad30e0e56..2a0418363 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface DeleteCustomAttributesRequest { - /** - * The ID of the target [merchant](entity:Merchant). - */ + /** The ID of the target [merchant](entity:Merchant). */ merchantId: string; /** * The key of the custom attribute to delete. This key must match the `key` of a custom diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index ddedc056e..a1349d1ea 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -12,9 +10,7 @@ * } */ export interface GetCustomAttributesRequest { - /** - * The ID of the target [merchant](entity:Merchant). - */ + /** The ID of the target [merchant](entity:Merchant). */ merchantId: string; /** * The key of the custom attribute to retrieve. This key must match the `key` of a custom diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index 649e8a162..fe86aa3f0 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,13 +13,9 @@ import * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributesRequest { - /** - * The ID of the target [merchant](entity:Merchant). - */ + /** The ID of the target [merchant](entity:Merchant). */ merchantId: string; - /** - * Filters the `CustomAttributeDefinition` results by their `visibility` values. - */ + /** Filters the `CustomAttributeDefinition` results by their `visibility` values. */ visibilityFilter?: Square.VisibilityFilter | null; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts index b798742bf..dedd481d3 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,9 +13,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpsertMerchantCustomAttributeRequest { - /** - * The ID of the target [merchant](entity:Merchant). - */ + /** The ID of the target [merchant](entity:Merchant). */ merchantId: string; /** * The key of the custom attribute to create or update. This key must match the `key` of a diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/index.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/index.ts index 0f91a2b02..6beabaad1 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/index.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/index.ts @@ -1,6 +1,6 @@ -export { type BulkDeleteMerchantCustomAttributesRequest } from "./BulkDeleteMerchantCustomAttributesRequest"; -export { type BulkUpsertMerchantCustomAttributesRequest } from "./BulkUpsertMerchantCustomAttributesRequest"; -export { type ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; -export { type GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; -export { type UpsertMerchantCustomAttributeRequest } from "./UpsertMerchantCustomAttributeRequest"; -export { type DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; +export type { BulkDeleteMerchantCustomAttributesRequest } from "./BulkDeleteMerchantCustomAttributesRequest"; +export type { BulkUpsertMerchantCustomAttributesRequest } from "./BulkUpsertMerchantCustomAttributesRequest"; +export type { DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; +export type { GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; +export type { ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; +export type { UpsertMerchantCustomAttributeRequest } from "./UpsertMerchantCustomAttributeRequest"; diff --git a/src/api/resources/merchants/resources/index.ts b/src/api/resources/merchants/resources/index.ts index bfa7c90b7..96153bc82 100644 --- a/src/api/resources/merchants/resources/index.ts +++ b/src/api/resources/merchants/resources/index.ts @@ -1,4 +1,4 @@ export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * as customAttributes from "./customAttributes"; export * from "./customAttributeDefinitions/client/requests"; +export * as customAttributes from "./customAttributes"; export * from "./customAttributes/client/requests"; diff --git a/src/api/resources/mobile/client/Client.ts b/src/api/resources/mobile/client/Client.ts index 96e12e7b0..bc57b0f9d 100644 --- a/src/api/resources/mobile/client/Client.ts +++ b/src/api/resources/mobile/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Mobile { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Mobile { @@ -79,6 +57,14 @@ export class Mobile { request: Square.CreateMobileAuthorizationCodeRequest = {}, requestOptions?: Mobile.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -87,22 +73,16 @@ export class Mobile { "mobile/authorization-code", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateMobileAuthorizationCodeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -144,7 +124,7 @@ export class Mobile { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/mobile/client/index.ts b/src/api/resources/mobile/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/mobile/client/index.ts +++ b/src/api/resources/mobile/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts b/src/api/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts index 3620d5786..df2769fdb 100644 --- a/src/api/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts +++ b/src/api/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/mobile/client/requests/index.ts b/src/api/resources/mobile/client/requests/index.ts index 1d310fdf0..45b5f1dc6 100644 --- a/src/api/resources/mobile/client/requests/index.ts +++ b/src/api/resources/mobile/client/requests/index.ts @@ -1 +1 @@ -export { type CreateMobileAuthorizationCodeRequest } from "./CreateMobileAuthorizationCodeRequest"; +export type { CreateMobileAuthorizationCodeRequest } from "./CreateMobileAuthorizationCodeRequest"; diff --git a/src/api/resources/oAuth/client/Client.ts b/src/api/resources/oAuth/client/Client.ts index 537e7526d..06774dfac 100644 --- a/src/api/resources/oAuth/client/Client.ts +++ b/src/api/resources/oAuth/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace OAuth { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class OAuth { @@ -79,6 +57,14 @@ export class OAuth { request: Square.RevokeTokenRequest = {}, requestOptions?: OAuth.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -87,22 +73,16 @@ export class OAuth { "oauth2/revoke", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.RevokeTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -188,6 +168,14 @@ export class OAuth { request: Square.ObtainTokenRequest, requestOptions?: OAuth.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -196,22 +184,16 @@ export class OAuth { "oauth2/token", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ObtainTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -282,6 +264,14 @@ export class OAuth { private async __retrieveTokenStatus( requestOptions?: OAuth.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -290,16 +280,10 @@ export class OAuth { "oauth2/token/status", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -351,6 +335,14 @@ export class OAuth { } private async __authorize(requestOptions?: OAuth.RequestOptions): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -359,16 +351,10 @@ export class OAuth { "oauth2/authorize", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -401,7 +387,7 @@ export class OAuth { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/oAuth/client/index.ts b/src/api/resources/oAuth/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/oAuth/client/index.ts +++ b/src/api/resources/oAuth/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/oAuth/client/requests/ObtainTokenRequest.ts b/src/api/resources/oAuth/client/requests/ObtainTokenRequest.ts index 3d744b592..3c64b3297 100644 --- a/src/api/resources/oAuth/client/requests/ObtainTokenRequest.ts +++ b/src/api/resources/oAuth/client/requests/ObtainTokenRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/oAuth/client/requests/RevokeTokenRequest.ts b/src/api/resources/oAuth/client/requests/RevokeTokenRequest.ts index 206891192..2c5233f71 100644 --- a/src/api/resources/oAuth/client/requests/RevokeTokenRequest.ts +++ b/src/api/resources/oAuth/client/requests/RevokeTokenRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/oAuth/client/requests/index.ts b/src/api/resources/oAuth/client/requests/index.ts index b92160be5..c1616cd4a 100644 --- a/src/api/resources/oAuth/client/requests/index.ts +++ b/src/api/resources/oAuth/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type RevokeTokenRequest } from "./RevokeTokenRequest"; -export { type ObtainTokenRequest } from "./ObtainTokenRequest"; +export type { ObtainTokenRequest } from "./ObtainTokenRequest"; +export type { RevokeTokenRequest } from "./RevokeTokenRequest"; diff --git a/src/api/resources/orders/client/Client.ts b/src/api/resources/orders/client/Client.ts index 36b40452a..c62a5cfbe 100644 --- a/src/api/resources/orders/client/Client.ts +++ b/src/api/resources/orders/client/Client.ts @@ -1,41 +1,19 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { CustomAttributeDefinitions } from "../resources/customAttributeDefinitions/client/Client"; import { CustomAttributes } from "../resources/customAttributes/client/Client"; export declare namespace Orders { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Orders { @@ -128,6 +106,14 @@ export class Orders { request: Square.CreateOrderRequest, requestOptions?: Orders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -136,22 +122,16 @@ export class Orders { "v2/orders", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -217,6 +197,14 @@ export class Orders { request: Square.BatchGetOrdersRequest, requestOptions?: Orders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -225,22 +213,16 @@ export class Orders { "v2/orders/batch-retrieve", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchGetOrdersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -325,6 +307,14 @@ export class Orders { request: Square.CalculateOrderRequest, requestOptions?: Orders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -333,22 +323,16 @@ export class Orders { "v2/orders/calculate", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CalculateOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -414,6 +398,14 @@ export class Orders { request: Square.CloneOrderRequest, requestOptions?: Orders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -422,22 +414,16 @@ export class Orders { "v2/orders/clone", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CloneOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -535,6 +521,14 @@ export class Orders { request: Square.SearchOrdersRequest = {}, requestOptions?: Orders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -543,22 +537,16 @@ export class Orders { "v2/orders/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchOrdersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -622,6 +610,14 @@ export class Orders { requestOptions?: Orders.RequestOptions, ): Promise> { const { orderId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -630,16 +626,10 @@ export class Orders { `v2/orders/${encodeURIComponent(orderId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -732,6 +722,14 @@ export class Orders { requestOptions?: Orders.RequestOptions, ): Promise> { const { orderId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -740,22 +738,16 @@ export class Orders { `v2/orders/${encodeURIComponent(orderId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -834,6 +826,14 @@ export class Orders { requestOptions?: Orders.RequestOptions, ): Promise> { const { orderId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -842,22 +842,16 @@ export class Orders { `v2/orders/${encodeURIComponent(orderId)}/pay`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.PayOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -899,7 +893,7 @@ export class Orders { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/orders/client/index.ts b/src/api/resources/orders/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/orders/client/index.ts +++ b/src/api/resources/orders/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/orders/client/requests/BatchGetOrdersRequest.ts b/src/api/resources/orders/client/requests/BatchGetOrdersRequest.ts index 96c31a8df..db430befb 100644 --- a/src/api/resources/orders/client/requests/BatchGetOrdersRequest.ts +++ b/src/api/resources/orders/client/requests/BatchGetOrdersRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/orders/client/requests/CalculateOrderRequest.ts b/src/api/resources/orders/client/requests/CalculateOrderRequest.ts index 419083fa9..72acd888f 100644 --- a/src/api/resources/orders/client/requests/CalculateOrderRequest.ts +++ b/src/api/resources/orders/client/requests/CalculateOrderRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/orders/client/requests/CloneOrderRequest.ts b/src/api/resources/orders/client/requests/CloneOrderRequest.ts index e246451d0..d1676b241 100644 --- a/src/api/resources/orders/client/requests/CloneOrderRequest.ts +++ b/src/api/resources/orders/client/requests/CloneOrderRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/orders/client/requests/GetOrdersRequest.ts b/src/api/resources/orders/client/requests/GetOrdersRequest.ts index 9d225211b..cf3a837fc 100644 --- a/src/api/resources/orders/client/requests/GetOrdersRequest.ts +++ b/src/api/resources/orders/client/requests/GetOrdersRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetOrdersRequest { - /** - * The ID of the order to retrieve. - */ + /** The ID of the order to retrieve. */ orderId: string; } diff --git a/src/api/resources/orders/client/requests/PayOrderRequest.ts b/src/api/resources/orders/client/requests/PayOrderRequest.ts index 3d74c7950..c6be66861 100644 --- a/src/api/resources/orders/client/requests/PayOrderRequest.ts +++ b/src/api/resources/orders/client/requests/PayOrderRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,9 +9,7 @@ * } */ export interface PayOrderRequest { - /** - * The ID of the order being paid. - */ + /** The ID of the order being paid. */ orderId: string; /** * A value you specify that uniquely identifies this request among requests you have sent. If diff --git a/src/api/resources/orders/client/requests/SearchOrdersRequest.ts b/src/api/resources/orders/client/requests/SearchOrdersRequest.ts index 5313f9d5d..b5b42759a 100644 --- a/src/api/resources/orders/client/requests/SearchOrdersRequest.ts +++ b/src/api/resources/orders/client/requests/SearchOrdersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/orders/client/requests/UpdateOrderRequest.ts b/src/api/resources/orders/client/requests/UpdateOrderRequest.ts index effc16634..519b32538 100644 --- a/src/api/resources/orders/client/requests/UpdateOrderRequest.ts +++ b/src/api/resources/orders/client/requests/UpdateOrderRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -26,9 +24,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateOrderRequest { - /** - * The ID of the order to update. - */ + /** The ID of the order to update. */ orderId: string; /** * The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) diff --git a/src/api/resources/orders/client/requests/index.ts b/src/api/resources/orders/client/requests/index.ts index f9f9976ef..c9b77cc8d 100644 --- a/src/api/resources/orders/client/requests/index.ts +++ b/src/api/resources/orders/client/requests/index.ts @@ -1,7 +1,7 @@ -export { type BatchGetOrdersRequest } from "./BatchGetOrdersRequest"; -export { type CalculateOrderRequest } from "./CalculateOrderRequest"; -export { type CloneOrderRequest } from "./CloneOrderRequest"; -export { type SearchOrdersRequest } from "./SearchOrdersRequest"; -export { type GetOrdersRequest } from "./GetOrdersRequest"; -export { type UpdateOrderRequest } from "./UpdateOrderRequest"; -export { type PayOrderRequest } from "./PayOrderRequest"; +export type { BatchGetOrdersRequest } from "./BatchGetOrdersRequest"; +export type { CalculateOrderRequest } from "./CalculateOrderRequest"; +export type { CloneOrderRequest } from "./CloneOrderRequest"; +export type { GetOrdersRequest } from "./GetOrdersRequest"; +export type { PayOrderRequest } from "./PayOrderRequest"; +export type { SearchOrdersRequest } from "./SearchOrdersRequest"; +export type { UpdateOrderRequest } from "./UpdateOrderRequest"; diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts index 899a7ba8d..c645e5193 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace CustomAttributeDefinitions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class CustomAttributeDefinitions { @@ -72,17 +50,25 @@ export class CustomAttributeDefinitions { const { visibilityFilter, cursor, limit } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -91,18 +77,10 @@ export class CustomAttributeDefinitions { "v2/orders/custom-attribute-definitions", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -191,6 +169,14 @@ export class CustomAttributeDefinitions { request: Square.orders.CreateOrderCustomAttributeDefinitionRequest, requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -199,22 +185,16 @@ export class CustomAttributeDefinitions { "v2/orders/custom-attribute-definitions", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.orders.CreateOrderCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -287,9 +267,17 @@ export class CustomAttributeDefinitions { const { key, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -298,17 +286,10 @@ export class CustomAttributeDefinitions { `v2/orders/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -382,6 +363,14 @@ export class CustomAttributeDefinitions { requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -390,22 +379,16 @@ export class CustomAttributeDefinitions { `v2/orders/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.orders.UpdateOrderCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -473,6 +456,14 @@ export class CustomAttributeDefinitions { requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -481,16 +472,10 @@ export class CustomAttributeDefinitions { `v2/orders/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -534,7 +519,7 @@ export class CustomAttributeDefinitions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/index.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/index.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts index 296e03219..00bbd9ece 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts index 6a1b34cf1..a9c9d9ec5 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteCustomAttributeDefinitionsRequest { - /** - * The key of the custom attribute definition to delete. - */ + /** The key of the custom attribute definition to delete. */ key: string; } diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index b72b1159b..a766f69cb 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface GetCustomAttributeDefinitionsRequest { - /** - * The key of the custom attribute definition to retrieve. - */ + /** The key of the custom attribute definition to retrieve. */ key: string; /** * To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index 3f1c4b730..0af73ad0e 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -13,9 +11,7 @@ import * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributeDefinitionsRequest { - /** - * Requests that all of the custom attributes be returned, or only those that are read-only or read-write. - */ + /** Requests that all of the custom attributes be returned, or only those that are read-only or read-write. */ visibilityFilter?: Square.VisibilityFilter | null; /** * The cursor returned in the paged response from the previous call to this endpoint. diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts index 3eaac2d78..6394705bb 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -17,9 +15,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateOrderCustomAttributeDefinitionRequest { - /** - * The key of the custom attribute definition to update. - */ + /** The key of the custom attribute definition to update. */ key: string; /** * The custom attribute definition that contains the fields to update. This endpoint supports sparse updates, diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/index.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/index.ts index fbb70badb..8a5b5749a 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; -export { type CreateOrderCustomAttributeDefinitionRequest } from "./CreateOrderCustomAttributeDefinitionRequest"; -export { type GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; -export { type UpdateOrderCustomAttributeDefinitionRequest } from "./UpdateOrderCustomAttributeDefinitionRequest"; -export { type DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; +export type { CreateOrderCustomAttributeDefinitionRequest } from "./CreateOrderCustomAttributeDefinitionRequest"; +export type { DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; +export type { GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; +export type { ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; +export type { UpdateOrderCustomAttributeDefinitionRequest } from "./UpdateOrderCustomAttributeDefinitionRequest"; diff --git a/src/api/resources/orders/resources/customAttributes/client/Client.ts b/src/api/resources/orders/resources/customAttributes/client/Client.ts index c67c62da9..c99e25710 100644 --- a/src/api/resources/orders/resources/customAttributes/client/Client.ts +++ b/src/api/resources/orders/resources/customAttributes/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace CustomAttributes { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class CustomAttributes { @@ -87,6 +65,14 @@ export class CustomAttributes { request: Square.orders.BulkDeleteOrderCustomAttributesRequest, requestOptions?: CustomAttributes.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -95,22 +81,16 @@ export class CustomAttributes { "v2/orders/custom-attributes/bulk-delete", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.orders.BulkDeleteOrderCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -205,6 +185,14 @@ export class CustomAttributes { request: Square.orders.BulkUpsertOrderCustomAttributesRequest, requestOptions?: CustomAttributes.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -213,22 +201,16 @@ export class CustomAttributes { "v2/orders/custom-attributes/bulk-upsert", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.orders.BulkUpsertOrderCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -304,20 +286,28 @@ export class CustomAttributes { const { orderId, visibilityFilter, cursor, limit, withDefinitions } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (withDefinitions !== undefined) { - _queryParams["with_definitions"] = withDefinitions?.toString() ?? null; + _queryParams.with_definitions = withDefinitions?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -326,18 +316,10 @@ export class CustomAttributes { `v2/orders/${encodeURIComponent(orderId)}/custom-attributes`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -426,13 +408,21 @@ export class CustomAttributes { const { orderId, customAttributeKey, version, withDefinition } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } if (withDefinition !== undefined) { - _queryParams["with_definition"] = withDefinition?.toString() ?? null; + _queryParams.with_definition = withDefinition?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -441,17 +431,10 @@ export class CustomAttributes { `v2/orders/${encodeURIComponent(orderId)}/custom-attributes/${encodeURIComponent(customAttributeKey)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -531,6 +514,14 @@ export class CustomAttributes { requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { orderId, customAttributeKey, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -539,22 +530,16 @@ export class CustomAttributes { `v2/orders/${encodeURIComponent(orderId)}/custom-attributes/${encodeURIComponent(customAttributeKey)}`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.orders.UpsertOrderCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -625,6 +610,14 @@ export class CustomAttributes { requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { orderId, customAttributeKey } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -633,16 +626,10 @@ export class CustomAttributes { `v2/orders/${encodeURIComponent(orderId)}/custom-attributes/${encodeURIComponent(customAttributeKey)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -686,7 +673,7 @@ export class CustomAttributes { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/orders/resources/customAttributes/client/index.ts b/src/api/resources/orders/resources/customAttributes/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/orders/resources/customAttributes/client/index.ts +++ b/src/api/resources/orders/resources/customAttributes/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts index c179f4272..e240e6b22 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts index 049e4a5fc..32f0efb3c 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts index 1ad104438..37be1b432 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface DeleteCustomAttributesRequest { - /** - * The ID of the target [order](entity:Order). - */ + /** The ID of the target [order](entity:Order). */ orderId: string; /** * The key of the custom attribute to delete. This key must match the key of an diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index 4c8dbdb0d..3478f0202 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -12,9 +10,7 @@ * } */ export interface GetCustomAttributesRequest { - /** - * The ID of the target [order](entity:Order). - */ + /** The ID of the target [order](entity:Order). */ orderId: string; /** * The key of the custom attribute to retrieve. This key must match the key of an diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index 206799d76..887cff2c7 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,13 +13,9 @@ import * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributesRequest { - /** - * The ID of the target [order](entity:Order). - */ + /** The ID of the target [order](entity:Order). */ orderId: string; - /** - * Requests that all of the custom attributes be returned, or only those that are read-only or read-write. - */ + /** Requests that all of the custom attributes be returned, or only those that are read-only or read-write. */ visibilityFilter?: Square.VisibilityFilter | null; /** * The cursor returned in the paged response from the previous call to this endpoint. diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts index d8edbbc12..1d293c94c 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -17,9 +15,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpsertOrderCustomAttributeRequest { - /** - * The ID of the target [order](entity:Order). - */ + /** The ID of the target [order](entity:Order). */ orderId: string; /** * The key of the custom attribute to create or update. This key must match the key diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/index.ts b/src/api/resources/orders/resources/customAttributes/client/requests/index.ts index 63278aa3e..ee8dadc35 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/index.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/index.ts @@ -1,6 +1,6 @@ -export { type BulkDeleteOrderCustomAttributesRequest } from "./BulkDeleteOrderCustomAttributesRequest"; -export { type BulkUpsertOrderCustomAttributesRequest } from "./BulkUpsertOrderCustomAttributesRequest"; -export { type ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; -export { type GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; -export { type UpsertOrderCustomAttributeRequest } from "./UpsertOrderCustomAttributeRequest"; -export { type DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; +export type { BulkDeleteOrderCustomAttributesRequest } from "./BulkDeleteOrderCustomAttributesRequest"; +export type { BulkUpsertOrderCustomAttributesRequest } from "./BulkUpsertOrderCustomAttributesRequest"; +export type { DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; +export type { GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; +export type { ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; +export type { UpsertOrderCustomAttributeRequest } from "./UpsertOrderCustomAttributeRequest"; diff --git a/src/api/resources/orders/resources/index.ts b/src/api/resources/orders/resources/index.ts index bfa7c90b7..96153bc82 100644 --- a/src/api/resources/orders/resources/index.ts +++ b/src/api/resources/orders/resources/index.ts @@ -1,4 +1,4 @@ export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * as customAttributes from "./customAttributes"; export * from "./customAttributeDefinitions/client/requests"; +export * as customAttributes from "./customAttributes"; export * from "./customAttributes/client/requests"; diff --git a/src/api/resources/payments/client/Client.ts b/src/api/resources/payments/client/Client.ts index c5e81a7cb..4a20869c1 100644 --- a/src/api/resources/payments/client/Client.ts +++ b/src/api/resources/payments/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; -import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Payments { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Payments { @@ -98,53 +76,61 @@ export class Payments { } = request; const _queryParams: Record = {}; if (beginTime !== undefined) { - _queryParams["begin_time"] = beginTime; + _queryParams.begin_time = beginTime; } if (endTime !== undefined) { - _queryParams["end_time"] = endTime; + _queryParams.end_time = endTime; } if (sortOrder !== undefined) { - _queryParams["sort_order"] = sortOrder; + _queryParams.sort_order = sortOrder; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } if (total !== undefined) { - _queryParams["total"] = total?.toString() ?? null; + _queryParams.total = total?.toString() ?? null; } if (last4 !== undefined) { - _queryParams["last_4"] = last4; + _queryParams.last_4 = last4; } if (cardBrand !== undefined) { - _queryParams["card_brand"] = cardBrand; + _queryParams.card_brand = cardBrand; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (isOfflinePayment !== undefined) { - _queryParams["is_offline_payment"] = isOfflinePayment?.toString() ?? null; + _queryParams.is_offline_payment = isOfflinePayment?.toString() ?? null; } if (offlineBeginTime !== undefined) { - _queryParams["offline_begin_time"] = offlineBeginTime; + _queryParams.offline_begin_time = offlineBeginTime; } if (offlineEndTime !== undefined) { - _queryParams["offline_end_time"] = offlineEndTime; + _queryParams.offline_end_time = offlineEndTime; } if (updatedAtBeginTime !== undefined) { - _queryParams["updated_at_begin_time"] = updatedAtBeginTime; + _queryParams.updated_at_begin_time = updatedAtBeginTime; } if (updatedAtEndTime !== undefined) { - _queryParams["updated_at_end_time"] = updatedAtEndTime; + _queryParams.updated_at_end_time = updatedAtEndTime; } if (sortField !== undefined) { - _queryParams["sort_field"] = serializers.ListPaymentsRequestSortField.jsonOrThrow(sortField, { + _queryParams.sort_field = serializers.ListPaymentsRequestSortField.jsonOrThrow(sortField, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -153,18 +139,10 @@ export class Payments { "v2/payments", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -259,6 +237,14 @@ export class Payments { request: Square.CreatePaymentRequest, requestOptions?: Payments.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -267,22 +253,16 @@ export class Payments { "v2/payments", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreatePaymentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -355,6 +335,14 @@ export class Payments { request: Square.CancelPaymentByIdempotencyKeyRequest, requestOptions?: Payments.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -363,22 +351,16 @@ export class Payments { "v2/payments/cancel", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CancelPaymentByIdempotencyKeyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -442,6 +424,14 @@ export class Payments { requestOptions?: Payments.RequestOptions, ): Promise> { const { paymentId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -450,16 +440,10 @@ export class Payments { `v2/payments/${encodeURIComponent(paymentId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -536,6 +520,14 @@ export class Payments { requestOptions?: Payments.RequestOptions, ): Promise> { const { paymentId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -544,22 +536,16 @@ export class Payments { `v2/payments/${encodeURIComponent(paymentId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdatePaymentRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -624,6 +610,14 @@ export class Payments { requestOptions?: Payments.RequestOptions, ): Promise> { const { paymentId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -632,16 +626,10 @@ export class Payments { `v2/payments/${encodeURIComponent(paymentId)}/cancel`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -710,6 +698,14 @@ export class Payments { requestOptions?: Payments.RequestOptions, ): Promise> { const { paymentId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -718,22 +714,16 @@ export class Payments { `v2/payments/${encodeURIComponent(paymentId)}/complete`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CompletePaymentRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -777,7 +767,7 @@ export class Payments { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/payments/client/index.ts b/src/api/resources/payments/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/payments/client/index.ts +++ b/src/api/resources/payments/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts b/src/api/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts index 7929437cc..476c4d4eb 100644 --- a/src/api/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts +++ b/src/api/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/payments/client/requests/CancelPaymentsRequest.ts b/src/api/resources/payments/client/requests/CancelPaymentsRequest.ts index 909ef567d..9f9ec3e0e 100644 --- a/src/api/resources/payments/client/requests/CancelPaymentsRequest.ts +++ b/src/api/resources/payments/client/requests/CancelPaymentsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface CancelPaymentsRequest { - /** - * The ID of the payment to cancel. - */ + /** The ID of the payment to cancel. */ paymentId: string; } diff --git a/src/api/resources/payments/client/requests/CompletePaymentRequest.ts b/src/api/resources/payments/client/requests/CompletePaymentRequest.ts index c75e332e9..12fdbc6c9 100644 --- a/src/api/resources/payments/client/requests/CompletePaymentRequest.ts +++ b/src/api/resources/payments/client/requests/CompletePaymentRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,9 +7,7 @@ * } */ export interface CompletePaymentRequest { - /** - * The unique ID identifying the payment to be completed. - */ + /** The unique ID identifying the payment to be completed. */ paymentId: string; /** * Used for optimistic concurrency. This opaque token identifies the current `Payment` diff --git a/src/api/resources/payments/client/requests/CreatePaymentRequest.ts b/src/api/resources/payments/client/requests/CreatePaymentRequest.ts index b9a1ae46a..1bb38cec3 100644 --- a/src/api/resources/payments/client/requests/CreatePaymentRequest.ts +++ b/src/api/resources/payments/client/requests/CreatePaymentRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/payments/client/requests/GetPaymentsRequest.ts b/src/api/resources/payments/client/requests/GetPaymentsRequest.ts index a012df8cd..a2fecfcf3 100644 --- a/src/api/resources/payments/client/requests/GetPaymentsRequest.ts +++ b/src/api/resources/payments/client/requests/GetPaymentsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetPaymentsRequest { - /** - * A unique ID for the desired payment. - */ + /** A unique ID for the desired payment. */ paymentId: string; } diff --git a/src/api/resources/payments/client/requests/ListPaymentsRequest.ts b/src/api/resources/payments/client/requests/ListPaymentsRequest.ts index affd3d479..09ed36f2c 100644 --- a/src/api/resources/payments/client/requests/ListPaymentsRequest.ts +++ b/src/api/resources/payments/client/requests/ListPaymentsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -56,17 +54,11 @@ export interface ListPaymentsRequest { * for the default (main) location associated with the seller. */ locationId?: string | null; - /** - * The exact amount in the `total_money` for a payment. - */ + /** The exact amount in the `total_money` for a payment. */ total?: bigint | null; - /** - * The last four digits of a payment card. - */ + /** The last four digits of a payment card. */ last4?: string | null; - /** - * The brand of the payment card (for example, VISA). - */ + /** The brand of the payment card (for example, VISA). */ cardBrand?: string | null; /** * The maximum number of results to be returned in a single page. @@ -78,9 +70,7 @@ export interface ListPaymentsRequest { * Default: `100` */ limit?: number | null; - /** - * Whether the payment was taken offline or not. - */ + /** Whether the payment was taken offline or not. */ isOfflinePayment?: boolean | null; /** * Indicates the start of the time range for which to retrieve offline payments, in RFC 3339 @@ -110,8 +100,6 @@ export interface ListPaymentsRequest { * range is determined using the `updated_at` field for each Payment. */ updatedAtEndTime?: string | null; - /** - * The field used to sort results by. The default is `CREATED_AT`. - */ + /** The field used to sort results by. The default is `CREATED_AT`. */ sortField?: Square.ListPaymentsRequestSortField | null; } diff --git a/src/api/resources/payments/client/requests/UpdatePaymentRequest.ts b/src/api/resources/payments/client/requests/UpdatePaymentRequest.ts index d6f7f9ba9..649ac9153 100644 --- a/src/api/resources/payments/client/requests/UpdatePaymentRequest.ts +++ b/src/api/resources/payments/client/requests/UpdatePaymentRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -23,9 +21,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdatePaymentRequest { - /** - * The ID of the payment to update. - */ + /** The ID of the payment to update. */ paymentId: string; /** The updated `Payment` object. */ payment?: Square.Payment; diff --git a/src/api/resources/payments/client/requests/index.ts b/src/api/resources/payments/client/requests/index.ts index 3828c6442..1a570a47e 100644 --- a/src/api/resources/payments/client/requests/index.ts +++ b/src/api/resources/payments/client/requests/index.ts @@ -1,7 +1,7 @@ -export { type ListPaymentsRequest } from "./ListPaymentsRequest"; -export { type CreatePaymentRequest } from "./CreatePaymentRequest"; -export { type CancelPaymentByIdempotencyKeyRequest } from "./CancelPaymentByIdempotencyKeyRequest"; -export { type GetPaymentsRequest } from "./GetPaymentsRequest"; -export { type UpdatePaymentRequest } from "./UpdatePaymentRequest"; -export { type CancelPaymentsRequest } from "./CancelPaymentsRequest"; -export { type CompletePaymentRequest } from "./CompletePaymentRequest"; +export type { CancelPaymentByIdempotencyKeyRequest } from "./CancelPaymentByIdempotencyKeyRequest"; +export type { CancelPaymentsRequest } from "./CancelPaymentsRequest"; +export type { CompletePaymentRequest } from "./CompletePaymentRequest"; +export type { CreatePaymentRequest } from "./CreatePaymentRequest"; +export type { GetPaymentsRequest } from "./GetPaymentsRequest"; +export type { ListPaymentsRequest } from "./ListPaymentsRequest"; +export type { UpdatePaymentRequest } from "./UpdatePaymentRequest"; diff --git a/src/api/resources/payouts/client/Client.ts b/src/api/resources/payouts/client/Client.ts index 19a6b714f..56bd8d1d2 100644 --- a/src/api/resources/payouts/client/Client.ts +++ b/src/api/resources/payouts/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; -import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Payouts { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Payouts { @@ -71,32 +49,40 @@ export class Payouts { const { locationId, status, beginTime, endTime, sortOrder, cursor, limit } = request; const _queryParams: Record = {}; if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } if (status !== undefined) { - _queryParams["status"] = serializers.PayoutStatus.jsonOrThrow(status, { + _queryParams.status = serializers.PayoutStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (beginTime !== undefined) { - _queryParams["begin_time"] = beginTime; + _queryParams.begin_time = beginTime; } if (endTime !== undefined) { - _queryParams["end_time"] = endTime; + _queryParams.end_time = endTime; } if (sortOrder !== undefined) { - _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -105,18 +91,10 @@ export class Payouts { "v2/payouts", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -192,6 +170,14 @@ export class Payouts { requestOptions?: Payouts.RequestOptions, ): Promise> { const { payoutId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -200,16 +186,10 @@ export class Payouts { `v2/payouts/${encodeURIComponent(payoutId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -276,17 +256,25 @@ export class Payouts { const { payoutId, sortOrder, cursor, limit } = request; const _queryParams: Record = {}; if (sortOrder !== undefined) { - _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -295,18 +283,10 @@ export class Payouts { `v2/payouts/${encodeURIComponent(payoutId)}/payout-entries`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -361,7 +341,7 @@ export class Payouts { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/payouts/client/index.ts b/src/api/resources/payouts/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/payouts/client/index.ts +++ b/src/api/resources/payouts/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/payouts/client/requests/GetPayoutsRequest.ts b/src/api/resources/payouts/client/requests/GetPayoutsRequest.ts index 2a31c8f5b..8e553472b 100644 --- a/src/api/resources/payouts/client/requests/GetPayoutsRequest.ts +++ b/src/api/resources/payouts/client/requests/GetPayoutsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetPayoutsRequest { - /** - * The ID of the payout to retrieve the information for. - */ + /** The ID of the payout to retrieve the information for. */ payoutId: string; } diff --git a/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts b/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts index 6b329f73c..bb67a6f96 100644 --- a/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts +++ b/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -14,13 +12,9 @@ import * as Square from "../../../../index"; * } */ export interface ListEntriesPayoutsRequest { - /** - * The ID of the payout to retrieve the information for. - */ + /** The ID of the payout to retrieve the information for. */ payoutId: string; - /** - * The order in which payout entries are listed. - */ + /** The order in which payout entries are listed. */ sortOrder?: Square.SortOrder | null; /** * A pagination cursor returned by a previous call to this endpoint. diff --git a/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts b/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts index 49f693190..7cc94db6a 100644 --- a/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts +++ b/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -22,9 +20,7 @@ export interface ListPayoutsRequest { * By default, payouts are returned for the default (main) location associated with the seller. */ locationId?: string | null; - /** - * If provided, only payouts with the given status are returned. - */ + /** If provided, only payouts with the given status are returned. */ status?: Square.PayoutStatus | null; /** * The timestamp for the beginning of the payout creation time, in RFC 3339 format. @@ -36,9 +32,7 @@ export interface ListPayoutsRequest { * Default: The current time. */ endTime?: string | null; - /** - * The order in which payouts are listed. - */ + /** The order in which payouts are listed. */ sortOrder?: Square.SortOrder | null; /** * A pagination cursor returned by a previous call to this endpoint. diff --git a/src/api/resources/payouts/client/requests/index.ts b/src/api/resources/payouts/client/requests/index.ts index 73f48e53f..af948303a 100644 --- a/src/api/resources/payouts/client/requests/index.ts +++ b/src/api/resources/payouts/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type ListPayoutsRequest } from "./ListPayoutsRequest"; -export { type GetPayoutsRequest } from "./GetPayoutsRequest"; -export { type ListEntriesPayoutsRequest } from "./ListEntriesPayoutsRequest"; +export type { GetPayoutsRequest } from "./GetPayoutsRequest"; +export type { ListEntriesPayoutsRequest } from "./ListEntriesPayoutsRequest"; +export type { ListPayoutsRequest } from "./ListPayoutsRequest"; diff --git a/src/api/resources/refunds/client/Client.ts b/src/api/resources/refunds/client/Client.ts index 6832f14e8..c0d038b55 100644 --- a/src/api/resources/refunds/client/Client.ts +++ b/src/api/resources/refunds/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; -import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Refunds { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Refunds { @@ -92,41 +70,49 @@ export class Refunds { } = request; const _queryParams: Record = {}; if (beginTime !== undefined) { - _queryParams["begin_time"] = beginTime; + _queryParams.begin_time = beginTime; } if (endTime !== undefined) { - _queryParams["end_time"] = endTime; + _queryParams.end_time = endTime; } if (sortOrder !== undefined) { - _queryParams["sort_order"] = sortOrder; + _queryParams.sort_order = sortOrder; } if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (locationId !== undefined) { - _queryParams["location_id"] = locationId; + _queryParams.location_id = locationId; } if (status !== undefined) { - _queryParams["status"] = status; + _queryParams.status = status; } if (sourceType !== undefined) { - _queryParams["source_type"] = sourceType; + _queryParams.source_type = sourceType; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (updatedAtBeginTime !== undefined) { - _queryParams["updated_at_begin_time"] = updatedAtBeginTime; + _queryParams.updated_at_begin_time = updatedAtBeginTime; } if (updatedAtEndTime !== undefined) { - _queryParams["updated_at_end_time"] = updatedAtEndTime; + _queryParams.updated_at_end_time = updatedAtEndTime; } if (sortField !== undefined) { - _queryParams["sort_field"] = serializers.ListPaymentRefundsRequestSortField.jsonOrThrow(sortField, { + _queryParams.sort_field = serializers.ListPaymentRefundsRequestSortField.jsonOrThrow(sortField, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -135,18 +121,10 @@ export class Refunds { "v2/refunds", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -233,6 +211,14 @@ export class Refunds { request: Square.RefundPaymentRequest, requestOptions?: Refunds.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -241,22 +227,16 @@ export class Refunds { "v2/refunds", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.RefundPaymentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -320,6 +300,14 @@ export class Refunds { requestOptions?: Refunds.RequestOptions, ): Promise> { const { refundId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -328,16 +316,10 @@ export class Refunds { `v2/refunds/${encodeURIComponent(refundId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -379,7 +361,7 @@ export class Refunds { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/refunds/client/index.ts b/src/api/resources/refunds/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/refunds/client/index.ts +++ b/src/api/resources/refunds/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/refunds/client/requests/GetRefundsRequest.ts b/src/api/resources/refunds/client/requests/GetRefundsRequest.ts index e5935da3f..006a22028 100644 --- a/src/api/resources/refunds/client/requests/GetRefundsRequest.ts +++ b/src/api/resources/refunds/client/requests/GetRefundsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetRefundsRequest { - /** - * The unique ID for the desired `PaymentRefund`. - */ + /** The unique ID for the desired `PaymentRefund`. */ refundId: string; } diff --git a/src/api/resources/refunds/client/requests/ListRefundsRequest.ts b/src/api/resources/refunds/client/requests/ListRefundsRequest.ts index e7e2d1d54..437501a4c 100644 --- a/src/api/resources/refunds/client/requests/ListRefundsRequest.ts +++ b/src/api/resources/refunds/client/requests/ListRefundsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -93,8 +91,6 @@ export interface ListRefundsRequest { * Default: The current time. */ updatedAtEndTime?: string | null; - /** - * The field used to sort results by. The default is `CREATED_AT`. - */ + /** The field used to sort results by. The default is `CREATED_AT`. */ sortField?: Square.ListPaymentRefundsRequestSortField | null; } diff --git a/src/api/resources/refunds/client/requests/RefundPaymentRequest.ts b/src/api/resources/refunds/client/requests/RefundPaymentRequest.ts index 9d700e817..887b23384 100644 --- a/src/api/resources/refunds/client/requests/RefundPaymentRequest.ts +++ b/src/api/resources/refunds/client/requests/RefundPaymentRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/refunds/client/requests/index.ts b/src/api/resources/refunds/client/requests/index.ts index 8effc0bce..4c0ce2a64 100644 --- a/src/api/resources/refunds/client/requests/index.ts +++ b/src/api/resources/refunds/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type ListRefundsRequest } from "./ListRefundsRequest"; -export { type RefundPaymentRequest } from "./RefundPaymentRequest"; -export { type GetRefundsRequest } from "./GetRefundsRequest"; +export type { GetRefundsRequest } from "./GetRefundsRequest"; +export type { ListRefundsRequest } from "./ListRefundsRequest"; +export type { RefundPaymentRequest } from "./RefundPaymentRequest"; diff --git a/src/api/resources/sites/client/Client.ts b/src/api/resources/sites/client/Client.ts index 3942631c3..f552c7c03 100644 --- a/src/api/resources/sites/client/Client.ts +++ b/src/api/resources/sites/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Sites { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Sites { @@ -61,6 +39,14 @@ export class Sites { private async __list( requestOptions?: Sites.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -69,16 +55,10 @@ export class Sites { "v2/sites", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -120,7 +100,7 @@ export class Sites { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/snippets/client/Client.ts b/src/api/resources/snippets/client/Client.ts index e118cc663..7d5afe5cf 100644 --- a/src/api/resources/snippets/client/Client.ts +++ b/src/api/resources/snippets/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Snippets { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Snippets { @@ -71,6 +49,14 @@ export class Snippets { requestOptions?: Snippets.RequestOptions, ): Promise> { const { siteId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -79,16 +65,10 @@ export class Snippets { `v2/sites/${encodeURIComponent(siteId)}/snippet`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -161,6 +141,14 @@ export class Snippets { requestOptions?: Snippets.RequestOptions, ): Promise> { const { siteId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -169,22 +157,16 @@ export class Snippets { `v2/sites/${encodeURIComponent(siteId)}/snippet`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpsertSnippetRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -253,6 +235,14 @@ export class Snippets { requestOptions?: Snippets.RequestOptions, ): Promise> { const { siteId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -261,16 +251,10 @@ export class Snippets { `v2/sites/${encodeURIComponent(siteId)}/snippet`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -314,7 +298,7 @@ export class Snippets { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/snippets/client/index.ts b/src/api/resources/snippets/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/snippets/client/index.ts +++ b/src/api/resources/snippets/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/snippets/client/requests/DeleteSnippetsRequest.ts b/src/api/resources/snippets/client/requests/DeleteSnippetsRequest.ts index 35df88023..1ebc31b51 100644 --- a/src/api/resources/snippets/client/requests/DeleteSnippetsRequest.ts +++ b/src/api/resources/snippets/client/requests/DeleteSnippetsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteSnippetsRequest { - /** - * The ID of the site that contains the snippet. - */ + /** The ID of the site that contains the snippet. */ siteId: string; } diff --git a/src/api/resources/snippets/client/requests/GetSnippetsRequest.ts b/src/api/resources/snippets/client/requests/GetSnippetsRequest.ts index 64275821f..15c4b0278 100644 --- a/src/api/resources/snippets/client/requests/GetSnippetsRequest.ts +++ b/src/api/resources/snippets/client/requests/GetSnippetsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetSnippetsRequest { - /** - * The ID of the site that contains the snippet. - */ + /** The ID of the site that contains the snippet. */ siteId: string; } diff --git a/src/api/resources/snippets/client/requests/UpsertSnippetRequest.ts b/src/api/resources/snippets/client/requests/UpsertSnippetRequest.ts index 28d2100a3..f713c91b0 100644 --- a/src/api/resources/snippets/client/requests/UpsertSnippetRequest.ts +++ b/src/api/resources/snippets/client/requests/UpsertSnippetRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -14,9 +12,7 @@ import * as Square from "../../../../index"; * } */ export interface UpsertSnippetRequest { - /** - * The ID of the site where you want to add or update the snippet. - */ + /** The ID of the site where you want to add or update the snippet. */ siteId: string; /** The snippet for the site. */ snippet: Square.Snippet; diff --git a/src/api/resources/snippets/client/requests/index.ts b/src/api/resources/snippets/client/requests/index.ts index 9dd51c182..90ce3a93b 100644 --- a/src/api/resources/snippets/client/requests/index.ts +++ b/src/api/resources/snippets/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type GetSnippetsRequest } from "./GetSnippetsRequest"; -export { type UpsertSnippetRequest } from "./UpsertSnippetRequest"; -export { type DeleteSnippetsRequest } from "./DeleteSnippetsRequest"; +export type { DeleteSnippetsRequest } from "./DeleteSnippetsRequest"; +export type { GetSnippetsRequest } from "./GetSnippetsRequest"; +export type { UpsertSnippetRequest } from "./UpsertSnippetRequest"; diff --git a/src/api/resources/subscriptions/client/Client.ts b/src/api/resources/subscriptions/client/Client.ts index de23f0291..3ff82d749 100644 --- a/src/api/resources/subscriptions/client/Client.ts +++ b/src/api/resources/subscriptions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Subscriptions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Subscriptions { @@ -85,6 +63,14 @@ export class Subscriptions { request: Square.CreateSubscriptionRequest, requestOptions?: Subscriptions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -93,22 +79,16 @@ export class Subscriptions { "v2/subscriptions", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateSubscriptionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -174,6 +154,14 @@ export class Subscriptions { request: Square.BulkSwapPlanRequest, requestOptions?: Subscriptions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -182,22 +170,16 @@ export class Subscriptions { "v2/subscriptions/bulk-swap-plan", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkSwapPlanRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -281,6 +263,14 @@ export class Subscriptions { request: Square.SearchSubscriptionsRequest = {}, requestOptions?: Subscriptions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -289,22 +279,16 @@ export class Subscriptions { "v2/subscriptions/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchSubscriptionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -371,9 +355,17 @@ export class Subscriptions { const { subscriptionId, include } = request; const _queryParams: Record = {}; if (include !== undefined) { - _queryParams["include"] = include; + _queryParams.include = include; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -382,17 +374,10 @@ export class Subscriptions { `v2/subscriptions/${encodeURIComponent(subscriptionId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -462,6 +447,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -470,22 +463,16 @@ export class Subscriptions { `v2/subscriptions/${encodeURIComponent(subscriptionId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -552,6 +539,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, actionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -560,16 +555,10 @@ export class Subscriptions { `v2/subscriptions/${encodeURIComponent(subscriptionId)}/actions/${encodeURIComponent(actionId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -637,6 +626,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -645,22 +642,16 @@ export class Subscriptions { `v2/subscriptions/${encodeURIComponent(subscriptionId)}/billing-anchor`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ChangeBillingAnchorDateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -728,6 +719,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -736,16 +735,10 @@ export class Subscriptions { `v2/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -812,11 +805,19 @@ export class Subscriptions { const { subscriptionId, cursor, limit } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -825,18 +826,10 @@ export class Subscriptions { `v2/subscriptions/${encodeURIComponent(subscriptionId)}/events`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -913,6 +906,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -921,22 +922,16 @@ export class Subscriptions { `v2/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.PauseSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1002,6 +997,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -1010,22 +1013,16 @@ export class Subscriptions { `v2/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ResumeSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1097,6 +1094,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -1105,22 +1110,16 @@ export class Subscriptions { `v2/subscriptions/${encodeURIComponent(subscriptionId)}/swap-plan`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SwapPlanRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1164,7 +1163,7 @@ export class Subscriptions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/subscriptions/client/index.ts b/src/api/resources/subscriptions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/subscriptions/client/index.ts +++ b/src/api/resources/subscriptions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts b/src/api/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts index b282183e2..6a459b086 100644 --- a/src/api/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts +++ b/src/api/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/subscriptions/client/requests/CancelSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/CancelSubscriptionsRequest.ts index 5586bc2e5..5009ed8d8 100644 --- a/src/api/resources/subscriptions/client/requests/CancelSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/CancelSubscriptionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface CancelSubscriptionsRequest { - /** - * The ID of the subscription to cancel. - */ + /** The ID of the subscription to cancel. */ subscriptionId: string; } diff --git a/src/api/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts b/src/api/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts index 9c715ee5f..e53f6a603 100644 --- a/src/api/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts +++ b/src/api/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface ChangeBillingAnchorDateRequest { - /** - * The ID of the subscription to update the billing anchor date. - */ + /** The ID of the subscription to update the billing anchor date. */ subscriptionId: string; /** The anchor day for the billing cycle. */ monthlyBillingAnchorDate?: number | null; diff --git a/src/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts b/src/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts index 260717683..b15df0699 100644 --- a/src/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts +++ b/src/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/subscriptions/client/requests/DeleteActionSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/DeleteActionSubscriptionsRequest.ts index efbc64238..1dd5187ba 100644 --- a/src/api/resources/subscriptions/client/requests/DeleteActionSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/DeleteActionSubscriptionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface DeleteActionSubscriptionsRequest { - /** - * The ID of the subscription the targeted action is to act upon. - */ + /** The ID of the subscription the targeted action is to act upon. */ subscriptionId: string; - /** - * The ID of the targeted action to be deleted. - */ + /** The ID of the targeted action to be deleted. */ actionId: string; } diff --git a/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts index 4604762dd..5f4cf252f 100644 --- a/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface GetSubscriptionsRequest { - /** - * The ID of the subscription to retrieve. - */ + /** The ID of the subscription to retrieve. */ subscriptionId: string; /** * A query parameter to specify related information to be included in the response. diff --git a/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts index d2597584e..06804a947 100644 --- a/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,9 +9,7 @@ * } */ export interface ListEventsSubscriptionsRequest { - /** - * The ID of the subscription to retrieve the events for. - */ + /** The ID of the subscription to retrieve the events for. */ subscriptionId: string; /** * When the total number of resulting subscription events exceeds the limit of a paged response, diff --git a/src/api/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts b/src/api/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts index 1b7358f4f..c1ed4a63e 100644 --- a/src/api/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts +++ b/src/api/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -11,9 +9,7 @@ import * as Square from "../../../../index"; * } */ export interface PauseSubscriptionRequest { - /** - * The ID of the subscription to pause. - */ + /** The ID of the subscription to pause. */ subscriptionId: string; /** * The `YYYY-MM-DD`-formatted date when the scheduled `PAUSE` action takes place on the subscription. diff --git a/src/api/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts b/src/api/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts index b0c1e5f91..c1d6e22b4 100644 --- a/src/api/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts +++ b/src/api/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -11,9 +9,7 @@ import * as Square from "../../../../index"; * } */ export interface ResumeSubscriptionRequest { - /** - * The ID of the subscription to resume. - */ + /** The ID of the subscription to resume. */ subscriptionId: string; /** The `YYYY-MM-DD`-formatted date when the subscription reactivated. */ resumeEffectiveDate?: string | null; diff --git a/src/api/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts index cf4de613c..0c96b9674 100644 --- a/src/api/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/subscriptions/client/requests/SwapPlanRequest.ts b/src/api/resources/subscriptions/client/requests/SwapPlanRequest.ts index 0b09db27f..ede85dea6 100644 --- a/src/api/resources/subscriptions/client/requests/SwapPlanRequest.ts +++ b/src/api/resources/subscriptions/client/requests/SwapPlanRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -16,9 +14,7 @@ import * as Square from "../../../../index"; * } */ export interface SwapPlanRequest { - /** - * The ID of the subscription to swap the subscription plan for. - */ + /** The ID of the subscription to swap the subscription plan for. */ subscriptionId: string; /** * The ID of the new subscription plan variation. diff --git a/src/api/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts b/src/api/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts index 2f2e513e5..62a96480b 100644 --- a/src/api/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts +++ b/src/api/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -14,9 +12,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateSubscriptionRequest { - /** - * The ID of the subscription to update. - */ + /** The ID of the subscription to update. */ subscriptionId: string; /** * The subscription object containing the current version, and fields to update. diff --git a/src/api/resources/subscriptions/client/requests/index.ts b/src/api/resources/subscriptions/client/requests/index.ts index e79da906c..edcd52789 100644 --- a/src/api/resources/subscriptions/client/requests/index.ts +++ b/src/api/resources/subscriptions/client/requests/index.ts @@ -1,12 +1,12 @@ -export { type CreateSubscriptionRequest } from "./CreateSubscriptionRequest"; -export { type BulkSwapPlanRequest } from "./BulkSwapPlanRequest"; -export { type SearchSubscriptionsRequest } from "./SearchSubscriptionsRequest"; -export { type GetSubscriptionsRequest } from "./GetSubscriptionsRequest"; -export { type UpdateSubscriptionRequest } from "./UpdateSubscriptionRequest"; -export { type DeleteActionSubscriptionsRequest } from "./DeleteActionSubscriptionsRequest"; -export { type ChangeBillingAnchorDateRequest } from "./ChangeBillingAnchorDateRequest"; -export { type CancelSubscriptionsRequest } from "./CancelSubscriptionsRequest"; -export { type ListEventsSubscriptionsRequest } from "./ListEventsSubscriptionsRequest"; -export { type PauseSubscriptionRequest } from "./PauseSubscriptionRequest"; -export { type ResumeSubscriptionRequest } from "./ResumeSubscriptionRequest"; -export { type SwapPlanRequest } from "./SwapPlanRequest"; +export type { BulkSwapPlanRequest } from "./BulkSwapPlanRequest"; +export type { CancelSubscriptionsRequest } from "./CancelSubscriptionsRequest"; +export type { ChangeBillingAnchorDateRequest } from "./ChangeBillingAnchorDateRequest"; +export type { CreateSubscriptionRequest } from "./CreateSubscriptionRequest"; +export type { DeleteActionSubscriptionsRequest } from "./DeleteActionSubscriptionsRequest"; +export type { GetSubscriptionsRequest } from "./GetSubscriptionsRequest"; +export type { ListEventsSubscriptionsRequest } from "./ListEventsSubscriptionsRequest"; +export type { PauseSubscriptionRequest } from "./PauseSubscriptionRequest"; +export type { ResumeSubscriptionRequest } from "./ResumeSubscriptionRequest"; +export type { SearchSubscriptionsRequest } from "./SearchSubscriptionsRequest"; +export type { SwapPlanRequest } from "./SwapPlanRequest"; +export type { UpdateSubscriptionRequest } from "./UpdateSubscriptionRequest"; diff --git a/src/api/resources/team/client/Client.ts b/src/api/resources/team/client/Client.ts index 0e86f4be0..507a70cf2 100644 --- a/src/api/resources/team/client/Client.ts +++ b/src/api/resources/team/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Team { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Team { @@ -68,9 +46,17 @@ export class Team { const { cursor } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -79,17 +65,10 @@ export class Team { "v2/team-members/jobs", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -157,6 +136,14 @@ export class Team { request: Square.CreateJobRequest, requestOptions?: Team.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -165,22 +152,16 @@ export class Team { "v2/team-members/jobs", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateJobRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -244,6 +225,14 @@ export class Team { requestOptions?: Team.RequestOptions, ): Promise> { const { jobId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -252,16 +241,10 @@ export class Team { `v2/team-members/jobs/${encodeURIComponent(jobId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -333,6 +316,14 @@ export class Team { requestOptions?: Team.RequestOptions, ): Promise> { const { jobId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -341,22 +332,16 @@ export class Team { `v2/team-members/jobs/${encodeURIComponent(jobId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateJobRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -400,7 +385,7 @@ export class Team { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/team/client/index.ts b/src/api/resources/team/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/team/client/index.ts +++ b/src/api/resources/team/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/team/client/requests/CreateJobRequest.ts b/src/api/resources/team/client/requests/CreateJobRequest.ts index 168657c5b..22f281a72 100644 --- a/src/api/resources/team/client/requests/CreateJobRequest.ts +++ b/src/api/resources/team/client/requests/CreateJobRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/team/client/requests/ListJobsRequest.ts b/src/api/resources/team/client/requests/ListJobsRequest.ts index 0202a0ebc..e7f9edc3e 100644 --- a/src/api/resources/team/client/requests/ListJobsRequest.ts +++ b/src/api/resources/team/client/requests/ListJobsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/team/client/requests/RetrieveJobRequest.ts b/src/api/resources/team/client/requests/RetrieveJobRequest.ts index a4b709eb1..8088ca5f2 100644 --- a/src/api/resources/team/client/requests/RetrieveJobRequest.ts +++ b/src/api/resources/team/client/requests/RetrieveJobRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface RetrieveJobRequest { - /** - * The ID of the job to retrieve. - */ + /** The ID of the job to retrieve. */ jobId: string; } diff --git a/src/api/resources/team/client/requests/UpdateJobRequest.ts b/src/api/resources/team/client/requests/UpdateJobRequest.ts index 2889c5bab..36a9aa5cf 100644 --- a/src/api/resources/team/client/requests/UpdateJobRequest.ts +++ b/src/api/resources/team/client/requests/UpdateJobRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -15,9 +13,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateJobRequest { - /** - * The ID of the job to update. - */ + /** The ID of the job to update. */ jobId: string; /** * The job with the updated fields, either `title`, `is_tip_eligible`, or both. Only changed fields need diff --git a/src/api/resources/team/client/requests/index.ts b/src/api/resources/team/client/requests/index.ts index 1ade5cbcb..2201831df 100644 --- a/src/api/resources/team/client/requests/index.ts +++ b/src/api/resources/team/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type ListJobsRequest } from "./ListJobsRequest"; -export { type CreateJobRequest } from "./CreateJobRequest"; -export { type RetrieveJobRequest } from "./RetrieveJobRequest"; -export { type UpdateJobRequest } from "./UpdateJobRequest"; +export type { CreateJobRequest } from "./CreateJobRequest"; +export type { ListJobsRequest } from "./ListJobsRequest"; +export type { RetrieveJobRequest } from "./RetrieveJobRequest"; +export type { UpdateJobRequest } from "./UpdateJobRequest"; diff --git a/src/api/resources/teamMembers/client/Client.ts b/src/api/resources/teamMembers/client/Client.ts index 5bc1df3b1..213851fd6 100644 --- a/src/api/resources/teamMembers/client/Client.ts +++ b/src/api/resources/teamMembers/client/Client.ts @@ -1,40 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { WageSetting } from "../resources/wageSetting/client/Client"; export declare namespace TeamMembers { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class TeamMembers { @@ -107,6 +85,14 @@ export class TeamMembers { request: Square.CreateTeamMemberRequest, requestOptions?: TeamMembers.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -115,22 +101,16 @@ export class TeamMembers { "v2/team-members", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateTeamMemberRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -224,6 +204,14 @@ export class TeamMembers { request: Square.BatchCreateTeamMembersRequest, requestOptions?: TeamMembers.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -232,22 +220,16 @@ export class TeamMembers { "v2/team-members/bulk-create", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchCreateTeamMembersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -344,6 +326,14 @@ export class TeamMembers { request: Square.BatchUpdateTeamMembersRequest, requestOptions?: TeamMembers.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -352,22 +342,16 @@ export class TeamMembers { "v2/team-members/bulk-update", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchUpdateTeamMembersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -438,6 +422,14 @@ export class TeamMembers { request: Square.SearchTeamMembersRequest = {}, requestOptions?: TeamMembers.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -446,22 +438,16 @@ export class TeamMembers { "v2/team-members/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchTeamMembersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -526,6 +512,14 @@ export class TeamMembers { requestOptions?: TeamMembers.RequestOptions, ): Promise> { const { teamMemberId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -534,16 +528,10 @@ export class TeamMembers { `v2/team-members/${encodeURIComponent(teamMemberId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -643,6 +631,14 @@ export class TeamMembers { requestOptions?: TeamMembers.RequestOptions, ): Promise> { const { teamMemberId, body: _body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -651,22 +647,16 @@ export class TeamMembers { `v2/team-members/${encodeURIComponent(teamMemberId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateTeamMemberRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -710,7 +700,7 @@ export class TeamMembers { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/teamMembers/client/index.ts b/src/api/resources/teamMembers/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/teamMembers/client/index.ts +++ b/src/api/resources/teamMembers/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts b/src/api/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts index b14d89bb5..1a9433502 100644 --- a/src/api/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts +++ b/src/api/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts b/src/api/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts index a29378d92..1821c3040 100644 --- a/src/api/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts +++ b/src/api/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/teamMembers/client/requests/GetTeamMembersRequest.ts b/src/api/resources/teamMembers/client/requests/GetTeamMembersRequest.ts index a8b345f61..e3c930549 100644 --- a/src/api/resources/teamMembers/client/requests/GetTeamMembersRequest.ts +++ b/src/api/resources/teamMembers/client/requests/GetTeamMembersRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetTeamMembersRequest { - /** - * The ID of the team member to retrieve. - */ + /** The ID of the team member to retrieve. */ teamMemberId: string; } diff --git a/src/api/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts b/src/api/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts index 2e097261d..c79733dc7 100644 --- a/src/api/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts +++ b/src/api/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/teamMembers/client/requests/UpdateTeamMembersRequest.ts b/src/api/resources/teamMembers/client/requests/UpdateTeamMembersRequest.ts index 7c8339675..b85d339f5 100644 --- a/src/api/resources/teamMembers/client/requests/UpdateTeamMembersRequest.ts +++ b/src/api/resources/teamMembers/client/requests/UpdateTeamMembersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -44,9 +42,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateTeamMembersRequest { - /** - * The ID of the team member to update. - */ + /** The ID of the team member to update. */ teamMemberId: string; body: Square.UpdateTeamMemberRequest; } diff --git a/src/api/resources/teamMembers/client/requests/index.ts b/src/api/resources/teamMembers/client/requests/index.ts index 64e675afc..499dfd8c1 100644 --- a/src/api/resources/teamMembers/client/requests/index.ts +++ b/src/api/resources/teamMembers/client/requests/index.ts @@ -1,5 +1,5 @@ -export { type BatchCreateTeamMembersRequest } from "./BatchCreateTeamMembersRequest"; -export { type BatchUpdateTeamMembersRequest } from "./BatchUpdateTeamMembersRequest"; -export { type SearchTeamMembersRequest } from "./SearchTeamMembersRequest"; -export { type GetTeamMembersRequest } from "./GetTeamMembersRequest"; -export { type UpdateTeamMembersRequest } from "./UpdateTeamMembersRequest"; +export type { BatchCreateTeamMembersRequest } from "./BatchCreateTeamMembersRequest"; +export type { BatchUpdateTeamMembersRequest } from "./BatchUpdateTeamMembersRequest"; +export type { GetTeamMembersRequest } from "./GetTeamMembersRequest"; +export type { SearchTeamMembersRequest } from "./SearchTeamMembersRequest"; +export type { UpdateTeamMembersRequest } from "./UpdateTeamMembersRequest"; diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts b/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts index eed114e5f..9dc66faf2 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace WageSetting { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class WageSetting { @@ -71,6 +49,14 @@ export class WageSetting { requestOptions?: WageSetting.RequestOptions, ): Promise> { const { teamMemberId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -79,16 +65,10 @@ export class WageSetting { `v2/team-members/${encodeURIComponent(teamMemberId)}/wage-setting`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -180,6 +160,14 @@ export class WageSetting { requestOptions?: WageSetting.RequestOptions, ): Promise> { const { teamMemberId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -188,22 +176,16 @@ export class WageSetting { `v2/team-members/${encodeURIComponent(teamMemberId)}/wage-setting`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.teamMembers.UpdateWageSettingRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -247,7 +229,7 @@ export class WageSetting { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/index.ts b/src/api/resources/teamMembers/resources/wageSetting/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/index.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/requests/GetWageSettingRequest.ts b/src/api/resources/teamMembers/resources/wageSetting/client/requests/GetWageSettingRequest.ts index 81df49508..b67341f8f 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/requests/GetWageSettingRequest.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/requests/GetWageSettingRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetWageSettingRequest { - /** - * The ID of the team member for which to retrieve the wage setting. - */ + /** The ID of the team member for which to retrieve the wage setting. */ teamMemberId: string; } diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts b/src/api/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts index b352121a3..a8c1df38f 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -30,9 +28,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateWageSettingRequest { - /** - * The ID of the team member for which to update the `WageSetting` object. - */ + /** The ID of the team member for which to update the `WageSetting` object. */ teamMemberId: string; /** * The complete `WageSetting` object. For all job assignments, specify one of the following: diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/requests/index.ts b/src/api/resources/teamMembers/resources/wageSetting/client/requests/index.ts index 68850acfa..fa5ad7a7d 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/requests/index.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/requests/index.ts @@ -1,2 +1,2 @@ -export { type GetWageSettingRequest } from "./GetWageSettingRequest"; -export { type UpdateWageSettingRequest } from "./UpdateWageSettingRequest"; +export type { GetWageSettingRequest } from "./GetWageSettingRequest"; +export type { UpdateWageSettingRequest } from "./UpdateWageSettingRequest"; diff --git a/src/api/resources/terminal/client/Client.ts b/src/api/resources/terminal/client/Client.ts index d436cce33..28ea944d9 100644 --- a/src/api/resources/terminal/client/Client.ts +++ b/src/api/resources/terminal/client/Client.ts @@ -1,42 +1,20 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; import { Actions } from "../resources/actions/client/Client"; import { Checkouts } from "../resources/checkouts/client/Client"; import { Refunds } from "../resources/refunds/client/Client"; export declare namespace Terminal { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Terminal { @@ -86,6 +64,14 @@ export class Terminal { requestOptions?: Terminal.RequestOptions, ): Promise> { const { actionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -94,16 +80,10 @@ export class Terminal { `v2/terminals/actions/${encodeURIComponent(actionId)}/dismiss`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -169,6 +149,14 @@ export class Terminal { requestOptions?: Terminal.RequestOptions, ): Promise> { const { checkoutId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -177,16 +165,10 @@ export class Terminal { `v2/terminals/checkouts/${encodeURIComponent(checkoutId)}/dismiss`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -252,6 +234,14 @@ export class Terminal { requestOptions?: Terminal.RequestOptions, ): Promise> { const { terminalRefundId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -260,16 +250,10 @@ export class Terminal { `v2/terminals/refunds/${encodeURIComponent(terminalRefundId)}/dismiss`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -313,7 +297,7 @@ export class Terminal { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/terminal/client/index.ts b/src/api/resources/terminal/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/terminal/client/index.ts +++ b/src/api/resources/terminal/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/terminal/client/requests/DismissTerminalActionRequest.ts b/src/api/resources/terminal/client/requests/DismissTerminalActionRequest.ts index 950b3ab0c..34d00e7e1 100644 --- a/src/api/resources/terminal/client/requests/DismissTerminalActionRequest.ts +++ b/src/api/resources/terminal/client/requests/DismissTerminalActionRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DismissTerminalActionRequest { - /** - * Unique ID for the `TerminalAction` associated with the action to be dismissed. - */ + /** Unique ID for the `TerminalAction` associated with the action to be dismissed. */ actionId: string; } diff --git a/src/api/resources/terminal/client/requests/DismissTerminalCheckoutRequest.ts b/src/api/resources/terminal/client/requests/DismissTerminalCheckoutRequest.ts index 3ff7298a2..3dc136868 100644 --- a/src/api/resources/terminal/client/requests/DismissTerminalCheckoutRequest.ts +++ b/src/api/resources/terminal/client/requests/DismissTerminalCheckoutRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DismissTerminalCheckoutRequest { - /** - * Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed. - */ + /** Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed. */ checkoutId: string; } diff --git a/src/api/resources/terminal/client/requests/DismissTerminalRefundRequest.ts b/src/api/resources/terminal/client/requests/DismissTerminalRefundRequest.ts index 699bf5b40..7b0448f78 100644 --- a/src/api/resources/terminal/client/requests/DismissTerminalRefundRequest.ts +++ b/src/api/resources/terminal/client/requests/DismissTerminalRefundRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DismissTerminalRefundRequest { - /** - * Unique ID for the `TerminalRefund` associated with the refund to be dismissed. - */ + /** Unique ID for the `TerminalRefund` associated with the refund to be dismissed. */ terminalRefundId: string; } diff --git a/src/api/resources/terminal/client/requests/index.ts b/src/api/resources/terminal/client/requests/index.ts index f3e44661a..8cf2ece59 100644 --- a/src/api/resources/terminal/client/requests/index.ts +++ b/src/api/resources/terminal/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type DismissTerminalActionRequest } from "./DismissTerminalActionRequest"; -export { type DismissTerminalCheckoutRequest } from "./DismissTerminalCheckoutRequest"; -export { type DismissTerminalRefundRequest } from "./DismissTerminalRefundRequest"; +export type { DismissTerminalActionRequest } from "./DismissTerminalActionRequest"; +export type { DismissTerminalCheckoutRequest } from "./DismissTerminalCheckoutRequest"; +export type { DismissTerminalRefundRequest } from "./DismissTerminalRefundRequest"; diff --git a/src/api/resources/terminal/resources/actions/client/Client.ts b/src/api/resources/terminal/resources/actions/client/Client.ts index 443e2a991..56d57b17f 100644 --- a/src/api/resources/terminal/resources/actions/client/Client.ts +++ b/src/api/resources/terminal/resources/actions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Actions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Actions { @@ -74,6 +52,14 @@ export class Actions { request: Square.terminal.CreateTerminalActionRequest, requestOptions?: Actions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -82,22 +68,16 @@ export class Actions { "v2/terminals/actions", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.CreateTerminalActionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -170,6 +150,14 @@ export class Actions { request: Square.terminal.SearchTerminalActionsRequest = {}, requestOptions?: Actions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -178,22 +166,16 @@ export class Actions { "v2/terminals/actions/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.SearchTerminalActionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -257,6 +239,14 @@ export class Actions { requestOptions?: Actions.RequestOptions, ): Promise> { const { actionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -265,16 +255,10 @@ export class Actions { `v2/terminals/actions/${encodeURIComponent(actionId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -340,6 +324,14 @@ export class Actions { requestOptions?: Actions.RequestOptions, ): Promise> { const { actionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -348,16 +340,10 @@ export class Actions { `v2/terminals/actions/${encodeURIComponent(actionId)}/cancel`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -401,7 +387,7 @@ export class Actions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/terminal/resources/actions/client/index.ts b/src/api/resources/terminal/resources/actions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/terminal/resources/actions/client/index.ts +++ b/src/api/resources/terminal/resources/actions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/terminal/resources/actions/client/requests/CancelActionsRequest.ts b/src/api/resources/terminal/resources/actions/client/requests/CancelActionsRequest.ts index e37d98233..466d543a5 100644 --- a/src/api/resources/terminal/resources/actions/client/requests/CancelActionsRequest.ts +++ b/src/api/resources/terminal/resources/actions/client/requests/CancelActionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface CancelActionsRequest { - /** - * Unique ID for the desired `TerminalAction`. - */ + /** Unique ID for the desired `TerminalAction`. */ actionId: string; } diff --git a/src/api/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts b/src/api/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts index 95d1c87d1..5017c0735 100644 --- a/src/api/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts +++ b/src/api/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/actions/client/requests/GetActionsRequest.ts b/src/api/resources/terminal/resources/actions/client/requests/GetActionsRequest.ts index 68e93ee26..57101abdf 100644 --- a/src/api/resources/terminal/resources/actions/client/requests/GetActionsRequest.ts +++ b/src/api/resources/terminal/resources/actions/client/requests/GetActionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetActionsRequest { - /** - * Unique ID for the desired `TerminalAction`. - */ + /** Unique ID for the desired `TerminalAction`. */ actionId: string; } diff --git a/src/api/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts b/src/api/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts index 7b4697a8e..1539787b4 100644 --- a/src/api/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts +++ b/src/api/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/actions/client/requests/index.ts b/src/api/resources/terminal/resources/actions/client/requests/index.ts index 1f4d52c70..b57544067 100644 --- a/src/api/resources/terminal/resources/actions/client/requests/index.ts +++ b/src/api/resources/terminal/resources/actions/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type CreateTerminalActionRequest } from "./CreateTerminalActionRequest"; -export { type SearchTerminalActionsRequest } from "./SearchTerminalActionsRequest"; -export { type GetActionsRequest } from "./GetActionsRequest"; -export { type CancelActionsRequest } from "./CancelActionsRequest"; +export type { CancelActionsRequest } from "./CancelActionsRequest"; +export type { CreateTerminalActionRequest } from "./CreateTerminalActionRequest"; +export type { GetActionsRequest } from "./GetActionsRequest"; +export type { SearchTerminalActionsRequest } from "./SearchTerminalActionsRequest"; diff --git a/src/api/resources/terminal/resources/checkouts/client/Client.ts b/src/api/resources/terminal/resources/checkouts/client/Client.ts index cb73ce7ac..bb375c30b 100644 --- a/src/api/resources/terminal/resources/checkouts/client/Client.ts +++ b/src/api/resources/terminal/resources/checkouts/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Checkouts { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Checkouts { @@ -77,6 +55,14 @@ export class Checkouts { request: Square.terminal.CreateTerminalCheckoutRequest, requestOptions?: Checkouts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -85,22 +71,16 @@ export class Checkouts { "v2/terminals/checkouts", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.CreateTerminalCheckoutRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -168,6 +148,14 @@ export class Checkouts { request: Square.terminal.SearchTerminalCheckoutsRequest = {}, requestOptions?: Checkouts.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -176,22 +164,16 @@ export class Checkouts { "v2/terminals/checkouts/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.SearchTerminalCheckoutsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -257,6 +239,14 @@ export class Checkouts { requestOptions?: Checkouts.RequestOptions, ): Promise> { const { checkoutId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -265,16 +255,10 @@ export class Checkouts { `v2/terminals/checkouts/${encodeURIComponent(checkoutId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -340,6 +324,14 @@ export class Checkouts { requestOptions?: Checkouts.RequestOptions, ): Promise> { const { checkoutId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -348,16 +340,10 @@ export class Checkouts { `v2/terminals/checkouts/${encodeURIComponent(checkoutId)}/cancel`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -401,7 +387,7 @@ export class Checkouts { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/terminal/resources/checkouts/client/index.ts b/src/api/resources/terminal/resources/checkouts/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/terminal/resources/checkouts/client/index.ts +++ b/src/api/resources/terminal/resources/checkouts/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/terminal/resources/checkouts/client/requests/CancelCheckoutsRequest.ts b/src/api/resources/terminal/resources/checkouts/client/requests/CancelCheckoutsRequest.ts index a346b1067..453a6e61a 100644 --- a/src/api/resources/terminal/resources/checkouts/client/requests/CancelCheckoutsRequest.ts +++ b/src/api/resources/terminal/resources/checkouts/client/requests/CancelCheckoutsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface CancelCheckoutsRequest { - /** - * The unique ID for the desired `TerminalCheckout`. - */ + /** The unique ID for the desired `TerminalCheckout`. */ checkoutId: string; } diff --git a/src/api/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts b/src/api/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts index a07279878..12f74d5af 100644 --- a/src/api/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts +++ b/src/api/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/checkouts/client/requests/GetCheckoutsRequest.ts b/src/api/resources/terminal/resources/checkouts/client/requests/GetCheckoutsRequest.ts index 83f26ef56..7e683baec 100644 --- a/src/api/resources/terminal/resources/checkouts/client/requests/GetCheckoutsRequest.ts +++ b/src/api/resources/terminal/resources/checkouts/client/requests/GetCheckoutsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetCheckoutsRequest { - /** - * The unique ID for the desired `TerminalCheckout`. - */ + /** The unique ID for the desired `TerminalCheckout`. */ checkoutId: string; } diff --git a/src/api/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts b/src/api/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts index 06ef4a3d5..3593cdd9b 100644 --- a/src/api/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts +++ b/src/api/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/checkouts/client/requests/index.ts b/src/api/resources/terminal/resources/checkouts/client/requests/index.ts index 5ef9dcb34..9447f39ad 100644 --- a/src/api/resources/terminal/resources/checkouts/client/requests/index.ts +++ b/src/api/resources/terminal/resources/checkouts/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type CreateTerminalCheckoutRequest } from "./CreateTerminalCheckoutRequest"; -export { type SearchTerminalCheckoutsRequest } from "./SearchTerminalCheckoutsRequest"; -export { type GetCheckoutsRequest } from "./GetCheckoutsRequest"; -export { type CancelCheckoutsRequest } from "./CancelCheckoutsRequest"; +export type { CancelCheckoutsRequest } from "./CancelCheckoutsRequest"; +export type { CreateTerminalCheckoutRequest } from "./CreateTerminalCheckoutRequest"; +export type { GetCheckoutsRequest } from "./GetCheckoutsRequest"; +export type { SearchTerminalCheckoutsRequest } from "./SearchTerminalCheckoutsRequest"; diff --git a/src/api/resources/terminal/resources/index.ts b/src/api/resources/terminal/resources/index.ts index 9c6d9980c..0a902a361 100644 --- a/src/api/resources/terminal/resources/index.ts +++ b/src/api/resources/terminal/resources/index.ts @@ -1,6 +1,6 @@ export * as actions from "./actions"; -export * as checkouts from "./checkouts"; -export * as refunds from "./refunds"; export * from "./actions/client/requests"; +export * as checkouts from "./checkouts"; export * from "./checkouts/client/requests"; +export * as refunds from "./refunds"; export * from "./refunds/client/requests"; diff --git a/src/api/resources/terminal/resources/refunds/client/Client.ts b/src/api/resources/terminal/resources/refunds/client/Client.ts index 1c874fa13..dcc965276 100644 --- a/src/api/resources/terminal/resources/refunds/client/Client.ts +++ b/src/api/resources/terminal/resources/refunds/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Refunds { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Refunds { @@ -74,6 +52,14 @@ export class Refunds { request: Square.terminal.CreateTerminalRefundRequest, requestOptions?: Refunds.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -82,22 +68,16 @@ export class Refunds { "v2/terminals/refunds", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.CreateTerminalRefundRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -165,6 +145,14 @@ export class Refunds { request: Square.terminal.SearchTerminalRefundsRequest = {}, requestOptions?: Refunds.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -173,22 +161,16 @@ export class Refunds { "v2/terminals/refunds/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.SearchTerminalRefundsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -252,6 +234,14 @@ export class Refunds { requestOptions?: Refunds.RequestOptions, ): Promise> { const { terminalRefundId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -260,16 +250,10 @@ export class Refunds { `v2/terminals/refunds/${encodeURIComponent(terminalRefundId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -335,6 +319,14 @@ export class Refunds { requestOptions?: Refunds.RequestOptions, ): Promise> { const { terminalRefundId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -343,16 +335,10 @@ export class Refunds { `v2/terminals/refunds/${encodeURIComponent(terminalRefundId)}/cancel`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -396,7 +382,7 @@ export class Refunds { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/terminal/resources/refunds/client/index.ts b/src/api/resources/terminal/resources/refunds/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/terminal/resources/refunds/client/index.ts +++ b/src/api/resources/terminal/resources/refunds/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/terminal/resources/refunds/client/requests/CancelRefundsRequest.ts b/src/api/resources/terminal/resources/refunds/client/requests/CancelRefundsRequest.ts index 250a548ff..89b889f9f 100644 --- a/src/api/resources/terminal/resources/refunds/client/requests/CancelRefundsRequest.ts +++ b/src/api/resources/terminal/resources/refunds/client/requests/CancelRefundsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface CancelRefundsRequest { - /** - * The unique ID for the desired `TerminalRefund`. - */ + /** The unique ID for the desired `TerminalRefund`. */ terminalRefundId: string; } diff --git a/src/api/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts b/src/api/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts index c6389887c..88c42331b 100644 --- a/src/api/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts +++ b/src/api/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/refunds/client/requests/GetRefundsRequest.ts b/src/api/resources/terminal/resources/refunds/client/requests/GetRefundsRequest.ts index 784c1cd2e..065a6dbc7 100644 --- a/src/api/resources/terminal/resources/refunds/client/requests/GetRefundsRequest.ts +++ b/src/api/resources/terminal/resources/refunds/client/requests/GetRefundsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetRefundsRequest { - /** - * The unique ID for the desired `TerminalRefund`. - */ + /** The unique ID for the desired `TerminalRefund`. */ terminalRefundId: string; } diff --git a/src/api/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts b/src/api/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts index 22f190f62..c8e6ced61 100644 --- a/src/api/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts +++ b/src/api/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/refunds/client/requests/index.ts b/src/api/resources/terminal/resources/refunds/client/requests/index.ts index d076a5792..ee75aecdc 100644 --- a/src/api/resources/terminal/resources/refunds/client/requests/index.ts +++ b/src/api/resources/terminal/resources/refunds/client/requests/index.ts @@ -1,4 +1,4 @@ -export { type CreateTerminalRefundRequest } from "./CreateTerminalRefundRequest"; -export { type SearchTerminalRefundsRequest } from "./SearchTerminalRefundsRequest"; -export { type GetRefundsRequest } from "./GetRefundsRequest"; -export { type CancelRefundsRequest } from "./CancelRefundsRequest"; +export type { CancelRefundsRequest } from "./CancelRefundsRequest"; +export type { CreateTerminalRefundRequest } from "./CreateTerminalRefundRequest"; +export type { GetRefundsRequest } from "./GetRefundsRequest"; +export type { SearchTerminalRefundsRequest } from "./SearchTerminalRefundsRequest"; diff --git a/src/api/resources/transferOrders/client/Client.ts b/src/api/resources/transferOrders/client/Client.ts index ea4b0ebf1..945e4e6c7 100644 --- a/src/api/resources/transferOrders/client/Client.ts +++ b/src/api/resources/transferOrders/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace TransferOrders { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class TransferOrders { @@ -99,6 +77,14 @@ export class TransferOrders { request: Square.CreateTransferOrderRequest, requestOptions?: TransferOrders.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -107,22 +93,16 @@ export class TransferOrders { "v2/transfer-orders", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateTransferOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -200,6 +180,14 @@ export class TransferOrders { async ( request: Square.SearchTransferOrdersRequest, ): Promise> => { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -208,23 +196,16 @@ export class TransferOrders { "v2/transfer-orders/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchTransferOrdersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -307,6 +288,14 @@ export class TransferOrders { requestOptions?: TransferOrders.RequestOptions, ): Promise> { const { transferOrderId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -315,16 +304,10 @@ export class TransferOrders { `v2/transfer-orders/${encodeURIComponent(transferOrderId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -412,6 +395,14 @@ export class TransferOrders { requestOptions?: TransferOrders.RequestOptions, ): Promise> { const { transferOrderId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -420,22 +411,16 @@ export class TransferOrders { `v2/transfer-orders/${encodeURIComponent(transferOrderId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateTransferOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -508,9 +493,17 @@ export class TransferOrders { const { transferOrderId, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams["version"] = version?.toString() ?? null; + _queryParams.version = version?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -519,17 +512,10 @@ export class TransferOrders { `v2/transfer-orders/${encodeURIComponent(transferOrderId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -606,6 +592,14 @@ export class TransferOrders { requestOptions?: TransferOrders.RequestOptions, ): Promise> { const { transferOrderId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -614,22 +608,16 @@ export class TransferOrders { `v2/transfer-orders/${encodeURIComponent(transferOrderId)}/cancel`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CancelTransferOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -724,6 +712,14 @@ export class TransferOrders { requestOptions?: TransferOrders.RequestOptions, ): Promise> { const { transferOrderId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -732,22 +728,16 @@ export class TransferOrders { `v2/transfer-orders/${encodeURIComponent(transferOrderId)}/receive`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ReceiveTransferOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -822,6 +812,14 @@ export class TransferOrders { requestOptions?: TransferOrders.RequestOptions, ): Promise> { const { transferOrderId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -830,22 +828,16 @@ export class TransferOrders { `v2/transfer-orders/${encodeURIComponent(transferOrderId)}/start`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.StartTransferOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -889,7 +881,7 @@ export class TransferOrders { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/transferOrders/client/index.ts b/src/api/resources/transferOrders/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/transferOrders/client/index.ts +++ b/src/api/resources/transferOrders/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts index 0f9610db4..f5228a95e 100644 --- a/src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts +++ b/src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,9 +9,7 @@ * } */ export interface CancelTransferOrderRequest { - /** - * The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status. - */ + /** The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status. */ transferOrderId: string; /** * A unique string that identifies this UpdateTransferOrder request. Keys can be diff --git a/src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts index faba51024..ca5c039b8 100644 --- a/src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts +++ b/src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts b/src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts index 06b9d4593..8f429adb2 100644 --- a/src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts +++ b/src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface DeleteTransferOrdersRequest { - /** - * The ID of the transfer order to delete - */ + /** The ID of the transfer order to delete */ transferOrderId: string; - /** - * Version for optimistic concurrency - */ + /** Version for optimistic concurrency */ version?: bigint | null; } diff --git a/src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts b/src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts index 63f1481de..3959a05f7 100644 --- a/src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts +++ b/src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetTransferOrdersRequest { - /** - * The ID of the transfer order to retrieve - */ + /** The ID of the transfer order to retrieve */ transferOrderId: string; } diff --git a/src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts index d7786a107..8b3bb7497 100644 --- a/src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts +++ b/src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -25,9 +23,7 @@ import * as Square from "../../../../index"; * } */ export interface ReceiveTransferOrderRequest { - /** - * The ID of the transfer order to receive items for - */ + /** The ID of the transfer order to receive items for */ transferOrderId: string; /** A unique key to make this request idempotent */ idempotencyKey: string; diff --git a/src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts b/src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts index 1dd02b62c..86f9a89ef 100644 --- a/src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts +++ b/src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts index cad5a9131..a3f56bece 100644 --- a/src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts +++ b/src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -11,9 +9,7 @@ * } */ export interface StartTransferOrderRequest { - /** - * The ID of the transfer order to start. Must be in DRAFT status. - */ + /** The ID of the transfer order to start. Must be in DRAFT status. */ transferOrderId: string; /** * A unique string that identifies this UpdateTransferOrder request. Keys can be diff --git a/src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts index 2882b1415..ec881fe67 100644 --- a/src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts +++ b/src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -30,9 +28,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateTransferOrderRequest { - /** - * The ID of the transfer order to update - */ + /** The ID of the transfer order to update */ transferOrderId: string; /** A unique string that identifies this UpdateTransferOrder request. Keys must contain only alphanumeric characters, dashes and underscores */ idempotencyKey: string; diff --git a/src/api/resources/transferOrders/client/requests/index.ts b/src/api/resources/transferOrders/client/requests/index.ts index f984bc5f1..c0324f7bc 100644 --- a/src/api/resources/transferOrders/client/requests/index.ts +++ b/src/api/resources/transferOrders/client/requests/index.ts @@ -1,8 +1,8 @@ -export { type CreateTransferOrderRequest } from "./CreateTransferOrderRequest"; -export { type SearchTransferOrdersRequest } from "./SearchTransferOrdersRequest"; -export { type GetTransferOrdersRequest } from "./GetTransferOrdersRequest"; -export { type UpdateTransferOrderRequest } from "./UpdateTransferOrderRequest"; -export { type DeleteTransferOrdersRequest } from "./DeleteTransferOrdersRequest"; -export { type CancelTransferOrderRequest } from "./CancelTransferOrderRequest"; -export { type ReceiveTransferOrderRequest } from "./ReceiveTransferOrderRequest"; -export { type StartTransferOrderRequest } from "./StartTransferOrderRequest"; +export type { CancelTransferOrderRequest } from "./CancelTransferOrderRequest"; +export type { CreateTransferOrderRequest } from "./CreateTransferOrderRequest"; +export type { DeleteTransferOrdersRequest } from "./DeleteTransferOrdersRequest"; +export type { GetTransferOrdersRequest } from "./GetTransferOrdersRequest"; +export type { ReceiveTransferOrderRequest } from "./ReceiveTransferOrderRequest"; +export type { SearchTransferOrdersRequest } from "./SearchTransferOrdersRequest"; +export type { StartTransferOrderRequest } from "./StartTransferOrderRequest"; +export type { UpdateTransferOrderRequest } from "./UpdateTransferOrderRequest"; diff --git a/src/api/resources/v1Transactions/client/Client.ts b/src/api/resources/v1Transactions/client/Client.ts index feb0094bb..065e977ad 100644 --- a/src/api/resources/v1Transactions/client/Client.ts +++ b/src/api/resources/v1Transactions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; -import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace V1Transactions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class V1Transactions { @@ -71,20 +49,28 @@ export class V1Transactions { const { locationId, order, limit, batchToken } = request; const _queryParams: Record = {}; if (order !== undefined) { - _queryParams["order"] = serializers.SortOrder.jsonOrThrow(order, { + _queryParams.order = serializers.SortOrder.jsonOrThrow(order, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } if (batchToken !== undefined) { - _queryParams["batch_token"] = batchToken; + _queryParams.batch_token = batchToken; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -93,17 +79,10 @@ export class V1Transactions { `v1/${encodeURIComponent(locationId)}/orders`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -168,6 +147,14 @@ export class V1Transactions { requestOptions?: V1Transactions.RequestOptions, ): Promise> { const { locationId, orderId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -176,16 +163,10 @@ export class V1Transactions { `v1/${encodeURIComponent(locationId)}/orders/${encodeURIComponent(orderId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -253,6 +234,14 @@ export class V1Transactions { requestOptions?: V1Transactions.RequestOptions, ): Promise> { const { locationId, orderId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -261,22 +250,16 @@ export class V1Transactions { `v1/${encodeURIComponent(locationId)}/orders/${encodeURIComponent(orderId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.V1UpdateOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -320,7 +303,7 @@ export class V1Transactions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/v1Transactions/client/index.ts b/src/api/resources/v1Transactions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/v1Transactions/client/index.ts +++ b/src/api/resources/v1Transactions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts b/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts index b485a1a5f..7913709bc 100644 --- a/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts +++ b/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -14,17 +12,11 @@ import * as Square from "../../../../index"; * } */ export interface V1ListOrdersRequest { - /** - * The ID of the location to list online store orders for. - */ + /** The ID of the location to list online store orders for. */ locationId: string; - /** - * The order in which payments are listed in the response. - */ + /** The order in which payments are listed in the response. */ order?: Square.SortOrder | null; - /** - * The maximum number of payments to return in a single response. This value cannot exceed 200. - */ + /** The maximum number of payments to return in a single response. This value cannot exceed 200. */ limit?: number | null; /** * A pagination cursor to retrieve the next set of results for your diff --git a/src/api/resources/v1Transactions/client/requests/V1RetrieveOrderRequest.ts b/src/api/resources/v1Transactions/client/requests/V1RetrieveOrderRequest.ts index cdc38ad36..749f2cc00 100644 --- a/src/api/resources/v1Transactions/client/requests/V1RetrieveOrderRequest.ts +++ b/src/api/resources/v1Transactions/client/requests/V1RetrieveOrderRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,12 +8,8 @@ * } */ export interface V1RetrieveOrderRequest { - /** - * The ID of the order's associated location. - */ + /** The ID of the order's associated location. */ locationId: string; - /** - * The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint - */ + /** The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint */ orderId: string; } diff --git a/src/api/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts b/src/api/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts index 29b41dae6..47073e210 100644 --- a/src/api/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts +++ b/src/api/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -13,13 +11,9 @@ import * as Square from "../../../../index"; * } */ export interface V1UpdateOrderRequest { - /** - * The ID of the order's associated location. - */ + /** The ID of the order's associated location. */ locationId: string; - /** - * The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint - */ + /** The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint */ orderId: string; /** * The action to perform on the order (COMPLETE, CANCEL, or REFUND). diff --git a/src/api/resources/v1Transactions/client/requests/index.ts b/src/api/resources/v1Transactions/client/requests/index.ts index 0d77a3125..27b522a40 100644 --- a/src/api/resources/v1Transactions/client/requests/index.ts +++ b/src/api/resources/v1Transactions/client/requests/index.ts @@ -1,3 +1,3 @@ -export { type V1ListOrdersRequest } from "./V1ListOrdersRequest"; -export { type V1RetrieveOrderRequest } from "./V1RetrieveOrderRequest"; -export { type V1UpdateOrderRequest } from "./V1UpdateOrderRequest"; +export type { V1ListOrdersRequest } from "./V1ListOrdersRequest"; +export type { V1RetrieveOrderRequest } from "./V1RetrieveOrderRequest"; +export type { V1UpdateOrderRequest } from "./V1UpdateOrderRequest"; diff --git a/src/api/resources/vendors/client/Client.ts b/src/api/resources/vendors/client/Client.ts index b9b5a2df7..1fdb4a3e6 100644 --- a/src/api/resources/vendors/client/Client.ts +++ b/src/api/resources/vendors/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import * as core from "../../../../core"; -import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as serializers from "../../../../serialization/index"; +import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../serialization/index"; +import type * as Square from "../../../index"; export declare namespace Vendors { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Vendors { @@ -85,6 +63,14 @@ export class Vendors { request: Square.BatchCreateVendorsRequest, requestOptions?: Vendors.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -93,22 +79,16 @@ export class Vendors { "v2/vendors/bulk-create", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchCreateVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -171,6 +151,14 @@ export class Vendors { request: Square.BatchGetVendorsRequest = {}, requestOptions?: Vendors.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -179,22 +167,16 @@ export class Vendors { "v2/vendors/bulk-retrieve", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchGetVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -264,6 +246,14 @@ export class Vendors { request: Square.BatchUpdateVendorsRequest, requestOptions?: Vendors.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -272,22 +262,16 @@ export class Vendors { "v2/vendors/bulk-update", ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchUpdateVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -369,6 +353,14 @@ export class Vendors { request: Square.CreateVendorRequest, requestOptions?: Vendors.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -377,22 +369,16 @@ export class Vendors { "v2/vendors/create", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateVendorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -453,6 +439,14 @@ export class Vendors { request: Square.SearchVendorsRequest = {}, requestOptions?: Vendors.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -461,22 +455,16 @@ export class Vendors { "v2/vendors/search", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -540,6 +528,14 @@ export class Vendors { requestOptions?: Vendors.RequestOptions, ): Promise> { const { vendorId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -548,16 +544,10 @@ export class Vendors { `v2/vendors/${encodeURIComponent(vendorId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -630,6 +620,14 @@ export class Vendors { requestOptions?: Vendors.RequestOptions, ): Promise> { const { vendorId, body: _body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -638,22 +636,16 @@ export class Vendors { `v2/vendors/${encodeURIComponent(vendorId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateVendorRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -695,7 +687,7 @@ export class Vendors { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/vendors/client/index.ts b/src/api/resources/vendors/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/vendors/client/index.ts +++ b/src/api/resources/vendors/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/vendors/client/requests/BatchCreateVendorsRequest.ts b/src/api/resources/vendors/client/requests/BatchCreateVendorsRequest.ts index 7137f0e8e..192cf92c5 100644 --- a/src/api/resources/vendors/client/requests/BatchCreateVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/BatchCreateVendorsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/vendors/client/requests/BatchGetVendorsRequest.ts b/src/api/resources/vendors/client/requests/BatchGetVendorsRequest.ts index 26dda1865..0da531abc 100644 --- a/src/api/resources/vendors/client/requests/BatchGetVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/BatchGetVendorsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example diff --git a/src/api/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts b/src/api/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts index 9af78e9eb..dc77bd25a 100644 --- a/src/api/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/vendors/client/requests/CreateVendorRequest.ts b/src/api/resources/vendors/client/requests/CreateVendorRequest.ts index 5af83d983..36c70f49a 100644 --- a/src/api/resources/vendors/client/requests/CreateVendorRequest.ts +++ b/src/api/resources/vendors/client/requests/CreateVendorRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/vendors/client/requests/GetVendorsRequest.ts b/src/api/resources/vendors/client/requests/GetVendorsRequest.ts index ac8bc8927..d36c6a790 100644 --- a/src/api/resources/vendors/client/requests/GetVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/GetVendorsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetVendorsRequest { - /** - * ID of the [Vendor](entity:Vendor) to retrieve. - */ + /** ID of the [Vendor](entity:Vendor) to retrieve. */ vendorId: string; } diff --git a/src/api/resources/vendors/client/requests/SearchVendorsRequest.ts b/src/api/resources/vendors/client/requests/SearchVendorsRequest.ts index 67d1ddc63..430634fe2 100644 --- a/src/api/resources/vendors/client/requests/SearchVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/SearchVendorsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/vendors/client/requests/UpdateVendorsRequest.ts b/src/api/resources/vendors/client/requests/UpdateVendorsRequest.ts index 912e5811f..b1b4eeb32 100644 --- a/src/api/resources/vendors/client/requests/UpdateVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/UpdateVendorsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../index"; +import type * as Square from "../../../../index"; /** * @example @@ -20,9 +18,7 @@ import * as Square from "../../../../index"; * } */ export interface UpdateVendorsRequest { - /** - * ID of the [Vendor](entity:Vendor) to retrieve. - */ + /** ID of the [Vendor](entity:Vendor) to retrieve. */ vendorId: string; body: Square.UpdateVendorRequest; } diff --git a/src/api/resources/vendors/client/requests/index.ts b/src/api/resources/vendors/client/requests/index.ts index 68fdae923..6b7ddb67a 100644 --- a/src/api/resources/vendors/client/requests/index.ts +++ b/src/api/resources/vendors/client/requests/index.ts @@ -1,7 +1,7 @@ -export { type BatchCreateVendorsRequest } from "./BatchCreateVendorsRequest"; -export { type BatchGetVendorsRequest } from "./BatchGetVendorsRequest"; -export { type BatchUpdateVendorsRequest } from "./BatchUpdateVendorsRequest"; -export { type CreateVendorRequest } from "./CreateVendorRequest"; -export { type SearchVendorsRequest } from "./SearchVendorsRequest"; -export { type GetVendorsRequest } from "./GetVendorsRequest"; -export { type UpdateVendorsRequest } from "./UpdateVendorsRequest"; +export type { BatchCreateVendorsRequest } from "./BatchCreateVendorsRequest"; +export type { BatchGetVendorsRequest } from "./BatchGetVendorsRequest"; +export type { BatchUpdateVendorsRequest } from "./BatchUpdateVendorsRequest"; +export type { CreateVendorRequest } from "./CreateVendorRequest"; +export type { GetVendorsRequest } from "./GetVendorsRequest"; +export type { SearchVendorsRequest } from "./SearchVendorsRequest"; +export type { UpdateVendorsRequest } from "./UpdateVendorsRequest"; diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index c0d48deaf..d2d50a94d 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -1,24 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../environments"; -import * as core from "../../../../core"; +import type { BaseClientOptions } from "../../../../BaseClient"; import { EventTypes } from "../resources/eventTypes/client/Client"; import { Subscriptions } from "../resources/subscriptions/client/Client"; export declare namespace Webhooks { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} } export class Webhooks { diff --git a/src/api/resources/webhooks/resources/eventTypes/client/Client.ts b/src/api/resources/webhooks/resources/eventTypes/client/Client.ts index 66b829363..c41034844 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/Client.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as serializers from "../../../../../../serialization/index"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace EventTypes { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class EventTypes { @@ -68,9 +46,17 @@ export class EventTypes { const { apiVersion } = request; const _queryParams: Record = {}; if (apiVersion !== undefined) { - _queryParams["api_version"] = apiVersion; + _queryParams.api_version = apiVersion; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -79,17 +65,10 @@ export class EventTypes { "v2/webhooks/event-types", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -131,7 +110,7 @@ export class EventTypes { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/webhooks/resources/eventTypes/client/index.ts b/src/api/resources/webhooks/resources/eventTypes/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/index.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts b/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts index dacf1b022..4b8cfb8d4 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface ListEventTypesRequest { - /** - * The API version for which to list event types. Setting this field overrides the default version used by the application. - */ + /** The API version for which to list event types. Setting this field overrides the default version used by the application. */ apiVersion?: string | null; } diff --git a/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts b/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts index 2e7e10bf3..6482bea3a 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts @@ -1 +1 @@ -export { type ListEventTypesRequest } from "./ListEventTypesRequest"; +export type { ListEventTypesRequest } from "./ListEventTypesRequest"; diff --git a/src/api/resources/webhooks/resources/index.ts b/src/api/resources/webhooks/resources/index.ts index f0cf7982d..d38891001 100644 --- a/src/api/resources/webhooks/resources/index.ts +++ b/src/api/resources/webhooks/resources/index.ts @@ -1,4 +1,4 @@ export * as eventTypes from "./eventTypes"; -export * as subscriptions from "./subscriptions"; export * from "./eventTypes/client/requests"; +export * as subscriptions from "./subscriptions"; export * from "./subscriptions/client/requests"; diff --git a/src/api/resources/webhooks/resources/subscriptions/client/Client.ts b/src/api/resources/webhooks/resources/subscriptions/client/Client.ts index c39e407b6..2a427b8e1 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/Client.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/Client.ts @@ -1,39 +1,17 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as environments from "../../../../../../environments"; +import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; import * as core from "../../../../../../core"; -import * as Square from "../../../../../index"; -import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import type * as Square from "../../../../../index"; export declare namespace Subscriptions { - export interface Options { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | undefined>; - fetcher?: core.FetchFunction; - } + export interface Options extends BaseClientOptions {} - export interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in the request. */ - headers?: Record | undefined>; - } + export interface RequestOptions extends BaseRequestOptions {} } export class Subscriptions { @@ -68,20 +46,28 @@ export class Subscriptions { const { cursor, includeDisabled, sortOrder, limit } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams["cursor"] = cursor; + _queryParams.cursor = cursor; } if (includeDisabled !== undefined) { - _queryParams["include_disabled"] = includeDisabled?.toString() ?? null; + _queryParams.include_disabled = includeDisabled?.toString() ?? null; } if (sortOrder !== undefined) { - _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams["limit"] = limit?.toString() ?? null; + _queryParams.limit = limit?.toString() ?? null; } + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -90,18 +76,10 @@ export class Subscriptions { "v2/webhooks/subscriptions", ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - queryParameters: _queryParams, - timeoutMs: - requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -183,6 +161,14 @@ export class Subscriptions { request: Square.webhooks.CreateWebhookSubscriptionRequest, requestOptions?: Subscriptions.RequestOptions, ): Promise> { + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -191,22 +177,16 @@ export class Subscriptions { "v2/webhooks/subscriptions", ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.webhooks.CreateWebhookSubscriptionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -270,6 +250,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -278,16 +266,10 @@ export class Subscriptions { `v2/webhooks/subscriptions/${encodeURIComponent(subscriptionId)}`, ), method: "GET", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -357,6 +339,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -365,22 +355,16 @@ export class Subscriptions { `v2/webhooks/subscriptions/${encodeURIComponent(subscriptionId)}`, ), method: "PUT", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.webhooks.UpdateWebhookSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -446,6 +430,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -454,16 +446,10 @@ export class Subscriptions { `v2/webhooks/subscriptions/${encodeURIComponent(subscriptionId)}`, ), method: "DELETE", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -530,6 +516,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -538,22 +532,16 @@ export class Subscriptions { `v2/webhooks/subscriptions/${encodeURIComponent(subscriptionId)}/signature-key`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -620,6 +608,14 @@ export class Subscriptions { requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -628,22 +624,16 @@ export class Subscriptions { `v2/webhooks/subscriptions/${encodeURIComponent(subscriptionId)}/test`, ), method: "POST", - headers: mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ), + headers: _headers, contentType: "application/json", + queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.webhooks.TestWebhookSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -687,7 +677,7 @@ export class Subscriptions { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/webhooks/resources/subscriptions/client/index.ts b/src/api/resources/webhooks/resources/subscriptions/client/index.ts index f33205a0f..415726b7f 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/index.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests"; diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts index 8b5233858..6203a96bd 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/DeleteSubscriptionsRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/DeleteSubscriptionsRequest.ts index e348ad484..de2b7e18d 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/DeleteSubscriptionsRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/DeleteSubscriptionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface DeleteSubscriptionsRequest { - /** - * [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to delete. - */ + /** [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to delete. */ subscriptionId: string; } diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts index fde07880e..febafeb9d 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -9,8 +7,6 @@ * } */ export interface GetSubscriptionsRequest { - /** - * [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to retrieve. - */ + /** [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to retrieve. */ subscriptionId: string; } diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts index 3507e8a2b..9f83667fd 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts index 2d08b14bb..1c4c4ba8c 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface TestWebhookSubscriptionRequest { - /** - * [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to test. - */ + /** [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to test. */ subscriptionId: string; /** * The event type that will be used to test the [Subscription](entity:WebhookSubscription). The event type must be diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts index 379f9f4e9..8359ec87c 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../../../../../../index"; +import type * as Square from "../../../../../../index"; /** * @example @@ -15,9 +13,7 @@ import * as Square from "../../../../../../index"; * } */ export interface UpdateWebhookSubscriptionRequest { - /** - * [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. - */ + /** [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. */ subscriptionId: string; /** The [Subscription](entity:WebhookSubscription) to update. */ subscription?: Square.WebhookSubscription; diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts index 3a61969f4..0d0d7e45b 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * @example @@ -10,9 +8,7 @@ * } */ export interface UpdateWebhookSubscriptionSignatureKeyRequest { - /** - * [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. - */ + /** [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. */ subscriptionId: string; /** A unique string that identifies the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) request. */ idempotencyKey?: string | null; diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/index.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/index.ts index f32c424a4..554524f6a 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/index.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/index.ts @@ -1,7 +1,7 @@ -export { type ListSubscriptionsRequest } from "./ListSubscriptionsRequest"; -export { type CreateWebhookSubscriptionRequest } from "./CreateWebhookSubscriptionRequest"; -export { type GetSubscriptionsRequest } from "./GetSubscriptionsRequest"; -export { type UpdateWebhookSubscriptionRequest } from "./UpdateWebhookSubscriptionRequest"; -export { type DeleteSubscriptionsRequest } from "./DeleteSubscriptionsRequest"; -export { type UpdateWebhookSubscriptionSignatureKeyRequest } from "./UpdateWebhookSubscriptionSignatureKeyRequest"; -export { type TestWebhookSubscriptionRequest } from "./TestWebhookSubscriptionRequest"; +export type { CreateWebhookSubscriptionRequest } from "./CreateWebhookSubscriptionRequest"; +export type { DeleteSubscriptionsRequest } from "./DeleteSubscriptionsRequest"; +export type { GetSubscriptionsRequest } from "./GetSubscriptionsRequest"; +export type { ListSubscriptionsRequest } from "./ListSubscriptionsRequest"; +export type { TestWebhookSubscriptionRequest } from "./TestWebhookSubscriptionRequest"; +export type { UpdateWebhookSubscriptionRequest } from "./UpdateWebhookSubscriptionRequest"; +export type { UpdateWebhookSubscriptionSignatureKeyRequest } from "./UpdateWebhookSubscriptionSignatureKeyRequest"; diff --git a/src/api/types/AcceptDisputeResponse.ts b/src/api/types/AcceptDisputeResponse.ts index 5cf8036d7..eb64ae625 100644 --- a/src/api/types/AcceptDisputeResponse.ts +++ b/src/api/types/AcceptDisputeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields in an `AcceptDispute` response. diff --git a/src/api/types/AcceptedPaymentMethods.ts b/src/api/types/AcceptedPaymentMethods.ts index 0c05ee8f3..78c1929c0 100644 --- a/src/api/types/AcceptedPaymentMethods.ts +++ b/src/api/types/AcceptedPaymentMethods.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface AcceptedPaymentMethods { /** Whether Apple Pay is accepted at checkout. */ diff --git a/src/api/types/AccumulateLoyaltyPointsResponse.ts b/src/api/types/AccumulateLoyaltyPointsResponse.ts index 524ee73d3..3595e437b 100644 --- a/src/api/types/AccumulateLoyaltyPointsResponse.ts +++ b/src/api/types/AccumulateLoyaltyPointsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) response. diff --git a/src/api/types/AchDetails.ts b/src/api/types/AchDetails.ts index cdf932f07..3eb96fe39 100644 --- a/src/api/types/AchDetails.ts +++ b/src/api/types/AchDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. diff --git a/src/api/types/ActionCancelReason.ts b/src/api/types/ActionCancelReason.ts index 1d1653a63..6fa5816b5 100644 --- a/src/api/types/ActionCancelReason.ts +++ b/src/api/types/ActionCancelReason.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type ActionCancelReason = "BUYER_CANCELED" | "SELLER_CANCELED" | "TIMED_OUT"; export const ActionCancelReason = { BuyerCanceled: "BUYER_CANCELED", SellerCanceled: "SELLER_CANCELED", TimedOut: "TIMED_OUT", } as const; +export type ActionCancelReason = (typeof ActionCancelReason)[keyof typeof ActionCancelReason]; diff --git a/src/api/types/ActivityType.ts b/src/api/types/ActivityType.ts index e31d2abb1..86d86082b 100644 --- a/src/api/types/ActivityType.ts +++ b/src/api/types/ActivityType.ts @@ -1,66 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type ActivityType = - | "ADJUSTMENT" - | "APP_FEE_REFUND" - | "APP_FEE_REVENUE" - | "AUTOMATIC_SAVINGS" - | "AUTOMATIC_SAVINGS_REVERSED" - | "CHARGE" - | "DEPOSIT_FEE" - | "DEPOSIT_FEE_REVERSED" - | "DISPUTE" - | "ESCHEATMENT" - | "FEE" - | "FREE_PROCESSING" - | "HOLD_ADJUSTMENT" - | "INITIAL_BALANCE_CHANGE" - | "MONEY_TRANSFER" - | "MONEY_TRANSFER_REVERSAL" - | "OPEN_DISPUTE" - | "OTHER" - | "OTHER_ADJUSTMENT" - | "PAID_SERVICE_FEE" - | "PAID_SERVICE_FEE_REFUND" - | "REDEMPTION_CODE" - | "REFUND" - | "RELEASE_ADJUSTMENT" - | "RESERVE_HOLD" - | "RESERVE_RELEASE" - | "RETURNED_PAYOUT" - | "SQUARE_CAPITAL_PAYMENT" - | "SQUARE_CAPITAL_REVERSED_PAYMENT" - | "SUBSCRIPTION_FEE" - | "SUBSCRIPTION_FEE_PAID_REFUND" - | "SUBSCRIPTION_FEE_REFUND" - | "TAX_ON_FEE" - | "THIRD_PARTY_FEE" - | "THIRD_PARTY_FEE_REFUND" - | "PAYOUT" - | "AUTOMATIC_BITCOIN_CONVERSIONS" - | "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED" - | "CREDIT_CARD_REPAYMENT" - | "CREDIT_CARD_REPAYMENT_REVERSED" - | "LOCAL_OFFERS_CASHBACK" - | "LOCAL_OFFERS_FEE" - | "PERCENTAGE_PROCESSING_ENROLLMENT" - | "PERCENTAGE_PROCESSING_DEACTIVATION" - | "PERCENTAGE_PROCESSING_REPAYMENT" - | "PERCENTAGE_PROCESSING_REPAYMENT_REVERSED" - | "PROCESSING_FEE" - | "PROCESSING_FEE_REFUND" - | "UNDO_PROCESSING_FEE_REFUND" - | "GIFT_CARD_LOAD_FEE" - | "GIFT_CARD_LOAD_FEE_REFUND" - | "UNDO_GIFT_CARD_LOAD_FEE_REFUND" - | "BALANCE_FOLDERS_TRANSFER" - | "BALANCE_FOLDERS_TRANSFER_REVERSED" - | "GIFT_CARD_POOL_TRANSFER" - | "GIFT_CARD_POOL_TRANSFER_REVERSED" - | "SQUARE_PAYROLL_TRANSFER" - | "SQUARE_PAYROLL_TRANSFER_REVERSED"; export const ActivityType = { Adjustment: "ADJUSTMENT", AppFeeRefund: "APP_FEE_REFUND", @@ -121,3 +60,4 @@ export const ActivityType = { SquarePayrollTransfer: "SQUARE_PAYROLL_TRANSFER", SquarePayrollTransferReversed: "SQUARE_PAYROLL_TRANSFER_REVERSED", } as const; +export type ActivityType = (typeof ActivityType)[keyof typeof ActivityType]; diff --git a/src/api/types/AddGroupToCustomerResponse.ts b/src/api/types/AddGroupToCustomerResponse.ts index 064a809ed..67e1426a7 100644 --- a/src/api/types/AddGroupToCustomerResponse.ts +++ b/src/api/types/AddGroupToCustomerResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/AdditionalRecipient.ts b/src/api/types/AdditionalRecipient.ts index 35b50da40..76d0d10d7 100644 --- a/src/api/types/AdditionalRecipient.ts +++ b/src/api/types/AdditionalRecipient.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an additional recipient (other than the merchant) receiving a portion of this tender. diff --git a/src/api/types/Address.ts b/src/api/types/Address.ts index 31ed6e0dd..2de755680 100644 --- a/src/api/types/Address.ts +++ b/src/api/types/Address.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a postal address in a country. diff --git a/src/api/types/AdjustLoyaltyPointsResponse.ts b/src/api/types/AdjustLoyaltyPointsResponse.ts index 90365ec62..c252e6464 100644 --- a/src/api/types/AdjustLoyaltyPointsResponse.ts +++ b/src/api/types/AdjustLoyaltyPointsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request. diff --git a/src/api/types/AfterpayDetails.ts b/src/api/types/AfterpayDetails.ts index 48fbcac19..02fb6edac 100644 --- a/src/api/types/AfterpayDetails.ts +++ b/src/api/types/AfterpayDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Additional details about Afterpay payments. diff --git a/src/api/types/ApplicationDetails.ts b/src/api/types/ApplicationDetails.ts index af1fb2d46..972d668aa 100644 --- a/src/api/types/ApplicationDetails.ts +++ b/src/api/types/ApplicationDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Details about the application that took the payment. diff --git a/src/api/types/ApplicationDetailsExternalSquareProduct.ts b/src/api/types/ApplicationDetailsExternalSquareProduct.ts index f4a156f50..243f9ded7 100644 --- a/src/api/types/ApplicationDetailsExternalSquareProduct.ts +++ b/src/api/types/ApplicationDetailsExternalSquareProduct.ts @@ -1,21 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * A list of products to return to external callers. - */ -export type ApplicationDetailsExternalSquareProduct = - | "APPOINTMENTS" - | "ECOMMERCE_API" - | "INVOICES" - | "ONLINE_STORE" - | "OTHER" - | "RESTAURANTS" - | "RETAIL" - | "SQUARE_POS" - | "TERMINAL_API" - | "VIRTUAL_TERMINAL"; +/** A list of products to return to external callers. */ export const ApplicationDetailsExternalSquareProduct = { Appointments: "APPOINTMENTS", EcommerceApi: "ECOMMERCE_API", @@ -28,3 +13,5 @@ export const ApplicationDetailsExternalSquareProduct = { TerminalApi: "TERMINAL_API", VirtualTerminal: "VIRTUAL_TERMINAL", } as const; +export type ApplicationDetailsExternalSquareProduct = + (typeof ApplicationDetailsExternalSquareProduct)[keyof typeof ApplicationDetailsExternalSquareProduct]; diff --git a/src/api/types/ApplicationType.ts b/src/api/types/ApplicationType.ts index 60d86551d..cb5649c86 100644 --- a/src/api/types/ApplicationType.ts +++ b/src/api/types/ApplicationType.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type ApplicationType = "TERMINAL_API"; diff --git a/src/api/types/AppointmentSegment.ts b/src/api/types/AppointmentSegment.ts index fd5e7e479..2c20ed327 100644 --- a/src/api/types/AppointmentSegment.ts +++ b/src/api/types/AppointmentSegment.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Defines an appointment segment of a booking. diff --git a/src/api/types/ArchivedState.ts b/src/api/types/ArchivedState.ts index 9bdf9cc21..94fa49d2d 100644 --- a/src/api/types/ArchivedState.ts +++ b/src/api/types/ArchivedState.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Defines the values for the `archived_state` query expression * used in [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) * to return the archived, not archived or either type of catalog items. */ -export type ArchivedState = "ARCHIVED_STATE_NOT_ARCHIVED" | "ARCHIVED_STATE_ARCHIVED" | "ARCHIVED_STATE_ALL"; export const ArchivedState = { ArchivedStateNotArchived: "ARCHIVED_STATE_NOT_ARCHIVED", ArchivedStateArchived: "ARCHIVED_STATE_ARCHIVED", ArchivedStateAll: "ARCHIVED_STATE_ALL", } as const; +export type ArchivedState = (typeof ArchivedState)[keyof typeof ArchivedState]; diff --git a/src/api/types/Availability.ts b/src/api/types/Availability.ts index 3dfd740d8..45cf1e5b6 100644 --- a/src/api/types/Availability.ts +++ b/src/api/types/Availability.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines an appointment slot that encapsulates the appointment segments, location and starting time available for booking. diff --git a/src/api/types/BankAccount.ts b/src/api/types/BankAccount.ts index 46946a700..83f68f4f8 100644 --- a/src/api/types/BankAccount.ts +++ b/src/api/types/BankAccount.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a bank account. For more information about diff --git a/src/api/types/BankAccountCreatedEvent.ts b/src/api/types/BankAccountCreatedEvent.ts index 71b39e5cf..d9297cb92 100644 --- a/src/api/types/BankAccountCreatedEvent.ts +++ b/src/api/types/BankAccountCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when you link an external bank account to a Square diff --git a/src/api/types/BankAccountCreatedEventData.ts b/src/api/types/BankAccountCreatedEventData.ts index f3fedf2ea..929735042 100644 --- a/src/api/types/BankAccountCreatedEventData.ts +++ b/src/api/types/BankAccountCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BankAccountCreatedEventData { /** Name of the affected object’s type, `"bank_account"`. */ diff --git a/src/api/types/BankAccountCreatedEventObject.ts b/src/api/types/BankAccountCreatedEventObject.ts index 34545b8dc..e3c8c8634 100644 --- a/src/api/types/BankAccountCreatedEventObject.ts +++ b/src/api/types/BankAccountCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BankAccountCreatedEventObject { /** The created bank account. */ diff --git a/src/api/types/BankAccountDisabledEvent.ts b/src/api/types/BankAccountDisabledEvent.ts index 9e54b24de..44eda7202 100644 --- a/src/api/types/BankAccountDisabledEvent.ts +++ b/src/api/types/BankAccountDisabledEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when Square sets the status of a diff --git a/src/api/types/BankAccountDisabledEventData.ts b/src/api/types/BankAccountDisabledEventData.ts index 842bb3dac..57383f87c 100644 --- a/src/api/types/BankAccountDisabledEventData.ts +++ b/src/api/types/BankAccountDisabledEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BankAccountDisabledEventData { /** Name of the affected object’s type, `"bank_account"`. */ diff --git a/src/api/types/BankAccountDisabledEventObject.ts b/src/api/types/BankAccountDisabledEventObject.ts index 8ef0589dc..76b44ecfc 100644 --- a/src/api/types/BankAccountDisabledEventObject.ts +++ b/src/api/types/BankAccountDisabledEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BankAccountDisabledEventObject { /** The disabled bank account. */ diff --git a/src/api/types/BankAccountPaymentDetails.ts b/src/api/types/BankAccountPaymentDetails.ts index 67c412152..1a0b2b4a9 100644 --- a/src/api/types/BankAccountPaymentDetails.ts +++ b/src/api/types/BankAccountPaymentDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Additional details about BANK_ACCOUNT type payments. diff --git a/src/api/types/BankAccountStatus.ts b/src/api/types/BankAccountStatus.ts index 8ffa2f5ec..3ac10423b 100644 --- a/src/api/types/BankAccountStatus.ts +++ b/src/api/types/BankAccountStatus.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the current verification status of a `BankAccount` object. - */ -export type BankAccountStatus = "VERIFICATION_IN_PROGRESS" | "VERIFIED" | "DISABLED"; +/** Indicates the current verification status of a `BankAccount` object. */ export const BankAccountStatus = { VerificationInProgress: "VERIFICATION_IN_PROGRESS", Verified: "VERIFIED", Disabled: "DISABLED", } as const; +export type BankAccountStatus = (typeof BankAccountStatus)[keyof typeof BankAccountStatus]; diff --git a/src/api/types/BankAccountType.ts b/src/api/types/BankAccountType.ts index fe1a46083..87bc55720 100644 --- a/src/api/types/BankAccountType.ts +++ b/src/api/types/BankAccountType.ts @@ -1,11 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the financial purpose of the bank account. - */ -export type BankAccountType = "CHECKING" | "SAVINGS" | "INVESTMENT" | "OTHER" | "BUSINESS_CHECKING"; +/** Indicates the financial purpose of the bank account. */ export const BankAccountType = { Checking: "CHECKING", Savings: "SAVINGS", @@ -13,3 +8,4 @@ export const BankAccountType = { Other: "OTHER", BusinessChecking: "BUSINESS_CHECKING", } as const; +export type BankAccountType = (typeof BankAccountType)[keyof typeof BankAccountType]; diff --git a/src/api/types/BankAccountVerifiedEvent.ts b/src/api/types/BankAccountVerifiedEvent.ts index ffbf6a3a2..6a2ce32ef 100644 --- a/src/api/types/BankAccountVerifiedEvent.ts +++ b/src/api/types/BankAccountVerifiedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when Square sets the status of a diff --git a/src/api/types/BankAccountVerifiedEventData.ts b/src/api/types/BankAccountVerifiedEventData.ts index 7976fc30a..a757dd502 100644 --- a/src/api/types/BankAccountVerifiedEventData.ts +++ b/src/api/types/BankAccountVerifiedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BankAccountVerifiedEventData { /** Name of the affected object’s type, `"bank_account"`. */ diff --git a/src/api/types/BankAccountVerifiedEventObject.ts b/src/api/types/BankAccountVerifiedEventObject.ts index 26af16448..d6c3d143f 100644 --- a/src/api/types/BankAccountVerifiedEventObject.ts +++ b/src/api/types/BankAccountVerifiedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BankAccountVerifiedEventObject { /** The verified bank account. */ diff --git a/src/api/types/BatchChangeInventoryRequest.ts b/src/api/types/BatchChangeInventoryRequest.ts index 1399ddc0d..4ae161bb6 100644 --- a/src/api/types/BatchChangeInventoryRequest.ts +++ b/src/api/types/BatchChangeInventoryRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BatchChangeInventoryRequest { /** diff --git a/src/api/types/BatchChangeInventoryResponse.ts b/src/api/types/BatchChangeInventoryResponse.ts index cbda27c7c..001ff66a2 100644 --- a/src/api/types/BatchChangeInventoryResponse.ts +++ b/src/api/types/BatchChangeInventoryResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BatchChangeInventoryResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchCreateTeamMembersResponse.ts b/src/api/types/BatchCreateTeamMembersResponse.ts index cdcb977b4..18768cabe 100644 --- a/src/api/types/BatchCreateTeamMembersResponse.ts +++ b/src/api/types/BatchCreateTeamMembersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from a bulk create request containing the created `TeamMember` objects or error messages. diff --git a/src/api/types/BatchCreateVendorsResponse.ts b/src/api/types/BatchCreateVendorsResponse.ts index 80ac755e2..2edb1a6d4 100644 --- a/src/api/types/BatchCreateVendorsResponse.ts +++ b/src/api/types/BatchCreateVendorsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an output from a call to [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors). diff --git a/src/api/types/BatchDeleteCatalogObjectsResponse.ts b/src/api/types/BatchDeleteCatalogObjectsResponse.ts index 18104eca4..fe86e5712 100644 --- a/src/api/types/BatchDeleteCatalogObjectsResponse.ts +++ b/src/api/types/BatchDeleteCatalogObjectsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BatchDeleteCatalogObjectsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchGetCatalogObjectsResponse.ts b/src/api/types/BatchGetCatalogObjectsResponse.ts index 55ec80255..bbbfffd85 100644 --- a/src/api/types/BatchGetCatalogObjectsResponse.ts +++ b/src/api/types/BatchGetCatalogObjectsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BatchGetCatalogObjectsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchGetInventoryChangesResponse.ts b/src/api/types/BatchGetInventoryChangesResponse.ts index 9921d17fe..2dec1c7e9 100644 --- a/src/api/types/BatchGetInventoryChangesResponse.ts +++ b/src/api/types/BatchGetInventoryChangesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BatchGetInventoryChangesResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchGetInventoryCountsRequest.ts b/src/api/types/BatchGetInventoryCountsRequest.ts index 2a606e459..a08eae5f2 100644 --- a/src/api/types/BatchGetInventoryCountsRequest.ts +++ b/src/api/types/BatchGetInventoryCountsRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BatchGetInventoryCountsRequest { /** diff --git a/src/api/types/BatchGetInventoryCountsResponse.ts b/src/api/types/BatchGetInventoryCountsResponse.ts index 3f436778a..858db849e 100644 --- a/src/api/types/BatchGetInventoryCountsResponse.ts +++ b/src/api/types/BatchGetInventoryCountsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BatchGetInventoryCountsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchGetOrdersResponse.ts b/src/api/types/BatchGetOrdersResponse.ts index 82b088f50..0c3cadbfd 100644 --- a/src/api/types/BatchGetOrdersResponse.ts +++ b/src/api/types/BatchGetOrdersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/BatchGetVendorsResponse.ts b/src/api/types/BatchGetVendorsResponse.ts index 3c3cb05d1..201c29362 100644 --- a/src/api/types/BatchGetVendorsResponse.ts +++ b/src/api/types/BatchGetVendorsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an output from a call to [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors). diff --git a/src/api/types/BatchRetrieveInventoryChangesRequest.ts b/src/api/types/BatchRetrieveInventoryChangesRequest.ts index 66c6c1cb7..96652103a 100644 --- a/src/api/types/BatchRetrieveInventoryChangesRequest.ts +++ b/src/api/types/BatchRetrieveInventoryChangesRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BatchRetrieveInventoryChangesRequest { /** diff --git a/src/api/types/BatchUpdateTeamMembersResponse.ts b/src/api/types/BatchUpdateTeamMembersResponse.ts index c3b6d9cb7..334b62398 100644 --- a/src/api/types/BatchUpdateTeamMembersResponse.ts +++ b/src/api/types/BatchUpdateTeamMembersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from a bulk update request containing the updated `TeamMember` objects or error messages. diff --git a/src/api/types/BatchUpdateVendorsResponse.ts b/src/api/types/BatchUpdateVendorsResponse.ts index e9e88cd75..1343c93db 100644 --- a/src/api/types/BatchUpdateVendorsResponse.ts +++ b/src/api/types/BatchUpdateVendorsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an output from a call to [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors). diff --git a/src/api/types/BatchUpsertCatalogObjectsResponse.ts b/src/api/types/BatchUpsertCatalogObjectsResponse.ts index 96bb78280..fb2e7178d 100644 --- a/src/api/types/BatchUpsertCatalogObjectsResponse.ts +++ b/src/api/types/BatchUpsertCatalogObjectsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BatchUpsertCatalogObjectsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts b/src/api/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts index ee0132735..fd760a2f4 100644 --- a/src/api/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts +++ b/src/api/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) diff --git a/src/api/types/BatchUpsertCustomerCustomAttributesResponse.ts b/src/api/types/BatchUpsertCustomerCustomAttributesResponse.ts index 800dbb96e..d1f73265d 100644 --- a/src/api/types/BatchUpsertCustomerCustomAttributesResponse.ts +++ b/src/api/types/BatchUpsertCustomerCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) response, diff --git a/src/api/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts b/src/api/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts index 3436be474..2909f5a15 100644 --- a/src/api/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts +++ b/src/api/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response for an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) operation. diff --git a/src/api/types/Booking.ts b/src/api/types/Booking.ts index c861453d3..93e203374 100644 --- a/src/api/types/Booking.ts +++ b/src/api/types/Booking.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service diff --git a/src/api/types/BookingBookingSource.ts b/src/api/types/BookingBookingSource.ts index 6b7febd37..76bbf801b 100644 --- a/src/api/types/BookingBookingSource.ts +++ b/src/api/types/BookingBookingSource.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Supported sources a booking was created from. - */ -export type BookingBookingSource = "FIRST_PARTY_MERCHANT" | "FIRST_PARTY_BUYER" | "THIRD_PARTY_BUYER" | "API"; +/** Supported sources a booking was created from. */ export const BookingBookingSource = { FirstPartyMerchant: "FIRST_PARTY_MERCHANT", FirstPartyBuyer: "FIRST_PARTY_BUYER", ThirdPartyBuyer: "THIRD_PARTY_BUYER", Api: "API", } as const; +export type BookingBookingSource = (typeof BookingBookingSource)[keyof typeof BookingBookingSource]; diff --git a/src/api/types/BookingCreatedEvent.ts b/src/api/types/BookingCreatedEvent.ts index 646208cca..f1ac0aba7 100644 --- a/src/api/types/BookingCreatedEvent.ts +++ b/src/api/types/BookingCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking is created. diff --git a/src/api/types/BookingCreatedEventData.ts b/src/api/types/BookingCreatedEventData.ts index ec3d1584d..7dd7ac19f 100644 --- a/src/api/types/BookingCreatedEventData.ts +++ b/src/api/types/BookingCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BookingCreatedEventData { /** The type of the event data object. The value is `"booking"`. */ diff --git a/src/api/types/BookingCreatedEventObject.ts b/src/api/types/BookingCreatedEventObject.ts index 1d59263ab..c75f0f2ab 100644 --- a/src/api/types/BookingCreatedEventObject.ts +++ b/src/api/types/BookingCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BookingCreatedEventObject { /** The created booking. */ diff --git a/src/api/types/BookingCreatorDetails.ts b/src/api/types/BookingCreatorDetails.ts index 95337d4ca..f7347d0f0 100644 --- a/src/api/types/BookingCreatorDetails.ts +++ b/src/api/types/BookingCreatorDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Information about a booking creator. diff --git a/src/api/types/BookingCreatorDetailsCreatorType.ts b/src/api/types/BookingCreatorDetailsCreatorType.ts index 75b0061c9..27b982ced 100644 --- a/src/api/types/BookingCreatorDetailsCreatorType.ts +++ b/src/api/types/BookingCreatorDetailsCreatorType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Supported types of a booking creator. - */ -export type BookingCreatorDetailsCreatorType = "TEAM_MEMBER" | "CUSTOMER"; +/** Supported types of a booking creator. */ export const BookingCreatorDetailsCreatorType = { TeamMember: "TEAM_MEMBER", Customer: "CUSTOMER", } as const; +export type BookingCreatorDetailsCreatorType = + (typeof BookingCreatorDetailsCreatorType)[keyof typeof BookingCreatorDetailsCreatorType]; diff --git a/src/api/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts index d0fa96275..a817b5bc4 100644 --- a/src/api/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts index 6088ec85c..0424c8365 100644 --- a/src/api/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts index 426ba305f..9d94afd43 100644 --- a/src/api/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts index 42a436488..5d365ef61 100644 --- a/src/api/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts index 9f4cb79d4..547073da7 100644 --- a/src/api/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts index 01afeca30..77d89ea52 100644 --- a/src/api/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDeleteRequest.ts b/src/api/types/BookingCustomAttributeDeleteRequest.ts index 216588d1b..75854ca9d 100644 --- a/src/api/types/BookingCustomAttributeDeleteRequest.ts +++ b/src/api/types/BookingCustomAttributeDeleteRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents an individual delete request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) diff --git a/src/api/types/BookingCustomAttributeDeleteResponse.ts b/src/api/types/BookingCustomAttributeDeleteResponse.ts index fd2712f24..07b83ea6a 100644 --- a/src/api/types/BookingCustomAttributeDeleteResponse.ts +++ b/src/api/types/BookingCustomAttributeDeleteResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response for an individual upsert request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) operation. diff --git a/src/api/types/BookingCustomAttributeOwnedDeletedEvent.ts b/src/api/types/BookingCustomAttributeOwnedDeletedEvent.ts index 00ea41bcb..2d9272336 100644 --- a/src/api/types/BookingCustomAttributeOwnedDeletedEvent.ts +++ b/src/api/types/BookingCustomAttributeOwnedDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/BookingCustomAttributeOwnedUpdatedEvent.ts b/src/api/types/BookingCustomAttributeOwnedUpdatedEvent.ts index 60c9a8944..fa6fa63cd 100644 --- a/src/api/types/BookingCustomAttributeOwnedUpdatedEvent.ts +++ b/src/api/types/BookingCustomAttributeOwnedUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/BookingCustomAttributeUpsertRequest.ts b/src/api/types/BookingCustomAttributeUpsertRequest.ts index 1635a8103..b9cd7c7a2 100644 --- a/src/api/types/BookingCustomAttributeUpsertRequest.ts +++ b/src/api/types/BookingCustomAttributeUpsertRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) diff --git a/src/api/types/BookingCustomAttributeUpsertResponse.ts b/src/api/types/BookingCustomAttributeUpsertResponse.ts index bcd008f99..af513649d 100644 --- a/src/api/types/BookingCustomAttributeUpsertResponse.ts +++ b/src/api/types/BookingCustomAttributeUpsertResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response for an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) operation. diff --git a/src/api/types/BookingCustomAttributeVisibleDeletedEvent.ts b/src/api/types/BookingCustomAttributeVisibleDeletedEvent.ts index b3c26f81a..80c5bf99c 100644 --- a/src/api/types/BookingCustomAttributeVisibleDeletedEvent.ts +++ b/src/api/types/BookingCustomAttributeVisibleDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking [custom attribute](entity:CustomAttribute) with diff --git a/src/api/types/BookingCustomAttributeVisibleUpdatedEvent.ts b/src/api/types/BookingCustomAttributeVisibleUpdatedEvent.ts index 8451ca112..dc7f35e9a 100644 --- a/src/api/types/BookingCustomAttributeVisibleUpdatedEvent.ts +++ b/src/api/types/BookingCustomAttributeVisibleUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/BookingStatus.ts b/src/api/types/BookingStatus.ts index fd41bf0d3..f22649f0b 100644 --- a/src/api/types/BookingStatus.ts +++ b/src/api/types/BookingStatus.ts @@ -1,17 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Supported booking statuses. - */ -export type BookingStatus = - | "PENDING" - | "CANCELLED_BY_CUSTOMER" - | "CANCELLED_BY_SELLER" - | "DECLINED" - | "ACCEPTED" - | "NO_SHOW"; +/** Supported booking statuses. */ export const BookingStatus = { Pending: "PENDING", CancelledByCustomer: "CANCELLED_BY_CUSTOMER", @@ -20,3 +9,4 @@ export const BookingStatus = { Accepted: "ACCEPTED", NoShow: "NO_SHOW", } as const; +export type BookingStatus = (typeof BookingStatus)[keyof typeof BookingStatus]; diff --git a/src/api/types/BookingUpdatedEvent.ts b/src/api/types/BookingUpdatedEvent.ts index 5304a624b..a6ec35237 100644 --- a/src/api/types/BookingUpdatedEvent.ts +++ b/src/api/types/BookingUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a booking is updated or cancelled. diff --git a/src/api/types/BookingUpdatedEventData.ts b/src/api/types/BookingUpdatedEventData.ts index 9bf4fd8f5..aa6784e42 100644 --- a/src/api/types/BookingUpdatedEventData.ts +++ b/src/api/types/BookingUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BookingUpdatedEventData { /** The type of the event data object. The value is `"booking"`. */ diff --git a/src/api/types/BookingUpdatedEventObject.ts b/src/api/types/BookingUpdatedEventObject.ts index 98f157bb1..f16d768f3 100644 --- a/src/api/types/BookingUpdatedEventObject.ts +++ b/src/api/types/BookingUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface BookingUpdatedEventObject { /** The updated booking. */ diff --git a/src/api/types/Break.ts b/src/api/types/Break.ts index 431faeb27..49936bd7b 100644 --- a/src/api/types/Break.ts +++ b/src/api/types/Break.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A record of a team member's break on a [timecard](entity:Timecard). diff --git a/src/api/types/BreakType.ts b/src/api/types/BreakType.ts index d27453549..182f0fb00 100644 --- a/src/api/types/BreakType.ts +++ b/src/api/types/BreakType.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A template for a type of [break](entity:Break) that can be added to a diff --git a/src/api/types/BulkCreateCustomerData.ts b/src/api/types/BulkCreateCustomerData.ts index 855023880..22d6cb4af 100644 --- a/src/api/types/BulkCreateCustomerData.ts +++ b/src/api/types/BulkCreateCustomerData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the customer data provided in individual create requests for a diff --git a/src/api/types/BulkCreateCustomersResponse.ts b/src/api/types/BulkCreateCustomersResponse.ts index e9c805cb1..ff2e028b1 100644 --- a/src/api/types/BulkCreateCustomersResponse.ts +++ b/src/api/types/BulkCreateCustomersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields included in the response body from the diff --git a/src/api/types/BulkDeleteBookingCustomAttributesResponse.ts b/src/api/types/BulkDeleteBookingCustomAttributesResponse.ts index 74b016507..e88909ec4 100644 --- a/src/api/types/BulkDeleteBookingCustomAttributesResponse.ts +++ b/src/api/types/BulkDeleteBookingCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) response, diff --git a/src/api/types/BulkDeleteCustomersResponse.ts b/src/api/types/BulkDeleteCustomersResponse.ts index 85c1433f0..22623e8f6 100644 --- a/src/api/types/BulkDeleteCustomersResponse.ts +++ b/src/api/types/BulkDeleteCustomersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields included in the response body from the diff --git a/src/api/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts b/src/api/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts index 371975d53..ac28fae05 100644 --- a/src/api/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts +++ b/src/api/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents an individual delete request in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) diff --git a/src/api/types/BulkDeleteLocationCustomAttributesResponse.ts b/src/api/types/BulkDeleteLocationCustomAttributesResponse.ts index 468fdcc14..c4812dfb1 100644 --- a/src/api/types/BulkDeleteLocationCustomAttributesResponse.ts +++ b/src/api/types/BulkDeleteLocationCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) response, diff --git a/src/api/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts b/src/api/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts index 66e4519b1..46ef4b221 100644 --- a/src/api/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts +++ b/src/api/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an individual delete response in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) diff --git a/src/api/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts b/src/api/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts index 1a31ee29f..9ae182ecc 100644 --- a/src/api/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts +++ b/src/api/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents an individual delete request in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) diff --git a/src/api/types/BulkDeleteMerchantCustomAttributesResponse.ts b/src/api/types/BulkDeleteMerchantCustomAttributesResponse.ts index 226851e80..36bf98fc8 100644 --- a/src/api/types/BulkDeleteMerchantCustomAttributesResponse.ts +++ b/src/api/types/BulkDeleteMerchantCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) response, diff --git a/src/api/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts b/src/api/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts index e2d3355fe..fa0085f4a 100644 --- a/src/api/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts +++ b/src/api/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an individual delete response in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) diff --git a/src/api/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts b/src/api/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts index ac779af87..389f9baeb 100644 --- a/src/api/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts +++ b/src/api/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents one delete within the bulk operation. diff --git a/src/api/types/BulkDeleteOrderCustomAttributesResponse.ts b/src/api/types/BulkDeleteOrderCustomAttributesResponse.ts index c163ac122..bb3d0d82c 100644 --- a/src/api/types/BulkDeleteOrderCustomAttributesResponse.ts +++ b/src/api/types/BulkDeleteOrderCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from deleting one or more order custom attributes. diff --git a/src/api/types/BulkPublishScheduledShiftsData.ts b/src/api/types/BulkPublishScheduledShiftsData.ts index 8c69e366f..7a7f934a6 100644 --- a/src/api/types/BulkPublishScheduledShiftsData.ts +++ b/src/api/types/BulkPublishScheduledShiftsData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents options for an individual publish request in a diff --git a/src/api/types/BulkPublishScheduledShiftsResponse.ts b/src/api/types/BulkPublishScheduledShiftsResponse.ts index 9bd347fb8..6dc99cb3b 100644 --- a/src/api/types/BulkPublishScheduledShiftsResponse.ts +++ b/src/api/types/BulkPublishScheduledShiftsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) response. diff --git a/src/api/types/BulkRetrieveBookingsResponse.ts b/src/api/types/BulkRetrieveBookingsResponse.ts index 5f852656a..c26f7ce78 100644 --- a/src/api/types/BulkRetrieveBookingsResponse.ts +++ b/src/api/types/BulkRetrieveBookingsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response payload for bulk retrieval of bookings. diff --git a/src/api/types/BulkRetrieveChannelsRequestConstants.ts b/src/api/types/BulkRetrieveChannelsRequestConstants.ts index 181509f5e..283f45d04 100644 --- a/src/api/types/BulkRetrieveChannelsRequestConstants.ts +++ b/src/api/types/BulkRetrieveChannelsRequestConstants.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type BulkRetrieveChannelsRequestConstants = "MAX_BATCH_SIZE"; diff --git a/src/api/types/BulkRetrieveChannelsResponse.ts b/src/api/types/BulkRetrieveChannelsResponse.ts index aeb031c2f..23b53292e 100644 --- a/src/api/types/BulkRetrieveChannelsResponse.ts +++ b/src/api/types/BulkRetrieveChannelsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the request body for the diff --git a/src/api/types/BulkRetrieveCustomersResponse.ts b/src/api/types/BulkRetrieveCustomersResponse.ts index 3fb4abeca..e280f8240 100644 --- a/src/api/types/BulkRetrieveCustomersResponse.ts +++ b/src/api/types/BulkRetrieveCustomersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields included in the response body from the diff --git a/src/api/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts b/src/api/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts index 0b7f776e2..9618591fe 100644 --- a/src/api/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts +++ b/src/api/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response payload for the [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) endpoint. diff --git a/src/api/types/BulkSwapPlanResponse.ts b/src/api/types/BulkSwapPlanResponse.ts index 6dcd1f10c..d3c9b8077 100644 --- a/src/api/types/BulkSwapPlanResponse.ts +++ b/src/api/types/BulkSwapPlanResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response of the diff --git a/src/api/types/BulkUpdateCustomerData.ts b/src/api/types/BulkUpdateCustomerData.ts index 64c458abb..c2ef2bde7 100644 --- a/src/api/types/BulkUpdateCustomerData.ts +++ b/src/api/types/BulkUpdateCustomerData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the customer data provided in individual update requests for a diff --git a/src/api/types/BulkUpdateCustomersResponse.ts b/src/api/types/BulkUpdateCustomersResponse.ts index 484c88cd0..7f4f9f8ec 100644 --- a/src/api/types/BulkUpdateCustomersResponse.ts +++ b/src/api/types/BulkUpdateCustomersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields included in the response body from the diff --git a/src/api/types/BulkUpsertBookingCustomAttributesResponse.ts b/src/api/types/BulkUpsertBookingCustomAttributesResponse.ts index 9a7bd6c32..d956047bb 100644 --- a/src/api/types/BulkUpsertBookingCustomAttributesResponse.ts +++ b/src/api/types/BulkUpsertBookingCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) response, diff --git a/src/api/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts b/src/api/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts index a41ba1c28..0fd16f129 100644 --- a/src/api/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts +++ b/src/api/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) diff --git a/src/api/types/BulkUpsertLocationCustomAttributesResponse.ts b/src/api/types/BulkUpsertLocationCustomAttributesResponse.ts index f32c5792c..cc83c28a6 100644 --- a/src/api/types/BulkUpsertLocationCustomAttributesResponse.ts +++ b/src/api/types/BulkUpsertLocationCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) response, diff --git a/src/api/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts b/src/api/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts index 29be7dcb1..79f6af543 100644 --- a/src/api/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts +++ b/src/api/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response for an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) operation. diff --git a/src/api/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts b/src/api/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts index 83382ffe7..a95835c72 100644 --- a/src/api/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts +++ b/src/api/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) diff --git a/src/api/types/BulkUpsertMerchantCustomAttributesResponse.ts b/src/api/types/BulkUpsertMerchantCustomAttributesResponse.ts index 6e6845881..29ce9697e 100644 --- a/src/api/types/BulkUpsertMerchantCustomAttributesResponse.ts +++ b/src/api/types/BulkUpsertMerchantCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) response, diff --git a/src/api/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts b/src/api/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts index 50e9680b5..9aaa58f1c 100644 --- a/src/api/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts +++ b/src/api/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response for an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) operation. diff --git a/src/api/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts b/src/api/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts index acf829020..3344cac38 100644 --- a/src/api/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts +++ b/src/api/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents one upsert within the bulk operation. diff --git a/src/api/types/BulkUpsertOrderCustomAttributesResponse.ts b/src/api/types/BulkUpsertOrderCustomAttributesResponse.ts index 2cccbde11..103f57d38 100644 --- a/src/api/types/BulkUpsertOrderCustomAttributesResponse.ts +++ b/src/api/types/BulkUpsertOrderCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from a bulk upsert of order custom attributes. diff --git a/src/api/types/BusinessAppointmentSettings.ts b/src/api/types/BusinessAppointmentSettings.ts index f95139f7a..3dc33fcb6 100644 --- a/src/api/types/BusinessAppointmentSettings.ts +++ b/src/api/types/BusinessAppointmentSettings.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The service appointment settings, including where and how the service is provided. diff --git a/src/api/types/BusinessAppointmentSettingsAlignmentTime.ts b/src/api/types/BusinessAppointmentSettingsAlignmentTime.ts index 9d9e410be..5f9530346 100644 --- a/src/api/types/BusinessAppointmentSettingsAlignmentTime.ts +++ b/src/api/types/BusinessAppointmentSettingsAlignmentTime.ts @@ -1,14 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Time units of a service duration for bookings. - */ -export type BusinessAppointmentSettingsAlignmentTime = "SERVICE_DURATION" | "QUARTER_HOURLY" | "HALF_HOURLY" | "HOURLY"; +/** Time units of a service duration for bookings. */ export const BusinessAppointmentSettingsAlignmentTime = { ServiceDuration: "SERVICE_DURATION", QuarterHourly: "QUARTER_HOURLY", HalfHourly: "HALF_HOURLY", Hourly: "HOURLY", } as const; +export type BusinessAppointmentSettingsAlignmentTime = + (typeof BusinessAppointmentSettingsAlignmentTime)[keyof typeof BusinessAppointmentSettingsAlignmentTime]; diff --git a/src/api/types/BusinessAppointmentSettingsBookingLocationType.ts b/src/api/types/BusinessAppointmentSettingsBookingLocationType.ts index 101e1b5d7..13750b8f1 100644 --- a/src/api/types/BusinessAppointmentSettingsBookingLocationType.ts +++ b/src/api/types/BusinessAppointmentSettingsBookingLocationType.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Supported types of location where service is provided. - */ -export type BusinessAppointmentSettingsBookingLocationType = "BUSINESS_LOCATION" | "CUSTOMER_LOCATION" | "PHONE"; +/** Supported types of location where service is provided. */ export const BusinessAppointmentSettingsBookingLocationType = { BusinessLocation: "BUSINESS_LOCATION", CustomerLocation: "CUSTOMER_LOCATION", Phone: "PHONE", } as const; +export type BusinessAppointmentSettingsBookingLocationType = + (typeof BusinessAppointmentSettingsBookingLocationType)[keyof typeof BusinessAppointmentSettingsBookingLocationType]; diff --git a/src/api/types/BusinessAppointmentSettingsCancellationPolicy.ts b/src/api/types/BusinessAppointmentSettingsCancellationPolicy.ts index d72b69834..ab73f33a8 100644 --- a/src/api/types/BusinessAppointmentSettingsCancellationPolicy.ts +++ b/src/api/types/BusinessAppointmentSettingsCancellationPolicy.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The category of the seller’s cancellation policy. - */ -export type BusinessAppointmentSettingsCancellationPolicy = "CANCELLATION_TREATED_AS_NO_SHOW" | "CUSTOM_POLICY"; +/** The category of the seller’s cancellation policy. */ export const BusinessAppointmentSettingsCancellationPolicy = { CancellationTreatedAsNoShow: "CANCELLATION_TREATED_AS_NO_SHOW", CustomPolicy: "CUSTOM_POLICY", } as const; +export type BusinessAppointmentSettingsCancellationPolicy = + (typeof BusinessAppointmentSettingsCancellationPolicy)[keyof typeof BusinessAppointmentSettingsCancellationPolicy]; diff --git a/src/api/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts b/src/api/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts index 2a915990d..1dae0c040 100644 --- a/src/api/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts +++ b/src/api/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Types of daily appointment limits. - */ -export type BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType = "PER_TEAM_MEMBER" | "PER_LOCATION"; +/** Types of daily appointment limits. */ export const BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType = { PerTeamMember: "PER_TEAM_MEMBER", PerLocation: "PER_LOCATION", } as const; +export type BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType = + (typeof BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType)[keyof typeof BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType]; diff --git a/src/api/types/BusinessBookingProfile.ts b/src/api/types/BusinessBookingProfile.ts index f3ab7bd24..72142c452 100644 --- a/src/api/types/BusinessBookingProfile.ts +++ b/src/api/types/BusinessBookingProfile.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A seller's business booking profile, including booking policy, appointment settings, etc. diff --git a/src/api/types/BusinessBookingProfileBookingPolicy.ts b/src/api/types/BusinessBookingProfileBookingPolicy.ts index 7159dc46e..f94b98492 100644 --- a/src/api/types/BusinessBookingProfileBookingPolicy.ts +++ b/src/api/types/BusinessBookingProfileBookingPolicy.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Policies for accepting bookings. - */ -export type BusinessBookingProfileBookingPolicy = "ACCEPT_ALL" | "REQUIRES_ACCEPTANCE"; +/** Policies for accepting bookings. */ export const BusinessBookingProfileBookingPolicy = { AcceptAll: "ACCEPT_ALL", RequiresAcceptance: "REQUIRES_ACCEPTANCE", } as const; +export type BusinessBookingProfileBookingPolicy = + (typeof BusinessBookingProfileBookingPolicy)[keyof typeof BusinessBookingProfileBookingPolicy]; diff --git a/src/api/types/BusinessBookingProfileCustomerTimezoneChoice.ts b/src/api/types/BusinessBookingProfileCustomerTimezoneChoice.ts index 15500acd4..97e7f11bd 100644 --- a/src/api/types/BusinessBookingProfileCustomerTimezoneChoice.ts +++ b/src/api/types/BusinessBookingProfileCustomerTimezoneChoice.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Choices of customer-facing time zone used for bookings. - */ -export type BusinessBookingProfileCustomerTimezoneChoice = "BUSINESS_LOCATION_TIMEZONE" | "CUSTOMER_CHOICE"; +/** Choices of customer-facing time zone used for bookings. */ export const BusinessBookingProfileCustomerTimezoneChoice = { BusinessLocationTimezone: "BUSINESS_LOCATION_TIMEZONE", CustomerChoice: "CUSTOMER_CHOICE", } as const; +export type BusinessBookingProfileCustomerTimezoneChoice = + (typeof BusinessBookingProfileCustomerTimezoneChoice)[keyof typeof BusinessBookingProfileCustomerTimezoneChoice]; diff --git a/src/api/types/BusinessHours.ts b/src/api/types/BusinessHours.ts index 5f2d1a5a5..c6543f8cf 100644 --- a/src/api/types/BusinessHours.ts +++ b/src/api/types/BusinessHours.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The hours of operation for a location. diff --git a/src/api/types/BusinessHoursPeriod.ts b/src/api/types/BusinessHoursPeriod.ts index 3391a95d4..85bc83a5e 100644 --- a/src/api/types/BusinessHoursPeriod.ts +++ b/src/api/types/BusinessHoursPeriod.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a period of time during which a business location is open. diff --git a/src/api/types/BuyNowPayLaterDetails.ts b/src/api/types/BuyNowPayLaterDetails.ts index 74b151f09..3784c04e1 100644 --- a/src/api/types/BuyNowPayLaterDetails.ts +++ b/src/api/types/BuyNowPayLaterDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Additional details about a Buy Now Pay Later payment type. diff --git a/src/api/types/CalculateLoyaltyPointsResponse.ts b/src/api/types/CalculateLoyaltyPointsResponse.ts index e970b5d91..dd869a7fd 100644 --- a/src/api/types/CalculateLoyaltyPointsResponse.ts +++ b/src/api/types/CalculateLoyaltyPointsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) response. diff --git a/src/api/types/CalculateOrderResponse.ts b/src/api/types/CalculateOrderResponse.ts index 055766021..3013d7440 100644 --- a/src/api/types/CalculateOrderResponse.ts +++ b/src/api/types/CalculateOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CalculateOrderResponse { /** The calculated version of the order provided in the request. */ diff --git a/src/api/types/CancelBookingResponse.ts b/src/api/types/CancelBookingResponse.ts index ccfb89b2c..6d40a236d 100644 --- a/src/api/types/CancelBookingResponse.ts +++ b/src/api/types/CancelBookingResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CancelBookingResponse { /** The booking that was cancelled. */ diff --git a/src/api/types/CancelInvoiceResponse.ts b/src/api/types/CancelInvoiceResponse.ts index 47bc03cca..69037df20 100644 --- a/src/api/types/CancelInvoiceResponse.ts +++ b/src/api/types/CancelInvoiceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response returned by the `CancelInvoice` request. diff --git a/src/api/types/CancelLoyaltyPromotionResponse.ts b/src/api/types/CancelLoyaltyPromotionResponse.ts index 720b5817c..40d03a58e 100644 --- a/src/api/types/CancelLoyaltyPromotionResponse.ts +++ b/src/api/types/CancelLoyaltyPromotionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [CancelLoyaltyPromotion](api-endpoint:Loyalty-CancelLoyaltyPromotion) response. diff --git a/src/api/types/CancelPaymentByIdempotencyKeyResponse.ts b/src/api/types/CancelPaymentByIdempotencyKeyResponse.ts index 8df4ee330..746f03334 100644 --- a/src/api/types/CancelPaymentByIdempotencyKeyResponse.ts +++ b/src/api/types/CancelPaymentByIdempotencyKeyResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response returned by diff --git a/src/api/types/CancelPaymentResponse.ts b/src/api/types/CancelPaymentResponse.ts index de09f1426..5164f1cd6 100644 --- a/src/api/types/CancelPaymentResponse.ts +++ b/src/api/types/CancelPaymentResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response returned by [CancelPayment](api-endpoint:Payments-CancelPayment). diff --git a/src/api/types/CancelSubscriptionResponse.ts b/src/api/types/CancelSubscriptionResponse.ts index 96950aacf..a90b84ff4 100644 --- a/src/api/types/CancelSubscriptionResponse.ts +++ b/src/api/types/CancelSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/CancelTerminalActionResponse.ts b/src/api/types/CancelTerminalActionResponse.ts index 1bae43a82..864a599dd 100644 --- a/src/api/types/CancelTerminalActionResponse.ts +++ b/src/api/types/CancelTerminalActionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CancelTerminalActionResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/CancelTerminalCheckoutResponse.ts b/src/api/types/CancelTerminalCheckoutResponse.ts index 280f22b90..23c018788 100644 --- a/src/api/types/CancelTerminalCheckoutResponse.ts +++ b/src/api/types/CancelTerminalCheckoutResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CancelTerminalCheckoutResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/CancelTerminalRefundResponse.ts b/src/api/types/CancelTerminalRefundResponse.ts index 5929fc431..2ef135538 100644 --- a/src/api/types/CancelTerminalRefundResponse.ts +++ b/src/api/types/CancelTerminalRefundResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CancelTerminalRefundResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/CancelTransferOrderResponse.ts b/src/api/types/CancelTransferOrderResponse.ts index b2d0da40c..8fd20936d 100644 --- a/src/api/types/CancelTransferOrderResponse.ts +++ b/src/api/types/CancelTransferOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response for canceling a transfer order diff --git a/src/api/types/CaptureTransactionResponse.ts b/src/api/types/CaptureTransactionResponse.ts index 32224c29a..77b44f500 100644 --- a/src/api/types/CaptureTransactionResponse.ts +++ b/src/api/types/CaptureTransactionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/Card.ts b/src/api/types/Card.ts index 4be90d322..e4f40600a 100644 --- a/src/api/types/Card.ts +++ b/src/api/types/Card.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the payment details of a card to be used for payments. These diff --git a/src/api/types/CardAutomaticallyUpdatedEvent.ts b/src/api/types/CardAutomaticallyUpdatedEvent.ts index 552768192..f5f90ef84 100644 --- a/src/api/types/CardAutomaticallyUpdatedEvent.ts +++ b/src/api/types/CardAutomaticallyUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when Square automatically updates the expiration date or diff --git a/src/api/types/CardAutomaticallyUpdatedEventData.ts b/src/api/types/CardAutomaticallyUpdatedEventData.ts index 73ff03d7a..3352089cb 100644 --- a/src/api/types/CardAutomaticallyUpdatedEventData.ts +++ b/src/api/types/CardAutomaticallyUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CardAutomaticallyUpdatedEventData { /** The type of the event data object. The value is `"card"`. */ diff --git a/src/api/types/CardAutomaticallyUpdatedEventObject.ts b/src/api/types/CardAutomaticallyUpdatedEventObject.ts index 7c5569acd..d7f76277a 100644 --- a/src/api/types/CardAutomaticallyUpdatedEventObject.ts +++ b/src/api/types/CardAutomaticallyUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CardAutomaticallyUpdatedEventObject { /** The automatically updated card. */ diff --git a/src/api/types/CardBrand.ts b/src/api/types/CardBrand.ts index b30410ad7..fd646bcf6 100644 --- a/src/api/types/CardBrand.ts +++ b/src/api/types/CardBrand.ts @@ -1,25 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates a card's brand, such as `VISA` or `MASTERCARD`. - */ -export type CardBrand = - | "OTHER_BRAND" - | "VISA" - | "MASTERCARD" - | "AMERICAN_EXPRESS" - | "DISCOVER" - | "DISCOVER_DINERS" - | "JCB" - | "CHINA_UNIONPAY" - | "SQUARE_GIFT_CARD" - | "SQUARE_CAPITAL_CARD" - | "INTERAC" - | "EFTPOS" - | "FELICA" - | "EBT"; +/** Indicates a card's brand, such as `VISA` or `MASTERCARD`. */ export const CardBrand = { OtherBrand: "OTHER_BRAND", Visa: "VISA", @@ -36,3 +17,4 @@ export const CardBrand = { Felica: "FELICA", Ebt: "EBT", } as const; +export type CardBrand = (typeof CardBrand)[keyof typeof CardBrand]; diff --git a/src/api/types/CardCoBrand.ts b/src/api/types/CardCoBrand.ts index 4a196be9a..381a6f6cf 100644 --- a/src/api/types/CardCoBrand.ts +++ b/src/api/types/CardCoBrand.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the brand for a co-branded card. - */ -export type CardCoBrand = "UNKNOWN" | "AFTERPAY" | "CLEARPAY"; +/** Indicates the brand for a co-branded card. */ export const CardCoBrand = { Unknown: "UNKNOWN", Afterpay: "AFTERPAY", Clearpay: "CLEARPAY", } as const; +export type CardCoBrand = (typeof CardCoBrand)[keyof typeof CardCoBrand]; diff --git a/src/api/types/CardCreatedEvent.ts b/src/api/types/CardCreatedEvent.ts index 810bc27f7..b0fbf30a3 100644 --- a/src/api/types/CardCreatedEvent.ts +++ b/src/api/types/CardCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [card](entity:Card) is created or imported. diff --git a/src/api/types/CardCreatedEventData.ts b/src/api/types/CardCreatedEventData.ts index 054e9e4bb..4b71f9227 100644 --- a/src/api/types/CardCreatedEventData.ts +++ b/src/api/types/CardCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CardCreatedEventData { /** The type of the event data object. The value is `"card"`. */ diff --git a/src/api/types/CardCreatedEventObject.ts b/src/api/types/CardCreatedEventObject.ts index 2dafa7445..d84090958 100644 --- a/src/api/types/CardCreatedEventObject.ts +++ b/src/api/types/CardCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CardCreatedEventObject { /** The created card. */ diff --git a/src/api/types/CardDisabledEvent.ts b/src/api/types/CardDisabledEvent.ts index 2ecede520..7a86e3918 100644 --- a/src/api/types/CardDisabledEvent.ts +++ b/src/api/types/CardDisabledEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [card](entity:Card) is disabled. diff --git a/src/api/types/CardDisabledEventData.ts b/src/api/types/CardDisabledEventData.ts index 24cbc2d0b..50451f256 100644 --- a/src/api/types/CardDisabledEventData.ts +++ b/src/api/types/CardDisabledEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CardDisabledEventData { /** The type of the event data object. The value is `"card"`. */ diff --git a/src/api/types/CardDisabledEventObject.ts b/src/api/types/CardDisabledEventObject.ts index f5f765ed1..353e1ca2d 100644 --- a/src/api/types/CardDisabledEventObject.ts +++ b/src/api/types/CardDisabledEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CardDisabledEventObject { /** The disabled card. */ diff --git a/src/api/types/CardForgottenEvent.ts b/src/api/types/CardForgottenEvent.ts index fff5cdcc0..e31e3ea5b 100644 --- a/src/api/types/CardForgottenEvent.ts +++ b/src/api/types/CardForgottenEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [card](entity:Card) is GDPR forgotten or vaulted. diff --git a/src/api/types/CardForgottenEventCard.ts b/src/api/types/CardForgottenEventCard.ts index af07de106..19b1cc4f2 100644 --- a/src/api/types/CardForgottenEventCard.ts +++ b/src/api/types/CardForgottenEventCard.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CardForgottenEventCard { /** Unique ID for this card. Generated by Square. */ diff --git a/src/api/types/CardForgottenEventData.ts b/src/api/types/CardForgottenEventData.ts index b6dcb0633..5e286606e 100644 --- a/src/api/types/CardForgottenEventData.ts +++ b/src/api/types/CardForgottenEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CardForgottenEventData { /** The type of the event data object. The value is `"card"`. */ diff --git a/src/api/types/CardForgottenEventObject.ts b/src/api/types/CardForgottenEventObject.ts index 0c49c64d6..f9833c652 100644 --- a/src/api/types/CardForgottenEventObject.ts +++ b/src/api/types/CardForgottenEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CardForgottenEventObject { /** The forgotten card. */ diff --git a/src/api/types/CardIssuerAlert.ts b/src/api/types/CardIssuerAlert.ts index 44ce7004e..ec1af6fe4 100644 --- a/src/api/types/CardIssuerAlert.ts +++ b/src/api/types/CardIssuerAlert.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the type of issuer alert for a [card on file](entity:Card). diff --git a/src/api/types/CardPaymentDetails.ts b/src/api/types/CardPaymentDetails.ts index 16c94f0fa..8e3fe5843 100644 --- a/src/api/types/CardPaymentDetails.ts +++ b/src/api/types/CardPaymentDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Reflects the current status of a card payment. Contains only non-confidential information. diff --git a/src/api/types/CardPaymentTimeline.ts b/src/api/types/CardPaymentTimeline.ts index ceb53d0e4..284fe8a87 100644 --- a/src/api/types/CardPaymentTimeline.ts +++ b/src/api/types/CardPaymentTimeline.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The timeline for card payments. diff --git a/src/api/types/CardPrepaidType.ts b/src/api/types/CardPrepaidType.ts index c20fff509..23bf96d4b 100644 --- a/src/api/types/CardPrepaidType.ts +++ b/src/api/types/CardPrepaidType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. - */ -export type CardPrepaidType = "UNKNOWN_PREPAID_TYPE" | "NOT_PREPAID" | "PREPAID"; +/** Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. */ export const CardPrepaidType = { UnknownPrepaidType: "UNKNOWN_PREPAID_TYPE", NotPrepaid: "NOT_PREPAID", Prepaid: "PREPAID", } as const; +export type CardPrepaidType = (typeof CardPrepaidType)[keyof typeof CardPrepaidType]; diff --git a/src/api/types/CardType.ts b/src/api/types/CardType.ts index b150f1ed1..fc2b8e602 100644 --- a/src/api/types/CardType.ts +++ b/src/api/types/CardType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates a card's type, such as `CREDIT` or `DEBIT`. - */ -export type CardType = "UNKNOWN_CARD_TYPE" | "CREDIT" | "DEBIT"; +/** Indicates a card's type, such as `CREDIT` or `DEBIT`. */ export const CardType = { UnknownCardType: "UNKNOWN_CARD_TYPE", Credit: "CREDIT", Debit: "DEBIT", } as const; +export type CardType = (typeof CardType)[keyof typeof CardType]; diff --git a/src/api/types/CardUpdatedEvent.ts b/src/api/types/CardUpdatedEvent.ts index 2ac6ab047..2ba22deb5 100644 --- a/src/api/types/CardUpdatedEvent.ts +++ b/src/api/types/CardUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [card](entity:Card) is updated by the seller in the Square Dashboard. diff --git a/src/api/types/CardUpdatedEventData.ts b/src/api/types/CardUpdatedEventData.ts index 1185c80fe..3c928fc5a 100644 --- a/src/api/types/CardUpdatedEventData.ts +++ b/src/api/types/CardUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CardUpdatedEventData { /** The type of the event data object. The value is `"card"`. */ diff --git a/src/api/types/CardUpdatedEventObject.ts b/src/api/types/CardUpdatedEventObject.ts index 8bf011a65..1528fd898 100644 --- a/src/api/types/CardUpdatedEventObject.ts +++ b/src/api/types/CardUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CardUpdatedEventObject { /** The updated card. */ diff --git a/src/api/types/CashAppDetails.ts b/src/api/types/CashAppDetails.ts index b1b2528b8..882377531 100644 --- a/src/api/types/CashAppDetails.ts +++ b/src/api/types/CashAppDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. diff --git a/src/api/types/CashDrawerDevice.ts b/src/api/types/CashDrawerDevice.ts index d3015226d..2d32f2ea9 100644 --- a/src/api/types/CashDrawerDevice.ts +++ b/src/api/types/CashDrawerDevice.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CashDrawerDevice { /** The device Square-issued ID */ diff --git a/src/api/types/CashDrawerEventType.ts b/src/api/types/CashDrawerEventType.ts index 21e07d00d..c2df9fb2e 100644 --- a/src/api/types/CashDrawerEventType.ts +++ b/src/api/types/CashDrawerEventType.ts @@ -1,22 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The types of events on a CashDrawerShift. * Each event type represents an employee action on the actual cash drawer * represented by a CashDrawerShift. */ -export type CashDrawerEventType = - | "NO_SALE" - | "CASH_TENDER_PAYMENT" - | "OTHER_TENDER_PAYMENT" - | "CASH_TENDER_CANCELLED_PAYMENT" - | "OTHER_TENDER_CANCELLED_PAYMENT" - | "CASH_TENDER_REFUND" - | "OTHER_TENDER_REFUND" - | "PAID_IN" - | "PAID_OUT"; export const CashDrawerEventType = { NoSale: "NO_SALE", CashTenderPayment: "CASH_TENDER_PAYMENT", @@ -28,3 +16,4 @@ export const CashDrawerEventType = { PaidIn: "PAID_IN", PaidOut: "PAID_OUT", } as const; +export type CashDrawerEventType = (typeof CashDrawerEventType)[keyof typeof CashDrawerEventType]; diff --git a/src/api/types/CashDrawerShift.ts b/src/api/types/CashDrawerShift.ts index 5d8254395..3817ae931 100644 --- a/src/api/types/CashDrawerShift.ts +++ b/src/api/types/CashDrawerShift.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * This model gives the details of a cash drawer shift. diff --git a/src/api/types/CashDrawerShiftEvent.ts b/src/api/types/CashDrawerShiftEvent.ts index ed6a3bf76..4a21ae4f3 100644 --- a/src/api/types/CashDrawerShiftEvent.ts +++ b/src/api/types/CashDrawerShiftEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CashDrawerShiftEvent { /** The unique ID of the event. */ diff --git a/src/api/types/CashDrawerShiftState.ts b/src/api/types/CashDrawerShiftState.ts index 9c3ac76de..e8c2f0eb8 100644 --- a/src/api/types/CashDrawerShiftState.ts +++ b/src/api/types/CashDrawerShiftState.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The current state of a cash drawer shift. - */ -export type CashDrawerShiftState = "OPEN" | "ENDED" | "CLOSED"; +/** The current state of a cash drawer shift. */ export const CashDrawerShiftState = { Open: "OPEN", Ended: "ENDED", Closed: "CLOSED", } as const; +export type CashDrawerShiftState = (typeof CashDrawerShiftState)[keyof typeof CashDrawerShiftState]; diff --git a/src/api/types/CashDrawerShiftSummary.ts b/src/api/types/CashDrawerShiftSummary.ts index b4053996b..3b12574b2 100644 --- a/src/api/types/CashDrawerShiftSummary.ts +++ b/src/api/types/CashDrawerShiftSummary.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The summary of a closed cash drawer shift. diff --git a/src/api/types/CashPaymentDetails.ts b/src/api/types/CashPaymentDetails.ts index baa0bfe5a..a3abe074f 100644 --- a/src/api/types/CashPaymentDetails.ts +++ b/src/api/types/CashPaymentDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Stores details about a cash payment. Contains only non-confidential information. For more information, see diff --git a/src/api/types/CatalogAvailabilityPeriod.ts b/src/api/types/CatalogAvailabilityPeriod.ts index 5400f1e59..82cfa7901 100644 --- a/src/api/types/CatalogAvailabilityPeriod.ts +++ b/src/api/types/CatalogAvailabilityPeriod.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a time period of availability. diff --git a/src/api/types/CatalogCategory.ts b/src/api/types/CatalogCategory.ts index 0abeda8e8..f4b8eeb00 100644 --- a/src/api/types/CatalogCategory.ts +++ b/src/api/types/CatalogCategory.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A category to which a `CatalogItem` instance belongs. diff --git a/src/api/types/CatalogCategoryType.ts b/src/api/types/CatalogCategoryType.ts index 0e86bdb13..3dd13f25a 100644 --- a/src/api/types/CatalogCategoryType.ts +++ b/src/api/types/CatalogCategoryType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the type of a category. - */ -export type CatalogCategoryType = "REGULAR_CATEGORY" | "MENU_CATEGORY" | "KITCHEN_CATEGORY"; +/** Indicates the type of a category. */ export const CatalogCategoryType = { RegularCategory: "REGULAR_CATEGORY", MenuCategory: "MENU_CATEGORY", KitchenCategory: "KITCHEN_CATEGORY", } as const; +export type CatalogCategoryType = (typeof CatalogCategoryType)[keyof typeof CatalogCategoryType]; diff --git a/src/api/types/CatalogCustomAttributeDefinition.ts b/src/api/types/CatalogCustomAttributeDefinition.ts index 550c1c5ae..d9dc92e5c 100644 --- a/src/api/types/CatalogCustomAttributeDefinition.ts +++ b/src/api/types/CatalogCustomAttributeDefinition.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Contains information defining a custom attribute. Custom attributes are diff --git a/src/api/types/CatalogCustomAttributeDefinitionAppVisibility.ts b/src/api/types/CatalogCustomAttributeDefinitionAppVisibility.ts index 2ca2aaa09..aaaf1eeca 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionAppVisibility.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionAppVisibility.ts @@ -1,17 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Defines the visibility of a custom attribute to applications other than their * creating application. */ -export type CatalogCustomAttributeDefinitionAppVisibility = - | "APP_VISIBILITY_HIDDEN" - | "APP_VISIBILITY_READ_ONLY" - | "APP_VISIBILITY_READ_WRITE_VALUES"; export const CatalogCustomAttributeDefinitionAppVisibility = { AppVisibilityHidden: "APP_VISIBILITY_HIDDEN", AppVisibilityReadOnly: "APP_VISIBILITY_READ_ONLY", AppVisibilityReadWriteValues: "APP_VISIBILITY_READ_WRITE_VALUES", } as const; +export type CatalogCustomAttributeDefinitionAppVisibility = + (typeof CatalogCustomAttributeDefinitionAppVisibility)[keyof typeof CatalogCustomAttributeDefinitionAppVisibility]; diff --git a/src/api/types/CatalogCustomAttributeDefinitionNumberConfig.ts b/src/api/types/CatalogCustomAttributeDefinitionNumberConfig.ts index 417d50970..759729a01 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionNumberConfig.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionNumberConfig.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CatalogCustomAttributeDefinitionNumberConfig { /** diff --git a/src/api/types/CatalogCustomAttributeDefinitionSelectionConfig.ts b/src/api/types/CatalogCustomAttributeDefinitionSelectionConfig.ts index 46e7f6cba..78afa0ffb 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionSelectionConfig.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionSelectionConfig.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Configuration associated with `SELECTION`-type custom attribute definitions. diff --git a/src/api/types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.ts b/src/api/types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.ts index 84f3d1188..ff23314c0 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A named selection for this `SELECTION`-type custom attribute definition. diff --git a/src/api/types/CatalogCustomAttributeDefinitionSellerVisibility.ts b/src/api/types/CatalogCustomAttributeDefinitionSellerVisibility.ts index dc4afe69b..39a5b2cc3 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionSellerVisibility.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionSellerVisibility.ts @@ -1,16 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Defines the visibility of a custom attribute to sellers in Square * client applications, Square APIs or in Square UIs (including Square Point * of Sale applications and Square Dashboard). */ -export type CatalogCustomAttributeDefinitionSellerVisibility = - | "SELLER_VISIBILITY_HIDDEN" - | "SELLER_VISIBILITY_READ_WRITE_VALUES"; export const CatalogCustomAttributeDefinitionSellerVisibility = { SellerVisibilityHidden: "SELLER_VISIBILITY_HIDDEN", SellerVisibilityReadWriteValues: "SELLER_VISIBILITY_READ_WRITE_VALUES", } as const; +export type CatalogCustomAttributeDefinitionSellerVisibility = + (typeof CatalogCustomAttributeDefinitionSellerVisibility)[keyof typeof CatalogCustomAttributeDefinitionSellerVisibility]; diff --git a/src/api/types/CatalogCustomAttributeDefinitionStringConfig.ts b/src/api/types/CatalogCustomAttributeDefinitionStringConfig.ts index ece421219..a185a2785 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionStringConfig.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionStringConfig.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Configuration associated with Custom Attribute Definitions of type `STRING`. diff --git a/src/api/types/CatalogCustomAttributeDefinitionType.ts b/src/api/types/CatalogCustomAttributeDefinitionType.ts index c456271cb..3ce9a2c14 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionType.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionType.ts @@ -1,14 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Defines the possible types for a custom attribute. - */ -export type CatalogCustomAttributeDefinitionType = "STRING" | "BOOLEAN" | "NUMBER" | "SELECTION"; +/** Defines the possible types for a custom attribute. */ export const CatalogCustomAttributeDefinitionType = { String: "STRING", Boolean: "BOOLEAN", Number: "NUMBER", Selection: "SELECTION", } as const; +export type CatalogCustomAttributeDefinitionType = + (typeof CatalogCustomAttributeDefinitionType)[keyof typeof CatalogCustomAttributeDefinitionType]; diff --git a/src/api/types/CatalogCustomAttributeValue.ts b/src/api/types/CatalogCustomAttributeValue.ts index 17709bb8a..50d532e7e 100644 --- a/src/api/types/CatalogCustomAttributeValue.ts +++ b/src/api/types/CatalogCustomAttributeValue.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An instance of a custom attribute. Custom attributes can be defined and diff --git a/src/api/types/CatalogDiscount.ts b/src/api/types/CatalogDiscount.ts index d152f7f98..8cc60e8bc 100644 --- a/src/api/types/CatalogDiscount.ts +++ b/src/api/types/CatalogDiscount.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A discount applicable to items. diff --git a/src/api/types/CatalogDiscountModifyTaxBasis.ts b/src/api/types/CatalogDiscountModifyTaxBasis.ts index eb9a292e7..72257b39e 100644 --- a/src/api/types/CatalogDiscountModifyTaxBasis.ts +++ b/src/api/types/CatalogDiscountModifyTaxBasis.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CatalogDiscountModifyTaxBasis = "MODIFY_TAX_BASIS" | "DO_NOT_MODIFY_TAX_BASIS"; export const CatalogDiscountModifyTaxBasis = { ModifyTaxBasis: "MODIFY_TAX_BASIS", DoNotModifyTaxBasis: "DO_NOT_MODIFY_TAX_BASIS", } as const; +export type CatalogDiscountModifyTaxBasis = + (typeof CatalogDiscountModifyTaxBasis)[keyof typeof CatalogDiscountModifyTaxBasis]; diff --git a/src/api/types/CatalogDiscountType.ts b/src/api/types/CatalogDiscountType.ts index cb163566d..f77c3d726 100644 --- a/src/api/types/CatalogDiscountType.ts +++ b/src/api/types/CatalogDiscountType.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * How to apply a CatalogDiscount to a CatalogItem. - */ -export type CatalogDiscountType = "FIXED_PERCENTAGE" | "FIXED_AMOUNT" | "VARIABLE_PERCENTAGE" | "VARIABLE_AMOUNT"; +/** How to apply a CatalogDiscount to a CatalogItem. */ export const CatalogDiscountType = { FixedPercentage: "FIXED_PERCENTAGE", FixedAmount: "FIXED_AMOUNT", VariablePercentage: "VARIABLE_PERCENTAGE", VariableAmount: "VARIABLE_AMOUNT", } as const; +export type CatalogDiscountType = (typeof CatalogDiscountType)[keyof typeof CatalogDiscountType]; diff --git a/src/api/types/CatalogEcomSeoData.ts b/src/api/types/CatalogEcomSeoData.ts index a5191e257..c307ec4dc 100644 --- a/src/api/types/CatalogEcomSeoData.ts +++ b/src/api/types/CatalogEcomSeoData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * SEO data for for a seller's Square Online store. diff --git a/src/api/types/CatalogIdMapping.ts b/src/api/types/CatalogIdMapping.ts index 6a64c6733..731701157 100644 --- a/src/api/types/CatalogIdMapping.ts +++ b/src/api/types/CatalogIdMapping.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A mapping between a temporary client-supplied ID and a permanent server-generated ID. diff --git a/src/api/types/CatalogImage.ts b/src/api/types/CatalogImage.ts index 702f7a63f..7a548767c 100644 --- a/src/api/types/CatalogImage.ts +++ b/src/api/types/CatalogImage.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * An image file to use in Square catalogs. It can be associated with diff --git a/src/api/types/CatalogInfoResponse.ts b/src/api/types/CatalogInfoResponse.ts index 74498a909..4639e0fce 100644 --- a/src/api/types/CatalogInfoResponse.ts +++ b/src/api/types/CatalogInfoResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogInfoResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/CatalogInfoResponseLimits.ts b/src/api/types/CatalogInfoResponseLimits.ts index 882ba531e..554d548ab 100644 --- a/src/api/types/CatalogInfoResponseLimits.ts +++ b/src/api/types/CatalogInfoResponseLimits.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CatalogInfoResponseLimits { /** diff --git a/src/api/types/CatalogItem.ts b/src/api/types/CatalogItem.ts index 3a60ac7e0..e3fcba9a5 100644 --- a/src/api/types/CatalogItem.ts +++ b/src/api/types/CatalogItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A [CatalogObject](entity:CatalogObject) instance of the `ITEM` type, also referred to as an item, in the catalog. diff --git a/src/api/types/CatalogItemFoodAndBeverageDetails.ts b/src/api/types/CatalogItemFoodAndBeverageDetails.ts index eace1998d..fd66a54b6 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetails.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The food and beverage-specific details of a `FOOD_AND_BEV` item. diff --git a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreference.ts b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreference.ts index 9b5123a8b..b796ead06 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreference.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreference.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its ingredients. diff --git a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.ts b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.ts index 434c7588d..7abc56223 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.ts @@ -1,18 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Standard dietary preferences for food and beverage items that are recommended on item creation. - */ -export type CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = - | "DAIRY_FREE" - | "GLUTEN_FREE" - | "HALAL" - | "KOSHER" - | "NUT_FREE" - | "VEGAN" - | "VEGETARIAN"; +/** Standard dietary preferences for food and beverage items that are recommended on item creation. */ export const CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = { DairyFree: "DAIRY_FREE", GlutenFree: "GLUTEN_FREE", @@ -22,3 +10,5 @@ export const CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPr Vegan: "VEGAN", Vegetarian: "VEGETARIAN", } as const; +export type CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = + (typeof CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference)[keyof typeof CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference]; diff --git a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType.ts b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType.ts index 31bb4e4f5..ef1b5c56a 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. - */ -export type CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = "STANDARD" | "CUSTOM"; +/** The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. */ export const CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = { Standard: "STANDARD", Custom: "CUSTOM", } as const; +export type CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = + (typeof CatalogItemFoodAndBeverageDetailsDietaryPreferenceType)[keyof typeof CatalogItemFoodAndBeverageDetailsDietaryPreferenceType]; diff --git a/src/api/types/CatalogItemFoodAndBeverageDetailsIngredient.ts b/src/api/types/CatalogItemFoodAndBeverageDetailsIngredient.ts index 95e34bd26..3887b1610 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetailsIngredient.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetailsIngredient.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes the ingredient used in a `FOOD_AND_BEV` item. diff --git a/src/api/types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.ts b/src/api/types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.ts index cef5da03e..b861dd04c 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.ts @@ -1,25 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Standard ingredients for food and beverage items that are recommended on item creation. - */ -export type CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = - | "CELERY" - | "CRUSTACEANS" - | "EGGS" - | "FISH" - | "GLUTEN" - | "LUPIN" - | "MILK" - | "MOLLUSCS" - | "MUSTARD" - | "PEANUTS" - | "SESAME" - | "SOY" - | "SULPHITES" - | "TREE_NUTS"; +/** Standard ingredients for food and beverage items that are recommended on item creation. */ export const CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = { Celery: "CELERY", Crustaceans: "CRUSTACEANS", @@ -36,3 +17,5 @@ export const CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = { Sulphites: "SULPHITES", TreeNuts: "TREE_NUTS", } as const; +export type CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = + (typeof CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient)[keyof typeof CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient]; diff --git a/src/api/types/CatalogItemModifierListInfo.ts b/src/api/types/CatalogItemModifierListInfo.ts index de2ce69c0..fc23c1005 100644 --- a/src/api/types/CatalogItemModifierListInfo.ts +++ b/src/api/types/CatalogItemModifierListInfo.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Controls how a modifier list is applied to a specific item. This object allows for item-specific customization of modifier list behavior diff --git a/src/api/types/CatalogItemOption.ts b/src/api/types/CatalogItemOption.ts index fa15b7904..892e9b54c 100644 --- a/src/api/types/CatalogItemOption.ts +++ b/src/api/types/CatalogItemOption.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A group of variations for a `CatalogItem`. diff --git a/src/api/types/CatalogItemOptionForItem.ts b/src/api/types/CatalogItemOptionForItem.ts index 1dc6995d2..2909b8c7c 100644 --- a/src/api/types/CatalogItemOptionForItem.ts +++ b/src/api/types/CatalogItemOptionForItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * An option that can be assigned to an item. diff --git a/src/api/types/CatalogItemOptionValue.ts b/src/api/types/CatalogItemOptionValue.ts index 3be28f3f6..a5045a8c1 100644 --- a/src/api/types/CatalogItemOptionValue.ts +++ b/src/api/types/CatalogItemOptionValue.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * An enumerated value that can link a diff --git a/src/api/types/CatalogItemOptionValueForItemVariation.ts b/src/api/types/CatalogItemOptionValueForItemVariation.ts index 5a23de8aa..8d4ac5ddb 100644 --- a/src/api/types/CatalogItemOptionValueForItemVariation.ts +++ b/src/api/types/CatalogItemOptionValueForItemVariation.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A `CatalogItemOptionValue` links an item variation to an item option as diff --git a/src/api/types/CatalogItemProductType.ts b/src/api/types/CatalogItemProductType.ts index 3fc91902c..4c916b763 100644 --- a/src/api/types/CatalogItemProductType.ts +++ b/src/api/types/CatalogItemProductType.ts @@ -1,20 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. - */ -export type CatalogItemProductType = - | "REGULAR" - | "GIFT_CARD" - | "APPOINTMENTS_SERVICE" - | "FOOD_AND_BEV" - | "EVENT" - | "DIGITAL" - | "DONATION" - | "LEGACY_SQUARE_ONLINE_SERVICE" - | "LEGACY_SQUARE_ONLINE_MEMBERSHIP"; +/** The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. */ export const CatalogItemProductType = { Regular: "REGULAR", GiftCard: "GIFT_CARD", @@ -26,3 +12,4 @@ export const CatalogItemProductType = { LegacySquareOnlineService: "LEGACY_SQUARE_ONLINE_SERVICE", LegacySquareOnlineMembership: "LEGACY_SQUARE_ONLINE_MEMBERSHIP", } as const; +export type CatalogItemProductType = (typeof CatalogItemProductType)[keyof typeof CatalogItemProductType]; diff --git a/src/api/types/CatalogItemVariation.ts b/src/api/types/CatalogItemVariation.ts index 59b92d315..73678d9ea 100644 --- a/src/api/types/CatalogItemVariation.ts +++ b/src/api/types/CatalogItemVariation.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An item variation, representing a product for sale, in the Catalog object model. Each [item](entity:CatalogItem) must have at least one diff --git a/src/api/types/CatalogMeasurementUnit.ts b/src/api/types/CatalogMeasurementUnit.ts index 9e37e5874..9eeca096e 100644 --- a/src/api/types/CatalogMeasurementUnit.ts +++ b/src/api/types/CatalogMeasurementUnit.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the unit used to measure a `CatalogItemVariation` and diff --git a/src/api/types/CatalogModifier.ts b/src/api/types/CatalogModifier.ts index 240e396db..ae423df0f 100644 --- a/src/api/types/CatalogModifier.ts +++ b/src/api/types/CatalogModifier.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A modifier that can be applied to items at the time of sale. For example, a cheese modifier for a burger, or a flavor modifier for a serving of ice cream. diff --git a/src/api/types/CatalogModifierList.ts b/src/api/types/CatalogModifierList.ts index 8c58b90e9..4c8696672 100644 --- a/src/api/types/CatalogModifierList.ts +++ b/src/api/types/CatalogModifierList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A container for a list of modifiers, or a text-based modifier. diff --git a/src/api/types/CatalogModifierListModifierType.ts b/src/api/types/CatalogModifierListModifierType.ts index 3275ff7f8..ceb042745 100644 --- a/src/api/types/CatalogModifierListModifierType.ts +++ b/src/api/types/CatalogModifierListModifierType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Defines the type of `CatalogModifierList`. - */ -export type CatalogModifierListModifierType = "LIST" | "TEXT"; +/** Defines the type of `CatalogModifierList`. */ export const CatalogModifierListModifierType = { List: "LIST", Text: "TEXT", } as const; +export type CatalogModifierListModifierType = + (typeof CatalogModifierListModifierType)[keyof typeof CatalogModifierListModifierType]; diff --git a/src/api/types/CatalogModifierListSelectionType.ts b/src/api/types/CatalogModifierListSelectionType.ts index ff4aea126..24057a3eb 100644 --- a/src/api/types/CatalogModifierListSelectionType.ts +++ b/src/api/types/CatalogModifierListSelectionType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates whether a CatalogModifierList supports multiple selections. - */ -export type CatalogModifierListSelectionType = "SINGLE" | "MULTIPLE"; +/** Indicates whether a CatalogModifierList supports multiple selections. */ export const CatalogModifierListSelectionType = { Single: "SINGLE", Multiple: "MULTIPLE", } as const; +export type CatalogModifierListSelectionType = + (typeof CatalogModifierListSelectionType)[keyof typeof CatalogModifierListSelectionType]; diff --git a/src/api/types/CatalogModifierOverride.ts b/src/api/types/CatalogModifierOverride.ts index ceefe9122..7ce823aa2 100644 --- a/src/api/types/CatalogModifierOverride.ts +++ b/src/api/types/CatalogModifierOverride.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Options to control how to override the default behavior of the specified modifier. diff --git a/src/api/types/CatalogObject.ts b/src/api/types/CatalogObject.ts index 0a9bb9766..fce388276 100644 --- a/src/api/types/CatalogObject.ts +++ b/src/api/types/CatalogObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The wrapper object for the catalog entries of a given object type. @@ -113,4 +111,37 @@ export namespace CatalogObject { export interface AvailabilityPeriod extends Square.CatalogObjectAvailabilityPeriod { type: "AVAILABILITY_PERIOD"; } + + /** + * The wrapper object for the catalog entries of a given object type. + * + * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. + * + * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. + * + * In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. + * + * For a more detailed discussion of the Catalog data model, please see the + * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. + */ + export type Request = + | Square.CatalogObject.Item + | Square.CatalogObject.Image + | Square.CatalogObject.Category + | Square.CatalogObject.ItemVariation + | Square.CatalogObject.Tax + | Square.CatalogObject.Discount + | Square.CatalogObject.ModifierList + | Square.CatalogObject.Modifier + | Square.CatalogObject.PricingRule + | Square.CatalogObject.ProductSet + | Square.CatalogObject.TimePeriod + | Square.CatalogObject.MeasurementUnit + | Square.CatalogObject.SubscriptionPlanVariation + | Square.CatalogObject.ItemOption + | Square.CatalogObject.ItemOptionVal + | Square.CatalogObject.CustomAttributeDefinition + | Square.CatalogObject.QuickAmountsSettings + | Square.CatalogObject.SubscriptionPlan + | Square.CatalogObject.AvailabilityPeriod; } diff --git a/src/api/types/CatalogObjectAvailabilityPeriod.ts b/src/api/types/CatalogObjectAvailabilityPeriod.ts index 84fade229..ecc08c3f7 100644 --- a/src/api/types/CatalogObjectAvailabilityPeriod.ts +++ b/src/api/types/CatalogObjectAvailabilityPeriod.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectAvailabilityPeriod extends Square.CatalogObjectBase { /** Structured data for a `CatalogAvailabilityPeriod`, set for CatalogObjects of type `AVAILABILITY_PERIOD`. */ diff --git a/src/api/types/CatalogObjectBase.ts b/src/api/types/CatalogObjectBase.ts index 27fea738d..1917d8621 100644 --- a/src/api/types/CatalogObjectBase.ts +++ b/src/api/types/CatalogObjectBase.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectBase { /** diff --git a/src/api/types/CatalogObjectBatch.ts b/src/api/types/CatalogObjectBatch.ts index e64670b38..c16d991b8 100644 --- a/src/api/types/CatalogObjectBatch.ts +++ b/src/api/types/CatalogObjectBatch.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A batch of catalog objects. diff --git a/src/api/types/CatalogObjectCategory.ts b/src/api/types/CatalogObjectCategory.ts index 1f73ec2e7..556712ffe 100644 --- a/src/api/types/CatalogObjectCategory.ts +++ b/src/api/types/CatalogObjectCategory.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A category that can be assigned to an item or a parent category that can be assigned diff --git a/src/api/types/CatalogObjectCustomAttributeDefinition.ts b/src/api/types/CatalogObjectCustomAttributeDefinition.ts index 90777ecf4..f6f02a7e7 100644 --- a/src/api/types/CatalogObjectCustomAttributeDefinition.ts +++ b/src/api/types/CatalogObjectCustomAttributeDefinition.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectCustomAttributeDefinition extends Square.CatalogObjectBase { /** Structured data for a `CatalogCustomAttributeDefinition`, set for CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. */ diff --git a/src/api/types/CatalogObjectDiscount.ts b/src/api/types/CatalogObjectDiscount.ts index cd8623cbb..f9b7e1911 100644 --- a/src/api/types/CatalogObjectDiscount.ts +++ b/src/api/types/CatalogObjectDiscount.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectDiscount extends Square.CatalogObjectBase { /** Structured data for a `CatalogDiscount`, set for CatalogObjects of type `DISCOUNT`. */ diff --git a/src/api/types/CatalogObjectImage.ts b/src/api/types/CatalogObjectImage.ts index 85ee6f5d7..47811d3bd 100644 --- a/src/api/types/CatalogObjectImage.ts +++ b/src/api/types/CatalogObjectImage.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectImage extends Square.CatalogObjectBase { /** Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`. */ diff --git a/src/api/types/CatalogObjectItem.ts b/src/api/types/CatalogObjectItem.ts index 041ad742e..845c9c414 100644 --- a/src/api/types/CatalogObjectItem.ts +++ b/src/api/types/CatalogObjectItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectItem extends Square.CatalogObjectBase { /** Structured data for a `CatalogItem`, set for CatalogObjects of type `ITEM`. */ diff --git a/src/api/types/CatalogObjectItemOption.ts b/src/api/types/CatalogObjectItemOption.ts index aa14a0a27..e237c8e75 100644 --- a/src/api/types/CatalogObjectItemOption.ts +++ b/src/api/types/CatalogObjectItemOption.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectItemOption extends Square.CatalogObjectBase { /** Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`. */ diff --git a/src/api/types/CatalogObjectItemOptionValue.ts b/src/api/types/CatalogObjectItemOptionValue.ts index e2538bd44..61906a0fe 100644 --- a/src/api/types/CatalogObjectItemOptionValue.ts +++ b/src/api/types/CatalogObjectItemOptionValue.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectItemOptionValue extends Square.CatalogObjectBase { /** Structured data for a `CatalogItemOptionValue`, set for CatalogObjects of type `ITEM_OPTION_VAL`. */ diff --git a/src/api/types/CatalogObjectItemVariation.ts b/src/api/types/CatalogObjectItemVariation.ts index e3db4f88e..7145f4c70 100644 --- a/src/api/types/CatalogObjectItemVariation.ts +++ b/src/api/types/CatalogObjectItemVariation.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectItemVariation extends Square.CatalogObjectBase { /** Structured data for a `CatalogItemVariation`, set for CatalogObjects of type `ITEM_VARIATION`. */ diff --git a/src/api/types/CatalogObjectMeasurementUnit.ts b/src/api/types/CatalogObjectMeasurementUnit.ts index 617db0199..2e788f2f8 100644 --- a/src/api/types/CatalogObjectMeasurementUnit.ts +++ b/src/api/types/CatalogObjectMeasurementUnit.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectMeasurementUnit extends Square.CatalogObjectBase { /** Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects of type `MEASUREMENT_UNIT`. */ diff --git a/src/api/types/CatalogObjectModifier.ts b/src/api/types/CatalogObjectModifier.ts index 4035903a2..499a579a1 100644 --- a/src/api/types/CatalogObjectModifier.ts +++ b/src/api/types/CatalogObjectModifier.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectModifier extends Square.CatalogObjectBase { /** Structured data for a `CatalogModifier`, set for CatalogObjects of type `MODIFIER`. */ diff --git a/src/api/types/CatalogObjectModifierList.ts b/src/api/types/CatalogObjectModifierList.ts index ba19d39a3..9751988e7 100644 --- a/src/api/types/CatalogObjectModifierList.ts +++ b/src/api/types/CatalogObjectModifierList.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectModifierList extends Square.CatalogObjectBase { /** Structured data for a `CatalogModifierList`, set for CatalogObjects of type `MODIFIER_LIST`. */ diff --git a/src/api/types/CatalogObjectPricingRule.ts b/src/api/types/CatalogObjectPricingRule.ts index 7ebc2203b..a5b4f31e5 100644 --- a/src/api/types/CatalogObjectPricingRule.ts +++ b/src/api/types/CatalogObjectPricingRule.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectPricingRule extends Square.CatalogObjectBase { /** diff --git a/src/api/types/CatalogObjectProductSet.ts b/src/api/types/CatalogObjectProductSet.ts index 8a8ac48d0..97651155a 100644 --- a/src/api/types/CatalogObjectProductSet.ts +++ b/src/api/types/CatalogObjectProductSet.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectProductSet extends Square.CatalogObjectBase { /** Structured data for a `CatalogProductSet`, set for CatalogObjects of type `PRODUCT_SET`. */ diff --git a/src/api/types/CatalogObjectQuickAmountsSettings.ts b/src/api/types/CatalogObjectQuickAmountsSettings.ts index 96dfaae14..9bac196ec 100644 --- a/src/api/types/CatalogObjectQuickAmountsSettings.ts +++ b/src/api/types/CatalogObjectQuickAmountsSettings.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectQuickAmountsSettings extends Square.CatalogObjectBase { /** Structured data for a `CatalogQuickAmountsSettings`, set for CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. */ diff --git a/src/api/types/CatalogObjectReference.ts b/src/api/types/CatalogObjectReference.ts index bae12f831..a9f6d72d6 100644 --- a/src/api/types/CatalogObjectReference.ts +++ b/src/api/types/CatalogObjectReference.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A reference to a Catalog object at a specific version. In general this is diff --git a/src/api/types/CatalogObjectSubscriptionPlan.ts b/src/api/types/CatalogObjectSubscriptionPlan.ts index cc8f91f21..96ec7bbde 100644 --- a/src/api/types/CatalogObjectSubscriptionPlan.ts +++ b/src/api/types/CatalogObjectSubscriptionPlan.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectSubscriptionPlan extends Square.CatalogObjectBase { /** Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`. */ diff --git a/src/api/types/CatalogObjectSubscriptionPlanVariation.ts b/src/api/types/CatalogObjectSubscriptionPlanVariation.ts index e7ad55b81..1c80142c2 100644 --- a/src/api/types/CatalogObjectSubscriptionPlanVariation.ts +++ b/src/api/types/CatalogObjectSubscriptionPlanVariation.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectSubscriptionPlanVariation extends Square.CatalogObjectBase { /** Structured data for a `CatalogSubscriptionPlanVariation`, set for CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`. */ diff --git a/src/api/types/CatalogObjectTax.ts b/src/api/types/CatalogObjectTax.ts index 9bd1f77c9..75a9dc637 100644 --- a/src/api/types/CatalogObjectTax.ts +++ b/src/api/types/CatalogObjectTax.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectTax extends Square.CatalogObjectBase { /** Structured data for a `CatalogTax`, set for CatalogObjects of type `TAX`. */ diff --git a/src/api/types/CatalogObjectTimePeriod.ts b/src/api/types/CatalogObjectTimePeriod.ts index 7e550db1a..d72b04a64 100644 --- a/src/api/types/CatalogObjectTimePeriod.ts +++ b/src/api/types/CatalogObjectTimePeriod.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogObjectTimePeriod extends Square.CatalogObjectBase { /** Structured data for a `CatalogTimePeriod`, set for CatalogObjects of type `TIME_PERIOD`. */ diff --git a/src/api/types/CatalogObjectType.ts b/src/api/types/CatalogObjectType.ts index 65f04fa5d..ec88763cd 100644 --- a/src/api/types/CatalogObjectType.ts +++ b/src/api/types/CatalogObjectType.ts @@ -1,31 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Possible types of CatalogObjects returned from the catalog, each * containing type-specific properties in the `*_data` field corresponding to the specified object type. */ -export type CatalogObjectType = - | "ITEM" - | "IMAGE" - | "CATEGORY" - | "ITEM_VARIATION" - | "TAX" - | "DISCOUNT" - | "MODIFIER_LIST" - | "MODIFIER" - | "PRICING_RULE" - | "PRODUCT_SET" - | "TIME_PERIOD" - | "MEASUREMENT_UNIT" - | "SUBSCRIPTION_PLAN_VARIATION" - | "ITEM_OPTION" - | "ITEM_OPTION_VAL" - | "CUSTOM_ATTRIBUTE_DEFINITION" - | "QUICK_AMOUNTS_SETTINGS" - | "SUBSCRIPTION_PLAN" - | "AVAILABILITY_PERIOD"; export const CatalogObjectType = { Item: "ITEM", Image: "IMAGE", @@ -47,3 +25,4 @@ export const CatalogObjectType = { SubscriptionPlan: "SUBSCRIPTION_PLAN", AvailabilityPeriod: "AVAILABILITY_PERIOD", } as const; +export type CatalogObjectType = (typeof CatalogObjectType)[keyof typeof CatalogObjectType]; diff --git a/src/api/types/CatalogPricingRule.ts b/src/api/types/CatalogPricingRule.ts index 7097f093e..8a68bc019 100644 --- a/src/api/types/CatalogPricingRule.ts +++ b/src/api/types/CatalogPricingRule.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines how discounts are automatically applied to a set of items that match the pricing rule diff --git a/src/api/types/CatalogPricingType.ts b/src/api/types/CatalogPricingType.ts index e1fb68180..755adb487 100644 --- a/src/api/types/CatalogPricingType.ts +++ b/src/api/types/CatalogPricingType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. - */ -export type CatalogPricingType = "FIXED_PRICING" | "VARIABLE_PRICING"; +/** Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. */ export const CatalogPricingType = { FixedPricing: "FIXED_PRICING", VariablePricing: "VARIABLE_PRICING", } as const; +export type CatalogPricingType = (typeof CatalogPricingType)[keyof typeof CatalogPricingType]; diff --git a/src/api/types/CatalogProductSet.ts b/src/api/types/CatalogProductSet.ts index af45500a6..ec01f4b80 100644 --- a/src/api/types/CatalogProductSet.ts +++ b/src/api/types/CatalogProductSet.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a collection of catalog objects for the purpose of applying a diff --git a/src/api/types/CatalogQuery.ts b/src/api/types/CatalogQuery.ts index e4e09f74f..5c1acbe6a 100644 --- a/src/api/types/CatalogQuery.ts +++ b/src/api/types/CatalogQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint. diff --git a/src/api/types/CatalogQueryExact.ts b/src/api/types/CatalogQueryExact.ts index 762749a7d..bf84376ae 100644 --- a/src/api/types/CatalogQueryExact.ts +++ b/src/api/types/CatalogQueryExact.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The query filter to return the search result by exact match of the specified attribute name and value. diff --git a/src/api/types/CatalogQueryItemVariationsForItemOptionValues.ts b/src/api/types/CatalogQueryItemVariationsForItemOptionValues.ts index 9f3a4f122..efe699b7c 100644 --- a/src/api/types/CatalogQueryItemVariationsForItemOptionValues.ts +++ b/src/api/types/CatalogQueryItemVariationsForItemOptionValues.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The query filter to return the item variations containing the specified item option value IDs. diff --git a/src/api/types/CatalogQueryItemsForItemOptions.ts b/src/api/types/CatalogQueryItemsForItemOptions.ts index 39e525afb..409e2ea45 100644 --- a/src/api/types/CatalogQueryItemsForItemOptions.ts +++ b/src/api/types/CatalogQueryItemsForItemOptions.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The query filter to return the items containing the specified item option IDs. diff --git a/src/api/types/CatalogQueryItemsForModifierList.ts b/src/api/types/CatalogQueryItemsForModifierList.ts index b1b539be4..6de216e7a 100644 --- a/src/api/types/CatalogQueryItemsForModifierList.ts +++ b/src/api/types/CatalogQueryItemsForModifierList.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The query filter to return the items containing the specified modifier list IDs. diff --git a/src/api/types/CatalogQueryItemsForTax.ts b/src/api/types/CatalogQueryItemsForTax.ts index 74186305a..41f63e4c0 100644 --- a/src/api/types/CatalogQueryItemsForTax.ts +++ b/src/api/types/CatalogQueryItemsForTax.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The query filter to return the items containing the specified tax IDs. diff --git a/src/api/types/CatalogQueryPrefix.ts b/src/api/types/CatalogQueryPrefix.ts index a834d4c3d..3a06c45d3 100644 --- a/src/api/types/CatalogQueryPrefix.ts +++ b/src/api/types/CatalogQueryPrefix.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. diff --git a/src/api/types/CatalogQueryRange.ts b/src/api/types/CatalogQueryRange.ts index c1a96a683..9ab1b87df 100644 --- a/src/api/types/CatalogQueryRange.ts +++ b/src/api/types/CatalogQueryRange.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The query filter to return the search result whose named attribute values fall between the specified range. diff --git a/src/api/types/CatalogQuerySet.ts b/src/api/types/CatalogQuerySet.ts index 316819065..b888fc430 100644 --- a/src/api/types/CatalogQuerySet.ts +++ b/src/api/types/CatalogQuerySet.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of diff --git a/src/api/types/CatalogQuerySortedAttribute.ts b/src/api/types/CatalogQuerySortedAttribute.ts index 44807e89f..5793ab788 100644 --- a/src/api/types/CatalogQuerySortedAttribute.ts +++ b/src/api/types/CatalogQuerySortedAttribute.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The query expression to specify the key to sort search results. diff --git a/src/api/types/CatalogQueryText.ts b/src/api/types/CatalogQueryText.ts index 166de4c8a..8cf667247 100644 --- a/src/api/types/CatalogQueryText.ts +++ b/src/api/types/CatalogQueryText.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The query filter to return the search result whose searchable attribute values contain all of the specified keywords or tokens, independent of the token order or case. diff --git a/src/api/types/CatalogQuickAmount.ts b/src/api/types/CatalogQuickAmount.ts index 8771b7c83..f97e4f0cf 100644 --- a/src/api/types/CatalogQuickAmount.ts +++ b/src/api/types/CatalogQuickAmount.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a Quick Amount in the Catalog. diff --git a/src/api/types/CatalogQuickAmountType.ts b/src/api/types/CatalogQuickAmountType.ts index 5cc618fa9..19c96d881 100644 --- a/src/api/types/CatalogQuickAmountType.ts +++ b/src/api/types/CatalogQuickAmountType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Determines the type of a specific Quick Amount. - */ -export type CatalogQuickAmountType = "QUICK_AMOUNT_TYPE_MANUAL" | "QUICK_AMOUNT_TYPE_AUTO"; +/** Determines the type of a specific Quick Amount. */ export const CatalogQuickAmountType = { QuickAmountTypeManual: "QUICK_AMOUNT_TYPE_MANUAL", QuickAmountTypeAuto: "QUICK_AMOUNT_TYPE_AUTO", } as const; +export type CatalogQuickAmountType = (typeof CatalogQuickAmountType)[keyof typeof CatalogQuickAmountType]; diff --git a/src/api/types/CatalogQuickAmountsSettings.ts b/src/api/types/CatalogQuickAmountsSettings.ts index f10fa63d9..89d19f3c1 100644 --- a/src/api/types/CatalogQuickAmountsSettings.ts +++ b/src/api/types/CatalogQuickAmountsSettings.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. diff --git a/src/api/types/CatalogQuickAmountsSettingsOption.ts b/src/api/types/CatalogQuickAmountsSettingsOption.ts index e25228ade..180ccf5ac 100644 --- a/src/api/types/CatalogQuickAmountsSettingsOption.ts +++ b/src/api/types/CatalogQuickAmountsSettingsOption.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Determines a seller's option on Quick Amounts feature. - */ -export type CatalogQuickAmountsSettingsOption = "DISABLED" | "MANUAL" | "AUTO"; +/** Determines a seller's option on Quick Amounts feature. */ export const CatalogQuickAmountsSettingsOption = { Disabled: "DISABLED", Manual: "MANUAL", Auto: "AUTO", } as const; +export type CatalogQuickAmountsSettingsOption = + (typeof CatalogQuickAmountsSettingsOption)[keyof typeof CatalogQuickAmountsSettingsOption]; diff --git a/src/api/types/CatalogStockConversion.ts b/src/api/types/CatalogStockConversion.ts index 2293c944f..47960031b 100644 --- a/src/api/types/CatalogStockConversion.ts +++ b/src/api/types/CatalogStockConversion.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the rule of conversion between a stockable [CatalogItemVariation](entity:CatalogItemVariation) diff --git a/src/api/types/CatalogSubscriptionPlan.ts b/src/api/types/CatalogSubscriptionPlan.ts index a649ce62e..3c3e9c96d 100644 --- a/src/api/types/CatalogSubscriptionPlan.ts +++ b/src/api/types/CatalogSubscriptionPlan.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a subscription plan. A subscription plan represents what you want to sell in a subscription model, and includes references to each of the associated subscription plan variations. diff --git a/src/api/types/CatalogSubscriptionPlanVariation.ts b/src/api/types/CatalogSubscriptionPlanVariation.ts index a3b24149d..876d36213 100644 --- a/src/api/types/CatalogSubscriptionPlanVariation.ts +++ b/src/api/types/CatalogSubscriptionPlanVariation.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a subscription plan variation. A subscription plan variation represents how the subscription for a product or service is sold. diff --git a/src/api/types/CatalogTax.ts b/src/api/types/CatalogTax.ts index 7333f2886..bc4d6597d 100644 --- a/src/api/types/CatalogTax.ts +++ b/src/api/types/CatalogTax.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A tax applicable to an item. diff --git a/src/api/types/CatalogTimePeriod.ts b/src/api/types/CatalogTimePeriod.ts index f93d98fa6..251e32851 100644 --- a/src/api/types/CatalogTimePeriod.ts +++ b/src/api/types/CatalogTimePeriod.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a time period - either a single period or a repeating period. diff --git a/src/api/types/CatalogV1Id.ts b/src/api/types/CatalogV1Id.ts index 7e8e9b68c..67fbe167f 100644 --- a/src/api/types/CatalogV1Id.ts +++ b/src/api/types/CatalogV1Id.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A Square API V1 identifier of an item, including the object ID and its associated location ID. diff --git a/src/api/types/CatalogVersionUpdatedEvent.ts b/src/api/types/CatalogVersionUpdatedEvent.ts index d7cf3d759..50f5f0e8c 100644 --- a/src/api/types/CatalogVersionUpdatedEvent.ts +++ b/src/api/types/CatalogVersionUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when the catalog is updated. diff --git a/src/api/types/CatalogVersionUpdatedEventCatalogVersion.ts b/src/api/types/CatalogVersionUpdatedEventCatalogVersion.ts index 917e5cf61..bf4f00118 100644 --- a/src/api/types/CatalogVersionUpdatedEventCatalogVersion.ts +++ b/src/api/types/CatalogVersionUpdatedEventCatalogVersion.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CatalogVersionUpdatedEventCatalogVersion { /** Last modification timestamp in RFC 3339 format. */ diff --git a/src/api/types/CatalogVersionUpdatedEventData.ts b/src/api/types/CatalogVersionUpdatedEventData.ts index c554fd6ee..dfe06045a 100644 --- a/src/api/types/CatalogVersionUpdatedEventData.ts +++ b/src/api/types/CatalogVersionUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogVersionUpdatedEventData { /** Name of the affected object’s type. */ diff --git a/src/api/types/CatalogVersionUpdatedEventObject.ts b/src/api/types/CatalogVersionUpdatedEventObject.ts index d2ee6eaa8..602192638 100644 --- a/src/api/types/CatalogVersionUpdatedEventObject.ts +++ b/src/api/types/CatalogVersionUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CatalogVersionUpdatedEventObject { /** The version of the object. */ diff --git a/src/api/types/CategoryPathToRootNode.ts b/src/api/types/CategoryPathToRootNode.ts index 3b8994258..caa724b92 100644 --- a/src/api/types/CategoryPathToRootNode.ts +++ b/src/api/types/CategoryPathToRootNode.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A node in the path from a retrieved category to its root node. diff --git a/src/api/types/ChangeBillingAnchorDateResponse.ts b/src/api/types/ChangeBillingAnchorDateResponse.ts index f05bb0771..af5b4eaa0 100644 --- a/src/api/types/ChangeBillingAnchorDateResponse.ts +++ b/src/api/types/ChangeBillingAnchorDateResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a request to the diff --git a/src/api/types/ChangeTiming.ts b/src/api/types/ChangeTiming.ts index 856c8c36f..9622388aa 100644 --- a/src/api/types/ChangeTiming.ts +++ b/src/api/types/ChangeTiming.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Supported timings when a pending change, as an action, takes place to a subscription. - */ -export type ChangeTiming = "IMMEDIATE" | "END_OF_BILLING_CYCLE"; +/** Supported timings when a pending change, as an action, takes place to a subscription. */ export const ChangeTiming = { Immediate: "IMMEDIATE", EndOfBillingCycle: "END_OF_BILLING_CYCLE", } as const; +export type ChangeTiming = (typeof ChangeTiming)[keyof typeof ChangeTiming]; diff --git a/src/api/types/Channel.ts b/src/api/types/Channel.ts index 6a655fc63..64dc9d913 100644 --- a/src/api/types/Channel.ts +++ b/src/api/types/Channel.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface Channel { /** The channel's unique ID. */ diff --git a/src/api/types/ChannelStatus.ts b/src/api/types/ChannelStatus.ts index b10da68a2..262474671 100644 --- a/src/api/types/ChannelStatus.ts +++ b/src/api/types/ChannelStatus.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type ChannelStatus = "ACTIVE" | "INACTIVE"; export const ChannelStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; +export type ChannelStatus = (typeof ChannelStatus)[keyof typeof ChannelStatus]; diff --git a/src/api/types/ChargeRequestAdditionalRecipient.ts b/src/api/types/ChargeRequestAdditionalRecipient.ts index 86f123eca..b73f813c4 100644 --- a/src/api/types/ChargeRequestAdditionalRecipient.ts +++ b/src/api/types/ChargeRequestAdditionalRecipient.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an additional recipient (other than the merchant) entitled to a portion of the tender. diff --git a/src/api/types/Checkout.ts b/src/api/types/Checkout.ts index 377cb8125..9f9cf94d6 100644 --- a/src/api/types/Checkout.ts +++ b/src/api/types/Checkout.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Square Checkout lets merchants accept online payments for supported diff --git a/src/api/types/CheckoutLocationSettings.ts b/src/api/types/CheckoutLocationSettings.ts index 5f4ddd1a5..44c086a5a 100644 --- a/src/api/types/CheckoutLocationSettings.ts +++ b/src/api/types/CheckoutLocationSettings.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CheckoutLocationSettings { /** The ID of the location that these settings apply to. */ diff --git a/src/api/types/CheckoutLocationSettingsBranding.ts b/src/api/types/CheckoutLocationSettingsBranding.ts index 1c87ae6c4..d0baa5ba9 100644 --- a/src/api/types/CheckoutLocationSettingsBranding.ts +++ b/src/api/types/CheckoutLocationSettingsBranding.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CheckoutLocationSettingsBranding { /** diff --git a/src/api/types/CheckoutLocationSettingsBrandingButtonShape.ts b/src/api/types/CheckoutLocationSettingsBrandingButtonShape.ts index 524ef6661..e57320add 100644 --- a/src/api/types/CheckoutLocationSettingsBrandingButtonShape.ts +++ b/src/api/types/CheckoutLocationSettingsBrandingButtonShape.ts @@ -1,10 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CheckoutLocationSettingsBrandingButtonShape = "SQUARED" | "ROUNDED" | "PILL"; export const CheckoutLocationSettingsBrandingButtonShape = { Squared: "SQUARED", Rounded: "ROUNDED", Pill: "PILL", } as const; +export type CheckoutLocationSettingsBrandingButtonShape = + (typeof CheckoutLocationSettingsBrandingButtonShape)[keyof typeof CheckoutLocationSettingsBrandingButtonShape]; diff --git a/src/api/types/CheckoutLocationSettingsBrandingHeaderType.ts b/src/api/types/CheckoutLocationSettingsBrandingHeaderType.ts index cea18d8b9..b727723c6 100644 --- a/src/api/types/CheckoutLocationSettingsBrandingHeaderType.ts +++ b/src/api/types/CheckoutLocationSettingsBrandingHeaderType.ts @@ -1,10 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CheckoutLocationSettingsBrandingHeaderType = "BUSINESS_NAME" | "FRAMED_LOGO" | "FULL_WIDTH_LOGO"; export const CheckoutLocationSettingsBrandingHeaderType = { BusinessName: "BUSINESS_NAME", FramedLogo: "FRAMED_LOGO", FullWidthLogo: "FULL_WIDTH_LOGO", } as const; +export type CheckoutLocationSettingsBrandingHeaderType = + (typeof CheckoutLocationSettingsBrandingHeaderType)[keyof typeof CheckoutLocationSettingsBrandingHeaderType]; diff --git a/src/api/types/CheckoutLocationSettingsCoupons.ts b/src/api/types/CheckoutLocationSettingsCoupons.ts index 5feeca992..b1b2f5337 100644 --- a/src/api/types/CheckoutLocationSettingsCoupons.ts +++ b/src/api/types/CheckoutLocationSettingsCoupons.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CheckoutLocationSettingsCoupons { /** Indicates whether coupons are enabled for this location. */ diff --git a/src/api/types/CheckoutLocationSettingsPolicy.ts b/src/api/types/CheckoutLocationSettingsPolicy.ts index 3ada5c55e..4d9d90f78 100644 --- a/src/api/types/CheckoutLocationSettingsPolicy.ts +++ b/src/api/types/CheckoutLocationSettingsPolicy.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CheckoutLocationSettingsPolicy { /** A unique ID to identify the policy when making changes. You must set the UID for policy updates, but it’s optional when setting new policies. */ diff --git a/src/api/types/CheckoutLocationSettingsTipping.ts b/src/api/types/CheckoutLocationSettingsTipping.ts index 5f7bb7342..abaf94f48 100644 --- a/src/api/types/CheckoutLocationSettingsTipping.ts +++ b/src/api/types/CheckoutLocationSettingsTipping.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CheckoutLocationSettingsTipping { /** Set three custom percentage amounts that buyers can select at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more. */ diff --git a/src/api/types/CheckoutMerchantSettings.ts b/src/api/types/CheckoutMerchantSettings.ts index 1f28f467a..81265c5ba 100644 --- a/src/api/types/CheckoutMerchantSettings.ts +++ b/src/api/types/CheckoutMerchantSettings.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CheckoutMerchantSettings { /** The set of payment methods accepted for the merchant's account. */ diff --git a/src/api/types/CheckoutMerchantSettingsPaymentMethods.ts b/src/api/types/CheckoutMerchantSettingsPaymentMethods.ts index 586a93755..c8b4cf614 100644 --- a/src/api/types/CheckoutMerchantSettingsPaymentMethods.ts +++ b/src/api/types/CheckoutMerchantSettingsPaymentMethods.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CheckoutMerchantSettingsPaymentMethods { applePay?: Square.CheckoutMerchantSettingsPaymentMethodsPaymentMethod; diff --git a/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.ts b/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.ts index f485e9053..0f932eb3d 100644 --- a/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.ts +++ b/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The settings allowed for AfterpayClearpay. diff --git a/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.ts b/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.ts index d43e503b5..ac9d774cc 100644 --- a/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.ts +++ b/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A range of purchase price that qualifies. diff --git a/src/api/types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.ts b/src/api/types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.ts index 9d3522728..d5462ec77 100644 --- a/src/api/types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.ts +++ b/src/api/types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The settings allowed for a payment method. diff --git a/src/api/types/CheckoutOptions.ts b/src/api/types/CheckoutOptions.ts index 0a598f295..e2cb36162 100644 --- a/src/api/types/CheckoutOptions.ts +++ b/src/api/types/CheckoutOptions.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CheckoutOptions { /** Indicates whether the payment allows tipping. */ diff --git a/src/api/types/CheckoutOptionsPaymentType.ts b/src/api/types/CheckoutOptionsPaymentType.ts index aa1e08cdd..560b2bde9 100644 --- a/src/api/types/CheckoutOptionsPaymentType.ts +++ b/src/api/types/CheckoutOptionsPaymentType.ts @@ -1,16 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type CheckoutOptionsPaymentType = - | "CARD_PRESENT" - | "MANUAL_CARD_ENTRY" - | "FELICA_ID" - | "FELICA_QUICPAY" - | "FELICA_TRANSPORTATION_GROUP" - | "FELICA_ALL" - | "PAYPAY" - | "QR_CODE"; export const CheckoutOptionsPaymentType = { CardPresent: "CARD_PRESENT", ManualCardEntry: "MANUAL_CARD_ENTRY", @@ -21,3 +10,4 @@ export const CheckoutOptionsPaymentType = { Paypay: "PAYPAY", QrCode: "QR_CODE", } as const; +export type CheckoutOptionsPaymentType = (typeof CheckoutOptionsPaymentType)[keyof typeof CheckoutOptionsPaymentType]; diff --git a/src/api/types/ClearpayDetails.ts b/src/api/types/ClearpayDetails.ts index f704dcb5a..5574152be 100644 --- a/src/api/types/ClearpayDetails.ts +++ b/src/api/types/ClearpayDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Additional details about Clearpay payments. diff --git a/src/api/types/CloneOrderResponse.ts b/src/api/types/CloneOrderResponse.ts index 94e715021..9b615836f 100644 --- a/src/api/types/CloneOrderResponse.ts +++ b/src/api/types/CloneOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CollectedData.ts b/src/api/types/CollectedData.ts index 0c1544f0a..9ba29a272 100644 --- a/src/api/types/CollectedData.ts +++ b/src/api/types/CollectedData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface CollectedData { /** The buyer's input text. */ diff --git a/src/api/types/CompletePaymentResponse.ts b/src/api/types/CompletePaymentResponse.ts index 0421416db..665faa6c6 100644 --- a/src/api/types/CompletePaymentResponse.ts +++ b/src/api/types/CompletePaymentResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response returned by[CompletePayment](api-endpoint:Payments-CompletePayment). diff --git a/src/api/types/Component.ts b/src/api/types/Component.ts index d6c9ed530..73a24bccc 100644 --- a/src/api/types/Component.ts +++ b/src/api/types/Component.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The wrapper object for the component entries of a given component type. diff --git a/src/api/types/ComponentComponentType.ts b/src/api/types/ComponentComponentType.ts index 07a975ad1..cee828568 100644 --- a/src/api/types/ComponentComponentType.ts +++ b/src/api/types/ComponentComponentType.ts @@ -1,11 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * An enum for ComponentType. - */ -export type ComponentComponentType = "APPLICATION" | "CARD_READER" | "BATTERY" | "WIFI" | "ETHERNET" | "PRINTER"; +/** An enum for ComponentType. */ export const ComponentComponentType = { Application: "APPLICATION", CardReader: "CARD_READER", @@ -14,3 +9,4 @@ export const ComponentComponentType = { Ethernet: "ETHERNET", Printer: "PRINTER", } as const; +export type ComponentComponentType = (typeof ComponentComponentType)[keyof typeof ComponentComponentType]; diff --git a/src/api/types/ConfirmationDecision.ts b/src/api/types/ConfirmationDecision.ts index 5fe860a59..683f0ff3c 100644 --- a/src/api/types/ConfirmationDecision.ts +++ b/src/api/types/ConfirmationDecision.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface ConfirmationDecision { /** The buyer's decision to the displayed terms. */ diff --git a/src/api/types/ConfirmationOptions.ts b/src/api/types/ConfirmationOptions.ts index 8a5614f98..b50f79fa9 100644 --- a/src/api/types/ConfirmationOptions.ts +++ b/src/api/types/ConfirmationOptions.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ConfirmationOptions { /** The title text to display in the confirmation screen flow on the Terminal. */ diff --git a/src/api/types/Coordinates.ts b/src/api/types/Coordinates.ts index ecb15a59a..2e44d4839 100644 --- a/src/api/types/Coordinates.ts +++ b/src/api/types/Coordinates.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Latitude and longitude coordinates. diff --git a/src/api/types/Country.ts b/src/api/types/Country.ts index 119c2d9e9..c12fc3fab 100644 --- a/src/api/types/Country.ts +++ b/src/api/types/Country.ts @@ -1,262 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the country associated with another entity, such as a business. * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). */ -export type Country = - | "ZZ" - | "AD" - | "AE" - | "AF" - | "AG" - | "AI" - | "AL" - | "AM" - | "AO" - | "AQ" - | "AR" - | "AS" - | "AT" - | "AU" - | "AW" - | "AX" - | "AZ" - | "BA" - | "BB" - | "BD" - | "BE" - | "BF" - | "BG" - | "BH" - | "BI" - | "BJ" - | "BL" - | "BM" - | "BN" - | "BO" - | "BQ" - | "BR" - | "BS" - | "BT" - | "BV" - | "BW" - | "BY" - | "BZ" - | "CA" - | "CC" - | "CD" - | "CF" - | "CG" - | "CH" - | "CI" - | "CK" - | "CL" - | "CM" - | "CN" - | "CO" - | "CR" - | "CU" - | "CV" - | "CW" - | "CX" - | "CY" - | "CZ" - | "DE" - | "DJ" - | "DK" - | "DM" - | "DO" - | "DZ" - | "EC" - | "EE" - | "EG" - | "EH" - | "ER" - | "ES" - | "ET" - | "FI" - | "FJ" - | "FK" - | "FM" - | "FO" - | "FR" - | "GA" - | "GB" - | "GD" - | "GE" - | "GF" - | "GG" - | "GH" - | "GI" - | "GL" - | "GM" - | "GN" - | "GP" - | "GQ" - | "GR" - | "GS" - | "GT" - | "GU" - | "GW" - | "GY" - | "HK" - | "HM" - | "HN" - | "HR" - | "HT" - | "HU" - | "ID" - | "IE" - | "IL" - | "IM" - | "IN" - | "IO" - | "IQ" - | "IR" - | "IS" - | "IT" - | "JE" - | "JM" - | "JO" - | "JP" - | "KE" - | "KG" - | "KH" - | "KI" - | "KM" - | "KN" - | "KP" - | "KR" - | "KW" - | "KY" - | "KZ" - | "LA" - | "LB" - | "LC" - | "LI" - | "LK" - | "LR" - | "LS" - | "LT" - | "LU" - | "LV" - | "LY" - | "MA" - | "MC" - | "MD" - | "ME" - | "MF" - | "MG" - | "MH" - | "MK" - | "ML" - | "MM" - | "MN" - | "MO" - | "MP" - | "MQ" - | "MR" - | "MS" - | "MT" - | "MU" - | "MV" - | "MW" - | "MX" - | "MY" - | "MZ" - | "NA" - | "NC" - | "NE" - | "NF" - | "NG" - | "NI" - | "NL" - | "NO" - | "NP" - | "NR" - | "NU" - | "NZ" - | "OM" - | "PA" - | "PE" - | "PF" - | "PG" - | "PH" - | "PK" - | "PL" - | "PM" - | "PN" - | "PR" - | "PS" - | "PT" - | "PW" - | "PY" - | "QA" - | "RE" - | "RO" - | "RS" - | "RU" - | "RW" - | "SA" - | "SB" - | "SC" - | "SD" - | "SE" - | "SG" - | "SH" - | "SI" - | "SJ" - | "SK" - | "SL" - | "SM" - | "SN" - | "SO" - | "SR" - | "SS" - | "ST" - | "SV" - | "SX" - | "SY" - | "SZ" - | "TC" - | "TD" - | "TF" - | "TG" - | "TH" - | "TJ" - | "TK" - | "TL" - | "TM" - | "TN" - | "TO" - | "TR" - | "TT" - | "TV" - | "TW" - | "TZ" - | "UA" - | "UG" - | "UM" - | "US" - | "UY" - | "UZ" - | "VA" - | "VC" - | "VE" - | "VG" - | "VI" - | "VN" - | "VU" - | "WF" - | "WS" - | "YE" - | "YT" - | "ZA" - | "ZM" - | "ZW"; export const Country = { Zz: "ZZ", Ad: "AD", @@ -509,3 +256,4 @@ export const Country = { Zm: "ZM", Zw: "ZW", } as const; +export type Country = (typeof Country)[keyof typeof Country]; diff --git a/src/api/types/CreateBookingCustomAttributeDefinitionResponse.ts b/src/api/types/CreateBookingCustomAttributeDefinitionResponse.ts index 9ddf6dc41..a985d96a9 100644 --- a/src/api/types/CreateBookingCustomAttributeDefinitionResponse.ts +++ b/src/api/types/CreateBookingCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) response. diff --git a/src/api/types/CreateBookingResponse.ts b/src/api/types/CreateBookingResponse.ts index 6926c089a..9c4d40097 100644 --- a/src/api/types/CreateBookingResponse.ts +++ b/src/api/types/CreateBookingResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CreateBookingResponse { /** The booking that was created. */ diff --git a/src/api/types/CreateBreakTypeResponse.ts b/src/api/types/CreateBreakTypeResponse.ts index f63265cca..0df0f2167 100644 --- a/src/api/types/CreateBreakTypeResponse.ts +++ b/src/api/types/CreateBreakTypeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to the request to create a `BreakType`. The response contains diff --git a/src/api/types/CreateCardResponse.ts b/src/api/types/CreateCardResponse.ts index dd2f132be..eee423d19 100644 --- a/src/api/types/CreateCardResponse.ts +++ b/src/api/types/CreateCardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateCatalogImageRequest.ts b/src/api/types/CreateCatalogImageRequest.ts index 42a34f4db..33909cdee 100644 --- a/src/api/types/CreateCatalogImageRequest.ts +++ b/src/api/types/CreateCatalogImageRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CreateCatalogImageRequest { /** diff --git a/src/api/types/CreateCatalogImageResponse.ts b/src/api/types/CreateCatalogImageResponse.ts index b8bdff543..726a67d0f 100644 --- a/src/api/types/CreateCatalogImageResponse.ts +++ b/src/api/types/CreateCatalogImageResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CreateCatalogImageResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/CreateCheckoutResponse.ts b/src/api/types/CreateCheckoutResponse.ts index d2fd0c058..97f64882f 100644 --- a/src/api/types/CreateCheckoutResponse.ts +++ b/src/api/types/CreateCheckoutResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateCustomerCardResponse.ts b/src/api/types/CreateCustomerCardResponse.ts index a44fac41c..236bdbd78 100644 --- a/src/api/types/CreateCustomerCardResponse.ts +++ b/src/api/types/CreateCustomerCardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateCustomerCustomAttributeDefinitionResponse.ts b/src/api/types/CreateCustomerCustomAttributeDefinitionResponse.ts index ee62749c2..1a47bec83 100644 --- a/src/api/types/CreateCustomerCustomAttributeDefinitionResponse.ts +++ b/src/api/types/CreateCustomerCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) response. diff --git a/src/api/types/CreateCustomerGroupResponse.ts b/src/api/types/CreateCustomerGroupResponse.ts index 4b2a3c26e..bf42cd86d 100644 --- a/src/api/types/CreateCustomerGroupResponse.ts +++ b/src/api/types/CreateCustomerGroupResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateCustomerResponse.ts b/src/api/types/CreateCustomerResponse.ts index c4df8272e..6a18b9f95 100644 --- a/src/api/types/CreateCustomerResponse.ts +++ b/src/api/types/CreateCustomerResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateDeviceCodeResponse.ts b/src/api/types/CreateDeviceCodeResponse.ts index 81fc1db4d..1689b38c6 100644 --- a/src/api/types/CreateDeviceCodeResponse.ts +++ b/src/api/types/CreateDeviceCodeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CreateDeviceCodeResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/CreateDisputeEvidenceFileRequest.ts b/src/api/types/CreateDisputeEvidenceFileRequest.ts index b618a355f..b862e411f 100644 --- a/src/api/types/CreateDisputeEvidenceFileRequest.ts +++ b/src/api/types/CreateDisputeEvidenceFileRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the parameters for a `CreateDisputeEvidenceFile` request. diff --git a/src/api/types/CreateDisputeEvidenceFileResponse.ts b/src/api/types/CreateDisputeEvidenceFileResponse.ts index 8eaae103c..99c660d46 100644 --- a/src/api/types/CreateDisputeEvidenceFileResponse.ts +++ b/src/api/types/CreateDisputeEvidenceFileResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields in a `CreateDisputeEvidenceFile` response. diff --git a/src/api/types/CreateDisputeEvidenceTextResponse.ts b/src/api/types/CreateDisputeEvidenceTextResponse.ts index 2f5ec1d8a..4e5d32e18 100644 --- a/src/api/types/CreateDisputeEvidenceTextResponse.ts +++ b/src/api/types/CreateDisputeEvidenceTextResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields in a `CreateDisputeEvidenceText` response. diff --git a/src/api/types/CreateGiftCardActivityResponse.ts b/src/api/types/CreateGiftCardActivityResponse.ts index 9815bd3a5..79ad0ad28 100644 --- a/src/api/types/CreateGiftCardActivityResponse.ts +++ b/src/api/types/CreateGiftCardActivityResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains a `GiftCardActivity` that was created. diff --git a/src/api/types/CreateGiftCardResponse.ts b/src/api/types/CreateGiftCardResponse.ts index a5705662b..c7050e3ba 100644 --- a/src/api/types/CreateGiftCardResponse.ts +++ b/src/api/types/CreateGiftCardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request diff --git a/src/api/types/CreateInvoiceAttachmentRequestData.ts b/src/api/types/CreateInvoiceAttachmentRequestData.ts index 731d8f7f0..1403d5adb 100644 --- a/src/api/types/CreateInvoiceAttachmentRequestData.ts +++ b/src/api/types/CreateInvoiceAttachmentRequestData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) request. diff --git a/src/api/types/CreateInvoiceAttachmentResponse.ts b/src/api/types/CreateInvoiceAttachmentResponse.ts index b14cfba0f..92820652f 100644 --- a/src/api/types/CreateInvoiceAttachmentResponse.ts +++ b/src/api/types/CreateInvoiceAttachmentResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) response. diff --git a/src/api/types/CreateInvoiceResponse.ts b/src/api/types/CreateInvoiceResponse.ts index e7f5e3396..956ef88e9 100644 --- a/src/api/types/CreateInvoiceResponse.ts +++ b/src/api/types/CreateInvoiceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response returned by the `CreateInvoice` request. diff --git a/src/api/types/CreateJobResponse.ts b/src/api/types/CreateJobResponse.ts index 78e3ce0ff..9e43d0df1 100644 --- a/src/api/types/CreateJobResponse.ts +++ b/src/api/types/CreateJobResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [CreateJob](api-endpoint:Team-CreateJob) response. Either `job` or `errors` diff --git a/src/api/types/CreateLocationCustomAttributeDefinitionResponse.ts b/src/api/types/CreateLocationCustomAttributeDefinitionResponse.ts index dc836c484..8f6d2d7da 100644 --- a/src/api/types/CreateLocationCustomAttributeDefinitionResponse.ts +++ b/src/api/types/CreateLocationCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) response. diff --git a/src/api/types/CreateLocationResponse.ts b/src/api/types/CreateLocationResponse.ts index e625beaaf..46d25de9f 100644 --- a/src/api/types/CreateLocationResponse.ts +++ b/src/api/types/CreateLocationResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response object returned by the [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint. diff --git a/src/api/types/CreateLoyaltyAccountResponse.ts b/src/api/types/CreateLoyaltyAccountResponse.ts index 8deca79e7..e3f23cd3b 100644 --- a/src/api/types/CreateLoyaltyAccountResponse.ts +++ b/src/api/types/CreateLoyaltyAccountResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that includes loyalty account created. diff --git a/src/api/types/CreateLoyaltyPromotionResponse.ts b/src/api/types/CreateLoyaltyPromotionResponse.ts index e9fddfd36..da482680c 100644 --- a/src/api/types/CreateLoyaltyPromotionResponse.ts +++ b/src/api/types/CreateLoyaltyPromotionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) response. diff --git a/src/api/types/CreateLoyaltyRewardResponse.ts b/src/api/types/CreateLoyaltyRewardResponse.ts index d7895312f..c03f5a2a4 100644 --- a/src/api/types/CreateLoyaltyRewardResponse.ts +++ b/src/api/types/CreateLoyaltyRewardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that includes the loyalty reward created. diff --git a/src/api/types/CreateMerchantCustomAttributeDefinitionResponse.ts b/src/api/types/CreateMerchantCustomAttributeDefinitionResponse.ts index 48eaa375b..5a907b3fc 100644 --- a/src/api/types/CreateMerchantCustomAttributeDefinitionResponse.ts +++ b/src/api/types/CreateMerchantCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) response. diff --git a/src/api/types/CreateMobileAuthorizationCodeResponse.ts b/src/api/types/CreateMobileAuthorizationCodeResponse.ts index 51b82b007..5c0ba9ad4 100644 --- a/src/api/types/CreateMobileAuthorizationCodeResponse.ts +++ b/src/api/types/CreateMobileAuthorizationCodeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateOrderCustomAttributeDefinitionResponse.ts b/src/api/types/CreateOrderCustomAttributeDefinitionResponse.ts index 2cb47336e..88206cc4b 100644 --- a/src/api/types/CreateOrderCustomAttributeDefinitionResponse.ts +++ b/src/api/types/CreateOrderCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from creating an order custom attribute definition. diff --git a/src/api/types/CreateOrderRequest.ts b/src/api/types/CreateOrderRequest.ts index 7d0bcab65..8d2c51144 100644 --- a/src/api/types/CreateOrderRequest.ts +++ b/src/api/types/CreateOrderRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CreateOrderRequest { /** diff --git a/src/api/types/CreateOrderResponse.ts b/src/api/types/CreateOrderResponse.ts index 3f049e6fb..44c10c7e2 100644 --- a/src/api/types/CreateOrderResponse.ts +++ b/src/api/types/CreateOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreatePaymentLinkResponse.ts b/src/api/types/CreatePaymentLinkResponse.ts index e77451368..ac0dad221 100644 --- a/src/api/types/CreatePaymentLinkResponse.ts +++ b/src/api/types/CreatePaymentLinkResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CreatePaymentLinkResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/CreatePaymentResponse.ts b/src/api/types/CreatePaymentResponse.ts index c8d39c720..a6bcb9994 100644 --- a/src/api/types/CreatePaymentResponse.ts +++ b/src/api/types/CreatePaymentResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response returned by [CreatePayment](api-endpoint:Payments-CreatePayment). diff --git a/src/api/types/CreateScheduledShiftResponse.ts b/src/api/types/CreateScheduledShiftResponse.ts index 2e16a71b9..2e0289767 100644 --- a/src/api/types/CreateScheduledShiftResponse.ts +++ b/src/api/types/CreateScheduledShiftResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) response. diff --git a/src/api/types/CreateShiftResponse.ts b/src/api/types/CreateShiftResponse.ts index 1b9200fe0..c4211df26 100644 --- a/src/api/types/CreateShiftResponse.ts +++ b/src/api/types/CreateShiftResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request to create a `Shift`. The response contains diff --git a/src/api/types/CreateSubscriptionResponse.ts b/src/api/types/CreateSubscriptionResponse.ts index 4e562b14b..4e5527b0f 100644 --- a/src/api/types/CreateSubscriptionResponse.ts +++ b/src/api/types/CreateSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/CreateTeamMemberRequest.ts b/src/api/types/CreateTeamMemberRequest.ts index 163ad0994..5331d1aac 100644 --- a/src/api/types/CreateTeamMemberRequest.ts +++ b/src/api/types/CreateTeamMemberRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a create request for a `TeamMember` object. diff --git a/src/api/types/CreateTeamMemberResponse.ts b/src/api/types/CreateTeamMemberResponse.ts index 28ef6df03..61c15cf15 100644 --- a/src/api/types/CreateTeamMemberResponse.ts +++ b/src/api/types/CreateTeamMemberResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from a create request containing the created `TeamMember` object or error messages. diff --git a/src/api/types/CreateTerminalActionResponse.ts b/src/api/types/CreateTerminalActionResponse.ts index cc9d6233e..69b9fa028 100644 --- a/src/api/types/CreateTerminalActionResponse.ts +++ b/src/api/types/CreateTerminalActionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CreateTerminalActionResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/CreateTerminalCheckoutResponse.ts b/src/api/types/CreateTerminalCheckoutResponse.ts index 212fbe7c7..a8907c22c 100644 --- a/src/api/types/CreateTerminalCheckoutResponse.ts +++ b/src/api/types/CreateTerminalCheckoutResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CreateTerminalCheckoutResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/CreateTerminalRefundResponse.ts b/src/api/types/CreateTerminalRefundResponse.ts index 7ef0c70d1..cc08ad2bb 100644 --- a/src/api/types/CreateTerminalRefundResponse.ts +++ b/src/api/types/CreateTerminalRefundResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CreateTerminalRefundResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/CreateTimecardResponse.ts b/src/api/types/CreateTimecardResponse.ts index 26ea8b8f8..275772d11 100644 --- a/src/api/types/CreateTimecardResponse.ts +++ b/src/api/types/CreateTimecardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request to create a `Timecard`. The response contains diff --git a/src/api/types/CreateTransferOrderData.ts b/src/api/types/CreateTransferOrderData.ts index 889cda53a..1399d622a 100644 --- a/src/api/types/CreateTransferOrderData.ts +++ b/src/api/types/CreateTransferOrderData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Data for creating a new transfer order to move [CatalogItemVariation](entity:CatalogItemVariation)s diff --git a/src/api/types/CreateTransferOrderLineData.ts b/src/api/types/CreateTransferOrderLineData.ts index 99db9a31f..1b0e9a05c 100644 --- a/src/api/types/CreateTransferOrderLineData.ts +++ b/src/api/types/CreateTransferOrderLineData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Data for creating a new transfer order line item. Each line item specifies a diff --git a/src/api/types/CreateTransferOrderResponse.ts b/src/api/types/CreateTransferOrderResponse.ts index e8d117fe7..7d5317469 100644 --- a/src/api/types/CreateTransferOrderResponse.ts +++ b/src/api/types/CreateTransferOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response for creating a transfer order. diff --git a/src/api/types/CreateVendorResponse.ts b/src/api/types/CreateVendorResponse.ts index fc742ce16..e18c6625e 100644 --- a/src/api/types/CreateVendorResponse.ts +++ b/src/api/types/CreateVendorResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an output from a call to [CreateVendor](api-endpoint:Vendors-CreateVendor). diff --git a/src/api/types/CreateWebhookSubscriptionResponse.ts b/src/api/types/CreateWebhookSubscriptionResponse.ts index 26321d45b..b05f74010 100644 --- a/src/api/types/CreateWebhookSubscriptionResponse.ts +++ b/src/api/types/CreateWebhookSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/Currency.ts b/src/api/types/Currency.ts index 68275d515..12c0b81cd 100644 --- a/src/api/types/Currency.ts +++ b/src/api/types/Currency.ts @@ -1,195 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the associated currency for an amount of money. Values correspond * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). */ -export type Currency = - | "UNKNOWN_CURRENCY" - | "AED" - | "AFN" - | "ALL" - | "AMD" - | "ANG" - | "AOA" - | "ARS" - | "AUD" - | "AWG" - | "AZN" - | "BAM" - | "BBD" - | "BDT" - | "BGN" - | "BHD" - | "BIF" - | "BMD" - | "BND" - | "BOB" - | "BOV" - | "BRL" - | "BSD" - | "BTN" - | "BWP" - | "BYR" - | "BZD" - | "CAD" - | "CDF" - | "CHE" - | "CHF" - | "CHW" - | "CLF" - | "CLP" - | "CNY" - | "COP" - | "COU" - | "CRC" - | "CUC" - | "CUP" - | "CVE" - | "CZK" - | "DJF" - | "DKK" - | "DOP" - | "DZD" - | "EGP" - | "ERN" - | "ETB" - | "EUR" - | "FJD" - | "FKP" - | "GBP" - | "GEL" - | "GHS" - | "GIP" - | "GMD" - | "GNF" - | "GTQ" - | "GYD" - | "HKD" - | "HNL" - | "HRK" - | "HTG" - | "HUF" - | "IDR" - | "ILS" - | "INR" - | "IQD" - | "IRR" - | "ISK" - | "JMD" - | "JOD" - | "JPY" - | "KES" - | "KGS" - | "KHR" - | "KMF" - | "KPW" - | "KRW" - | "KWD" - | "KYD" - | "KZT" - | "LAK" - | "LBP" - | "LKR" - | "LRD" - | "LSL" - | "LTL" - | "LVL" - | "LYD" - | "MAD" - | "MDL" - | "MGA" - | "MKD" - | "MMK" - | "MNT" - | "MOP" - | "MRO" - | "MUR" - | "MVR" - | "MWK" - | "MXN" - | "MXV" - | "MYR" - | "MZN" - | "NAD" - | "NGN" - | "NIO" - | "NOK" - | "NPR" - | "NZD" - | "OMR" - | "PAB" - | "PEN" - | "PGK" - | "PHP" - | "PKR" - | "PLN" - | "PYG" - | "QAR" - | "RON" - | "RSD" - | "RUB" - | "RWF" - | "SAR" - | "SBD" - | "SCR" - | "SDG" - | "SEK" - | "SGD" - | "SHP" - | "SLL" - | "SLE" - | "SOS" - | "SRD" - | "SSP" - | "STD" - | "SVC" - | "SYP" - | "SZL" - | "THB" - | "TJS" - | "TMT" - | "TND" - | "TOP" - | "TRY" - | "TTD" - | "TWD" - | "TZS" - | "UAH" - | "UGX" - | "USD" - | "USN" - | "USS" - | "UYI" - | "UYU" - | "UZS" - | "VEF" - | "VND" - | "VUV" - | "WST" - | "XAF" - | "XAG" - | "XAU" - | "XBA" - | "XBB" - | "XBC" - | "XBD" - | "XCD" - | "XDR" - | "XOF" - | "XPD" - | "XPF" - | "XPT" - | "XTS" - | "XXX" - | "YER" - | "ZAR" - | "ZMK" - | "ZMW" - | "BTC" - | "XUS"; export const Currency = { UnknownCurrency: "UNKNOWN_CURRENCY", Aed: "AED", @@ -375,3 +189,4 @@ export const Currency = { Btc: "BTC", Xus: "XUS", } as const; +export type Currency = (typeof Currency)[keyof typeof Currency]; diff --git a/src/api/types/CustomAttribute.ts b/src/api/types/CustomAttribute.ts index ee921ef55..3758c8361 100644 --- a/src/api/types/CustomAttribute.ts +++ b/src/api/types/CustomAttribute.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A custom attribute value. Each custom attribute value has a corresponding diff --git a/src/api/types/CustomAttributeDefinition.ts b/src/api/types/CustomAttributeDefinition.ts index f5c5c5e37..df912d3ed 100644 --- a/src/api/types/CustomAttributeDefinition.ts +++ b/src/api/types/CustomAttributeDefinition.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a definition for custom attribute values. A custom attribute definition diff --git a/src/api/types/CustomAttributeDefinitionEventData.ts b/src/api/types/CustomAttributeDefinitionEventData.ts index d128a0008..b91b20423 100644 --- a/src/api/types/CustomAttributeDefinitionEventData.ts +++ b/src/api/types/CustomAttributeDefinitionEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an object in the CustomAttributeDefinition event notification diff --git a/src/api/types/CustomAttributeDefinitionEventDataObject.ts b/src/api/types/CustomAttributeDefinitionEventDataObject.ts index 597e74c37..3bab3fa9e 100644 --- a/src/api/types/CustomAttributeDefinitionEventDataObject.ts +++ b/src/api/types/CustomAttributeDefinitionEventDataObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CustomAttributeDefinitionEventDataObject { /** The custom attribute definition. */ diff --git a/src/api/types/CustomAttributeDefinitionVisibility.ts b/src/api/types/CustomAttributeDefinitionVisibility.ts index 65923bc78..4ab17f834 100644 --- a/src/api/types/CustomAttributeDefinitionVisibility.ts +++ b/src/api/types/CustomAttributeDefinitionVisibility.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The level of permission that a seller or other applications requires to @@ -8,12 +6,10 @@ * The `Visibility` field controls who can read and write the custom attribute values * and custom attribute definition. */ -export type CustomAttributeDefinitionVisibility = - | "VISIBILITY_HIDDEN" - | "VISIBILITY_READ_ONLY" - | "VISIBILITY_READ_WRITE_VALUES"; export const CustomAttributeDefinitionVisibility = { VisibilityHidden: "VISIBILITY_HIDDEN", VisibilityReadOnly: "VISIBILITY_READ_ONLY", VisibilityReadWriteValues: "VISIBILITY_READ_WRITE_VALUES", } as const; +export type CustomAttributeDefinitionVisibility = + (typeof CustomAttributeDefinitionVisibility)[keyof typeof CustomAttributeDefinitionVisibility]; diff --git a/src/api/types/CustomAttributeEventData.ts b/src/api/types/CustomAttributeEventData.ts index ff4eba0ac..5958cb007 100644 --- a/src/api/types/CustomAttributeEventData.ts +++ b/src/api/types/CustomAttributeEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CustomAttributeEventData { /** The type of the event data object. The value is `"custom_attribute"`. */ diff --git a/src/api/types/CustomAttributeEventDataObject.ts b/src/api/types/CustomAttributeEventDataObject.ts index fe08aa765..f4410e25b 100644 --- a/src/api/types/CustomAttributeEventDataObject.ts +++ b/src/api/types/CustomAttributeEventDataObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface CustomAttributeEventDataObject { /** The custom attribute. */ diff --git a/src/api/types/CustomAttributeFilter.ts b/src/api/types/CustomAttributeFilter.ts index 691eb9f87..d0692365c 100644 --- a/src/api/types/CustomAttributeFilter.ts +++ b/src/api/types/CustomAttributeFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Supported custom attribute query expressions for calling the diff --git a/src/api/types/CustomField.ts b/src/api/types/CustomField.ts index 3ad7203a4..3bbeca038 100644 --- a/src/api/types/CustomField.ts +++ b/src/api/types/CustomField.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Describes a custom form field to add to the checkout page to collect more information from buyers during checkout. diff --git a/src/api/types/Customer.ts b/src/api/types/Customer.ts index 9bf3d84b5..24194b213 100644 --- a/src/api/types/Customer.ts +++ b/src/api/types/Customer.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a Square customer profile in the Customer Directory of a Square seller. diff --git a/src/api/types/CustomerAddressFilter.ts b/src/api/types/CustomerAddressFilter.ts index 174856341..0383d4460 100644 --- a/src/api/types/CustomerAddressFilter.ts +++ b/src/api/types/CustomerAddressFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](entity:CustomerCustomAttributeFilterValue) filter when diff --git a/src/api/types/CustomerCreatedEvent.ts b/src/api/types/CustomerCreatedEvent.ts index d990529e3..d4ccd0dd4 100644 --- a/src/api/types/CustomerCreatedEvent.ts +++ b/src/api/types/CustomerCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [customer](entity:Customer) is created. Subscribe to this event to track customer profiles affected by a merge operation. diff --git a/src/api/types/CustomerCreatedEventData.ts b/src/api/types/CustomerCreatedEventData.ts index b5462a273..e60f5465f 100644 --- a/src/api/types/CustomerCreatedEventData.ts +++ b/src/api/types/CustomerCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with the event. diff --git a/src/api/types/CustomerCreatedEventEventContext.ts b/src/api/types/CustomerCreatedEventEventContext.ts index cffb661e6..807545acf 100644 --- a/src/api/types/CustomerCreatedEventEventContext.ts +++ b/src/api/types/CustomerCreatedEventEventContext.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Information about the change that triggered the event. diff --git a/src/api/types/CustomerCreatedEventEventContextMerge.ts b/src/api/types/CustomerCreatedEventEventContextMerge.ts index 2fc291518..9fcc1c5d4 100644 --- a/src/api/types/CustomerCreatedEventEventContextMerge.ts +++ b/src/api/types/CustomerCreatedEventEventContextMerge.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers. diff --git a/src/api/types/CustomerCreatedEventObject.ts b/src/api/types/CustomerCreatedEventObject.ts index 123408329..2d6fd6800 100644 --- a/src/api/types/CustomerCreatedEventObject.ts +++ b/src/api/types/CustomerCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the customer associated with the event. diff --git a/src/api/types/CustomerCreationSource.ts b/src/api/types/CustomerCreationSource.ts index 041067922..c5b3a64e1 100644 --- a/src/api/types/CustomerCreationSource.ts +++ b/src/api/types/CustomerCreationSource.ts @@ -1,30 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the method used to create the customer profile. - */ -export type CustomerCreationSource = - | "OTHER" - | "APPOINTMENTS" - | "COUPON" - | "DELETION_RECOVERY" - | "DIRECTORY" - | "EGIFTING" - | "EMAIL_COLLECTION" - | "FEEDBACK" - | "IMPORT" - | "INVOICES" - | "LOYALTY" - | "MARKETING" - | "MERGE" - | "ONLINE_STORE" - | "INSTANT_PROFILE" - | "TERMINAL" - | "THIRD_PARTY" - | "THIRD_PARTY_IMPORT" - | "UNMERGE_RECOVERY"; +/** Indicates the method used to create the customer profile. */ export const CustomerCreationSource = { Other: "OTHER", Appointments: "APPOINTMENTS", @@ -46,3 +22,4 @@ export const CustomerCreationSource = { ThirdPartyImport: "THIRD_PARTY_IMPORT", UnmergeRecovery: "UNMERGE_RECOVERY", } as const; +export type CustomerCreationSource = (typeof CustomerCreationSource)[keyof typeof CustomerCreationSource]; diff --git a/src/api/types/CustomerCreationSourceFilter.ts b/src/api/types/CustomerCreationSourceFilter.ts index 01d0be76c..855cb8ed5 100644 --- a/src/api/types/CustomerCreationSourceFilter.ts +++ b/src/api/types/CustomerCreationSourceFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The creation source filter. diff --git a/src/api/types/CustomerCustomAttributeDefinitionCreatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionCreatedEvent.ts index b7d19dab5..0e6cd03fe 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionCreatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts index e1226f9d7..5332d8b88 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionDeletedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionDeletedEvent.ts index 58b5c9d58..e81cd9f46 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts index 3b1c5fc47..51eee6722 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts index 4bdd8bdfa..a947c3b83 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts index 485f48e57..720c8e1ec 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts index 72cf63c0c..f2ee6355c 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts index d5fd169b3..67a3df298 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts index b457074b0..6f6d9fb18 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts index a5c4e8a57..f31e793f5 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts index 9f69e1548..57607c648 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts index 0f6ca331c..be6ed293d 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDeletedEvent.ts b/src/api/types/CustomerCustomAttributeDeletedEvent.ts index 67472d51f..9366947ce 100644 --- a/src/api/types/CustomerCustomAttributeDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) owned by the diff --git a/src/api/types/CustomerCustomAttributeDeletedPublicEvent.ts b/src/api/types/CustomerCustomAttributeDeletedPublicEvent.ts index 905861835..835ebf129 100644 --- a/src/api/types/CustomerCustomAttributeDeletedPublicEvent.ts +++ b/src/api/types/CustomerCustomAttributeDeletedPublicEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) that is visible diff --git a/src/api/types/CustomerCustomAttributeFilter.ts b/src/api/types/CustomerCustomAttributeFilter.ts index 0d2b2ddc7..ad4f76a74 100644 --- a/src/api/types/CustomerCustomAttributeFilter.ts +++ b/src/api/types/CustomerCustomAttributeFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The custom attribute filter. Use this filter in a set of [custom attribute filters](entity:CustomerCustomAttributeFilters) to search diff --git a/src/api/types/CustomerCustomAttributeFilterValue.ts b/src/api/types/CustomerCustomAttributeFilterValue.ts index 25df2dfb4..46838b891 100644 --- a/src/api/types/CustomerCustomAttributeFilterValue.ts +++ b/src/api/types/CustomerCustomAttributeFilterValue.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A type-specific filter used in a [custom attribute filter](entity:CustomerCustomAttributeFilter) to search based on the value diff --git a/src/api/types/CustomerCustomAttributeFilters.ts b/src/api/types/CustomerCustomAttributeFilters.ts index bc9ac3f27..7c149bf56 100644 --- a/src/api/types/CustomerCustomAttributeFilters.ts +++ b/src/api/types/CustomerCustomAttributeFilters.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The custom attribute filters in a set of [customer filters](entity:CustomerFilter) used in a search query. Use this filter diff --git a/src/api/types/CustomerCustomAttributeOwnedDeletedEvent.ts b/src/api/types/CustomerCustomAttributeOwnedDeletedEvent.ts index e2d18f053..dac644434 100644 --- a/src/api/types/CustomerCustomAttributeOwnedDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeOwnedDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) owned by the diff --git a/src/api/types/CustomerCustomAttributeOwnedUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeOwnedUpdatedEvent.ts index 307c5c9d7..83aa5f382 100644 --- a/src/api/types/CustomerCustomAttributeOwnedUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeOwnedUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) owned by the diff --git a/src/api/types/CustomerCustomAttributeUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeUpdatedEvent.ts index d426f098f..6e0b5accb 100644 --- a/src/api/types/CustomerCustomAttributeUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) owned by the diff --git a/src/api/types/CustomerCustomAttributeUpdatedPublicEvent.ts b/src/api/types/CustomerCustomAttributeUpdatedPublicEvent.ts index c4f4819e3..634f11256 100644 --- a/src/api/types/CustomerCustomAttributeUpdatedPublicEvent.ts +++ b/src/api/types/CustomerCustomAttributeUpdatedPublicEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) that is visible diff --git a/src/api/types/CustomerCustomAttributeVisibleDeletedEvent.ts b/src/api/types/CustomerCustomAttributeVisibleDeletedEvent.ts index 1a12c2c3d..649be1d03 100644 --- a/src/api/types/CustomerCustomAttributeVisibleDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeVisibleDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the diff --git a/src/api/types/CustomerCustomAttributeVisibleUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeVisibleUpdatedEvent.ts index 151a94dac..90f78e294 100644 --- a/src/api/types/CustomerCustomAttributeVisibleUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeVisibleUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the diff --git a/src/api/types/CustomerDeletedEvent.ts b/src/api/types/CustomerDeletedEvent.ts index 6b4f4a606..6c3d3ee13 100644 --- a/src/api/types/CustomerDeletedEvent.ts +++ b/src/api/types/CustomerDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [customer](entity:Customer) is deleted. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). diff --git a/src/api/types/CustomerDeletedEventData.ts b/src/api/types/CustomerDeletedEventData.ts index 6f163c33e..4971c78c2 100644 --- a/src/api/types/CustomerDeletedEventData.ts +++ b/src/api/types/CustomerDeletedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with the event. diff --git a/src/api/types/CustomerDeletedEventEventContext.ts b/src/api/types/CustomerDeletedEventEventContext.ts index e9dc77218..d33a26745 100644 --- a/src/api/types/CustomerDeletedEventEventContext.ts +++ b/src/api/types/CustomerDeletedEventEventContext.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Information about the change that triggered the event. diff --git a/src/api/types/CustomerDeletedEventEventContextMerge.ts b/src/api/types/CustomerDeletedEventEventContextMerge.ts index edab8c7f9..4a87832c6 100644 --- a/src/api/types/CustomerDeletedEventEventContextMerge.ts +++ b/src/api/types/CustomerDeletedEventEventContextMerge.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers. diff --git a/src/api/types/CustomerDeletedEventObject.ts b/src/api/types/CustomerDeletedEventObject.ts index 1e347011a..7f9d949ad 100644 --- a/src/api/types/CustomerDeletedEventObject.ts +++ b/src/api/types/CustomerDeletedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the customer associated with the event. diff --git a/src/api/types/CustomerDetails.ts b/src/api/types/CustomerDetails.ts index 6ffb58fd6..00e65d7b5 100644 --- a/src/api/types/CustomerDetails.ts +++ b/src/api/types/CustomerDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Details about the customer making the payment. diff --git a/src/api/types/CustomerFilter.ts b/src/api/types/CustomerFilter.ts index c7546e024..b87018036 100644 --- a/src/api/types/CustomerFilter.ts +++ b/src/api/types/CustomerFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the filtering criteria in a [search query](entity:CustomerQuery) that defines how to filter diff --git a/src/api/types/CustomerGroup.ts b/src/api/types/CustomerGroup.ts index d7d65b7fa..53287b5a1 100644 --- a/src/api/types/CustomerGroup.ts +++ b/src/api/types/CustomerGroup.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a group of customer profiles. diff --git a/src/api/types/CustomerInclusionExclusion.ts b/src/api/types/CustomerInclusionExclusion.ts index 1d8be541f..1a857d74b 100644 --- a/src/api/types/CustomerInclusionExclusion.ts +++ b/src/api/types/CustomerInclusionExclusion.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates whether customers should be included in, or excluded from, * the result set when they match the filtering criteria. */ -export type CustomerInclusionExclusion = "INCLUDE" | "EXCLUDE"; export const CustomerInclusionExclusion = { Include: "INCLUDE", Exclude: "EXCLUDE", } as const; +export type CustomerInclusionExclusion = (typeof CustomerInclusionExclusion)[keyof typeof CustomerInclusionExclusion]; diff --git a/src/api/types/CustomerPreferences.ts b/src/api/types/CustomerPreferences.ts index 2d50d372d..5f88624a4 100644 --- a/src/api/types/CustomerPreferences.ts +++ b/src/api/types/CustomerPreferences.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents communication preferences for the customer profile. diff --git a/src/api/types/CustomerQuery.ts b/src/api/types/CustomerQuery.ts index 0cfacb26e..f6171d90b 100644 --- a/src/api/types/CustomerQuery.ts +++ b/src/api/types/CustomerQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents filtering and sorting criteria for a [SearchCustomers](api-endpoint:Customers-SearchCustomers) request. diff --git a/src/api/types/CustomerSegment.ts b/src/api/types/CustomerSegment.ts index 6137a846b..e8ce7f811 100644 --- a/src/api/types/CustomerSegment.ts +++ b/src/api/types/CustomerSegment.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a group of customer profiles that match one or more predefined filter criteria. diff --git a/src/api/types/CustomerSort.ts b/src/api/types/CustomerSort.ts index 31fe8860b..a84ee2109 100644 --- a/src/api/types/CustomerSort.ts +++ b/src/api/types/CustomerSort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the sorting criteria in a [search query](entity:CustomerQuery) that defines how to sort diff --git a/src/api/types/CustomerSortField.ts b/src/api/types/CustomerSortField.ts index 453994a28..05a44dab8 100644 --- a/src/api/types/CustomerSortField.ts +++ b/src/api/types/CustomerSortField.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Specifies customer attributes as the sort key to customer profiles returned from a search. - */ -export type CustomerSortField = "DEFAULT" | "CREATED_AT"; +/** Specifies customer attributes as the sort key to customer profiles returned from a search. */ export const CustomerSortField = { Default: "DEFAULT", CreatedAt: "CREATED_AT", } as const; +export type CustomerSortField = (typeof CustomerSortField)[keyof typeof CustomerSortField]; diff --git a/src/api/types/CustomerTaxIds.ts b/src/api/types/CustomerTaxIds.ts index 93daf9e65..842819d3e 100644 --- a/src/api/types/CustomerTaxIds.ts +++ b/src/api/types/CustomerTaxIds.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the tax ID associated with a [customer profile](entity:Customer). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom. diff --git a/src/api/types/CustomerTextFilter.ts b/src/api/types/CustomerTextFilter.ts index 598e03ca9..33392d3f7 100644 --- a/src/api/types/CustomerTextFilter.ts +++ b/src/api/types/CustomerTextFilter.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A filter to select customers based on exact or fuzzy matching of diff --git a/src/api/types/CustomerUpdatedEvent.ts b/src/api/types/CustomerUpdatedEvent.ts index 9bbb4aa96..efdb90015 100644 --- a/src/api/types/CustomerUpdatedEvent.ts +++ b/src/api/types/CustomerUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [customer](entity:Customer) is updated. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). diff --git a/src/api/types/CustomerUpdatedEventData.ts b/src/api/types/CustomerUpdatedEventData.ts index 143415a30..23da57a4c 100644 --- a/src/api/types/CustomerUpdatedEventData.ts +++ b/src/api/types/CustomerUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with the event. diff --git a/src/api/types/CustomerUpdatedEventObject.ts b/src/api/types/CustomerUpdatedEventObject.ts index 666d5fa91..06441be95 100644 --- a/src/api/types/CustomerUpdatedEventObject.ts +++ b/src/api/types/CustomerUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the customer associated with the event. diff --git a/src/api/types/DataCollectionOptions.ts b/src/api/types/DataCollectionOptions.ts index c9fb89b7a..e9c925cce 100644 --- a/src/api/types/DataCollectionOptions.ts +++ b/src/api/types/DataCollectionOptions.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DataCollectionOptions { /** The title text to display in the data collection flow on the Terminal. */ diff --git a/src/api/types/DataCollectionOptionsInputType.ts b/src/api/types/DataCollectionOptionsInputType.ts index 2e8b0cec0..02ffc049f 100644 --- a/src/api/types/DataCollectionOptionsInputType.ts +++ b/src/api/types/DataCollectionOptionsInputType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Describes the input type of the data. - */ -export type DataCollectionOptionsInputType = "EMAIL" | "PHONE_NUMBER"; +/** Describes the input type of the data. */ export const DataCollectionOptionsInputType = { Email: "EMAIL", PhoneNumber: "PHONE_NUMBER", } as const; +export type DataCollectionOptionsInputType = + (typeof DataCollectionOptionsInputType)[keyof typeof DataCollectionOptionsInputType]; diff --git a/src/api/types/DateRange.ts b/src/api/types/DateRange.ts index d5b5c2a3f..3833df326 100644 --- a/src/api/types/DateRange.ts +++ b/src/api/types/DateRange.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A range defined by two dates. Used for filtering a query for Connect v2 diff --git a/src/api/types/DayOfWeek.ts b/src/api/types/DayOfWeek.ts index d2f9beb46..ba252a2ae 100644 --- a/src/api/types/DayOfWeek.ts +++ b/src/api/types/DayOfWeek.ts @@ -1,11 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the specific day of the week. - */ -export type DayOfWeek = "SUN" | "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT"; +/** Indicates the specific day of the week. */ export const DayOfWeek = { Sun: "SUN", Mon: "MON", @@ -15,3 +10,4 @@ export const DayOfWeek = { Fri: "FRI", Sat: "SAT", } as const; +export type DayOfWeek = (typeof DayOfWeek)[keyof typeof DayOfWeek]; diff --git a/src/api/types/DeleteBookingCustomAttributeDefinitionResponse.ts b/src/api/types/DeleteBookingCustomAttributeDefinitionResponse.ts index a2aefe00c..992a6caa1 100644 --- a/src/api/types/DeleteBookingCustomAttributeDefinitionResponse.ts +++ b/src/api/types/DeleteBookingCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [DeleteBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttributeDefinition) response diff --git a/src/api/types/DeleteBookingCustomAttributeResponse.ts b/src/api/types/DeleteBookingCustomAttributeResponse.ts index 57ab7546b..57494b413 100644 --- a/src/api/types/DeleteBookingCustomAttributeResponse.ts +++ b/src/api/types/DeleteBookingCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [DeleteBookingCustomAttribute](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttribute) response. diff --git a/src/api/types/DeleteBreakTypeResponse.ts b/src/api/types/DeleteBreakTypeResponse.ts index c85ce0eb0..50aaa5084 100644 --- a/src/api/types/DeleteBreakTypeResponse.ts +++ b/src/api/types/DeleteBreakTypeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request to delete a `BreakType`. The response might contain a set diff --git a/src/api/types/DeleteCatalogObjectResponse.ts b/src/api/types/DeleteCatalogObjectResponse.ts index 734606657..65c8020c6 100644 --- a/src/api/types/DeleteCatalogObjectResponse.ts +++ b/src/api/types/DeleteCatalogObjectResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeleteCatalogObjectResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/DeleteCustomerCardResponse.ts b/src/api/types/DeleteCustomerCardResponse.ts index a5fcc3f81..a509918ff 100644 --- a/src/api/types/DeleteCustomerCardResponse.ts +++ b/src/api/types/DeleteCustomerCardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/DeleteCustomerCustomAttributeDefinitionResponse.ts b/src/api/types/DeleteCustomerCustomAttributeDefinitionResponse.ts index 66a5ca47b..12fb6d5a8 100644 --- a/src/api/types/DeleteCustomerCustomAttributeDefinitionResponse.ts +++ b/src/api/types/DeleteCustomerCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from a delete request containing error messages if there are any. diff --git a/src/api/types/DeleteCustomerCustomAttributeResponse.ts b/src/api/types/DeleteCustomerCustomAttributeResponse.ts index c4bdba587..0da612549 100644 --- a/src/api/types/DeleteCustomerCustomAttributeResponse.ts +++ b/src/api/types/DeleteCustomerCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [DeleteCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-DeleteCustomerCustomAttribute) response. diff --git a/src/api/types/DeleteCustomerGroupResponse.ts b/src/api/types/DeleteCustomerGroupResponse.ts index 2a78946f7..4f0054a43 100644 --- a/src/api/types/DeleteCustomerGroupResponse.ts +++ b/src/api/types/DeleteCustomerGroupResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/DeleteCustomerResponse.ts b/src/api/types/DeleteCustomerResponse.ts index 225fa47cf..ba834abf9 100644 --- a/src/api/types/DeleteCustomerResponse.ts +++ b/src/api/types/DeleteCustomerResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/DeleteDisputeEvidenceResponse.ts b/src/api/types/DeleteDisputeEvidenceResponse.ts index a13499b2b..8d92cfc57 100644 --- a/src/api/types/DeleteDisputeEvidenceResponse.ts +++ b/src/api/types/DeleteDisputeEvidenceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields in a `DeleteDisputeEvidence` response. diff --git a/src/api/types/DeleteInvoiceAttachmentResponse.ts b/src/api/types/DeleteInvoiceAttachmentResponse.ts index adc386aaa..a84141f04 100644 --- a/src/api/types/DeleteInvoiceAttachmentResponse.ts +++ b/src/api/types/DeleteInvoiceAttachmentResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) response. diff --git a/src/api/types/DeleteInvoiceResponse.ts b/src/api/types/DeleteInvoiceResponse.ts index f4a336074..038a1e13b 100644 --- a/src/api/types/DeleteInvoiceResponse.ts +++ b/src/api/types/DeleteInvoiceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a `DeleteInvoice` response. diff --git a/src/api/types/DeleteLocationCustomAttributeDefinitionResponse.ts b/src/api/types/DeleteLocationCustomAttributeDefinitionResponse.ts index 35143f1d1..0c36b6add 100644 --- a/src/api/types/DeleteLocationCustomAttributeDefinitionResponse.ts +++ b/src/api/types/DeleteLocationCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from a delete request containing error messages if there are any. diff --git a/src/api/types/DeleteLocationCustomAttributeResponse.ts b/src/api/types/DeleteLocationCustomAttributeResponse.ts index e5f09f379..671800c4a 100644 --- a/src/api/types/DeleteLocationCustomAttributeResponse.ts +++ b/src/api/types/DeleteLocationCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [DeleteLocationCustomAttribute](api-endpoint:LocationCustomAttributes-DeleteLocationCustomAttribute) response. diff --git a/src/api/types/DeleteLoyaltyRewardResponse.ts b/src/api/types/DeleteLoyaltyRewardResponse.ts index f53e6ca05..ddcea62dd 100644 --- a/src/api/types/DeleteLoyaltyRewardResponse.ts +++ b/src/api/types/DeleteLoyaltyRewardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response returned by the API call. diff --git a/src/api/types/DeleteMerchantCustomAttributeDefinitionResponse.ts b/src/api/types/DeleteMerchantCustomAttributeDefinitionResponse.ts index 76deacfa0..a0a94eee8 100644 --- a/src/api/types/DeleteMerchantCustomAttributeDefinitionResponse.ts +++ b/src/api/types/DeleteMerchantCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from a delete request containing error messages if there are any. diff --git a/src/api/types/DeleteMerchantCustomAttributeResponse.ts b/src/api/types/DeleteMerchantCustomAttributeResponse.ts index d878ba548..0a844d8f2 100644 --- a/src/api/types/DeleteMerchantCustomAttributeResponse.ts +++ b/src/api/types/DeleteMerchantCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [DeleteMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-DeleteMerchantCustomAttribute) response. diff --git a/src/api/types/DeleteOrderCustomAttributeDefinitionResponse.ts b/src/api/types/DeleteOrderCustomAttributeDefinitionResponse.ts index 7f1d85972..c13ff7c6a 100644 --- a/src/api/types/DeleteOrderCustomAttributeDefinitionResponse.ts +++ b/src/api/types/DeleteOrderCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from deleting an order custom attribute definition. diff --git a/src/api/types/DeleteOrderCustomAttributeResponse.ts b/src/api/types/DeleteOrderCustomAttributeResponse.ts index 2f1d498b6..28ba985fb 100644 --- a/src/api/types/DeleteOrderCustomAttributeResponse.ts +++ b/src/api/types/DeleteOrderCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from deleting an order custom attribute. diff --git a/src/api/types/DeletePaymentLinkResponse.ts b/src/api/types/DeletePaymentLinkResponse.ts index 6aef5e3e4..59d46a8b3 100644 --- a/src/api/types/DeletePaymentLinkResponse.ts +++ b/src/api/types/DeletePaymentLinkResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeletePaymentLinkResponse { errors?: Square.Error_[]; diff --git a/src/api/types/DeleteShiftResponse.ts b/src/api/types/DeleteShiftResponse.ts index 8c7b76899..806e58fca 100644 --- a/src/api/types/DeleteShiftResponse.ts +++ b/src/api/types/DeleteShiftResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request to delete a `Shift`. The response might contain a set of diff --git a/src/api/types/DeleteSnippetResponse.ts b/src/api/types/DeleteSnippetResponse.ts index 2a768b803..e80b6b261 100644 --- a/src/api/types/DeleteSnippetResponse.ts +++ b/src/api/types/DeleteSnippetResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a `DeleteSnippet` response. diff --git a/src/api/types/DeleteSubscriptionActionResponse.ts b/src/api/types/DeleteSubscriptionActionResponse.ts index 5adb33949..cfe759bf1 100644 --- a/src/api/types/DeleteSubscriptionActionResponse.ts +++ b/src/api/types/DeleteSubscriptionActionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response of the [DeleteSubscriptionAction](api-endpoint:Subscriptions-DeleteSubscriptionAction) diff --git a/src/api/types/DeleteTimecardResponse.ts b/src/api/types/DeleteTimecardResponse.ts index 6f2ff565b..3dbbac027 100644 --- a/src/api/types/DeleteTimecardResponse.ts +++ b/src/api/types/DeleteTimecardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request to delete a `Timecard`. The response might contain a set of diff --git a/src/api/types/DeleteTransferOrderResponse.ts b/src/api/types/DeleteTransferOrderResponse.ts index 2b83f2ccc..8a3323659 100644 --- a/src/api/types/DeleteTransferOrderResponse.ts +++ b/src/api/types/DeleteTransferOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response for deleting a transfer order diff --git a/src/api/types/DeleteWebhookSubscriptionResponse.ts b/src/api/types/DeleteWebhookSubscriptionResponse.ts index 5fd49d18f..14d80ffaf 100644 --- a/src/api/types/DeleteWebhookSubscriptionResponse.ts +++ b/src/api/types/DeleteWebhookSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/Destination.ts b/src/api/types/Destination.ts index c677acd36..3495cc679 100644 --- a/src/api/types/Destination.ts +++ b/src/api/types/Destination.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Information about the destination against which the payout was made. diff --git a/src/api/types/DestinationDetails.ts b/src/api/types/DestinationDetails.ts index 5cdc3ccc7..c9201f083 100644 --- a/src/api/types/DestinationDetails.ts +++ b/src/api/types/DestinationDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Details about a refund's destination. diff --git a/src/api/types/DestinationDetailsCardRefundDetails.ts b/src/api/types/DestinationDetailsCardRefundDetails.ts index dbeddd7e1..70d402139 100644 --- a/src/api/types/DestinationDetailsCardRefundDetails.ts +++ b/src/api/types/DestinationDetailsCardRefundDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DestinationDetailsCardRefundDetails { /** The card's non-confidential details. */ diff --git a/src/api/types/DestinationDetailsCashRefundDetails.ts b/src/api/types/DestinationDetailsCashRefundDetails.ts index c88e91e58..12b1aa1b5 100644 --- a/src/api/types/DestinationDetailsCashRefundDetails.ts +++ b/src/api/types/DestinationDetailsCashRefundDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Stores details about a cash refund. Contains only non-confidential information. diff --git a/src/api/types/DestinationDetailsExternalRefundDetails.ts b/src/api/types/DestinationDetailsExternalRefundDetails.ts index 1ebbbb2a8..ea8a8fce5 100644 --- a/src/api/types/DestinationDetailsExternalRefundDetails.ts +++ b/src/api/types/DestinationDetailsExternalRefundDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Stores details about an external refund. Contains only non-confidential information. diff --git a/src/api/types/DestinationType.ts b/src/api/types/DestinationType.ts index 6864671ab..53d37f9b3 100644 --- a/src/api/types/DestinationType.ts +++ b/src/api/types/DestinationType.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * List of possible destinations against which a payout can be made. - */ -export type DestinationType = "BANK_ACCOUNT" | "CARD" | "SQUARE_BALANCE" | "SQUARE_STORED_BALANCE"; +/** List of possible destinations against which a payout can be made. */ export const DestinationType = { BankAccount: "BANK_ACCOUNT", Card: "CARD", SquareBalance: "SQUARE_BALANCE", SquareStoredBalance: "SQUARE_STORED_BALANCE", } as const; +export type DestinationType = (typeof DestinationType)[keyof typeof DestinationType]; diff --git a/src/api/types/Device.ts b/src/api/types/Device.ts index 45d8ea2e0..5247a94f3 100644 --- a/src/api/types/Device.ts +++ b/src/api/types/Device.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface Device { /** diff --git a/src/api/types/DeviceAttributes.ts b/src/api/types/DeviceAttributes.ts index 8c76e3e37..36fd6255a 100644 --- a/src/api/types/DeviceAttributes.ts +++ b/src/api/types/DeviceAttributes.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceAttributes { /** diff --git a/src/api/types/DeviceAttributesDeviceType.ts b/src/api/types/DeviceAttributesDeviceType.ts index c465f0234..db7bbe91d 100644 --- a/src/api/types/DeviceAttributesDeviceType.ts +++ b/src/api/types/DeviceAttributesDeviceType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * An enum identifier of the device type. - */ -export type DeviceAttributesDeviceType = "TERMINAL" | "HANDHELD"; +/** An enum identifier of the device type. */ export const DeviceAttributesDeviceType = { Terminal: "TERMINAL", Handheld: "HANDHELD", } as const; +export type DeviceAttributesDeviceType = (typeof DeviceAttributesDeviceType)[keyof typeof DeviceAttributesDeviceType]; diff --git a/src/api/types/DeviceCheckoutOptions.ts b/src/api/types/DeviceCheckoutOptions.ts index 98d96f543..b8c03f2b3 100644 --- a/src/api/types/DeviceCheckoutOptions.ts +++ b/src/api/types/DeviceCheckoutOptions.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceCheckoutOptions { /** diff --git a/src/api/types/DeviceCode.ts b/src/api/types/DeviceCode.ts index e762c9166..6e5120d4d 100644 --- a/src/api/types/DeviceCode.ts +++ b/src/api/types/DeviceCode.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceCode { /** The unique id for this device code. */ diff --git a/src/api/types/DeviceCodePairedEvent.ts b/src/api/types/DeviceCodePairedEvent.ts index df8d3398d..261969718 100644 --- a/src/api/types/DeviceCodePairedEvent.ts +++ b/src/api/types/DeviceCodePairedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a Square Terminal has been paired with a diff --git a/src/api/types/DeviceCodePairedEventData.ts b/src/api/types/DeviceCodePairedEventData.ts index a310beca5..e9efa7568 100644 --- a/src/api/types/DeviceCodePairedEventData.ts +++ b/src/api/types/DeviceCodePairedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceCodePairedEventData { /** Name of the paired object’s type, `"device_code"`. */ diff --git a/src/api/types/DeviceCodePairedEventObject.ts b/src/api/types/DeviceCodePairedEventObject.ts index e634cc245..0f913377c 100644 --- a/src/api/types/DeviceCodePairedEventObject.ts +++ b/src/api/types/DeviceCodePairedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceCodePairedEventObject { /** The created terminal checkout */ diff --git a/src/api/types/DeviceCodeStatus.ts b/src/api/types/DeviceCodeStatus.ts index f1c62347d..407b8b512 100644 --- a/src/api/types/DeviceCodeStatus.ts +++ b/src/api/types/DeviceCodeStatus.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * DeviceCode.Status enum. - */ -export type DeviceCodeStatus = "UNKNOWN" | "UNPAIRED" | "PAIRED" | "EXPIRED"; +/** DeviceCode.Status enum. */ export const DeviceCodeStatus = { Unknown: "UNKNOWN", Unpaired: "UNPAIRED", Paired: "PAIRED", Expired: "EXPIRED", } as const; +export type DeviceCodeStatus = (typeof DeviceCodeStatus)[keyof typeof DeviceCodeStatus]; diff --git a/src/api/types/DeviceComponentDetailsApplicationDetails.ts b/src/api/types/DeviceComponentDetailsApplicationDetails.ts index f514f19aa..9d1b309dd 100644 --- a/src/api/types/DeviceComponentDetailsApplicationDetails.ts +++ b/src/api/types/DeviceComponentDetailsApplicationDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceComponentDetailsApplicationDetails { /** diff --git a/src/api/types/DeviceComponentDetailsBatteryDetails.ts b/src/api/types/DeviceComponentDetailsBatteryDetails.ts index 3484279ff..2ea89df08 100644 --- a/src/api/types/DeviceComponentDetailsBatteryDetails.ts +++ b/src/api/types/DeviceComponentDetailsBatteryDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceComponentDetailsBatteryDetails { /** The battery charge percentage as displayed on the device. */ diff --git a/src/api/types/DeviceComponentDetailsCardReaderDetails.ts b/src/api/types/DeviceComponentDetailsCardReaderDetails.ts index 73be61ee8..30acdae10 100644 --- a/src/api/types/DeviceComponentDetailsCardReaderDetails.ts +++ b/src/api/types/DeviceComponentDetailsCardReaderDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface DeviceComponentDetailsCardReaderDetails { /** The version of the card reader. */ diff --git a/src/api/types/DeviceComponentDetailsEthernetDetails.ts b/src/api/types/DeviceComponentDetailsEthernetDetails.ts index 40334e49b..8522cc5d7 100644 --- a/src/api/types/DeviceComponentDetailsEthernetDetails.ts +++ b/src/api/types/DeviceComponentDetailsEthernetDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface DeviceComponentDetailsEthernetDetails { /** A boolean to represent whether the Ethernet interface is currently active. */ diff --git a/src/api/types/DeviceComponentDetailsExternalPower.ts b/src/api/types/DeviceComponentDetailsExternalPower.ts index 360a472b6..1d49951e2 100644 --- a/src/api/types/DeviceComponentDetailsExternalPower.ts +++ b/src/api/types/DeviceComponentDetailsExternalPower.ts @@ -1,18 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * An enum for ExternalPower. - */ -export type DeviceComponentDetailsExternalPower = - | "AVAILABLE_CHARGING" - | "AVAILABLE_NOT_IN_USE" - | "UNAVAILABLE" - | "AVAILABLE_INSUFFICIENT"; +/** An enum for ExternalPower. */ export const DeviceComponentDetailsExternalPower = { AvailableCharging: "AVAILABLE_CHARGING", AvailableNotInUse: "AVAILABLE_NOT_IN_USE", Unavailable: "UNAVAILABLE", AvailableInsufficient: "AVAILABLE_INSUFFICIENT", } as const; +export type DeviceComponentDetailsExternalPower = + (typeof DeviceComponentDetailsExternalPower)[keyof typeof DeviceComponentDetailsExternalPower]; diff --git a/src/api/types/DeviceComponentDetailsMeasurement.ts b/src/api/types/DeviceComponentDetailsMeasurement.ts index b4fada2af..cb59b792a 100644 --- a/src/api/types/DeviceComponentDetailsMeasurement.ts +++ b/src/api/types/DeviceComponentDetailsMeasurement.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A value qualified by unit of measure. diff --git a/src/api/types/DeviceComponentDetailsWiFiDetails.ts b/src/api/types/DeviceComponentDetailsWiFiDetails.ts index ec2577d41..faef70f73 100644 --- a/src/api/types/DeviceComponentDetailsWiFiDetails.ts +++ b/src/api/types/DeviceComponentDetailsWiFiDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceComponentDetailsWiFiDetails { /** A boolean to represent whether the WiFI interface is currently active. */ diff --git a/src/api/types/DeviceCreatedEvent.ts b/src/api/types/DeviceCreatedEvent.ts index c84998fe9..5d36b9e86 100644 --- a/src/api/types/DeviceCreatedEvent.ts +++ b/src/api/types/DeviceCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a Device is created. diff --git a/src/api/types/DeviceCreatedEventData.ts b/src/api/types/DeviceCreatedEventData.ts index e28b29517..f09071a7a 100644 --- a/src/api/types/DeviceCreatedEventData.ts +++ b/src/api/types/DeviceCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceCreatedEventData { /** The type of the event data object. The value is `"device"`. */ diff --git a/src/api/types/DeviceCreatedEventObject.ts b/src/api/types/DeviceCreatedEventObject.ts index 849560516..63ca5e136 100644 --- a/src/api/types/DeviceCreatedEventObject.ts +++ b/src/api/types/DeviceCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceCreatedEventObject { /** The created device. */ diff --git a/src/api/types/DeviceDetails.ts b/src/api/types/DeviceDetails.ts index a2b401bd9..0eb7722c5 100644 --- a/src/api/types/DeviceDetails.ts +++ b/src/api/types/DeviceDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Details about the device that took the payment. diff --git a/src/api/types/DeviceMetadata.ts b/src/api/types/DeviceMetadata.ts index 407c6ecc6..06071d729 100644 --- a/src/api/types/DeviceMetadata.ts +++ b/src/api/types/DeviceMetadata.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface DeviceMetadata { /** The Terminal’s remaining battery percentage, between 1-100. */ diff --git a/src/api/types/DeviceStatus.ts b/src/api/types/DeviceStatus.ts index f7853ffa9..310c81ad3 100644 --- a/src/api/types/DeviceStatus.ts +++ b/src/api/types/DeviceStatus.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DeviceStatus { /** diff --git a/src/api/types/DeviceStatusCategory.ts b/src/api/types/DeviceStatusCategory.ts index cb580c647..55f72cea0 100644 --- a/src/api/types/DeviceStatusCategory.ts +++ b/src/api/types/DeviceStatusCategory.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type DeviceStatusCategory = "AVAILABLE" | "NEEDS_ATTENTION" | "OFFLINE"; export const DeviceStatusCategory = { Available: "AVAILABLE", NeedsAttention: "NEEDS_ATTENTION", Offline: "OFFLINE", } as const; +export type DeviceStatusCategory = (typeof DeviceStatusCategory)[keyof typeof DeviceStatusCategory]; diff --git a/src/api/types/DigitalWalletDetails.ts b/src/api/types/DigitalWalletDetails.ts index d64610a55..0f517c33e 100644 --- a/src/api/types/DigitalWalletDetails.ts +++ b/src/api/types/DigitalWalletDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Additional details about `WALLET` type payments. Contains only non-confidential information. diff --git a/src/api/types/DisableCardResponse.ts b/src/api/types/DisableCardResponse.ts index 9b9a103db..92ae51d46 100644 --- a/src/api/types/DisableCardResponse.ts +++ b/src/api/types/DisableCardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/DisableEventsResponse.ts b/src/api/types/DisableEventsResponse.ts index 070f3298f..28a8dcb53 100644 --- a/src/api/types/DisableEventsResponse.ts +++ b/src/api/types/DisableEventsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/DismissTerminalActionResponse.ts b/src/api/types/DismissTerminalActionResponse.ts index 2eb4d847e..374d79226 100644 --- a/src/api/types/DismissTerminalActionResponse.ts +++ b/src/api/types/DismissTerminalActionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DismissTerminalActionResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/DismissTerminalCheckoutResponse.ts b/src/api/types/DismissTerminalCheckoutResponse.ts index 1cf11b8b8..f33ef6b93 100644 --- a/src/api/types/DismissTerminalCheckoutResponse.ts +++ b/src/api/types/DismissTerminalCheckoutResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DismissTerminalCheckoutResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/DismissTerminalRefundResponse.ts b/src/api/types/DismissTerminalRefundResponse.ts index e79e0f94b..aefd26b6d 100644 --- a/src/api/types/DismissTerminalRefundResponse.ts +++ b/src/api/types/DismissTerminalRefundResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DismissTerminalRefundResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/Dispute.ts b/src/api/types/Dispute.ts index ad6f9f8f9..fc3dbc951 100644 --- a/src/api/types/Dispute.ts +++ b/src/api/types/Dispute.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. diff --git a/src/api/types/DisputeCreatedEvent.ts b/src/api/types/DisputeCreatedEvent.ts index b9e946c8f..b979dc294 100644 --- a/src/api/types/DisputeCreatedEvent.ts +++ b/src/api/types/DisputeCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Dispute](entity:Dispute) is created. diff --git a/src/api/types/DisputeCreatedEventData.ts b/src/api/types/DisputeCreatedEventData.ts index e6f6bf112..71a3da78e 100644 --- a/src/api/types/DisputeCreatedEventData.ts +++ b/src/api/types/DisputeCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeCreatedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeCreatedEventObject.ts b/src/api/types/DisputeCreatedEventObject.ts index 1c12a8303..e026522eb 100644 --- a/src/api/types/DisputeCreatedEventObject.ts +++ b/src/api/types/DisputeCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeCreatedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeEvidence.ts b/src/api/types/DisputeEvidence.ts index 958a24acb..d3111ab90 100644 --- a/src/api/types/DisputeEvidence.ts +++ b/src/api/types/DisputeEvidence.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeEvidence { /** The Square-generated ID of the evidence. */ diff --git a/src/api/types/DisputeEvidenceAddedEvent.ts b/src/api/types/DisputeEvidenceAddedEvent.ts index 895c5c6b4..e451dc333 100644 --- a/src/api/types/DisputeEvidenceAddedEvent.ts +++ b/src/api/types/DisputeEvidenceAddedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when evidence is added to a [Dispute](entity:Dispute) diff --git a/src/api/types/DisputeEvidenceAddedEventData.ts b/src/api/types/DisputeEvidenceAddedEventData.ts index 5f6b1fe5d..25535d6fd 100644 --- a/src/api/types/DisputeEvidenceAddedEventData.ts +++ b/src/api/types/DisputeEvidenceAddedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeEvidenceAddedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeEvidenceAddedEventObject.ts b/src/api/types/DisputeEvidenceAddedEventObject.ts index 08116c916..91774e1e6 100644 --- a/src/api/types/DisputeEvidenceAddedEventObject.ts +++ b/src/api/types/DisputeEvidenceAddedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeEvidenceAddedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeEvidenceCreatedEvent.ts b/src/api/types/DisputeEvidenceCreatedEvent.ts index 7f08581f3..8cc5ff473 100644 --- a/src/api/types/DisputeEvidenceCreatedEvent.ts +++ b/src/api/types/DisputeEvidenceCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when evidence is added to a [Dispute](entity:Dispute) diff --git a/src/api/types/DisputeEvidenceCreatedEventData.ts b/src/api/types/DisputeEvidenceCreatedEventData.ts index bad96233d..57cbc46b0 100644 --- a/src/api/types/DisputeEvidenceCreatedEventData.ts +++ b/src/api/types/DisputeEvidenceCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeEvidenceCreatedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeEvidenceCreatedEventObject.ts b/src/api/types/DisputeEvidenceCreatedEventObject.ts index 0255378b7..a43571d99 100644 --- a/src/api/types/DisputeEvidenceCreatedEventObject.ts +++ b/src/api/types/DisputeEvidenceCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeEvidenceCreatedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeEvidenceDeletedEvent.ts b/src/api/types/DisputeEvidenceDeletedEvent.ts index 3c178b634..4939b3d58 100644 --- a/src/api/types/DisputeEvidenceDeletedEvent.ts +++ b/src/api/types/DisputeEvidenceDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when evidence is removed from a [Dispute](entity:Dispute) diff --git a/src/api/types/DisputeEvidenceDeletedEventData.ts b/src/api/types/DisputeEvidenceDeletedEventData.ts index d81b1aabf..4889d6d85 100644 --- a/src/api/types/DisputeEvidenceDeletedEventData.ts +++ b/src/api/types/DisputeEvidenceDeletedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeEvidenceDeletedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeEvidenceDeletedEventObject.ts b/src/api/types/DisputeEvidenceDeletedEventObject.ts index c6c07882e..e570bdae5 100644 --- a/src/api/types/DisputeEvidenceDeletedEventObject.ts +++ b/src/api/types/DisputeEvidenceDeletedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeEvidenceDeletedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeEvidenceFile.ts b/src/api/types/DisputeEvidenceFile.ts index 44c30dd16..b9cff7d30 100644 --- a/src/api/types/DisputeEvidenceFile.ts +++ b/src/api/types/DisputeEvidenceFile.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A file to be uploaded as dispute evidence. diff --git a/src/api/types/DisputeEvidenceRemovedEvent.ts b/src/api/types/DisputeEvidenceRemovedEvent.ts index d4e31851b..373f94373 100644 --- a/src/api/types/DisputeEvidenceRemovedEvent.ts +++ b/src/api/types/DisputeEvidenceRemovedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when evidence is removed from a [Dispute](entity:Dispute) diff --git a/src/api/types/DisputeEvidenceRemovedEventData.ts b/src/api/types/DisputeEvidenceRemovedEventData.ts index fdbad3646..a4f88c0ac 100644 --- a/src/api/types/DisputeEvidenceRemovedEventData.ts +++ b/src/api/types/DisputeEvidenceRemovedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeEvidenceRemovedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeEvidenceRemovedEventObject.ts b/src/api/types/DisputeEvidenceRemovedEventObject.ts index 4ad892935..981fa5ad2 100644 --- a/src/api/types/DisputeEvidenceRemovedEventObject.ts +++ b/src/api/types/DisputeEvidenceRemovedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeEvidenceRemovedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeEvidenceType.ts b/src/api/types/DisputeEvidenceType.ts index a1952d50e..4d49da566 100644 --- a/src/api/types/DisputeEvidenceType.ts +++ b/src/api/types/DisputeEvidenceType.ts @@ -1,26 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of the dispute evidence. - */ -export type DisputeEvidenceType = - | "GENERIC_EVIDENCE" - | "ONLINE_OR_APP_ACCESS_LOG" - | "AUTHORIZATION_DOCUMENTATION" - | "CANCELLATION_OR_REFUND_DOCUMENTATION" - | "CARDHOLDER_COMMUNICATION" - | "CARDHOLDER_INFORMATION" - | "PURCHASE_ACKNOWLEDGEMENT" - | "DUPLICATE_CHARGE_DOCUMENTATION" - | "PRODUCT_OR_SERVICE_DESCRIPTION" - | "RECEIPT" - | "SERVICE_RECEIVED_DOCUMENTATION" - | "PROOF_OF_DELIVERY_DOCUMENTATION" - | "RELATED_TRANSACTION_DOCUMENTATION" - | "REBUTTAL_EXPLANATION" - | "TRACKING_NUMBER"; +/** The type of the dispute evidence. */ export const DisputeEvidenceType = { GenericEvidence: "GENERIC_EVIDENCE", OnlineOrAppAccessLog: "ONLINE_OR_APP_ACCESS_LOG", @@ -38,3 +18,4 @@ export const DisputeEvidenceType = { RebuttalExplanation: "REBUTTAL_EXPLANATION", TrackingNumber: "TRACKING_NUMBER", } as const; +export type DisputeEvidenceType = (typeof DisputeEvidenceType)[keyof typeof DisputeEvidenceType]; diff --git a/src/api/types/DisputeReason.ts b/src/api/types/DisputeReason.ts index a2f57806c..9393feca5 100644 --- a/src/api/types/DisputeReason.ts +++ b/src/api/types/DisputeReason.ts @@ -1,21 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The list of possible reasons why a cardholder might initiate a * dispute with their bank. */ -export type DisputeReason = - | "AMOUNT_DIFFERS" - | "CANCELLED" - | "DUPLICATE" - | "NO_KNOWLEDGE" - | "NOT_AS_DESCRIBED" - | "NOT_RECEIVED" - | "PAID_BY_OTHER_MEANS" - | "CUSTOMER_REQUESTS_CREDIT" - | "EMV_LIABILITY_SHIFT"; export const DisputeReason = { AmountDiffers: "AMOUNT_DIFFERS", Cancelled: "CANCELLED", @@ -27,3 +15,4 @@ export const DisputeReason = { CustomerRequestsCredit: "CUSTOMER_REQUESTS_CREDIT", EmvLiabilityShift: "EMV_LIABILITY_SHIFT", } as const; +export type DisputeReason = (typeof DisputeReason)[keyof typeof DisputeReason]; diff --git a/src/api/types/DisputeState.ts b/src/api/types/DisputeState.ts index bb425f605..70ca34de3 100644 --- a/src/api/types/DisputeState.ts +++ b/src/api/types/DisputeState.ts @@ -1,19 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The list of possible dispute states. - */ -export type DisputeState = - | "INQUIRY_EVIDENCE_REQUIRED" - | "INQUIRY_PROCESSING" - | "INQUIRY_CLOSED" - | "EVIDENCE_REQUIRED" - | "PROCESSING" - | "WON" - | "LOST" - | "ACCEPTED"; +/** The list of possible dispute states. */ export const DisputeState = { InquiryEvidenceRequired: "INQUIRY_EVIDENCE_REQUIRED", InquiryProcessing: "INQUIRY_PROCESSING", @@ -24,3 +11,4 @@ export const DisputeState = { Lost: "LOST", Accepted: "ACCEPTED", } as const; +export type DisputeState = (typeof DisputeState)[keyof typeof DisputeState]; diff --git a/src/api/types/DisputeStateChangedEvent.ts b/src/api/types/DisputeStateChangedEvent.ts index ed1a0b03b..93b43a918 100644 --- a/src/api/types/DisputeStateChangedEvent.ts +++ b/src/api/types/DisputeStateChangedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when the state of a [Dispute](entity:Dispute) changes. diff --git a/src/api/types/DisputeStateChangedEventData.ts b/src/api/types/DisputeStateChangedEventData.ts index dde8e9f45..71eb22546 100644 --- a/src/api/types/DisputeStateChangedEventData.ts +++ b/src/api/types/DisputeStateChangedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeStateChangedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeStateChangedEventObject.ts b/src/api/types/DisputeStateChangedEventObject.ts index 9166ecb26..33f75e098 100644 --- a/src/api/types/DisputeStateChangedEventObject.ts +++ b/src/api/types/DisputeStateChangedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeStateChangedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeStateUpdatedEvent.ts b/src/api/types/DisputeStateUpdatedEvent.ts index 2182af2cf..65604b864 100644 --- a/src/api/types/DisputeStateUpdatedEvent.ts +++ b/src/api/types/DisputeStateUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when the state of a [Dispute](entity:Dispute) changes. diff --git a/src/api/types/DisputeStateUpdatedEventData.ts b/src/api/types/DisputeStateUpdatedEventData.ts index 981082463..88c1451bb 100644 --- a/src/api/types/DisputeStateUpdatedEventData.ts +++ b/src/api/types/DisputeStateUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeStateUpdatedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeStateUpdatedEventObject.ts b/src/api/types/DisputeStateUpdatedEventObject.ts index 12aa43443..43eb52fc1 100644 --- a/src/api/types/DisputeStateUpdatedEventObject.ts +++ b/src/api/types/DisputeStateUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface DisputeStateUpdatedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputedPayment.ts b/src/api/types/DisputedPayment.ts index 3a0c7158e..5a3f4f8a6 100644 --- a/src/api/types/DisputedPayment.ts +++ b/src/api/types/DisputedPayment.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The payment the cardholder disputed. diff --git a/src/api/types/EcomVisibility.ts b/src/api/types/EcomVisibility.ts index aeeec9a94..492d903e7 100644 --- a/src/api/types/EcomVisibility.ts +++ b/src/api/types/EcomVisibility.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Determines item visibility in Ecom (Online Store) and Online Checkout. - */ -export type EcomVisibility = "UNINDEXED" | "UNAVAILABLE" | "HIDDEN" | "VISIBLE"; +/** Determines item visibility in Ecom (Online Store) and Online Checkout. */ export const EcomVisibility = { Unindexed: "UNINDEXED", Unavailable: "UNAVAILABLE", Hidden: "HIDDEN", Visible: "VISIBLE", } as const; +export type EcomVisibility = (typeof EcomVisibility)[keyof typeof EcomVisibility]; diff --git a/src/api/types/Employee.ts b/src/api/types/Employee.ts index e8ae75817..999c26b7b 100644 --- a/src/api/types/Employee.ts +++ b/src/api/types/Employee.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An employee object that is used by the external API. diff --git a/src/api/types/EmployeeStatus.ts b/src/api/types/EmployeeStatus.ts index 3a9d7592f..706db862d 100644 --- a/src/api/types/EmployeeStatus.ts +++ b/src/api/types/EmployeeStatus.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The status of the Employee being retrieved. * * DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). */ -export type EmployeeStatus = "ACTIVE" | "INACTIVE"; export const EmployeeStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; +export type EmployeeStatus = (typeof EmployeeStatus)[keyof typeof EmployeeStatus]; diff --git a/src/api/types/EmployeeWage.ts b/src/api/types/EmployeeWage.ts index ef2a5948e..b8dd659d0 100644 --- a/src/api/types/EmployeeWage.ts +++ b/src/api/types/EmployeeWage.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage). diff --git a/src/api/types/EnableEventsResponse.ts b/src/api/types/EnableEventsResponse.ts index 28a57e147..62308d441 100644 --- a/src/api/types/EnableEventsResponse.ts +++ b/src/api/types/EnableEventsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ErrorCategory.ts b/src/api/types/ErrorCategory.ts index 90766ec56..f859b9573 100644 --- a/src/api/types/ErrorCategory.ts +++ b/src/api/types/ErrorCategory.ts @@ -1,20 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates which high-level category of error has occurred during a * request to the Connect API. */ -export type ErrorCategory = - | "API_ERROR" - | "AUTHENTICATION_ERROR" - | "INVALID_REQUEST_ERROR" - | "RATE_LIMIT_ERROR" - | "PAYMENT_METHOD_ERROR" - | "REFUND_ERROR" - | "MERCHANT_SUBSCRIPTION_ERROR" - | "EXTERNAL_VENDOR_ERROR"; export const ErrorCategory = { ApiError: "API_ERROR", AuthenticationError: "AUTHENTICATION_ERROR", @@ -25,3 +14,4 @@ export const ErrorCategory = { MerchantSubscriptionError: "MERCHANT_SUBSCRIPTION_ERROR", ExternalVendorError: "EXTERNAL_VENDOR_ERROR", } as const; +export type ErrorCategory = (typeof ErrorCategory)[keyof typeof ErrorCategory]; diff --git a/src/api/types/ErrorCode.ts b/src/api/types/ErrorCode.ts index 6f14b0c24..b0064d470 100644 --- a/src/api/types/ErrorCode.ts +++ b/src/api/types/ErrorCode.ts @@ -1,165 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the specific error that occurred during a request to a * Square API. */ -export type ErrorCode = - | "INTERNAL_SERVER_ERROR" - | "UNAUTHORIZED" - | "ACCESS_TOKEN_EXPIRED" - | "ACCESS_TOKEN_REVOKED" - | "CLIENT_DISABLED" - | "FORBIDDEN" - | "INSUFFICIENT_SCOPES" - | "APPLICATION_DISABLED" - | "V1_APPLICATION" - | "V1_ACCESS_TOKEN" - | "CARD_PROCESSING_NOT_ENABLED" - | "MERCHANT_SUBSCRIPTION_NOT_FOUND" - | "BAD_REQUEST" - | "MISSING_REQUIRED_PARAMETER" - | "INCORRECT_TYPE" - | "INVALID_TIME" - | "INVALID_TIME_RANGE" - | "INVALID_VALUE" - | "INVALID_CURSOR" - | "UNKNOWN_QUERY_PARAMETER" - | "CONFLICTING_PARAMETERS" - | "EXPECTED_JSON_BODY" - | "INVALID_SORT_ORDER" - | "VALUE_REGEX_MISMATCH" - | "VALUE_TOO_SHORT" - | "VALUE_TOO_LONG" - | "VALUE_TOO_LOW" - | "VALUE_TOO_HIGH" - | "VALUE_EMPTY" - | "ARRAY_LENGTH_TOO_LONG" - | "ARRAY_LENGTH_TOO_SHORT" - | "ARRAY_EMPTY" - | "EXPECTED_BOOLEAN" - | "EXPECTED_INTEGER" - | "EXPECTED_FLOAT" - | "EXPECTED_STRING" - | "EXPECTED_OBJECT" - | "EXPECTED_ARRAY" - | "EXPECTED_MAP" - | "EXPECTED_BASE64_ENCODED_BYTE_ARRAY" - | "INVALID_ARRAY_VALUE" - | "INVALID_ENUM_VALUE" - | "INVALID_CONTENT_TYPE" - | "INVALID_FORM_VALUE" - | "CUSTOMER_NOT_FOUND" - | "ONE_INSTRUMENT_EXPECTED" - | "NO_FIELDS_SET" - | "TOO_MANY_MAP_ENTRIES" - | "MAP_KEY_LENGTH_TOO_SHORT" - | "MAP_KEY_LENGTH_TOO_LONG" - | "CUSTOMER_MISSING_NAME" - | "CUSTOMER_MISSING_EMAIL" - | "INVALID_PAUSE_LENGTH" - | "INVALID_DATE" - | "UNSUPPORTED_COUNTRY" - | "UNSUPPORTED_CURRENCY" - | "APPLE_TTP_PIN_TOKEN" - | "CARD_EXPIRED" - | "INVALID_EXPIRATION" - | "INVALID_EXPIRATION_YEAR" - | "INVALID_EXPIRATION_DATE" - | "UNSUPPORTED_CARD_BRAND" - | "UNSUPPORTED_ENTRY_METHOD" - | "INVALID_ENCRYPTED_CARD" - | "INVALID_CARD" - | "PAYMENT_AMOUNT_MISMATCH" - | "GENERIC_DECLINE" - | "CVV_FAILURE" - | "ADDRESS_VERIFICATION_FAILURE" - | "INVALID_ACCOUNT" - | "CURRENCY_MISMATCH" - | "INSUFFICIENT_FUNDS" - | "INSUFFICIENT_PERMISSIONS" - | "CARDHOLDER_INSUFFICIENT_PERMISSIONS" - | "INVALID_LOCATION" - | "TRANSACTION_LIMIT" - | "VOICE_FAILURE" - | "PAN_FAILURE" - | "EXPIRATION_FAILURE" - | "CARD_NOT_SUPPORTED" - | "READER_DECLINED" - | "INVALID_PIN" - | "MISSING_PIN" - | "MISSING_ACCOUNT_TYPE" - | "INVALID_POSTAL_CODE" - | "INVALID_FEES" - | "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED" - | "PAYMENT_LIMIT_EXCEEDED" - | "GIFT_CARD_AVAILABLE_AMOUNT" - | "ACCOUNT_UNUSABLE" - | "BUYER_REFUSED_PAYMENT" - | "DELAYED_TRANSACTION_EXPIRED" - | "DELAYED_TRANSACTION_CANCELED" - | "DELAYED_TRANSACTION_CAPTURED" - | "DELAYED_TRANSACTION_FAILED" - | "CARD_TOKEN_EXPIRED" - | "CARD_TOKEN_USED" - | "AMOUNT_TOO_HIGH" - | "UNSUPPORTED_INSTRUMENT_TYPE" - | "REFUND_AMOUNT_INVALID" - | "REFUND_ALREADY_PENDING" - | "PAYMENT_NOT_REFUNDABLE" - | "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE" - | "REFUND_ERROR_PAYMENT_NEEDS_COMPLETION" - | "REFUND_DECLINED" - | "INSUFFICIENT_PERMISSIONS_FOR_REFUND" - | "INVALID_CARD_DATA" - | "SOURCE_USED" - | "SOURCE_EXPIRED" - | "UNSUPPORTED_LOYALTY_REWARD_TIER" - | "LOCATION_MISMATCH" - | "ORDER_UNPAID_NOT_RETURNABLE" - | "IDEMPOTENCY_KEY_REUSED" - | "UNEXPECTED_VALUE" - | "SANDBOX_NOT_SUPPORTED" - | "INVALID_EMAIL_ADDRESS" - | "INVALID_PHONE_NUMBER" - | "CHECKOUT_EXPIRED" - | "BAD_CERTIFICATE" - | "INVALID_SQUARE_VERSION_FORMAT" - | "API_VERSION_INCOMPATIBLE" - | "CARD_PRESENCE_REQUIRED" - | "UNSUPPORTED_SOURCE_TYPE" - | "CARD_MISMATCH" - | "PLAID_ERROR" - | "PLAID_ERROR_ITEM_LOGIN_REQUIRED" - | "PLAID_ERROR_RATE_LIMIT" - | "CARD_DECLINED" - | "VERIFY_CVV_FAILURE" - | "VERIFY_AVS_FAILURE" - | "CARD_DECLINED_CALL_ISSUER" - | "CARD_DECLINED_VERIFICATION_REQUIRED" - | "BAD_EXPIRATION" - | "CHIP_INSERTION_REQUIRED" - | "ALLOWABLE_PIN_TRIES_EXCEEDED" - | "RESERVATION_DECLINED" - | "UNKNOWN_BODY_PARAMETER" - | "NOT_FOUND" - | "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND" - | "METHOD_NOT_ALLOWED" - | "NOT_ACCEPTABLE" - | "REQUEST_TIMEOUT" - | "CONFLICT" - | "GONE" - | "REQUEST_ENTITY_TOO_LARGE" - | "UNSUPPORTED_MEDIA_TYPE" - | "UNPROCESSABLE_ENTITY" - | "RATE_LIMITED" - | "NOT_IMPLEMENTED" - | "BAD_GATEWAY" - | "SERVICE_UNAVAILABLE" - | "TEMPORARY_ERROR" - | "GATEWAY_TIMEOUT"; export const ErrorCode = { InternalServerError: "INTERNAL_SERVER_ERROR", Unauthorized: "UNAUTHORIZED", @@ -315,3 +159,4 @@ export const ErrorCode = { TemporaryError: "TEMPORARY_ERROR", GatewayTimeout: "GATEWAY_TIMEOUT", } as const; +export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode]; diff --git a/src/api/types/Error_.ts b/src/api/types/Error_.ts index 6efac0309..c982a6701 100644 --- a/src/api/types/Error_.ts +++ b/src/api/types/Error_.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an error encountered during a request to the Connect API. diff --git a/src/api/types/Event.ts b/src/api/types/Event.ts index b3c8135ed..e28255b07 100644 --- a/src/api/types/Event.ts +++ b/src/api/types/Event.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface Event { /** The ID of the target merchant associated with the event. */ diff --git a/src/api/types/EventData.ts b/src/api/types/EventData.ts index 54d750b75..29d98abea 100644 --- a/src/api/types/EventData.ts +++ b/src/api/types/EventData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface EventData { /** The name of the affected object’s type. */ diff --git a/src/api/types/EventMetadata.ts b/src/api/types/EventMetadata.ts index afda8f14d..14df56655 100644 --- a/src/api/types/EventMetadata.ts +++ b/src/api/types/EventMetadata.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Contains metadata about a particular [Event](entity:Event). diff --git a/src/api/types/EventTypeMetadata.ts b/src/api/types/EventTypeMetadata.ts index ab26d5ea5..0fa04d63c 100644 --- a/src/api/types/EventTypeMetadata.ts +++ b/src/api/types/EventTypeMetadata.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Contains the metadata of a webhook event type. diff --git a/src/api/types/ExcludeStrategy.ts b/src/api/types/ExcludeStrategy.ts index 6305eb6fa..a8bfa7bb1 100644 --- a/src/api/types/ExcludeStrategy.ts +++ b/src/api/types/ExcludeStrategy.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates which products matched by a CatalogPricingRule * will be excluded if the pricing rule uses an exclude set. */ -export type ExcludeStrategy = "LEAST_EXPENSIVE" | "MOST_EXPENSIVE"; export const ExcludeStrategy = { LeastExpensive: "LEAST_EXPENSIVE", MostExpensive: "MOST_EXPENSIVE", } as const; +export type ExcludeStrategy = (typeof ExcludeStrategy)[keyof typeof ExcludeStrategy]; diff --git a/src/api/types/ExternalPaymentDetails.ts b/src/api/types/ExternalPaymentDetails.ts index 013cd8786..76fabb0c4 100644 --- a/src/api/types/ExternalPaymentDetails.ts +++ b/src/api/types/ExternalPaymentDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Stores details about an external payment. Contains only non-confidential information. diff --git a/src/api/types/FilterValue.ts b/src/api/types/FilterValue.ts index 2e3e17584..8129af549 100644 --- a/src/api/types/FilterValue.ts +++ b/src/api/types/FilterValue.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A filter to select resources based on an exact field value. For any given diff --git a/src/api/types/FloatNumberRange.ts b/src/api/types/FloatNumberRange.ts index 8505a494b..676df55da 100644 --- a/src/api/types/FloatNumberRange.ts +++ b/src/api/types/FloatNumberRange.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Specifies a decimal number range. diff --git a/src/api/types/Fulfillment.ts b/src/api/types/Fulfillment.ts index 41dfa331b..ba69a5c04 100644 --- a/src/api/types/Fulfillment.ts +++ b/src/api/types/Fulfillment.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Contains details about how to fulfill this order. diff --git a/src/api/types/FulfillmentDeliveryDetails.ts b/src/api/types/FulfillmentDeliveryDetails.ts index 42b3e3ae3..fa73fce19 100644 --- a/src/api/types/FulfillmentDeliveryDetails.ts +++ b/src/api/types/FulfillmentDeliveryDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes delivery details of an order fulfillment. diff --git a/src/api/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts b/src/api/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts index e27edc29d..d9baf4440 100644 --- a/src/api/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts +++ b/src/api/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The schedule type of the delivery fulfillment. - */ -export type FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = "SCHEDULED" | "ASAP"; +/** The schedule type of the delivery fulfillment. */ export const FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = { Scheduled: "SCHEDULED", Asap: "ASAP", } as const; +export type FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = + (typeof FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType)[keyof typeof FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType]; diff --git a/src/api/types/FulfillmentFulfillmentEntry.ts b/src/api/types/FulfillmentFulfillmentEntry.ts index eee1b6960..e7d955961 100644 --- a/src/api/types/FulfillmentFulfillmentEntry.ts +++ b/src/api/types/FulfillmentFulfillmentEntry.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Links an order line item to a fulfillment. Each entry must reference diff --git a/src/api/types/FulfillmentFulfillmentLineItemApplication.ts b/src/api/types/FulfillmentFulfillmentLineItemApplication.ts index 4669179a4..3781549f2 100644 --- a/src/api/types/FulfillmentFulfillmentLineItemApplication.ts +++ b/src/api/types/FulfillmentFulfillmentLineItemApplication.ts @@ -1,13 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The `line_item_application` describes what order line items this fulfillment applies * to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. */ -export type FulfillmentFulfillmentLineItemApplication = "ALL" | "ENTRY_LIST"; export const FulfillmentFulfillmentLineItemApplication = { All: "ALL", EntryList: "ENTRY_LIST", } as const; +export type FulfillmentFulfillmentLineItemApplication = + (typeof FulfillmentFulfillmentLineItemApplication)[keyof typeof FulfillmentFulfillmentLineItemApplication]; diff --git a/src/api/types/FulfillmentPickupDetails.ts b/src/api/types/FulfillmentPickupDetails.ts index 2860652d2..fbdc0c029 100644 --- a/src/api/types/FulfillmentPickupDetails.ts +++ b/src/api/types/FulfillmentPickupDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Contains details necessary to fulfill a pickup order. diff --git a/src/api/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts b/src/api/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts index 68fade02b..c1b4bc455 100644 --- a/src/api/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts +++ b/src/api/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Specific details for curbside pickup. diff --git a/src/api/types/FulfillmentPickupDetailsScheduleType.ts b/src/api/types/FulfillmentPickupDetailsScheduleType.ts index fab10fcda..95c7b5f18 100644 --- a/src/api/types/FulfillmentPickupDetailsScheduleType.ts +++ b/src/api/types/FulfillmentPickupDetailsScheduleType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The schedule type of the pickup fulfillment. - */ -export type FulfillmentPickupDetailsScheduleType = "SCHEDULED" | "ASAP"; +/** The schedule type of the pickup fulfillment. */ export const FulfillmentPickupDetailsScheduleType = { Scheduled: "SCHEDULED", Asap: "ASAP", } as const; +export type FulfillmentPickupDetailsScheduleType = + (typeof FulfillmentPickupDetailsScheduleType)[keyof typeof FulfillmentPickupDetailsScheduleType]; diff --git a/src/api/types/FulfillmentRecipient.ts b/src/api/types/FulfillmentRecipient.ts index 96e30c413..b5d6e89fb 100644 --- a/src/api/types/FulfillmentRecipient.ts +++ b/src/api/types/FulfillmentRecipient.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Information about the fulfillment recipient. diff --git a/src/api/types/FulfillmentShipmentDetails.ts b/src/api/types/FulfillmentShipmentDetails.ts index 48c6176a6..e29d014c7 100644 --- a/src/api/types/FulfillmentShipmentDetails.ts +++ b/src/api/types/FulfillmentShipmentDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Contains the details necessary to fulfill a shipment order. diff --git a/src/api/types/FulfillmentState.ts b/src/api/types/FulfillmentState.ts index 49236c3cc..7e4354b1a 100644 --- a/src/api/types/FulfillmentState.ts +++ b/src/api/types/FulfillmentState.ts @@ -1,11 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The current state of this fulfillment. - */ -export type FulfillmentState = "PROPOSED" | "RESERVED" | "PREPARED" | "COMPLETED" | "CANCELED" | "FAILED"; +/** The current state of this fulfillment. */ export const FulfillmentState = { Proposed: "PROPOSED", Reserved: "RESERVED", @@ -14,3 +9,4 @@ export const FulfillmentState = { Canceled: "CANCELED", Failed: "FAILED", } as const; +export type FulfillmentState = (typeof FulfillmentState)[keyof typeof FulfillmentState]; diff --git a/src/api/types/FulfillmentType.ts b/src/api/types/FulfillmentType.ts index 59bf58a4e..f9105158f 100644 --- a/src/api/types/FulfillmentType.ts +++ b/src/api/types/FulfillmentType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of fulfillment. - */ -export type FulfillmentType = "PICKUP" | "SHIPMENT" | "DELIVERY"; +/** The type of fulfillment. */ export const FulfillmentType = { Pickup: "PICKUP", Shipment: "SHIPMENT", Delivery: "DELIVERY", } as const; +export type FulfillmentType = (typeof FulfillmentType)[keyof typeof FulfillmentType]; diff --git a/src/api/types/GetBankAccountByV1IdResponse.ts b/src/api/types/GetBankAccountByV1IdResponse.ts index eb32b38e2..12490270c 100644 --- a/src/api/types/GetBankAccountByV1IdResponse.ts +++ b/src/api/types/GetBankAccountByV1IdResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response object returned by GetBankAccountByV1Id. diff --git a/src/api/types/GetBankAccountResponse.ts b/src/api/types/GetBankAccountResponse.ts index 4da1157b5..10a5a9994 100644 --- a/src/api/types/GetBankAccountResponse.ts +++ b/src/api/types/GetBankAccountResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response object returned by `GetBankAccount`. diff --git a/src/api/types/GetBookingRequest.ts b/src/api/types/GetBookingRequest.ts index 3d13e82c9..ba2057594 100644 --- a/src/api/types/GetBookingRequest.ts +++ b/src/api/types/GetBookingRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetBookingRequest = unknown; diff --git a/src/api/types/GetBookingResponse.ts b/src/api/types/GetBookingResponse.ts index 802155711..e819d4f9f 100644 --- a/src/api/types/GetBookingResponse.ts +++ b/src/api/types/GetBookingResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetBookingResponse { /** The booking that was requested. */ diff --git a/src/api/types/GetBreakTypeResponse.ts b/src/api/types/GetBreakTypeResponse.ts index c19ef2831..5e6d8d0f9 100644 --- a/src/api/types/GetBreakTypeResponse.ts +++ b/src/api/types/GetBreakTypeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request to get a `BreakType`. The response contains diff --git a/src/api/types/GetBusinessBookingProfileRequest.ts b/src/api/types/GetBusinessBookingProfileRequest.ts index aefa167f4..4f4d13f1f 100644 --- a/src/api/types/GetBusinessBookingProfileRequest.ts +++ b/src/api/types/GetBusinessBookingProfileRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetBusinessBookingProfileRequest = unknown; diff --git a/src/api/types/GetBusinessBookingProfileResponse.ts b/src/api/types/GetBusinessBookingProfileResponse.ts index 4d00700b7..fb2851c56 100644 --- a/src/api/types/GetBusinessBookingProfileResponse.ts +++ b/src/api/types/GetBusinessBookingProfileResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetBusinessBookingProfileResponse { /** The seller's booking profile. */ diff --git a/src/api/types/GetCardRequest.ts b/src/api/types/GetCardRequest.ts index a24eec96f..bdb411fed 100644 --- a/src/api/types/GetCardRequest.ts +++ b/src/api/types/GetCardRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetCardRequest = unknown; diff --git a/src/api/types/GetCardResponse.ts b/src/api/types/GetCardResponse.ts index 977887b0f..b114e9c3a 100644 --- a/src/api/types/GetCardResponse.ts +++ b/src/api/types/GetCardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/GetCashDrawerShiftResponse.ts b/src/api/types/GetCashDrawerShiftResponse.ts index c0dcd2bad..59d347e02 100644 --- a/src/api/types/GetCashDrawerShiftResponse.ts +++ b/src/api/types/GetCashDrawerShiftResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetCashDrawerShiftResponse { /** The cash drawer shift queried for. */ diff --git a/src/api/types/GetCatalogObjectResponse.ts b/src/api/types/GetCatalogObjectResponse.ts index 0c9fd7b6d..0162a372b 100644 --- a/src/api/types/GetCatalogObjectResponse.ts +++ b/src/api/types/GetCatalogObjectResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetCatalogObjectResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetCustomerCustomAttributeDefinitionResponse.ts b/src/api/types/GetCustomerCustomAttributeDefinitionResponse.ts index d0e5c7991..467be3574 100644 --- a/src/api/types/GetCustomerCustomAttributeDefinitionResponse.ts +++ b/src/api/types/GetCustomerCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttributeDefinition) response. diff --git a/src/api/types/GetCustomerCustomAttributeResponse.ts b/src/api/types/GetCustomerCustomAttributeResponse.ts index 1cddb6f62..5583834c3 100644 --- a/src/api/types/GetCustomerCustomAttributeResponse.ts +++ b/src/api/types/GetCustomerCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) response. diff --git a/src/api/types/GetCustomerGroupRequest.ts b/src/api/types/GetCustomerGroupRequest.ts index 7511737ba..1556f73f8 100644 --- a/src/api/types/GetCustomerGroupRequest.ts +++ b/src/api/types/GetCustomerGroupRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetCustomerGroupRequest = unknown; diff --git a/src/api/types/GetCustomerGroupResponse.ts b/src/api/types/GetCustomerGroupResponse.ts index 34e43193a..b9b439507 100644 --- a/src/api/types/GetCustomerGroupResponse.ts +++ b/src/api/types/GetCustomerGroupResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/GetCustomerRequest.ts b/src/api/types/GetCustomerRequest.ts index aa6515c1b..2b6fe27a4 100644 --- a/src/api/types/GetCustomerRequest.ts +++ b/src/api/types/GetCustomerRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetCustomerRequest = unknown; diff --git a/src/api/types/GetCustomerResponse.ts b/src/api/types/GetCustomerResponse.ts index 6729a7527..78196d4ff 100644 --- a/src/api/types/GetCustomerResponse.ts +++ b/src/api/types/GetCustomerResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/GetCustomerSegmentRequest.ts b/src/api/types/GetCustomerSegmentRequest.ts index 548e71c69..0675a45ab 100644 --- a/src/api/types/GetCustomerSegmentRequest.ts +++ b/src/api/types/GetCustomerSegmentRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetCustomerSegmentRequest = unknown; diff --git a/src/api/types/GetCustomerSegmentResponse.ts b/src/api/types/GetCustomerSegmentResponse.ts index 03f3c5b30..2435ee587 100644 --- a/src/api/types/GetCustomerSegmentResponse.ts +++ b/src/api/types/GetCustomerSegmentResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body for requests to the `RetrieveCustomerSegment` endpoint. diff --git a/src/api/types/GetDeviceCodeResponse.ts b/src/api/types/GetDeviceCodeResponse.ts index cc4425f39..28c8b6b33 100644 --- a/src/api/types/GetDeviceCodeResponse.ts +++ b/src/api/types/GetDeviceCodeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetDeviceCodeResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetDeviceResponse.ts b/src/api/types/GetDeviceResponse.ts index 307d74483..ad2b61319 100644 --- a/src/api/types/GetDeviceResponse.ts +++ b/src/api/types/GetDeviceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetDeviceResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/GetDisputeEvidenceRequest.ts b/src/api/types/GetDisputeEvidenceRequest.ts index 7bab2adc2..e4353c9ea 100644 --- a/src/api/types/GetDisputeEvidenceRequest.ts +++ b/src/api/types/GetDisputeEvidenceRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetDisputeEvidenceRequest = unknown; diff --git a/src/api/types/GetDisputeEvidenceResponse.ts b/src/api/types/GetDisputeEvidenceResponse.ts index 48a52ff8c..f05d01d6e 100644 --- a/src/api/types/GetDisputeEvidenceResponse.ts +++ b/src/api/types/GetDisputeEvidenceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields in a `RetrieveDisputeEvidence` response. diff --git a/src/api/types/GetDisputeRequest.ts b/src/api/types/GetDisputeRequest.ts index d41f72517..40116ee10 100644 --- a/src/api/types/GetDisputeRequest.ts +++ b/src/api/types/GetDisputeRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetDisputeRequest = unknown; diff --git a/src/api/types/GetDisputeResponse.ts b/src/api/types/GetDisputeResponse.ts index a6d615a91..9025bb7a1 100644 --- a/src/api/types/GetDisputeResponse.ts +++ b/src/api/types/GetDisputeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines fields in a `RetrieveDispute` response. diff --git a/src/api/types/GetEmployeeRequest.ts b/src/api/types/GetEmployeeRequest.ts index a85cb2cfc..e7cfe37a2 100644 --- a/src/api/types/GetEmployeeRequest.ts +++ b/src/api/types/GetEmployeeRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetEmployeeRequest = unknown; diff --git a/src/api/types/GetEmployeeResponse.ts b/src/api/types/GetEmployeeResponse.ts index 266fa41e1..25c03e685 100644 --- a/src/api/types/GetEmployeeResponse.ts +++ b/src/api/types/GetEmployeeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetEmployeeResponse { employee?: Square.Employee; diff --git a/src/api/types/GetEmployeeWageResponse.ts b/src/api/types/GetEmployeeWageResponse.ts index fe7c71f55..63eda6ed0 100644 --- a/src/api/types/GetEmployeeWageResponse.ts +++ b/src/api/types/GetEmployeeWageResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response to a request to get an `EmployeeWage`. The response contains diff --git a/src/api/types/GetGiftCardFromGanResponse.ts b/src/api/types/GetGiftCardFromGanResponse.ts index ecb5ff639..c02b88461 100644 --- a/src/api/types/GetGiftCardFromGanResponse.ts +++ b/src/api/types/GetGiftCardFromGanResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains a `GiftCard`. This response might contain a set of `Error` objects diff --git a/src/api/types/GetGiftCardFromNonceResponse.ts b/src/api/types/GetGiftCardFromNonceResponse.ts index dca2bcbfe..e4cb42f71 100644 --- a/src/api/types/GetGiftCardFromNonceResponse.ts +++ b/src/api/types/GetGiftCardFromNonceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains a `GiftCard` object. If the request resulted in errors, diff --git a/src/api/types/GetGiftCardRequest.ts b/src/api/types/GetGiftCardRequest.ts index d4632f78c..84c96bd76 100644 --- a/src/api/types/GetGiftCardRequest.ts +++ b/src/api/types/GetGiftCardRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetGiftCardRequest = unknown; diff --git a/src/api/types/GetGiftCardResponse.ts b/src/api/types/GetGiftCardResponse.ts index 2548f71c0..8840cb6ee 100644 --- a/src/api/types/GetGiftCardResponse.ts +++ b/src/api/types/GetGiftCardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains a `GiftCard`. The response might contain a set of `Error` objects diff --git a/src/api/types/GetInventoryAdjustmentRequest.ts b/src/api/types/GetInventoryAdjustmentRequest.ts index 2b69c2f4d..94f38f33e 100644 --- a/src/api/types/GetInventoryAdjustmentRequest.ts +++ b/src/api/types/GetInventoryAdjustmentRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetInventoryAdjustmentRequest = unknown; diff --git a/src/api/types/GetInventoryAdjustmentResponse.ts b/src/api/types/GetInventoryAdjustmentResponse.ts index 549648d11..6ee38b654 100644 --- a/src/api/types/GetInventoryAdjustmentResponse.ts +++ b/src/api/types/GetInventoryAdjustmentResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetInventoryAdjustmentResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetInventoryChangesResponse.ts b/src/api/types/GetInventoryChangesResponse.ts index 91187103f..ec09d6dd1 100644 --- a/src/api/types/GetInventoryChangesResponse.ts +++ b/src/api/types/GetInventoryChangesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetInventoryChangesResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetInventoryCountResponse.ts b/src/api/types/GetInventoryCountResponse.ts index cdedcffdf..229685573 100644 --- a/src/api/types/GetInventoryCountResponse.ts +++ b/src/api/types/GetInventoryCountResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetInventoryCountResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetInventoryPhysicalCountRequest.ts b/src/api/types/GetInventoryPhysicalCountRequest.ts index 4e423b2a8..9ac1aace4 100644 --- a/src/api/types/GetInventoryPhysicalCountRequest.ts +++ b/src/api/types/GetInventoryPhysicalCountRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetInventoryPhysicalCountRequest = unknown; diff --git a/src/api/types/GetInventoryPhysicalCountResponse.ts b/src/api/types/GetInventoryPhysicalCountResponse.ts index 32b1b4305..969e82f37 100644 --- a/src/api/types/GetInventoryPhysicalCountResponse.ts +++ b/src/api/types/GetInventoryPhysicalCountResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetInventoryPhysicalCountResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetInventoryTransferRequest.ts b/src/api/types/GetInventoryTransferRequest.ts index 91ff3d2c4..e8c3a8906 100644 --- a/src/api/types/GetInventoryTransferRequest.ts +++ b/src/api/types/GetInventoryTransferRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetInventoryTransferRequest = unknown; diff --git a/src/api/types/GetInventoryTransferResponse.ts b/src/api/types/GetInventoryTransferResponse.ts index e25b1fc68..72d3c3bab 100644 --- a/src/api/types/GetInventoryTransferResponse.ts +++ b/src/api/types/GetInventoryTransferResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetInventoryTransferResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetInvoiceResponse.ts b/src/api/types/GetInvoiceResponse.ts index 620869be5..45246db3c 100644 --- a/src/api/types/GetInvoiceResponse.ts +++ b/src/api/types/GetInvoiceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a `GetInvoice` response. diff --git a/src/api/types/GetLocationRequest.ts b/src/api/types/GetLocationRequest.ts index ba6883ff1..2381e4df1 100644 --- a/src/api/types/GetLocationRequest.ts +++ b/src/api/types/GetLocationRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetLocationRequest = unknown; diff --git a/src/api/types/GetLocationResponse.ts b/src/api/types/GetLocationResponse.ts index fc0af595d..cf8994a3a 100644 --- a/src/api/types/GetLocationResponse.ts +++ b/src/api/types/GetLocationResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that the [RetrieveLocation](api-endpoint:Locations-RetrieveLocation) diff --git a/src/api/types/GetLoyaltyAccountRequest.ts b/src/api/types/GetLoyaltyAccountRequest.ts index 4c4b168fe..485fe087e 100644 --- a/src/api/types/GetLoyaltyAccountRequest.ts +++ b/src/api/types/GetLoyaltyAccountRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetLoyaltyAccountRequest = unknown; diff --git a/src/api/types/GetLoyaltyAccountResponse.ts b/src/api/types/GetLoyaltyAccountResponse.ts index 566275fc9..d11fb5286 100644 --- a/src/api/types/GetLoyaltyAccountResponse.ts +++ b/src/api/types/GetLoyaltyAccountResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that includes the loyalty account. diff --git a/src/api/types/GetLoyaltyProgramRequest.ts b/src/api/types/GetLoyaltyProgramRequest.ts index dd7259869..d9a142b05 100644 --- a/src/api/types/GetLoyaltyProgramRequest.ts +++ b/src/api/types/GetLoyaltyProgramRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetLoyaltyProgramRequest = unknown; diff --git a/src/api/types/GetLoyaltyProgramResponse.ts b/src/api/types/GetLoyaltyProgramResponse.ts index e01dee587..ceff46141 100644 --- a/src/api/types/GetLoyaltyProgramResponse.ts +++ b/src/api/types/GetLoyaltyProgramResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains the loyalty program. diff --git a/src/api/types/GetLoyaltyPromotionRequest.ts b/src/api/types/GetLoyaltyPromotionRequest.ts index 4817ea7a7..ffc5d2aaa 100644 --- a/src/api/types/GetLoyaltyPromotionRequest.ts +++ b/src/api/types/GetLoyaltyPromotionRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetLoyaltyPromotionRequest = unknown; diff --git a/src/api/types/GetLoyaltyPromotionResponse.ts b/src/api/types/GetLoyaltyPromotionResponse.ts index 689d5a772..649001259 100644 --- a/src/api/types/GetLoyaltyPromotionResponse.ts +++ b/src/api/types/GetLoyaltyPromotionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveLoyaltyPromotionPromotions](api-endpoint:Loyalty-RetrieveLoyaltyPromotion) response. diff --git a/src/api/types/GetLoyaltyRewardRequest.ts b/src/api/types/GetLoyaltyRewardRequest.ts index 6cae255b6..c46972187 100644 --- a/src/api/types/GetLoyaltyRewardRequest.ts +++ b/src/api/types/GetLoyaltyRewardRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetLoyaltyRewardRequest = unknown; diff --git a/src/api/types/GetLoyaltyRewardResponse.ts b/src/api/types/GetLoyaltyRewardResponse.ts index c285d582e..c0a4fe62f 100644 --- a/src/api/types/GetLoyaltyRewardResponse.ts +++ b/src/api/types/GetLoyaltyRewardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that includes the loyalty reward. diff --git a/src/api/types/GetMerchantRequest.ts b/src/api/types/GetMerchantRequest.ts index 21042b11b..785f383b3 100644 --- a/src/api/types/GetMerchantRequest.ts +++ b/src/api/types/GetMerchantRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetMerchantRequest = unknown; diff --git a/src/api/types/GetMerchantResponse.ts b/src/api/types/GetMerchantResponse.ts index 603d2c794..c94cefe81 100644 --- a/src/api/types/GetMerchantResponse.ts +++ b/src/api/types/GetMerchantResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response object returned by the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) endpoint. diff --git a/src/api/types/GetOrderRequest.ts b/src/api/types/GetOrderRequest.ts index afbc2cb24..9a9ec2cb3 100644 --- a/src/api/types/GetOrderRequest.ts +++ b/src/api/types/GetOrderRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetOrderRequest = unknown; diff --git a/src/api/types/GetOrderResponse.ts b/src/api/types/GetOrderResponse.ts index 17b50598b..376b115ad 100644 --- a/src/api/types/GetOrderResponse.ts +++ b/src/api/types/GetOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetOrderResponse { /** The requested order. */ diff --git a/src/api/types/GetPaymentLinkRequest.ts b/src/api/types/GetPaymentLinkRequest.ts index 6997b357e..0d47ded9c 100644 --- a/src/api/types/GetPaymentLinkRequest.ts +++ b/src/api/types/GetPaymentLinkRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetPaymentLinkRequest = unknown; diff --git a/src/api/types/GetPaymentLinkResponse.ts b/src/api/types/GetPaymentLinkResponse.ts index e7fa33c13..02de7ba20 100644 --- a/src/api/types/GetPaymentLinkResponse.ts +++ b/src/api/types/GetPaymentLinkResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetPaymentLinkResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetPaymentRefundResponse.ts b/src/api/types/GetPaymentRefundResponse.ts index 2fcdadd81..21a600c62 100644 --- a/src/api/types/GetPaymentRefundResponse.ts +++ b/src/api/types/GetPaymentRefundResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response returned by [GetRefund](api-endpoint:Refunds-GetPaymentRefund). diff --git a/src/api/types/GetPaymentResponse.ts b/src/api/types/GetPaymentResponse.ts index 75908b112..8bd49c91a 100644 --- a/src/api/types/GetPaymentResponse.ts +++ b/src/api/types/GetPaymentResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response returned by [GetPayment](api-endpoint:Payments-GetPayment). diff --git a/src/api/types/GetPayoutResponse.ts b/src/api/types/GetPayoutResponse.ts index 7c70935d8..0e8c2b4ec 100644 --- a/src/api/types/GetPayoutResponse.ts +++ b/src/api/types/GetPayoutResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetPayoutResponse { /** The requested payout. */ diff --git a/src/api/types/GetShiftResponse.ts b/src/api/types/GetShiftResponse.ts index 926693b5c..343da4826 100644 --- a/src/api/types/GetShiftResponse.ts +++ b/src/api/types/GetShiftResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response to a request to get a `Shift`. The response contains diff --git a/src/api/types/GetSnippetRequest.ts b/src/api/types/GetSnippetRequest.ts index ae27a6a6e..a1334d1fc 100644 --- a/src/api/types/GetSnippetRequest.ts +++ b/src/api/types/GetSnippetRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetSnippetRequest = unknown; diff --git a/src/api/types/GetSnippetResponse.ts b/src/api/types/GetSnippetResponse.ts index e37027c89..2453f853e 100644 --- a/src/api/types/GetSnippetResponse.ts +++ b/src/api/types/GetSnippetResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a `RetrieveSnippet` response. The response can include either `snippet` or `errors`. diff --git a/src/api/types/GetSubscriptionResponse.ts b/src/api/types/GetSubscriptionResponse.ts index 77341f9a7..8854cd0d9 100644 --- a/src/api/types/GetSubscriptionResponse.ts +++ b/src/api/types/GetSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/GetTeamMemberBookingProfileRequest.ts b/src/api/types/GetTeamMemberBookingProfileRequest.ts index 63c0e3f3e..6adc7274b 100644 --- a/src/api/types/GetTeamMemberBookingProfileRequest.ts +++ b/src/api/types/GetTeamMemberBookingProfileRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetTeamMemberBookingProfileRequest = unknown; diff --git a/src/api/types/GetTeamMemberBookingProfileResponse.ts b/src/api/types/GetTeamMemberBookingProfileResponse.ts index df4c923ae..70889bca1 100644 --- a/src/api/types/GetTeamMemberBookingProfileResponse.ts +++ b/src/api/types/GetTeamMemberBookingProfileResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetTeamMemberBookingProfileResponse { /** The returned team member booking profile. */ diff --git a/src/api/types/GetTeamMemberRequest.ts b/src/api/types/GetTeamMemberRequest.ts index c19ab9437..248b7ca84 100644 --- a/src/api/types/GetTeamMemberRequest.ts +++ b/src/api/types/GetTeamMemberRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetTeamMemberRequest = unknown; diff --git a/src/api/types/GetTeamMemberResponse.ts b/src/api/types/GetTeamMemberResponse.ts index e269e7dfa..693752e16 100644 --- a/src/api/types/GetTeamMemberResponse.ts +++ b/src/api/types/GetTeamMemberResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from a retrieve request containing a `TeamMember` object or error messages. diff --git a/src/api/types/GetTeamMemberWageResponse.ts b/src/api/types/GetTeamMemberWageResponse.ts index 2b8a9770a..6be168259 100644 --- a/src/api/types/GetTeamMemberWageResponse.ts +++ b/src/api/types/GetTeamMemberWageResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response to a request to get a `TeamMemberWage`. The response contains diff --git a/src/api/types/GetTerminalActionResponse.ts b/src/api/types/GetTerminalActionResponse.ts index ac4225cbc..047d8da1b 100644 --- a/src/api/types/GetTerminalActionResponse.ts +++ b/src/api/types/GetTerminalActionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetTerminalActionResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/GetTerminalCheckoutResponse.ts b/src/api/types/GetTerminalCheckoutResponse.ts index 23f4d7e68..f667bffae 100644 --- a/src/api/types/GetTerminalCheckoutResponse.ts +++ b/src/api/types/GetTerminalCheckoutResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetTerminalCheckoutResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/GetTerminalRefundResponse.ts b/src/api/types/GetTerminalRefundResponse.ts index 973ca5864..887249c8c 100644 --- a/src/api/types/GetTerminalRefundResponse.ts +++ b/src/api/types/GetTerminalRefundResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface GetTerminalRefundResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/GetTransactionRequest.ts b/src/api/types/GetTransactionRequest.ts index 2e5fc36c7..8d8421008 100644 --- a/src/api/types/GetTransactionRequest.ts +++ b/src/api/types/GetTransactionRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetTransactionRequest = unknown; diff --git a/src/api/types/GetTransactionResponse.ts b/src/api/types/GetTransactionResponse.ts index aff31de00..924073a3d 100644 --- a/src/api/types/GetTransactionResponse.ts +++ b/src/api/types/GetTransactionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/GetVendorRequest.ts b/src/api/types/GetVendorRequest.ts index 96956cd9b..3fb35714d 100644 --- a/src/api/types/GetVendorRequest.ts +++ b/src/api/types/GetVendorRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetVendorRequest = unknown; diff --git a/src/api/types/GetVendorResponse.ts b/src/api/types/GetVendorResponse.ts index 34662553d..5b0562dbd 100644 --- a/src/api/types/GetVendorResponse.ts +++ b/src/api/types/GetVendorResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an output from a call to [RetrieveVendor](api-endpoint:Vendors-RetrieveVendor). diff --git a/src/api/types/GetWageSettingRequest.ts b/src/api/types/GetWageSettingRequest.ts index befc636af..59aa878cb 100644 --- a/src/api/types/GetWageSettingRequest.ts +++ b/src/api/types/GetWageSettingRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetWageSettingRequest = unknown; diff --git a/src/api/types/GetWageSettingResponse.ts b/src/api/types/GetWageSettingResponse.ts index d34904d40..2e78b89fe 100644 --- a/src/api/types/GetWageSettingResponse.ts +++ b/src/api/types/GetWageSettingResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from a retrieve request containing the specified `WageSetting` object or error messages. diff --git a/src/api/types/GetWebhookSubscriptionRequest.ts b/src/api/types/GetWebhookSubscriptionRequest.ts index 94e94c97b..e5851e94c 100644 --- a/src/api/types/GetWebhookSubscriptionRequest.ts +++ b/src/api/types/GetWebhookSubscriptionRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type GetWebhookSubscriptionRequest = unknown; diff --git a/src/api/types/GetWebhookSubscriptionResponse.ts b/src/api/types/GetWebhookSubscriptionResponse.ts index 55d50ead7..f17f26534 100644 --- a/src/api/types/GetWebhookSubscriptionResponse.ts +++ b/src/api/types/GetWebhookSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/GiftCard.ts b/src/api/types/GiftCard.ts index ed24ffacb..1f145f84b 100644 --- a/src/api/types/GiftCard.ts +++ b/src/api/types/GiftCard.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a Square gift card. diff --git a/src/api/types/GiftCardActivity.ts b/src/api/types/GiftCardActivity.ts index a19037829..7689db29a 100644 --- a/src/api/types/GiftCardActivity.ts +++ b/src/api/types/GiftCardActivity.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an action performed on a [gift card](entity:GiftCard) that affects its state or balance. diff --git a/src/api/types/GiftCardActivityActivate.ts b/src/api/types/GiftCardActivityActivate.ts index c8f56828f..01c82b49a 100644 --- a/src/api/types/GiftCardActivityActivate.ts +++ b/src/api/types/GiftCardActivityActivate.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about an `ACTIVATE` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityAdjustDecrement.ts b/src/api/types/GiftCardActivityAdjustDecrement.ts index 80d24f854..1e89d946a 100644 --- a/src/api/types/GiftCardActivityAdjustDecrement.ts +++ b/src/api/types/GiftCardActivityAdjustDecrement.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about an `ADJUST_DECREMENT` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityAdjustDecrementReason.ts b/src/api/types/GiftCardActivityAdjustDecrementReason.ts index 3d14288d9..ac8b925f9 100644 --- a/src/api/types/GiftCardActivityAdjustDecrementReason.ts +++ b/src/api/types/GiftCardActivityAdjustDecrementReason.ts @@ -1,18 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the reason for deducting money from a [gift card](entity:GiftCard). - */ -export type GiftCardActivityAdjustDecrementReason = - | "SUSPICIOUS_ACTIVITY" - | "BALANCE_ACCIDENTALLY_INCREASED" - | "SUPPORT_ISSUE" - | "PURCHASE_WAS_REFUNDED"; +/** Indicates the reason for deducting money from a [gift card](entity:GiftCard). */ export const GiftCardActivityAdjustDecrementReason = { SuspiciousActivity: "SUSPICIOUS_ACTIVITY", BalanceAccidentallyIncreased: "BALANCE_ACCIDENTALLY_INCREASED", SupportIssue: "SUPPORT_ISSUE", PurchaseWasRefunded: "PURCHASE_WAS_REFUNDED", } as const; +export type GiftCardActivityAdjustDecrementReason = + (typeof GiftCardActivityAdjustDecrementReason)[keyof typeof GiftCardActivityAdjustDecrementReason]; diff --git a/src/api/types/GiftCardActivityAdjustIncrement.ts b/src/api/types/GiftCardActivityAdjustIncrement.ts index 7e333c906..bf60c32b6 100644 --- a/src/api/types/GiftCardActivityAdjustIncrement.ts +++ b/src/api/types/GiftCardActivityAdjustIncrement.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about an `ADJUST_INCREMENT` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityAdjustIncrementReason.ts b/src/api/types/GiftCardActivityAdjustIncrementReason.ts index b863b9066..f24df5652 100644 --- a/src/api/types/GiftCardActivityAdjustIncrementReason.ts +++ b/src/api/types/GiftCardActivityAdjustIncrementReason.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the reason for adding money to a [gift card](entity:GiftCard). - */ -export type GiftCardActivityAdjustIncrementReason = "COMPLIMENTARY" | "SUPPORT_ISSUE" | "TRANSACTION_VOIDED"; +/** Indicates the reason for adding money to a [gift card](entity:GiftCard). */ export const GiftCardActivityAdjustIncrementReason = { Complimentary: "COMPLIMENTARY", SupportIssue: "SUPPORT_ISSUE", TransactionVoided: "TRANSACTION_VOIDED", } as const; +export type GiftCardActivityAdjustIncrementReason = + (typeof GiftCardActivityAdjustIncrementReason)[keyof typeof GiftCardActivityAdjustIncrementReason]; diff --git a/src/api/types/GiftCardActivityBlock.ts b/src/api/types/GiftCardActivityBlock.ts index 7369f2101..fe8d3604b 100644 --- a/src/api/types/GiftCardActivityBlock.ts +++ b/src/api/types/GiftCardActivityBlock.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about a `BLOCK` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityBlockReason.ts b/src/api/types/GiftCardActivityBlockReason.ts index 74695af78..555970fa6 100644 --- a/src/api/types/GiftCardActivityBlockReason.ts +++ b/src/api/types/GiftCardActivityBlockReason.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the reason for blocking a [gift card](entity:GiftCard). diff --git a/src/api/types/GiftCardActivityClearBalance.ts b/src/api/types/GiftCardActivityClearBalance.ts index 3ead099c7..92c6c76c5 100644 --- a/src/api/types/GiftCardActivityClearBalance.ts +++ b/src/api/types/GiftCardActivityClearBalance.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about a `CLEAR_BALANCE` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityClearBalanceReason.ts b/src/api/types/GiftCardActivityClearBalanceReason.ts index c780f08f8..feea47409 100644 --- a/src/api/types/GiftCardActivityClearBalanceReason.ts +++ b/src/api/types/GiftCardActivityClearBalanceReason.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the reason for clearing the balance of a [gift card](entity:GiftCard). - */ -export type GiftCardActivityClearBalanceReason = "SUSPICIOUS_ACTIVITY" | "REUSE_GIFTCARD" | "UNKNOWN_REASON"; +/** Indicates the reason for clearing the balance of a [gift card](entity:GiftCard). */ export const GiftCardActivityClearBalanceReason = { SuspiciousActivity: "SUSPICIOUS_ACTIVITY", ReuseGiftcard: "REUSE_GIFTCARD", UnknownReason: "UNKNOWN_REASON", } as const; +export type GiftCardActivityClearBalanceReason = + (typeof GiftCardActivityClearBalanceReason)[keyof typeof GiftCardActivityClearBalanceReason]; diff --git a/src/api/types/GiftCardActivityCreatedEvent.ts b/src/api/types/GiftCardActivityCreatedEvent.ts index 0bb4409dc..73d6c7831 100644 --- a/src/api/types/GiftCardActivityCreatedEvent.ts +++ b/src/api/types/GiftCardActivityCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [gift card activity](entity:GiftCardActivity) is created. diff --git a/src/api/types/GiftCardActivityCreatedEventData.ts b/src/api/types/GiftCardActivityCreatedEventData.ts index 7b92234e8..2c04b531a 100644 --- a/src/api/types/GiftCardActivityCreatedEventData.ts +++ b/src/api/types/GiftCardActivityCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the data associated with a `gift_card.activity.created` event. diff --git a/src/api/types/GiftCardActivityCreatedEventObject.ts b/src/api/types/GiftCardActivityCreatedEventObject.ts index fe1ca38ff..f1f3aa1fe 100644 --- a/src/api/types/GiftCardActivityCreatedEventObject.ts +++ b/src/api/types/GiftCardActivityCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the gift card activity associated with a diff --git a/src/api/types/GiftCardActivityDeactivate.ts b/src/api/types/GiftCardActivityDeactivate.ts index 3129c1c2f..5b98a00c6 100644 --- a/src/api/types/GiftCardActivityDeactivate.ts +++ b/src/api/types/GiftCardActivityDeactivate.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about a `DEACTIVATE` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityDeactivateReason.ts b/src/api/types/GiftCardActivityDeactivateReason.ts index efe431f40..eb6590000 100644 --- a/src/api/types/GiftCardActivityDeactivateReason.ts +++ b/src/api/types/GiftCardActivityDeactivateReason.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the reason for deactivating a [gift card](entity:GiftCard). - */ -export type GiftCardActivityDeactivateReason = "SUSPICIOUS_ACTIVITY" | "UNKNOWN_REASON" | "CHARGEBACK_DEACTIVATE"; +/** Indicates the reason for deactivating a [gift card](entity:GiftCard). */ export const GiftCardActivityDeactivateReason = { SuspiciousActivity: "SUSPICIOUS_ACTIVITY", UnknownReason: "UNKNOWN_REASON", ChargebackDeactivate: "CHARGEBACK_DEACTIVATE", } as const; +export type GiftCardActivityDeactivateReason = + (typeof GiftCardActivityDeactivateReason)[keyof typeof GiftCardActivityDeactivateReason]; diff --git a/src/api/types/GiftCardActivityImport.ts b/src/api/types/GiftCardActivityImport.ts index c0d4189de..0f103205e 100644 --- a/src/api/types/GiftCardActivityImport.ts +++ b/src/api/types/GiftCardActivityImport.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about an `IMPORT` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityImportReversal.ts b/src/api/types/GiftCardActivityImportReversal.ts index 33e18276e..95876f96e 100644 --- a/src/api/types/GiftCardActivityImportReversal.ts +++ b/src/api/types/GiftCardActivityImportReversal.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about an `IMPORT_REVERSAL` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityLoad.ts b/src/api/types/GiftCardActivityLoad.ts index f5ec18e1a..077c404f1 100644 --- a/src/api/types/GiftCardActivityLoad.ts +++ b/src/api/types/GiftCardActivityLoad.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about a `LOAD` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityRedeem.ts b/src/api/types/GiftCardActivityRedeem.ts index 536cafdd3..d5360056b 100644 --- a/src/api/types/GiftCardActivityRedeem.ts +++ b/src/api/types/GiftCardActivityRedeem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about a `REDEEM` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityRedeemStatus.ts b/src/api/types/GiftCardActivityRedeemStatus.ts index a8f616921..3531fbafd 100644 --- a/src/api/types/GiftCardActivityRedeemStatus.ts +++ b/src/api/types/GiftCardActivityRedeemStatus.ts @@ -1,15 +1,14 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the status of a [gift card](entity:GiftCard) redemption. This status is relevant only for * redemptions made from Square products (such as Square Point of Sale) because Square products use a * two-state process. Gift cards redeemed using the Gift Card Activities API always have a `COMPLETED` status. */ -export type GiftCardActivityRedeemStatus = "PENDING" | "COMPLETED" | "CANCELED"; export const GiftCardActivityRedeemStatus = { Pending: "PENDING", Completed: "COMPLETED", Canceled: "CANCELED", } as const; +export type GiftCardActivityRedeemStatus = + (typeof GiftCardActivityRedeemStatus)[keyof typeof GiftCardActivityRedeemStatus]; diff --git a/src/api/types/GiftCardActivityRefund.ts b/src/api/types/GiftCardActivityRefund.ts index 854c4eae2..5738d1e2f 100644 --- a/src/api/types/GiftCardActivityRefund.ts +++ b/src/api/types/GiftCardActivityRefund.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about a `REFUND` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityTransferBalanceFrom.ts b/src/api/types/GiftCardActivityTransferBalanceFrom.ts index 41f6839de..d121ddf46 100644 --- a/src/api/types/GiftCardActivityTransferBalanceFrom.ts +++ b/src/api/types/GiftCardActivityTransferBalanceFrom.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityTransferBalanceTo.ts b/src/api/types/GiftCardActivityTransferBalanceTo.ts index d68325bf3..2d3b393ef 100644 --- a/src/api/types/GiftCardActivityTransferBalanceTo.ts +++ b/src/api/types/GiftCardActivityTransferBalanceTo.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityType.ts b/src/api/types/GiftCardActivityType.ts index bc776443d..d7d2e8067 100644 --- a/src/api/types/GiftCardActivityType.ts +++ b/src/api/types/GiftCardActivityType.ts @@ -1,26 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the type of [gift card activity](entity:GiftCardActivity). - */ -export type GiftCardActivityType = - | "ACTIVATE" - | "LOAD" - | "REDEEM" - | "CLEAR_BALANCE" - | "DEACTIVATE" - | "ADJUST_INCREMENT" - | "ADJUST_DECREMENT" - | "REFUND" - | "UNLINKED_ACTIVITY_REFUND" - | "IMPORT" - | "BLOCK" - | "UNBLOCK" - | "IMPORT_REVERSAL" - | "TRANSFER_BALANCE_FROM" - | "TRANSFER_BALANCE_TO"; +/** Indicates the type of [gift card activity](entity:GiftCardActivity). */ export const GiftCardActivityType = { Activate: "ACTIVATE", Load: "LOAD", @@ -38,3 +18,4 @@ export const GiftCardActivityType = { TransferBalanceFrom: "TRANSFER_BALANCE_FROM", TransferBalanceTo: "TRANSFER_BALANCE_TO", } as const; +export type GiftCardActivityType = (typeof GiftCardActivityType)[keyof typeof GiftCardActivityType]; diff --git a/src/api/types/GiftCardActivityUnblock.ts b/src/api/types/GiftCardActivityUnblock.ts index b6cb30f11..e5b698427 100644 --- a/src/api/types/GiftCardActivityUnblock.ts +++ b/src/api/types/GiftCardActivityUnblock.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about an `UNBLOCK` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityUnblockReason.ts b/src/api/types/GiftCardActivityUnblockReason.ts index 9f67b21e8..f6beae057 100644 --- a/src/api/types/GiftCardActivityUnblockReason.ts +++ b/src/api/types/GiftCardActivityUnblockReason.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the reason for unblocking a [gift card](entity:GiftCard). diff --git a/src/api/types/GiftCardActivityUnlinkedActivityRefund.ts b/src/api/types/GiftCardActivityUnlinkedActivityRefund.ts index 01f3229b4..b35eb8d7f 100644 --- a/src/api/types/GiftCardActivityUnlinkedActivityRefund.ts +++ b/src/api/types/GiftCardActivityUnlinkedActivityRefund.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityUpdatedEvent.ts b/src/api/types/GiftCardActivityUpdatedEvent.ts index f693bdab8..dbd7538e0 100644 --- a/src/api/types/GiftCardActivityUpdatedEvent.ts +++ b/src/api/types/GiftCardActivityUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [gift card activity](entity:GiftCardActivity) is updated. diff --git a/src/api/types/GiftCardActivityUpdatedEventData.ts b/src/api/types/GiftCardActivityUpdatedEventData.ts index 473d79192..334f66ee6 100644 --- a/src/api/types/GiftCardActivityUpdatedEventData.ts +++ b/src/api/types/GiftCardActivityUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `gift_card.activity.updated` event. diff --git a/src/api/types/GiftCardActivityUpdatedEventObject.ts b/src/api/types/GiftCardActivityUpdatedEventObject.ts index b0f319574..01d1fee2f 100644 --- a/src/api/types/GiftCardActivityUpdatedEventObject.ts +++ b/src/api/types/GiftCardActivityUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the gift card activity associated with a diff --git a/src/api/types/GiftCardCreatedEvent.ts b/src/api/types/GiftCardCreatedEvent.ts index 806cf9e84..4e975adb9 100644 --- a/src/api/types/GiftCardCreatedEvent.ts +++ b/src/api/types/GiftCardCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [gift card](entity:GiftCard) is created. diff --git a/src/api/types/GiftCardCreatedEventData.ts b/src/api/types/GiftCardCreatedEventData.ts index 5377785bb..d652cf993 100644 --- a/src/api/types/GiftCardCreatedEventData.ts +++ b/src/api/types/GiftCardCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `gift_card.created` event. diff --git a/src/api/types/GiftCardCreatedEventObject.ts b/src/api/types/GiftCardCreatedEventObject.ts index 3b3f72a26..0e759d505 100644 --- a/src/api/types/GiftCardCreatedEventObject.ts +++ b/src/api/types/GiftCardCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the gift card associated with a `gift_card.created` event. diff --git a/src/api/types/GiftCardCustomerLinkedEvent.ts b/src/api/types/GiftCardCustomerLinkedEvent.ts index 81d22c4f2..3cf45f52b 100644 --- a/src/api/types/GiftCardCustomerLinkedEvent.ts +++ b/src/api/types/GiftCardCustomerLinkedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [customer](entity:Customer) is linked to a [gift card](entity:GiftCard). diff --git a/src/api/types/GiftCardCustomerLinkedEventData.ts b/src/api/types/GiftCardCustomerLinkedEventData.ts index 386681909..f1fb64c79 100644 --- a/src/api/types/GiftCardCustomerLinkedEventData.ts +++ b/src/api/types/GiftCardCustomerLinkedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `gift_card.customer_linked` event. diff --git a/src/api/types/GiftCardCustomerLinkedEventObject.ts b/src/api/types/GiftCardCustomerLinkedEventObject.ts index 2f0d47889..9e832bffa 100644 --- a/src/api/types/GiftCardCustomerLinkedEventObject.ts +++ b/src/api/types/GiftCardCustomerLinkedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the gift card and customer ID associated with a diff --git a/src/api/types/GiftCardCustomerUnlinkedEvent.ts b/src/api/types/GiftCardCustomerUnlinkedEvent.ts index f2e4e6806..fddd6e2e8 100644 --- a/src/api/types/GiftCardCustomerUnlinkedEvent.ts +++ b/src/api/types/GiftCardCustomerUnlinkedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [customer](entity:Customer) is unlinked from a [gift card](entity:GiftCard). diff --git a/src/api/types/GiftCardCustomerUnlinkedEventData.ts b/src/api/types/GiftCardCustomerUnlinkedEventData.ts index 46aba1266..473f04283 100644 --- a/src/api/types/GiftCardCustomerUnlinkedEventData.ts +++ b/src/api/types/GiftCardCustomerUnlinkedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `gift_card.customer_unlinked` event. diff --git a/src/api/types/GiftCardCustomerUnlinkedEventObject.ts b/src/api/types/GiftCardCustomerUnlinkedEventObject.ts index ede810855..f95ed2d24 100644 --- a/src/api/types/GiftCardCustomerUnlinkedEventObject.ts +++ b/src/api/types/GiftCardCustomerUnlinkedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the gift card and the customer ID associated with a diff --git a/src/api/types/GiftCardGanSource.ts b/src/api/types/GiftCardGanSource.ts index 4f0f75504..a37853a5e 100644 --- a/src/api/types/GiftCardGanSource.ts +++ b/src/api/types/GiftCardGanSource.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the source that generated the gift card * account number (GAN). */ -export type GiftCardGanSource = "SQUARE" | "OTHER"; export const GiftCardGanSource = { Square: "SQUARE", Other: "OTHER", } as const; +export type GiftCardGanSource = (typeof GiftCardGanSource)[keyof typeof GiftCardGanSource]; diff --git a/src/api/types/GiftCardStatus.ts b/src/api/types/GiftCardStatus.ts index 10395ce3d..fdc0d28d8 100644 --- a/src/api/types/GiftCardStatus.ts +++ b/src/api/types/GiftCardStatus.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the gift card state. - */ -export type GiftCardStatus = "ACTIVE" | "DEACTIVATED" | "BLOCKED" | "PENDING"; +/** Indicates the gift card state. */ export const GiftCardStatus = { Active: "ACTIVE", Deactivated: "DEACTIVATED", Blocked: "BLOCKED", Pending: "PENDING", } as const; +export type GiftCardStatus = (typeof GiftCardStatus)[keyof typeof GiftCardStatus]; diff --git a/src/api/types/GiftCardType.ts b/src/api/types/GiftCardType.ts index 22c2337f3..5e937b67b 100644 --- a/src/api/types/GiftCardType.ts +++ b/src/api/types/GiftCardType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the gift card type. - */ -export type GiftCardType = "PHYSICAL" | "DIGITAL"; +/** Indicates the gift card type. */ export const GiftCardType = { Physical: "PHYSICAL", Digital: "DIGITAL", } as const; +export type GiftCardType = (typeof GiftCardType)[keyof typeof GiftCardType]; diff --git a/src/api/types/GiftCardUpdatedEvent.ts b/src/api/types/GiftCardUpdatedEvent.ts index 466c2fb45..960a1e6ec 100644 --- a/src/api/types/GiftCardUpdatedEvent.ts +++ b/src/api/types/GiftCardUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [gift card](entity:GiftCard) is updated. This includes diff --git a/src/api/types/GiftCardUpdatedEventData.ts b/src/api/types/GiftCardUpdatedEventData.ts index 96c5db2f1..80702d4a9 100644 --- a/src/api/types/GiftCardUpdatedEventData.ts +++ b/src/api/types/GiftCardUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `gift_card.updated` event. diff --git a/src/api/types/GiftCardUpdatedEventObject.ts b/src/api/types/GiftCardUpdatedEventObject.ts index 2b9aa6532..f3b0074bc 100644 --- a/src/api/types/GiftCardUpdatedEventObject.ts +++ b/src/api/types/GiftCardUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the gift card associated with a `gift_card.updated` event. diff --git a/src/api/types/InventoryAdjustment.ts b/src/api/types/InventoryAdjustment.ts index b4914ae0b..bc0ba3ab3 100644 --- a/src/api/types/InventoryAdjustment.ts +++ b/src/api/types/InventoryAdjustment.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a change in state or quantity of product inventory at a diff --git a/src/api/types/InventoryAdjustmentGroup.ts b/src/api/types/InventoryAdjustmentGroup.ts index 5d5325815..78ef87bd3 100644 --- a/src/api/types/InventoryAdjustmentGroup.ts +++ b/src/api/types/InventoryAdjustmentGroup.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InventoryAdjustmentGroup { /** diff --git a/src/api/types/InventoryAlertType.ts b/src/api/types/InventoryAlertType.ts index d4157ce67..4cc807bb7 100644 --- a/src/api/types/InventoryAlertType.ts +++ b/src/api/types/InventoryAlertType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. - */ -export type InventoryAlertType = "NONE" | "LOW_QUANTITY"; +/** Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. */ export const InventoryAlertType = { None: "NONE", LowQuantity: "LOW_QUANTITY", } as const; +export type InventoryAlertType = (typeof InventoryAlertType)[keyof typeof InventoryAlertType]; diff --git a/src/api/types/InventoryChange.ts b/src/api/types/InventoryChange.ts index 155b8d6ad..25da4cac7 100644 --- a/src/api/types/InventoryChange.ts +++ b/src/api/types/InventoryChange.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a single physical count, inventory, adjustment, or transfer diff --git a/src/api/types/InventoryChangeType.ts b/src/api/types/InventoryChangeType.ts index c77ce19e8..dbb8054b7 100644 --- a/src/api/types/InventoryChangeType.ts +++ b/src/api/types/InventoryChangeType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates how the inventory change was applied to a tracked product quantity. - */ -export type InventoryChangeType = "PHYSICAL_COUNT" | "ADJUSTMENT" | "TRANSFER"; +/** Indicates how the inventory change was applied to a tracked product quantity. */ export const InventoryChangeType = { PhysicalCount: "PHYSICAL_COUNT", Adjustment: "ADJUSTMENT", Transfer: "TRANSFER", } as const; +export type InventoryChangeType = (typeof InventoryChangeType)[keyof typeof InventoryChangeType]; diff --git a/src/api/types/InventoryCount.ts b/src/api/types/InventoryCount.ts index d5bcbd693..9ac14ae96 100644 --- a/src/api/types/InventoryCount.ts +++ b/src/api/types/InventoryCount.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents Square-estimated quantity of items in a particular state at a diff --git a/src/api/types/InventoryCountUpdatedEvent.ts b/src/api/types/InventoryCountUpdatedEvent.ts index 6ac19435a..af73de8e2 100644 --- a/src/api/types/InventoryCountUpdatedEvent.ts +++ b/src/api/types/InventoryCountUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when the quantity is updated for a diff --git a/src/api/types/InventoryCountUpdatedEventData.ts b/src/api/types/InventoryCountUpdatedEventData.ts index b88761e37..003dabfef 100644 --- a/src/api/types/InventoryCountUpdatedEventData.ts +++ b/src/api/types/InventoryCountUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InventoryCountUpdatedEventData { /** Name of the affected object’s type. For this event, the value is `inventory_counts`. */ diff --git a/src/api/types/InventoryCountUpdatedEventObject.ts b/src/api/types/InventoryCountUpdatedEventObject.ts index fb145136a..2f013920b 100644 --- a/src/api/types/InventoryCountUpdatedEventObject.ts +++ b/src/api/types/InventoryCountUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InventoryCountUpdatedEventObject { /** The inventory counts. */ diff --git a/src/api/types/InventoryPhysicalCount.ts b/src/api/types/InventoryPhysicalCount.ts index c20ca06af..8272ff746 100644 --- a/src/api/types/InventoryPhysicalCount.ts +++ b/src/api/types/InventoryPhysicalCount.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the quantity of an item variation that is physically present diff --git a/src/api/types/InventoryState.ts b/src/api/types/InventoryState.ts index 34af6a483..30c402767 100644 --- a/src/api/types/InventoryState.ts +++ b/src/api/types/InventoryState.ts @@ -1,27 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the state of a tracked item quantity in the lifecycle of goods. - */ -export type InventoryState = - | "CUSTOM" - | "IN_STOCK" - | "SOLD" - | "RETURNED_BY_CUSTOMER" - | "RESERVED_FOR_SALE" - | "SOLD_ONLINE" - | "ORDERED_FROM_VENDOR" - | "RECEIVED_FROM_VENDOR" - | "IN_TRANSIT_TO" - | "NONE" - | "WASTE" - | "UNLINKED_RETURN" - | "COMPOSED" - | "DECOMPOSED" - | "SUPPORTED_BY_NEWER_VERSION" - | "IN_TRANSIT"; +/** Indicates the state of a tracked item quantity in the lifecycle of goods. */ export const InventoryState = { Custom: "CUSTOM", InStock: "IN_STOCK", @@ -40,3 +19,4 @@ export const InventoryState = { SupportedByNewerVersion: "SUPPORTED_BY_NEWER_VERSION", InTransit: "IN_TRANSIT", } as const; +export type InventoryState = (typeof InventoryState)[keyof typeof InventoryState]; diff --git a/src/api/types/InventoryTransfer.ts b/src/api/types/InventoryTransfer.ts index 180a85c25..395becc87 100644 --- a/src/api/types/InventoryTransfer.ts +++ b/src/api/types/InventoryTransfer.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the transfer of a quantity of product inventory at a diff --git a/src/api/types/Invoice.ts b/src/api/types/Invoice.ts index c0395c393..2aa39c0b4 100644 --- a/src/api/types/Invoice.ts +++ b/src/api/types/Invoice.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Stores information about an invoice. You use the Invoices API to create and manage diff --git a/src/api/types/InvoiceAcceptedPaymentMethods.ts b/src/api/types/InvoiceAcceptedPaymentMethods.ts index 3423517b3..a2f90d16a 100644 --- a/src/api/types/InvoiceAcceptedPaymentMethods.ts +++ b/src/api/types/InvoiceAcceptedPaymentMethods.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The payment methods that customers can use to pay an [invoice](entity:Invoice) on the Square-hosted invoice payment page. diff --git a/src/api/types/InvoiceAttachment.ts b/src/api/types/InvoiceAttachment.ts index 025574248..7bf8ddaea 100644 --- a/src/api/types/InvoiceAttachment.ts +++ b/src/api/types/InvoiceAttachment.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a file attached to an [invoice](entity:Invoice). diff --git a/src/api/types/InvoiceAutomaticPaymentSource.ts b/src/api/types/InvoiceAutomaticPaymentSource.ts index 19068be2d..8d3421c33 100644 --- a/src/api/types/InvoiceAutomaticPaymentSource.ts +++ b/src/api/types/InvoiceAutomaticPaymentSource.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the automatic payment method for an [invoice payment request](entity:InvoicePaymentRequest). - */ -export type InvoiceAutomaticPaymentSource = "NONE" | "CARD_ON_FILE" | "BANK_ON_FILE"; +/** Indicates the automatic payment method for an [invoice payment request](entity:InvoicePaymentRequest). */ export const InvoiceAutomaticPaymentSource = { None: "NONE", CardOnFile: "CARD_ON_FILE", BankOnFile: "BANK_ON_FILE", } as const; +export type InvoiceAutomaticPaymentSource = + (typeof InvoiceAutomaticPaymentSource)[keyof typeof InvoiceAutomaticPaymentSource]; diff --git a/src/api/types/InvoiceCanceledEvent.ts b/src/api/types/InvoiceCanceledEvent.ts index 06f8098a4..55e82eb08 100644 --- a/src/api/types/InvoiceCanceledEvent.ts +++ b/src/api/types/InvoiceCanceledEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an [Invoice](entity:Invoice) is canceled. diff --git a/src/api/types/InvoiceCanceledEventData.ts b/src/api/types/InvoiceCanceledEventData.ts index 7fc4fffed..8948cb55e 100644 --- a/src/api/types/InvoiceCanceledEventData.ts +++ b/src/api/types/InvoiceCanceledEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoiceCanceledEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceCanceledEventObject.ts b/src/api/types/InvoiceCanceledEventObject.ts index 887f3ac67..33442b952 100644 --- a/src/api/types/InvoiceCanceledEventObject.ts +++ b/src/api/types/InvoiceCanceledEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoiceCanceledEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoiceCreatedEvent.ts b/src/api/types/InvoiceCreatedEvent.ts index f2e6515aa..53abe59cc 100644 --- a/src/api/types/InvoiceCreatedEvent.ts +++ b/src/api/types/InvoiceCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an [Invoice](entity:Invoice) is created. diff --git a/src/api/types/InvoiceCreatedEventData.ts b/src/api/types/InvoiceCreatedEventData.ts index 21a388170..728c94bdc 100644 --- a/src/api/types/InvoiceCreatedEventData.ts +++ b/src/api/types/InvoiceCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoiceCreatedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceCreatedEventObject.ts b/src/api/types/InvoiceCreatedEventObject.ts index 48de67333..520bd3623 100644 --- a/src/api/types/InvoiceCreatedEventObject.ts +++ b/src/api/types/InvoiceCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoiceCreatedEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoiceCustomField.ts b/src/api/types/InvoiceCustomField.ts index 4dee741b2..df4a717db 100644 --- a/src/api/types/InvoiceCustomField.ts +++ b/src/api/types/InvoiceCustomField.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An additional seller-defined and customer-facing field to include on the invoice. For more information, diff --git a/src/api/types/InvoiceCustomFieldPlacement.ts b/src/api/types/InvoiceCustomFieldPlacement.ts index efafb510b..60457cef5 100644 --- a/src/api/types/InvoiceCustomFieldPlacement.ts +++ b/src/api/types/InvoiceCustomFieldPlacement.ts @@ -1,13 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF * copies of the invoice. */ -export type InvoiceCustomFieldPlacement = "ABOVE_LINE_ITEMS" | "BELOW_LINE_ITEMS"; export const InvoiceCustomFieldPlacement = { AboveLineItems: "ABOVE_LINE_ITEMS", BelowLineItems: "BELOW_LINE_ITEMS", } as const; +export type InvoiceCustomFieldPlacement = + (typeof InvoiceCustomFieldPlacement)[keyof typeof InvoiceCustomFieldPlacement]; diff --git a/src/api/types/InvoiceDeletedEvent.ts b/src/api/types/InvoiceDeletedEvent.ts index 388a6abb5..6804f7f14 100644 --- a/src/api/types/InvoiceDeletedEvent.ts +++ b/src/api/types/InvoiceDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a draft [Invoice](entity:Invoice) is deleted. diff --git a/src/api/types/InvoiceDeletedEventData.ts b/src/api/types/InvoiceDeletedEventData.ts index bd53f5ecd..34c41270a 100644 --- a/src/api/types/InvoiceDeletedEventData.ts +++ b/src/api/types/InvoiceDeletedEventData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface InvoiceDeletedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceDeliveryMethod.ts b/src/api/types/InvoiceDeliveryMethod.ts index d4cc5e7da..4bbd1cfa3 100644 --- a/src/api/types/InvoiceDeliveryMethod.ts +++ b/src/api/types/InvoiceDeliveryMethod.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates how Square delivers the [invoice](entity:Invoice) to the customer. - */ -export type InvoiceDeliveryMethod = "EMAIL" | "SHARE_MANUALLY" | "SMS"; +/** Indicates how Square delivers the [invoice](entity:Invoice) to the customer. */ export const InvoiceDeliveryMethod = { Email: "EMAIL", ShareManually: "SHARE_MANUALLY", Sms: "SMS", } as const; +export type InvoiceDeliveryMethod = (typeof InvoiceDeliveryMethod)[keyof typeof InvoiceDeliveryMethod]; diff --git a/src/api/types/InvoiceFilter.ts b/src/api/types/InvoiceFilter.ts index 32d264df3..e1e74e38f 100644 --- a/src/api/types/InvoiceFilter.ts +++ b/src/api/types/InvoiceFilter.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Describes query filters to apply. diff --git a/src/api/types/InvoicePaymentMadeEvent.ts b/src/api/types/InvoicePaymentMadeEvent.ts index 9f782fddd..bad16b74e 100644 --- a/src/api/types/InvoicePaymentMadeEvent.ts +++ b/src/api/types/InvoicePaymentMadeEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a payment that is associated with an [invoice](entity:Invoice) is completed. diff --git a/src/api/types/InvoicePaymentMadeEventData.ts b/src/api/types/InvoicePaymentMadeEventData.ts index ec74fbf5d..cd6034a61 100644 --- a/src/api/types/InvoicePaymentMadeEventData.ts +++ b/src/api/types/InvoicePaymentMadeEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoicePaymentMadeEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoicePaymentMadeEventObject.ts b/src/api/types/InvoicePaymentMadeEventObject.ts index 71dff4017..146a1193c 100644 --- a/src/api/types/InvoicePaymentMadeEventObject.ts +++ b/src/api/types/InvoicePaymentMadeEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoicePaymentMadeEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoicePaymentReminder.ts b/src/api/types/InvoicePaymentReminder.ts index 4d52f0894..648250f84 100644 --- a/src/api/types/InvoicePaymentReminder.ts +++ b/src/api/types/InvoicePaymentReminder.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a payment request reminder (automatic notification) that Square sends diff --git a/src/api/types/InvoicePaymentReminderStatus.ts b/src/api/types/InvoicePaymentReminderStatus.ts index 96f891348..42bfc2b73 100644 --- a/src/api/types/InvoicePaymentReminderStatus.ts +++ b/src/api/types/InvoicePaymentReminderStatus.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The status of a payment request reminder. - */ -export type InvoicePaymentReminderStatus = "PENDING" | "NOT_APPLICABLE" | "SENT"; +/** The status of a payment request reminder. */ export const InvoicePaymentReminderStatus = { Pending: "PENDING", NotApplicable: "NOT_APPLICABLE", Sent: "SENT", } as const; +export type InvoicePaymentReminderStatus = + (typeof InvoicePaymentReminderStatus)[keyof typeof InvoicePaymentReminderStatus]; diff --git a/src/api/types/InvoicePaymentRequest.ts b/src/api/types/InvoicePaymentRequest.ts index b238a38b4..ba30b04cd 100644 --- a/src/api/types/InvoicePaymentRequest.ts +++ b/src/api/types/InvoicePaymentRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a payment request for an [invoice](entity:Invoice). Invoices can specify a maximum diff --git a/src/api/types/InvoicePublishedEvent.ts b/src/api/types/InvoicePublishedEvent.ts index 53b1c9ab2..0d999b81a 100644 --- a/src/api/types/InvoicePublishedEvent.ts +++ b/src/api/types/InvoicePublishedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an [Invoice](entity:Invoice) transitions from a draft to a non-draft status. diff --git a/src/api/types/InvoicePublishedEventData.ts b/src/api/types/InvoicePublishedEventData.ts index 0087be06c..e74b4ba73 100644 --- a/src/api/types/InvoicePublishedEventData.ts +++ b/src/api/types/InvoicePublishedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoicePublishedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoicePublishedEventObject.ts b/src/api/types/InvoicePublishedEventObject.ts index 3b6d290cb..53750c7b1 100644 --- a/src/api/types/InvoicePublishedEventObject.ts +++ b/src/api/types/InvoicePublishedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoicePublishedEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoiceQuery.ts b/src/api/types/InvoiceQuery.ts index 4ed3833b7..d8893764b 100644 --- a/src/api/types/InvoiceQuery.ts +++ b/src/api/types/InvoiceQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes query criteria for searching invoices. diff --git a/src/api/types/InvoiceRecipient.ts b/src/api/types/InvoiceRecipient.ts index 37cf7b4d2..0b45b087e 100644 --- a/src/api/types/InvoiceRecipient.ts +++ b/src/api/types/InvoiceRecipient.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a snapshot of customer data. This object stores customer data that is displayed on the invoice diff --git a/src/api/types/InvoiceRecipientTaxIds.ts b/src/api/types/InvoiceRecipientTaxIds.ts index bb695aae0..a89c103c5 100644 --- a/src/api/types/InvoiceRecipientTaxIds.ts +++ b/src/api/types/InvoiceRecipientTaxIds.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the tax IDs for an invoice recipient. The country of the seller account determines diff --git a/src/api/types/InvoiceRefundedEvent.ts b/src/api/types/InvoiceRefundedEvent.ts index 323f4d1e6..66cea20b2 100644 --- a/src/api/types/InvoiceRefundedEvent.ts +++ b/src/api/types/InvoiceRefundedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a refund is applied toward a payment of an [invoice](entity:Invoice). diff --git a/src/api/types/InvoiceRefundedEventData.ts b/src/api/types/InvoiceRefundedEventData.ts index a8dcf2de6..dee623e7b 100644 --- a/src/api/types/InvoiceRefundedEventData.ts +++ b/src/api/types/InvoiceRefundedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoiceRefundedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceRefundedEventObject.ts b/src/api/types/InvoiceRefundedEventObject.ts index 9975bfd57..84d173696 100644 --- a/src/api/types/InvoiceRefundedEventObject.ts +++ b/src/api/types/InvoiceRefundedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoiceRefundedEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoiceRequestMethod.ts b/src/api/types/InvoiceRequestMethod.ts index 2c6c5698f..768478b78 100644 --- a/src/api/types/InvoiceRequestMethod.ts +++ b/src/api/types/InvoiceRequestMethod.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Specifies the action for Square to take for processing the invoice. For example, @@ -8,14 +6,6 @@ * version 2021-01-21. The corresponding `request_method` field is replaced by the * `Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. */ -export type InvoiceRequestMethod = - | "EMAIL" - | "CHARGE_CARD_ON_FILE" - | "SHARE_MANUALLY" - | "CHARGE_BANK_ON_FILE" - | "SMS" - | "SMS_CHARGE_CARD_ON_FILE" - | "SMS_CHARGE_BANK_ON_FILE"; export const InvoiceRequestMethod = { Email: "EMAIL", ChargeCardOnFile: "CHARGE_CARD_ON_FILE", @@ -25,3 +15,4 @@ export const InvoiceRequestMethod = { SmsChargeCardOnFile: "SMS_CHARGE_CARD_ON_FILE", SmsChargeBankOnFile: "SMS_CHARGE_BANK_ON_FILE", } as const; +export type InvoiceRequestMethod = (typeof InvoiceRequestMethod)[keyof typeof InvoiceRequestMethod]; diff --git a/src/api/types/InvoiceRequestType.ts b/src/api/types/InvoiceRequestType.ts index 7b8d8188c..a358eec86 100644 --- a/src/api/types/InvoiceRequestType.ts +++ b/src/api/types/InvoiceRequestType.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the type of the payment request. For more information, see * [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). */ -export type InvoiceRequestType = "BALANCE" | "DEPOSIT" | "INSTALLMENT"; export const InvoiceRequestType = { Balance: "BALANCE", Deposit: "DEPOSIT", Installment: "INSTALLMENT", } as const; +export type InvoiceRequestType = (typeof InvoiceRequestType)[keyof typeof InvoiceRequestType]; diff --git a/src/api/types/InvoiceScheduledChargeFailedEvent.ts b/src/api/types/InvoiceScheduledChargeFailedEvent.ts index a8ea74ed4..6eb419105 100644 --- a/src/api/types/InvoiceScheduledChargeFailedEvent.ts +++ b/src/api/types/InvoiceScheduledChargeFailedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an automatic scheduled payment for an [Invoice](entity:Invoice) has failed. diff --git a/src/api/types/InvoiceScheduledChargeFailedEventData.ts b/src/api/types/InvoiceScheduledChargeFailedEventData.ts index ba7b88e9d..3e74429ef 100644 --- a/src/api/types/InvoiceScheduledChargeFailedEventData.ts +++ b/src/api/types/InvoiceScheduledChargeFailedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoiceScheduledChargeFailedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceScheduledChargeFailedEventObject.ts b/src/api/types/InvoiceScheduledChargeFailedEventObject.ts index 53871b634..18e089ea1 100644 --- a/src/api/types/InvoiceScheduledChargeFailedEventObject.ts +++ b/src/api/types/InvoiceScheduledChargeFailedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoiceScheduledChargeFailedEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoiceSort.ts b/src/api/types/InvoiceSort.ts index 4ddefc79d..03e1c89cd 100644 --- a/src/api/types/InvoiceSort.ts +++ b/src/api/types/InvoiceSort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Identifies the sort field and sort order. diff --git a/src/api/types/InvoiceSortField.ts b/src/api/types/InvoiceSortField.ts index 0f1781d15..b1c08350f 100644 --- a/src/api/types/InvoiceSortField.ts +++ b/src/api/types/InvoiceSortField.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The field to use for sorting. diff --git a/src/api/types/InvoiceStatus.ts b/src/api/types/InvoiceStatus.ts index 32c521001..d2c296b2e 100644 --- a/src/api/types/InvoiceStatus.ts +++ b/src/api/types/InvoiceStatus.ts @@ -1,21 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the status of an [invoice](entity:Invoice). - */ -export type InvoiceStatus = - | "DRAFT" - | "UNPAID" - | "SCHEDULED" - | "PARTIALLY_PAID" - | "PAID" - | "PARTIALLY_REFUNDED" - | "REFUNDED" - | "CANCELED" - | "FAILED" - | "PAYMENT_PENDING"; +/** Indicates the status of an [invoice](entity:Invoice). */ export const InvoiceStatus = { Draft: "DRAFT", Unpaid: "UNPAID", @@ -28,3 +13,4 @@ export const InvoiceStatus = { Failed: "FAILED", PaymentPending: "PAYMENT_PENDING", } as const; +export type InvoiceStatus = (typeof InvoiceStatus)[keyof typeof InvoiceStatus]; diff --git a/src/api/types/InvoiceUpdatedEvent.ts b/src/api/types/InvoiceUpdatedEvent.ts index 26e446131..f9d835390 100644 --- a/src/api/types/InvoiceUpdatedEvent.ts +++ b/src/api/types/InvoiceUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an [Invoice](entity:Invoice) is updated. diff --git a/src/api/types/InvoiceUpdatedEventData.ts b/src/api/types/InvoiceUpdatedEventData.ts index 666c6f156..6a74ba2ea 100644 --- a/src/api/types/InvoiceUpdatedEventData.ts +++ b/src/api/types/InvoiceUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoiceUpdatedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceUpdatedEventObject.ts b/src/api/types/InvoiceUpdatedEventObject.ts index 743f7b063..cbbb46493 100644 --- a/src/api/types/InvoiceUpdatedEventObject.ts +++ b/src/api/types/InvoiceUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface InvoiceUpdatedEventObject { /** The related invoice. */ diff --git a/src/api/types/ItemVariationLocationOverrides.ts b/src/api/types/ItemVariationLocationOverrides.ts index fb9055148..0475c43c7 100644 --- a/src/api/types/ItemVariationLocationOverrides.ts +++ b/src/api/types/ItemVariationLocationOverrides.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`. diff --git a/src/api/types/Job.ts b/src/api/types/Job.ts index feae74ed7..d86cabb2d 100644 --- a/src/api/types/Job.ts +++ b/src/api/types/Job.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a job that can be assigned to [team members](entity:TeamMember). This object defines the diff --git a/src/api/types/JobAssignment.ts b/src/api/types/JobAssignment.ts index 676dacd7b..d4d37859f 100644 --- a/src/api/types/JobAssignment.ts +++ b/src/api/types/JobAssignment.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a job assigned to a [team member](entity:TeamMember), including the compensation the team diff --git a/src/api/types/JobAssignmentPayType.ts b/src/api/types/JobAssignmentPayType.ts index 5dde03d42..0db74fe12 100644 --- a/src/api/types/JobAssignmentPayType.ts +++ b/src/api/types/JobAssignmentPayType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Enumerates the possible pay types that a job can be assigned. - */ -export type JobAssignmentPayType = "NONE" | "HOURLY" | "SALARY"; +/** Enumerates the possible pay types that a job can be assigned. */ export const JobAssignmentPayType = { None: "NONE", Hourly: "HOURLY", Salary: "SALARY", } as const; +export type JobAssignmentPayType = (typeof JobAssignmentPayType)[keyof typeof JobAssignmentPayType]; diff --git a/src/api/types/JobCreatedEvent.ts b/src/api/types/JobCreatedEvent.ts index 886336561..c942c2c7f 100644 --- a/src/api/types/JobCreatedEvent.ts +++ b/src/api/types/JobCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a Job is created. diff --git a/src/api/types/JobCreatedEventData.ts b/src/api/types/JobCreatedEventData.ts index 75849b538..051b019a7 100644 --- a/src/api/types/JobCreatedEventData.ts +++ b/src/api/types/JobCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface JobCreatedEventData { /** Name of the affected object’s type, `"job"`. */ diff --git a/src/api/types/JobCreatedEventObject.ts b/src/api/types/JobCreatedEventObject.ts index b1ff685a5..6fefe46c2 100644 --- a/src/api/types/JobCreatedEventObject.ts +++ b/src/api/types/JobCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface JobCreatedEventObject { /** The created job. */ diff --git a/src/api/types/JobUpdatedEvent.ts b/src/api/types/JobUpdatedEvent.ts index 4fb5b31f5..fb86b89de 100644 --- a/src/api/types/JobUpdatedEvent.ts +++ b/src/api/types/JobUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a Job is updated. diff --git a/src/api/types/JobUpdatedEventData.ts b/src/api/types/JobUpdatedEventData.ts index ad8f20cc1..667a6f1bc 100644 --- a/src/api/types/JobUpdatedEventData.ts +++ b/src/api/types/JobUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface JobUpdatedEventData { /** Name of the affected object’s type, `"job"`. */ diff --git a/src/api/types/JobUpdatedEventObject.ts b/src/api/types/JobUpdatedEventObject.ts index 69142b916..e45de8f93 100644 --- a/src/api/types/JobUpdatedEventObject.ts +++ b/src/api/types/JobUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface JobUpdatedEventObject { /** The updated job. */ diff --git a/src/api/types/LaborScheduledShiftCreatedEvent.ts b/src/api/types/LaborScheduledShiftCreatedEvent.ts index f77eedcbb..298cbf438 100644 --- a/src/api/types/LaborScheduledShiftCreatedEvent.ts +++ b/src/api/types/LaborScheduledShiftCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [ScheduledShift](entity:ScheduledShift) is created. diff --git a/src/api/types/LaborScheduledShiftCreatedEventData.ts b/src/api/types/LaborScheduledShiftCreatedEventData.ts index f710a9ce6..0904da14d 100644 --- a/src/api/types/LaborScheduledShiftCreatedEventData.ts +++ b/src/api/types/LaborScheduledShiftCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborScheduledShiftCreatedEventData { /** The type of object affected by the event. For this event, the value is `scheduled_shift`. */ diff --git a/src/api/types/LaborScheduledShiftCreatedEventObject.ts b/src/api/types/LaborScheduledShiftCreatedEventObject.ts index b78cc2241..fb2495f2c 100644 --- a/src/api/types/LaborScheduledShiftCreatedEventObject.ts +++ b/src/api/types/LaborScheduledShiftCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborScheduledShiftCreatedEventObject { /** The new `ScheduledShift`. */ diff --git a/src/api/types/LaborScheduledShiftDeletedEvent.ts b/src/api/types/LaborScheduledShiftDeletedEvent.ts index 20af8987c..c3f821ebd 100644 --- a/src/api/types/LaborScheduledShiftDeletedEvent.ts +++ b/src/api/types/LaborScheduledShiftDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [ScheduledShift](entity:ScheduledShift) is deleted. diff --git a/src/api/types/LaborScheduledShiftDeletedEventData.ts b/src/api/types/LaborScheduledShiftDeletedEventData.ts index d948a68a0..098337422 100644 --- a/src/api/types/LaborScheduledShiftDeletedEventData.ts +++ b/src/api/types/LaborScheduledShiftDeletedEventData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface LaborScheduledShiftDeletedEventData { /** The type of object affected by the event. For this event, the value is `scheduled_shift`. */ diff --git a/src/api/types/LaborScheduledShiftPublishedEvent.ts b/src/api/types/LaborScheduledShiftPublishedEvent.ts index 2b03c27ea..7ad721b5f 100644 --- a/src/api/types/LaborScheduledShiftPublishedEvent.ts +++ b/src/api/types/LaborScheduledShiftPublishedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [ScheduledShift](entity:ScheduledShift) is published. diff --git a/src/api/types/LaborScheduledShiftPublishedEventData.ts b/src/api/types/LaborScheduledShiftPublishedEventData.ts index a837ce599..c6b60a831 100644 --- a/src/api/types/LaborScheduledShiftPublishedEventData.ts +++ b/src/api/types/LaborScheduledShiftPublishedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborScheduledShiftPublishedEventData { /** The type of object affected by the event. For this event, the value is `scheduled_shift`. */ diff --git a/src/api/types/LaborScheduledShiftPublishedEventObject.ts b/src/api/types/LaborScheduledShiftPublishedEventObject.ts index 56f68ace8..922971cad 100644 --- a/src/api/types/LaborScheduledShiftPublishedEventObject.ts +++ b/src/api/types/LaborScheduledShiftPublishedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborScheduledShiftPublishedEventObject { /** The published `ScheduledShift`. */ diff --git a/src/api/types/LaborScheduledShiftUpdatedEvent.ts b/src/api/types/LaborScheduledShiftUpdatedEvent.ts index ff1177120..5546a6df9 100644 --- a/src/api/types/LaborScheduledShiftUpdatedEvent.ts +++ b/src/api/types/LaborScheduledShiftUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [ScheduledShift](entity:ScheduledShift) is updated. diff --git a/src/api/types/LaborScheduledShiftUpdatedEventData.ts b/src/api/types/LaborScheduledShiftUpdatedEventData.ts index 10a6bfebd..8ee2d46a7 100644 --- a/src/api/types/LaborScheduledShiftUpdatedEventData.ts +++ b/src/api/types/LaborScheduledShiftUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborScheduledShiftUpdatedEventData { /** The type of object affected by the event. For this event, the value is `scheduled_shift`. */ diff --git a/src/api/types/LaborScheduledShiftUpdatedEventObject.ts b/src/api/types/LaborScheduledShiftUpdatedEventObject.ts index 726c1cb02..33e267783 100644 --- a/src/api/types/LaborScheduledShiftUpdatedEventObject.ts +++ b/src/api/types/LaborScheduledShiftUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborScheduledShiftUpdatedEventObject { /** The updated `ScheduledShift`. */ diff --git a/src/api/types/LaborShiftCreatedEvent.ts b/src/api/types/LaborShiftCreatedEvent.ts index 50f481c25..3a98aa3b9 100644 --- a/src/api/types/LaborShiftCreatedEvent.ts +++ b/src/api/types/LaborShiftCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a worker starts a [Shift](entity:Shift). diff --git a/src/api/types/LaborShiftCreatedEventData.ts b/src/api/types/LaborShiftCreatedEventData.ts index 59b9bfbcf..d10b7f899 100644 --- a/src/api/types/LaborShiftCreatedEventData.ts +++ b/src/api/types/LaborShiftCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborShiftCreatedEventData { /** The type of object affected by the event. For this event, the value is `shift`. */ diff --git a/src/api/types/LaborShiftCreatedEventObject.ts b/src/api/types/LaborShiftCreatedEventObject.ts index b5d179491..c6b13d9ca 100644 --- a/src/api/types/LaborShiftCreatedEventObject.ts +++ b/src/api/types/LaborShiftCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborShiftCreatedEventObject { /** The new `Shift`. */ diff --git a/src/api/types/LaborShiftDeletedEvent.ts b/src/api/types/LaborShiftDeletedEvent.ts index 3f89ce20f..13a3597fc 100644 --- a/src/api/types/LaborShiftDeletedEvent.ts +++ b/src/api/types/LaborShiftDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Shift](entity:Shift) is deleted. diff --git a/src/api/types/LaborShiftDeletedEventData.ts b/src/api/types/LaborShiftDeletedEventData.ts index ead517c78..cf194d285 100644 --- a/src/api/types/LaborShiftDeletedEventData.ts +++ b/src/api/types/LaborShiftDeletedEventData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface LaborShiftDeletedEventData { /** The type of object affected by the event. For this event, the value is `shift`. */ diff --git a/src/api/types/LaborShiftUpdatedEvent.ts b/src/api/types/LaborShiftUpdatedEvent.ts index b5d16a143..ac3ea62c0 100644 --- a/src/api/types/LaborShiftUpdatedEvent.ts +++ b/src/api/types/LaborShiftUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Shift](entity:Shift) is updated. diff --git a/src/api/types/LaborShiftUpdatedEventData.ts b/src/api/types/LaborShiftUpdatedEventData.ts index fe716c7d6..e7eb04d5e 100644 --- a/src/api/types/LaborShiftUpdatedEventData.ts +++ b/src/api/types/LaborShiftUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborShiftUpdatedEventData { /** The type of object affected by the event. For this event, the value is `shift`. */ diff --git a/src/api/types/LaborShiftUpdatedEventObject.ts b/src/api/types/LaborShiftUpdatedEventObject.ts index aca0d470e..ff0f804ba 100644 --- a/src/api/types/LaborShiftUpdatedEventObject.ts +++ b/src/api/types/LaborShiftUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborShiftUpdatedEventObject { /** The updated `Shift`. */ diff --git a/src/api/types/LaborTimecardCreatedEvent.ts b/src/api/types/LaborTimecardCreatedEvent.ts index 5b4512fe8..78a586d8d 100644 --- a/src/api/types/LaborTimecardCreatedEvent.ts +++ b/src/api/types/LaborTimecardCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a worker starts a [Timecard](entity:Timecard). diff --git a/src/api/types/LaborTimecardCreatedEventData.ts b/src/api/types/LaborTimecardCreatedEventData.ts index 71fd122e8..f66a50029 100644 --- a/src/api/types/LaborTimecardCreatedEventData.ts +++ b/src/api/types/LaborTimecardCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborTimecardCreatedEventData { /** The type of object affected by the event. For this event, the value is `timecard`. */ diff --git a/src/api/types/LaborTimecardCreatedEventObject.ts b/src/api/types/LaborTimecardCreatedEventObject.ts index 703303338..30e2b2942 100644 --- a/src/api/types/LaborTimecardCreatedEventObject.ts +++ b/src/api/types/LaborTimecardCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborTimecardCreatedEventObject { /** The new `Timecard`. */ diff --git a/src/api/types/LaborTimecardDeletedEvent.ts b/src/api/types/LaborTimecardDeletedEvent.ts index 7f914a3c2..d80874b1b 100644 --- a/src/api/types/LaborTimecardDeletedEvent.ts +++ b/src/api/types/LaborTimecardDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Timecard](entity:Timecard) is deleted. diff --git a/src/api/types/LaborTimecardDeletedEventData.ts b/src/api/types/LaborTimecardDeletedEventData.ts index 5ad7bf3da..f13be6757 100644 --- a/src/api/types/LaborTimecardDeletedEventData.ts +++ b/src/api/types/LaborTimecardDeletedEventData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface LaborTimecardDeletedEventData { /** The type of object affected by the event. For this event, the value is `timecard`. */ diff --git a/src/api/types/LaborTimecardUpdatedEvent.ts b/src/api/types/LaborTimecardUpdatedEvent.ts index cae70aa2e..0ab6ef2e0 100644 --- a/src/api/types/LaborTimecardUpdatedEvent.ts +++ b/src/api/types/LaborTimecardUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Timecard](entity:Timecard) is updated. diff --git a/src/api/types/LaborTimecardUpdatedEventData.ts b/src/api/types/LaborTimecardUpdatedEventData.ts index a4a26e515..1c3d4026a 100644 --- a/src/api/types/LaborTimecardUpdatedEventData.ts +++ b/src/api/types/LaborTimecardUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborTimecardUpdatedEventData { /** The type of object affected by the event. For this event, the value is `timecard`. */ diff --git a/src/api/types/LaborTimecardUpdatedEventObject.ts b/src/api/types/LaborTimecardUpdatedEventObject.ts index 72c23a258..3a0275288 100644 --- a/src/api/types/LaborTimecardUpdatedEventObject.ts +++ b/src/api/types/LaborTimecardUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LaborTimecardUpdatedEventObject { /** The updated `Timecard`. */ diff --git a/src/api/types/LinkCustomerToGiftCardResponse.ts b/src/api/types/LinkCustomerToGiftCardResponse.ts index e0bafe979..c5e9c0f9a 100644 --- a/src/api/types/LinkCustomerToGiftCardResponse.ts +++ b/src/api/types/LinkCustomerToGiftCardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains the linked `GiftCard` object. If the request resulted in errors, diff --git a/src/api/types/ListBankAccountsResponse.ts b/src/api/types/ListBankAccountsResponse.ts index 2ab464731..a46626b74 100644 --- a/src/api/types/ListBankAccountsResponse.ts +++ b/src/api/types/ListBankAccountsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response object returned by ListBankAccounts. diff --git a/src/api/types/ListBookingCustomAttributeDefinitionsResponse.ts b/src/api/types/ListBookingCustomAttributeDefinitionsResponse.ts index a2513f5fb..d5aa5584b 100644 --- a/src/api/types/ListBookingCustomAttributeDefinitionsResponse.ts +++ b/src/api/types/ListBookingCustomAttributeDefinitionsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [ListBookingCustomAttributeDefinitions](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributeDefinitions) response. diff --git a/src/api/types/ListBookingCustomAttributesResponse.ts b/src/api/types/ListBookingCustomAttributesResponse.ts index ce84c0459..cc725f033 100644 --- a/src/api/types/ListBookingCustomAttributesResponse.ts +++ b/src/api/types/ListBookingCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [ListBookingCustomAttributes](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributes) response. diff --git a/src/api/types/ListBookingsResponse.ts b/src/api/types/ListBookingsResponse.ts index e6ec3d16d..2daaddc35 100644 --- a/src/api/types/ListBookingsResponse.ts +++ b/src/api/types/ListBookingsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListBookingsResponse { /** The list of targeted bookings. */ diff --git a/src/api/types/ListBreakTypesResponse.ts b/src/api/types/ListBreakTypesResponse.ts index 130fe20ea..5311a175a 100644 --- a/src/api/types/ListBreakTypesResponse.ts +++ b/src/api/types/ListBreakTypesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request for a set of `BreakType` objects. The response contains diff --git a/src/api/types/ListCardsResponse.ts b/src/api/types/ListCardsResponse.ts index 1d62d8cec..5a576d97f 100644 --- a/src/api/types/ListCardsResponse.ts +++ b/src/api/types/ListCardsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListCashDrawerShiftEventsResponse.ts b/src/api/types/ListCashDrawerShiftEventsResponse.ts index 3383ab7a6..933f6ed86 100644 --- a/src/api/types/ListCashDrawerShiftEventsResponse.ts +++ b/src/api/types/ListCashDrawerShiftEventsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListCashDrawerShiftEventsResponse { /** diff --git a/src/api/types/ListCashDrawerShiftsResponse.ts b/src/api/types/ListCashDrawerShiftsResponse.ts index 3e0d2e263..73a98dec5 100644 --- a/src/api/types/ListCashDrawerShiftsResponse.ts +++ b/src/api/types/ListCashDrawerShiftsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListCashDrawerShiftsResponse { /** diff --git a/src/api/types/ListCatalogResponse.ts b/src/api/types/ListCatalogResponse.ts index b1b84b52d..9f10755d0 100644 --- a/src/api/types/ListCatalogResponse.ts +++ b/src/api/types/ListCatalogResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListCatalogResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/ListChannelsRequestConstants.ts b/src/api/types/ListChannelsRequestConstants.ts index 8cfda1584..f0b7ca7c6 100644 --- a/src/api/types/ListChannelsRequestConstants.ts +++ b/src/api/types/ListChannelsRequestConstants.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type ListChannelsRequestConstants = "MAX_PAGE_SIZE"; diff --git a/src/api/types/ListChannelsResponse.ts b/src/api/types/ListChannelsResponse.ts index c16d7b2ee..c4acb4a7c 100644 --- a/src/api/types/ListChannelsResponse.ts +++ b/src/api/types/ListChannelsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListChannelsResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/ListCustomerCustomAttributeDefinitionsResponse.ts b/src/api/types/ListCustomerCustomAttributeDefinitionsResponse.ts index 4f19c1fb0..edb30347b 100644 --- a/src/api/types/ListCustomerCustomAttributeDefinitionsResponse.ts +++ b/src/api/types/ListCustomerCustomAttributeDefinitionsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [ListCustomerCustomAttributeDefinitions](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributeDefinitions) response. diff --git a/src/api/types/ListCustomerCustomAttributesResponse.ts b/src/api/types/ListCustomerCustomAttributesResponse.ts index 5a657217d..fd789213c 100644 --- a/src/api/types/ListCustomerCustomAttributesResponse.ts +++ b/src/api/types/ListCustomerCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [ListCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributes) response. diff --git a/src/api/types/ListCustomerGroupsResponse.ts b/src/api/types/ListCustomerGroupsResponse.ts index ac41c182a..6375e311e 100644 --- a/src/api/types/ListCustomerGroupsResponse.ts +++ b/src/api/types/ListCustomerGroupsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListCustomerSegmentsResponse.ts b/src/api/types/ListCustomerSegmentsResponse.ts index 883cea16d..e254066bb 100644 --- a/src/api/types/ListCustomerSegmentsResponse.ts +++ b/src/api/types/ListCustomerSegmentsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body for requests to the `ListCustomerSegments` endpoint. diff --git a/src/api/types/ListCustomersResponse.ts b/src/api/types/ListCustomersResponse.ts index bfb19bc90..a119efbd7 100644 --- a/src/api/types/ListCustomersResponse.ts +++ b/src/api/types/ListCustomersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListDeviceCodesResponse.ts b/src/api/types/ListDeviceCodesResponse.ts index 5929459ee..52e7b6e1d 100644 --- a/src/api/types/ListDeviceCodesResponse.ts +++ b/src/api/types/ListDeviceCodesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListDeviceCodesResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/ListDevicesResponse.ts b/src/api/types/ListDevicesResponse.ts index d4bb92d53..adbd4a0c4 100644 --- a/src/api/types/ListDevicesResponse.ts +++ b/src/api/types/ListDevicesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListDevicesResponse { /** Information about errors that occurred during the request. */ diff --git a/src/api/types/ListDisputeEvidenceResponse.ts b/src/api/types/ListDisputeEvidenceResponse.ts index 5f54466da..d586fd095 100644 --- a/src/api/types/ListDisputeEvidenceResponse.ts +++ b/src/api/types/ListDisputeEvidenceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields in a `ListDisputeEvidence` response. diff --git a/src/api/types/ListDisputesResponse.ts b/src/api/types/ListDisputesResponse.ts index e5375c429..c6446c96e 100644 --- a/src/api/types/ListDisputesResponse.ts +++ b/src/api/types/ListDisputesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines fields in a `ListDisputes` response. diff --git a/src/api/types/ListEmployeeWagesResponse.ts b/src/api/types/ListEmployeeWagesResponse.ts index 942884239..ba4df9331 100644 --- a/src/api/types/ListEmployeeWagesResponse.ts +++ b/src/api/types/ListEmployeeWagesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request for a set of `EmployeeWage` objects. The response contains diff --git a/src/api/types/ListEmployeesResponse.ts b/src/api/types/ListEmployeesResponse.ts index cc7e8a11e..99a6375bf 100644 --- a/src/api/types/ListEmployeesResponse.ts +++ b/src/api/types/ListEmployeesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListEmployeesResponse { employees?: Square.Employee[]; diff --git a/src/api/types/ListEventTypesResponse.ts b/src/api/types/ListEventTypesResponse.ts index 109d6e21e..460d22df9 100644 --- a/src/api/types/ListEventTypesResponse.ts +++ b/src/api/types/ListEventTypesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListGiftCardActivitiesResponse.ts b/src/api/types/ListGiftCardActivitiesResponse.ts index 34fc283b3..ddbce6701 100644 --- a/src/api/types/ListGiftCardActivitiesResponse.ts +++ b/src/api/types/ListGiftCardActivitiesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains a list of `GiftCardActivity` objects. If the request resulted in errors, diff --git a/src/api/types/ListGiftCardsResponse.ts b/src/api/types/ListGiftCardsResponse.ts index 1b13da7bc..f8fb1e4be 100644 --- a/src/api/types/ListGiftCardsResponse.ts +++ b/src/api/types/ListGiftCardsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains a list of `GiftCard` objects. If the request resulted in errors, diff --git a/src/api/types/ListInvoicesResponse.ts b/src/api/types/ListInvoicesResponse.ts index 6e45726bf..e99b0fbce 100644 --- a/src/api/types/ListInvoicesResponse.ts +++ b/src/api/types/ListInvoicesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a `ListInvoice` response. diff --git a/src/api/types/ListJobsResponse.ts b/src/api/types/ListJobsResponse.ts index 5322bc98a..6e18e18a1 100644 --- a/src/api/types/ListJobsResponse.ts +++ b/src/api/types/ListJobsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [ListJobs](api-endpoint:Team-ListJobs) response. Either `jobs` or `errors` diff --git a/src/api/types/ListLocationBookingProfilesResponse.ts b/src/api/types/ListLocationBookingProfilesResponse.ts index b5f346193..08093667c 100644 --- a/src/api/types/ListLocationBookingProfilesResponse.ts +++ b/src/api/types/ListLocationBookingProfilesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListLocationBookingProfilesResponse { /** The list of a seller's location booking profiles. */ diff --git a/src/api/types/ListLocationCustomAttributeDefinitionsResponse.ts b/src/api/types/ListLocationCustomAttributeDefinitionsResponse.ts index 26b6776aa..14db478cd 100644 --- a/src/api/types/ListLocationCustomAttributeDefinitionsResponse.ts +++ b/src/api/types/ListLocationCustomAttributeDefinitionsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [ListLocationCustomAttributeDefinitions](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributeDefinitions) response. diff --git a/src/api/types/ListLocationCustomAttributesResponse.ts b/src/api/types/ListLocationCustomAttributesResponse.ts index c5ddf2867..2afb5264c 100644 --- a/src/api/types/ListLocationCustomAttributesResponse.ts +++ b/src/api/types/ListLocationCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [ListLocationCustomAttributes](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributes) response. diff --git a/src/api/types/ListLocationsResponse.ts b/src/api/types/ListLocationsResponse.ts index b03599ce5..63fe89c20 100644 --- a/src/api/types/ListLocationsResponse.ts +++ b/src/api/types/ListLocationsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of a request diff --git a/src/api/types/ListLoyaltyProgramsResponse.ts b/src/api/types/ListLoyaltyProgramsResponse.ts index 8ff095768..79dab4c20 100644 --- a/src/api/types/ListLoyaltyProgramsResponse.ts +++ b/src/api/types/ListLoyaltyProgramsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains all loyalty programs. diff --git a/src/api/types/ListLoyaltyPromotionsResponse.ts b/src/api/types/ListLoyaltyPromotionsResponse.ts index 500c81c9a..90640f41a 100644 --- a/src/api/types/ListLoyaltyPromotionsResponse.ts +++ b/src/api/types/ListLoyaltyPromotionsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) response. diff --git a/src/api/types/ListMerchantCustomAttributeDefinitionsResponse.ts b/src/api/types/ListMerchantCustomAttributeDefinitionsResponse.ts index bc8d167d1..2fd165712 100644 --- a/src/api/types/ListMerchantCustomAttributeDefinitionsResponse.ts +++ b/src/api/types/ListMerchantCustomAttributeDefinitionsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [ListMerchantCustomAttributeDefinitions](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributeDefinitions) response. diff --git a/src/api/types/ListMerchantCustomAttributesResponse.ts b/src/api/types/ListMerchantCustomAttributesResponse.ts index 06bd4e2f1..51c9cc0bc 100644 --- a/src/api/types/ListMerchantCustomAttributesResponse.ts +++ b/src/api/types/ListMerchantCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [ListMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributes) response. diff --git a/src/api/types/ListMerchantsResponse.ts b/src/api/types/ListMerchantsResponse.ts index c90dae379..6e42130d6 100644 --- a/src/api/types/ListMerchantsResponse.ts +++ b/src/api/types/ListMerchantsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response object returned by the [ListMerchant](api-endpoint:Merchants-ListMerchants) endpoint. diff --git a/src/api/types/ListOrderCustomAttributeDefinitionsResponse.ts b/src/api/types/ListOrderCustomAttributeDefinitionsResponse.ts index 8acfd8fcb..bbeaf37c0 100644 --- a/src/api/types/ListOrderCustomAttributeDefinitionsResponse.ts +++ b/src/api/types/ListOrderCustomAttributeDefinitionsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from listing order custom attribute definitions. diff --git a/src/api/types/ListOrderCustomAttributesResponse.ts b/src/api/types/ListOrderCustomAttributesResponse.ts index 73595ad53..6939f3c0e 100644 --- a/src/api/types/ListOrderCustomAttributesResponse.ts +++ b/src/api/types/ListOrderCustomAttributesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from listing order custom attributes. diff --git a/src/api/types/ListPaymentLinksResponse.ts b/src/api/types/ListPaymentLinksResponse.ts index b380ee63e..a5c9565a8 100644 --- a/src/api/types/ListPaymentLinksResponse.ts +++ b/src/api/types/ListPaymentLinksResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListPaymentLinksResponse { /** Errors that occurred during the request. */ diff --git a/src/api/types/ListPaymentRefundsRequestSortField.ts b/src/api/types/ListPaymentRefundsRequestSortField.ts index c835a78d5..1b0f44d4c 100644 --- a/src/api/types/ListPaymentRefundsRequestSortField.ts +++ b/src/api/types/ListPaymentRefundsRequestSortField.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type ListPaymentRefundsRequestSortField = "CREATED_AT" | "UPDATED_AT"; export const ListPaymentRefundsRequestSortField = { CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; +export type ListPaymentRefundsRequestSortField = + (typeof ListPaymentRefundsRequestSortField)[keyof typeof ListPaymentRefundsRequestSortField]; diff --git a/src/api/types/ListPaymentRefundsResponse.ts b/src/api/types/ListPaymentRefundsResponse.ts index a2f5aa8e1..cfbfa9964 100644 --- a/src/api/types/ListPaymentRefundsResponse.ts +++ b/src/api/types/ListPaymentRefundsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response returned by [ListPaymentRefunds](api-endpoint:Refunds-ListPaymentRefunds). diff --git a/src/api/types/ListPaymentsRequestSortField.ts b/src/api/types/ListPaymentsRequestSortField.ts index 5062db1b6..222202be6 100644 --- a/src/api/types/ListPaymentsRequestSortField.ts +++ b/src/api/types/ListPaymentsRequestSortField.ts @@ -1,10 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type ListPaymentsRequestSortField = "CREATED_AT" | "OFFLINE_CREATED_AT" | "UPDATED_AT"; export const ListPaymentsRequestSortField = { CreatedAt: "CREATED_AT", OfflineCreatedAt: "OFFLINE_CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; +export type ListPaymentsRequestSortField = + (typeof ListPaymentsRequestSortField)[keyof typeof ListPaymentsRequestSortField]; diff --git a/src/api/types/ListPaymentsResponse.ts b/src/api/types/ListPaymentsResponse.ts index 65cb703a0..07474db12 100644 --- a/src/api/types/ListPaymentsResponse.ts +++ b/src/api/types/ListPaymentsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response returned by [ListPayments](api-endpoint:Payments-ListPayments). diff --git a/src/api/types/ListPayoutEntriesResponse.ts b/src/api/types/ListPayoutEntriesResponse.ts index fad7d4893..313d5b8d1 100644 --- a/src/api/types/ListPayoutEntriesResponse.ts +++ b/src/api/types/ListPayoutEntriesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to retrieve payout records entries. diff --git a/src/api/types/ListPayoutsResponse.ts b/src/api/types/ListPayoutsResponse.ts index 6a76b4579..59eda7f77 100644 --- a/src/api/types/ListPayoutsResponse.ts +++ b/src/api/types/ListPayoutsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to retrieve payout records entries. diff --git a/src/api/types/ListSitesResponse.ts b/src/api/types/ListSitesResponse.ts index 5a329a381..b4d0a1804 100644 --- a/src/api/types/ListSitesResponse.ts +++ b/src/api/types/ListSitesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a `ListSites` response. The response can include either `sites` or `errors`. diff --git a/src/api/types/ListSubscriptionEventsResponse.ts b/src/api/types/ListSubscriptionEventsResponse.ts index 2b2f1e37d..e9b3cc49f 100644 --- a/src/api/types/ListSubscriptionEventsResponse.ts +++ b/src/api/types/ListSubscriptionEventsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/ListTeamMemberBookingProfilesResponse.ts b/src/api/types/ListTeamMemberBookingProfilesResponse.ts index 01db09ff2..4c7b464f6 100644 --- a/src/api/types/ListTeamMemberBookingProfilesResponse.ts +++ b/src/api/types/ListTeamMemberBookingProfilesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ListTeamMemberBookingProfilesResponse { /** diff --git a/src/api/types/ListTeamMemberWagesResponse.ts b/src/api/types/ListTeamMemberWagesResponse.ts index 363e6aea4..5a8c51cca 100644 --- a/src/api/types/ListTeamMemberWagesResponse.ts +++ b/src/api/types/ListTeamMemberWagesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request for a set of `TeamMemberWage` objects. The response contains diff --git a/src/api/types/ListTransactionsResponse.ts b/src/api/types/ListTransactionsResponse.ts index 515c68cd5..b8918b129 100644 --- a/src/api/types/ListTransactionsResponse.ts +++ b/src/api/types/ListTransactionsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListWebhookEventTypesResponse.ts b/src/api/types/ListWebhookEventTypesResponse.ts index 8f365f9df..fd0a1e4e2 100644 --- a/src/api/types/ListWebhookEventTypesResponse.ts +++ b/src/api/types/ListWebhookEventTypesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListWebhookSubscriptionsResponse.ts b/src/api/types/ListWebhookSubscriptionsResponse.ts index 968cd9a68..7849ae01d 100644 --- a/src/api/types/ListWebhookSubscriptionsResponse.ts +++ b/src/api/types/ListWebhookSubscriptionsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListWorkweekConfigsResponse.ts b/src/api/types/ListWorkweekConfigsResponse.ts index e24e7e639..bb6e12cc0 100644 --- a/src/api/types/ListWorkweekConfigsResponse.ts +++ b/src/api/types/ListWorkweekConfigsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request for a set of `WorkweekConfig` objects. The response contains diff --git a/src/api/types/Location.ts b/src/api/types/Location.ts index 070551111..cb17835cd 100644 --- a/src/api/types/Location.ts +++ b/src/api/types/Location.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). diff --git a/src/api/types/LocationBookingProfile.ts b/src/api/types/LocationBookingProfile.ts index c75b777aa..6ba3d8128 100644 --- a/src/api/types/LocationBookingProfile.ts +++ b/src/api/types/LocationBookingProfile.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The booking profile of a seller's location, including the location's ID and whether the location is enabled for online booking. diff --git a/src/api/types/LocationCapability.ts b/src/api/types/LocationCapability.ts index 93dc952ea..10408b9d5 100644 --- a/src/api/types/LocationCapability.ts +++ b/src/api/types/LocationCapability.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The capabilities a location might have. - */ -export type LocationCapability = "CREDIT_CARD_PROCESSING" | "AUTOMATIC_TRANSFERS" | "UNLINKED_REFUNDS"; +/** The capabilities a location might have. */ export const LocationCapability = { CreditCardProcessing: "CREDIT_CARD_PROCESSING", AutomaticTransfers: "AUTOMATIC_TRANSFERS", UnlinkedRefunds: "UNLINKED_REFUNDS", } as const; +export type LocationCapability = (typeof LocationCapability)[keyof typeof LocationCapability]; diff --git a/src/api/types/LocationCreatedEvent.ts b/src/api/types/LocationCreatedEvent.ts index 00654f2b6..4372d787f 100644 --- a/src/api/types/LocationCreatedEvent.ts +++ b/src/api/types/LocationCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Location](entity:Location) is created. diff --git a/src/api/types/LocationCreatedEventData.ts b/src/api/types/LocationCreatedEventData.ts index a55b34988..6ad7160d7 100644 --- a/src/api/types/LocationCreatedEventData.ts +++ b/src/api/types/LocationCreatedEventData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface LocationCreatedEventData { /** Name of the affected object’s type, `"location"`. */ diff --git a/src/api/types/LocationCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionOwnedCreatedEvent.ts index 5139600a2..8f40b6a56 100644 --- a/src/api/types/LocationCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionOwnedDeletedEvent.ts index e0e5da3aa..e2a545e46 100644 --- a/src/api/types/LocationCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionOwnedUpdatedEvent.ts index d187dd3f1..2e0a844a4 100644 --- a/src/api/types/LocationCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionVisibleCreatedEvent.ts index e1093a350..92b3e4ea6 100644 --- a/src/api/types/LocationCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionVisibleDeletedEvent.ts index bf624af8b..98fd46647 100644 --- a/src/api/types/LocationCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionVisibleUpdatedEvent.ts index dca159f86..91c695d6d 100644 --- a/src/api/types/LocationCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeOwnedDeletedEvent.ts b/src/api/types/LocationCustomAttributeOwnedDeletedEvent.ts index 3fc2337b4..f560e1d2b 100644 --- a/src/api/types/LocationCustomAttributeOwnedDeletedEvent.ts +++ b/src/api/types/LocationCustomAttributeOwnedDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a location [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/LocationCustomAttributeOwnedUpdatedEvent.ts b/src/api/types/LocationCustomAttributeOwnedUpdatedEvent.ts index 7323a84e1..09302ad06 100644 --- a/src/api/types/LocationCustomAttributeOwnedUpdatedEvent.ts +++ b/src/api/types/LocationCustomAttributeOwnedUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a location [custom attribute](entity:CustomAttribute) owned by the diff --git a/src/api/types/LocationCustomAttributeVisibleDeletedEvent.ts b/src/api/types/LocationCustomAttributeVisibleDeletedEvent.ts index e9ef28cb5..315ff2a91 100644 --- a/src/api/types/LocationCustomAttributeVisibleDeletedEvent.ts +++ b/src/api/types/LocationCustomAttributeVisibleDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a location [custom attribute](entity:CustomAttribute) that is visible to the diff --git a/src/api/types/LocationCustomAttributeVisibleUpdatedEvent.ts b/src/api/types/LocationCustomAttributeVisibleUpdatedEvent.ts index 68db4d117..9d0919594 100644 --- a/src/api/types/LocationCustomAttributeVisibleUpdatedEvent.ts +++ b/src/api/types/LocationCustomAttributeVisibleUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a location [custom attribute](entity:CustomAttribute) that is visible diff --git a/src/api/types/LocationSettingsUpdatedEvent.ts b/src/api/types/LocationSettingsUpdatedEvent.ts index d5156843c..02bcfda44 100644 --- a/src/api/types/LocationSettingsUpdatedEvent.ts +++ b/src/api/types/LocationSettingsUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when online checkout location settings are updated diff --git a/src/api/types/LocationSettingsUpdatedEventData.ts b/src/api/types/LocationSettingsUpdatedEventData.ts index cc5d90a38..6e0d8f2e8 100644 --- a/src/api/types/LocationSettingsUpdatedEventData.ts +++ b/src/api/types/LocationSettingsUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LocationSettingsUpdatedEventData { /** Name of the updated object’s type, `"online_checkout.location_settings"`. */ diff --git a/src/api/types/LocationSettingsUpdatedEventObject.ts b/src/api/types/LocationSettingsUpdatedEventObject.ts index ca7ef9d8e..276010596 100644 --- a/src/api/types/LocationSettingsUpdatedEventObject.ts +++ b/src/api/types/LocationSettingsUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LocationSettingsUpdatedEventObject { /** The updated location settings. */ diff --git a/src/api/types/LocationStatus.ts b/src/api/types/LocationStatus.ts index b9cb3d638..ed166b04a 100644 --- a/src/api/types/LocationStatus.ts +++ b/src/api/types/LocationStatus.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * A location's status. - */ -export type LocationStatus = "ACTIVE" | "INACTIVE"; +/** A location's status. */ export const LocationStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; +export type LocationStatus = (typeof LocationStatus)[keyof typeof LocationStatus]; diff --git a/src/api/types/LocationType.ts b/src/api/types/LocationType.ts index f9021c395..9302ef938 100644 --- a/src/api/types/LocationType.ts +++ b/src/api/types/LocationType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * A location's type. - */ -export type LocationType = "PHYSICAL" | "MOBILE"; +/** A location's type. */ export const LocationType = { Physical: "PHYSICAL", Mobile: "MOBILE", } as const; +export type LocationType = (typeof LocationType)[keyof typeof LocationType]; diff --git a/src/api/types/LocationUpdatedEvent.ts b/src/api/types/LocationUpdatedEvent.ts index ad9581061..c4f26505d 100644 --- a/src/api/types/LocationUpdatedEvent.ts +++ b/src/api/types/LocationUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Location](entity:Location) is updated. diff --git a/src/api/types/LocationUpdatedEventData.ts b/src/api/types/LocationUpdatedEventData.ts index f5bd36949..d78118247 100644 --- a/src/api/types/LocationUpdatedEventData.ts +++ b/src/api/types/LocationUpdatedEventData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface LocationUpdatedEventData { /** Name of the affected object’s type, `"location"`. */ diff --git a/src/api/types/LoyaltyAccount.ts b/src/api/types/LoyaltyAccount.ts index 6e30c4eae..1a9a9c0cf 100644 --- a/src/api/types/LoyaltyAccount.ts +++ b/src/api/types/LoyaltyAccount.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a loyalty account in a [loyalty program](entity:LoyaltyProgram). For more information, see diff --git a/src/api/types/LoyaltyAccountCreatedEvent.ts b/src/api/types/LoyaltyAccountCreatedEvent.ts index f903e6b8e..c9917c934 100644 --- a/src/api/types/LoyaltyAccountCreatedEvent.ts +++ b/src/api/types/LoyaltyAccountCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [loyalty account](entity:LoyaltyAccount) is created. diff --git a/src/api/types/LoyaltyAccountCreatedEventData.ts b/src/api/types/LoyaltyAccountCreatedEventData.ts index e2121f78b..ba08a0b0b 100644 --- a/src/api/types/LoyaltyAccountCreatedEventData.ts +++ b/src/api/types/LoyaltyAccountCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `loyalty.account.created` event. diff --git a/src/api/types/LoyaltyAccountCreatedEventObject.ts b/src/api/types/LoyaltyAccountCreatedEventObject.ts index 42652de88..9b4f3a355 100644 --- a/src/api/types/LoyaltyAccountCreatedEventObject.ts +++ b/src/api/types/LoyaltyAccountCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LoyaltyAccountCreatedEventObject { /** The loyalty account that was created. */ diff --git a/src/api/types/LoyaltyAccountDeletedEvent.ts b/src/api/types/LoyaltyAccountDeletedEvent.ts index 111ab9f04..36d8608e1 100644 --- a/src/api/types/LoyaltyAccountDeletedEvent.ts +++ b/src/api/types/LoyaltyAccountDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [loyalty account](entity:LoyaltyAccount) is deleted. diff --git a/src/api/types/LoyaltyAccountDeletedEventData.ts b/src/api/types/LoyaltyAccountDeletedEventData.ts index bb91e983f..85bf70193 100644 --- a/src/api/types/LoyaltyAccountDeletedEventData.ts +++ b/src/api/types/LoyaltyAccountDeletedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `loyalty.account.deleted` event. diff --git a/src/api/types/LoyaltyAccountDeletedEventObject.ts b/src/api/types/LoyaltyAccountDeletedEventObject.ts index f873af4e0..3713f98ac 100644 --- a/src/api/types/LoyaltyAccountDeletedEventObject.ts +++ b/src/api/types/LoyaltyAccountDeletedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LoyaltyAccountDeletedEventObject { /** The loyalty account that was deleted. */ diff --git a/src/api/types/LoyaltyAccountExpiringPointDeadline.ts b/src/api/types/LoyaltyAccountExpiringPointDeadline.ts index 778b340b3..2204b8422 100644 --- a/src/api/types/LoyaltyAccountExpiringPointDeadline.ts +++ b/src/api/types/LoyaltyAccountExpiringPointDeadline.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a set of points for a loyalty account that are scheduled to expire on a specific date. diff --git a/src/api/types/LoyaltyAccountMapping.ts b/src/api/types/LoyaltyAccountMapping.ts index 59d14a0b3..6f26c9807 100644 --- a/src/api/types/LoyaltyAccountMapping.ts +++ b/src/api/types/LoyaltyAccountMapping.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the mapping that associates a loyalty account with a buyer. diff --git a/src/api/types/LoyaltyAccountMappingType.ts b/src/api/types/LoyaltyAccountMappingType.ts index 3824a4777..6de787d37 100644 --- a/src/api/types/LoyaltyAccountMappingType.ts +++ b/src/api/types/LoyaltyAccountMappingType.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The type of mapping. diff --git a/src/api/types/LoyaltyAccountUpdatedEvent.ts b/src/api/types/LoyaltyAccountUpdatedEvent.ts index e42a752b9..e44bf3252 100644 --- a/src/api/types/LoyaltyAccountUpdatedEvent.ts +++ b/src/api/types/LoyaltyAccountUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [loyalty account](entity:LoyaltyAccount) is updated. diff --git a/src/api/types/LoyaltyAccountUpdatedEventData.ts b/src/api/types/LoyaltyAccountUpdatedEventData.ts index 32ef96617..cff945cd5 100644 --- a/src/api/types/LoyaltyAccountUpdatedEventData.ts +++ b/src/api/types/LoyaltyAccountUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `loyalty.account.updated` event. diff --git a/src/api/types/LoyaltyAccountUpdatedEventObject.ts b/src/api/types/LoyaltyAccountUpdatedEventObject.ts index e9d837fc5..ea14f5574 100644 --- a/src/api/types/LoyaltyAccountUpdatedEventObject.ts +++ b/src/api/types/LoyaltyAccountUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LoyaltyAccountUpdatedEventObject { /** The loyalty account that was updated. */ diff --git a/src/api/types/LoyaltyEvent.ts b/src/api/types/LoyaltyEvent.ts index 1f95583c3..0d1499926 100644 --- a/src/api/types/LoyaltyEvent.ts +++ b/src/api/types/LoyaltyEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Provides information about a loyalty event. diff --git a/src/api/types/LoyaltyEventAccumulatePoints.ts b/src/api/types/LoyaltyEventAccumulatePoints.ts index 11a26a152..86ca99628 100644 --- a/src/api/types/LoyaltyEventAccumulatePoints.ts +++ b/src/api/types/LoyaltyEventAccumulatePoints.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Provides metadata when the event `type` is `ACCUMULATE_POINTS`. diff --git a/src/api/types/LoyaltyEventAccumulatePromotionPoints.ts b/src/api/types/LoyaltyEventAccumulatePromotionPoints.ts index 9aff14b5d..9a27b0aae 100644 --- a/src/api/types/LoyaltyEventAccumulatePromotionPoints.ts +++ b/src/api/types/LoyaltyEventAccumulatePromotionPoints.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. diff --git a/src/api/types/LoyaltyEventAdjustPoints.ts b/src/api/types/LoyaltyEventAdjustPoints.ts index 92ea5fca2..72e5d4457 100644 --- a/src/api/types/LoyaltyEventAdjustPoints.ts +++ b/src/api/types/LoyaltyEventAdjustPoints.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Provides metadata when the event `type` is `ADJUST_POINTS`. diff --git a/src/api/types/LoyaltyEventCreateReward.ts b/src/api/types/LoyaltyEventCreateReward.ts index 9ca80fbb6..f9716d190 100644 --- a/src/api/types/LoyaltyEventCreateReward.ts +++ b/src/api/types/LoyaltyEventCreateReward.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Provides metadata when the event `type` is `CREATE_REWARD`. diff --git a/src/api/types/LoyaltyEventCreatedEvent.ts b/src/api/types/LoyaltyEventCreatedEvent.ts index 686c00240..3172859d0 100644 --- a/src/api/types/LoyaltyEventCreatedEvent.ts +++ b/src/api/types/LoyaltyEventCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [loyalty event](entity:LoyaltyEvent) is created. diff --git a/src/api/types/LoyaltyEventCreatedEventData.ts b/src/api/types/LoyaltyEventCreatedEventData.ts index 874b67bcd..282647243 100644 --- a/src/api/types/LoyaltyEventCreatedEventData.ts +++ b/src/api/types/LoyaltyEventCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `loyalty.event.created` event. diff --git a/src/api/types/LoyaltyEventCreatedEventObject.ts b/src/api/types/LoyaltyEventCreatedEventObject.ts index 0dd22c3f2..cce9736ed 100644 --- a/src/api/types/LoyaltyEventCreatedEventObject.ts +++ b/src/api/types/LoyaltyEventCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface LoyaltyEventCreatedEventObject { /** The loyalty event that was created. */ diff --git a/src/api/types/LoyaltyEventDateTimeFilter.ts b/src/api/types/LoyaltyEventDateTimeFilter.ts index 55bf54033..4103a4dfb 100644 --- a/src/api/types/LoyaltyEventDateTimeFilter.ts +++ b/src/api/types/LoyaltyEventDateTimeFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Filter events by date time range. diff --git a/src/api/types/LoyaltyEventDeleteReward.ts b/src/api/types/LoyaltyEventDeleteReward.ts index 8c4bf1d44..b38a878de 100644 --- a/src/api/types/LoyaltyEventDeleteReward.ts +++ b/src/api/types/LoyaltyEventDeleteReward.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Provides metadata when the event `type` is `DELETE_REWARD`. diff --git a/src/api/types/LoyaltyEventExpirePoints.ts b/src/api/types/LoyaltyEventExpirePoints.ts index 063d100c5..86ee5f3ff 100644 --- a/src/api/types/LoyaltyEventExpirePoints.ts +++ b/src/api/types/LoyaltyEventExpirePoints.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Provides metadata when the event `type` is `EXPIRE_POINTS`. diff --git a/src/api/types/LoyaltyEventFilter.ts b/src/api/types/LoyaltyEventFilter.ts index 2b0b4788f..03d927161 100644 --- a/src/api/types/LoyaltyEventFilter.ts +++ b/src/api/types/LoyaltyEventFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The filtering criteria. If the request specifies multiple filters, diff --git a/src/api/types/LoyaltyEventLocationFilter.ts b/src/api/types/LoyaltyEventLocationFilter.ts index 0b3d8fe91..3ec942158 100644 --- a/src/api/types/LoyaltyEventLocationFilter.ts +++ b/src/api/types/LoyaltyEventLocationFilter.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Filter events by location. diff --git a/src/api/types/LoyaltyEventLoyaltyAccountFilter.ts b/src/api/types/LoyaltyEventLoyaltyAccountFilter.ts index a0e04bf97..0b39762a5 100644 --- a/src/api/types/LoyaltyEventLoyaltyAccountFilter.ts +++ b/src/api/types/LoyaltyEventLoyaltyAccountFilter.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Filter events by loyalty account. diff --git a/src/api/types/LoyaltyEventOrderFilter.ts b/src/api/types/LoyaltyEventOrderFilter.ts index b051f9fdd..5acc0d8f0 100644 --- a/src/api/types/LoyaltyEventOrderFilter.ts +++ b/src/api/types/LoyaltyEventOrderFilter.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Filter events by the order associated with the event. diff --git a/src/api/types/LoyaltyEventOther.ts b/src/api/types/LoyaltyEventOther.ts index 3451ccf3a..be5b78548 100644 --- a/src/api/types/LoyaltyEventOther.ts +++ b/src/api/types/LoyaltyEventOther.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Provides metadata when the event `type` is `OTHER`. diff --git a/src/api/types/LoyaltyEventQuery.ts b/src/api/types/LoyaltyEventQuery.ts index 12a06292f..142b09139 100644 --- a/src/api/types/LoyaltyEventQuery.ts +++ b/src/api/types/LoyaltyEventQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a query used to search for loyalty events. diff --git a/src/api/types/LoyaltyEventRedeemReward.ts b/src/api/types/LoyaltyEventRedeemReward.ts index 555d84f0d..5ec8f0fd1 100644 --- a/src/api/types/LoyaltyEventRedeemReward.ts +++ b/src/api/types/LoyaltyEventRedeemReward.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Provides metadata when the event `type` is `REDEEM_REWARD`. diff --git a/src/api/types/LoyaltyEventSource.ts b/src/api/types/LoyaltyEventSource.ts index cdd90ab3a..b60585134 100644 --- a/src/api/types/LoyaltyEventSource.ts +++ b/src/api/types/LoyaltyEventSource.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Defines whether the event was generated by the Square Point of Sale. - */ -export type LoyaltyEventSource = "SQUARE" | "LOYALTY_API"; +/** Defines whether the event was generated by the Square Point of Sale. */ export const LoyaltyEventSource = { Square: "SQUARE", LoyaltyApi: "LOYALTY_API", } as const; +export type LoyaltyEventSource = (typeof LoyaltyEventSource)[keyof typeof LoyaltyEventSource]; diff --git a/src/api/types/LoyaltyEventType.ts b/src/api/types/LoyaltyEventType.ts index 3c0232c1f..3bfbdb044 100644 --- a/src/api/types/LoyaltyEventType.ts +++ b/src/api/types/LoyaltyEventType.ts @@ -1,19 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of the loyalty event. - */ -export type LoyaltyEventType = - | "ACCUMULATE_POINTS" - | "CREATE_REWARD" - | "REDEEM_REWARD" - | "DELETE_REWARD" - | "ADJUST_POINTS" - | "EXPIRE_POINTS" - | "OTHER" - | "ACCUMULATE_PROMOTION_POINTS"; +/** The type of the loyalty event. */ export const LoyaltyEventType = { AccumulatePoints: "ACCUMULATE_POINTS", CreateReward: "CREATE_REWARD", @@ -24,3 +11,4 @@ export const LoyaltyEventType = { Other: "OTHER", AccumulatePromotionPoints: "ACCUMULATE_PROMOTION_POINTS", } as const; +export type LoyaltyEventType = (typeof LoyaltyEventType)[keyof typeof LoyaltyEventType]; diff --git a/src/api/types/LoyaltyEventTypeFilter.ts b/src/api/types/LoyaltyEventTypeFilter.ts index f8308dd64..273fbe116 100644 --- a/src/api/types/LoyaltyEventTypeFilter.ts +++ b/src/api/types/LoyaltyEventTypeFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Filter events by event type. diff --git a/src/api/types/LoyaltyProgram.ts b/src/api/types/LoyaltyProgram.ts index 944dfefb2..6a7cae7df 100644 --- a/src/api/types/LoyaltyProgram.ts +++ b/src/api/types/LoyaltyProgram.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a Square loyalty program. Loyalty programs define how buyers can earn points and redeem points for rewards. diff --git a/src/api/types/LoyaltyProgramAccrualRule.ts b/src/api/types/LoyaltyProgramAccrualRule.ts index 233cc9068..3207e8eb2 100644 --- a/src/api/types/LoyaltyProgramAccrualRule.ts +++ b/src/api/types/LoyaltyProgramAccrualRule.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an accrual rule, which defines how buyers can earn points from the base [loyalty program](entity:LoyaltyProgram). diff --git a/src/api/types/LoyaltyProgramAccrualRuleCategoryData.ts b/src/api/types/LoyaltyProgramAccrualRuleCategoryData.ts index 4fb4d01da..dc71281d3 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleCategoryData.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleCategoryData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents additional data for rules with the `CATEGORY` accrual type. diff --git a/src/api/types/LoyaltyProgramAccrualRuleItemVariationData.ts b/src/api/types/LoyaltyProgramAccrualRuleItemVariationData.ts index e3bbea3e7..8bba49e98 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleItemVariationData.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleItemVariationData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents additional data for rules with the `ITEM_VARIATION` accrual type. diff --git a/src/api/types/LoyaltyProgramAccrualRuleSpendData.ts b/src/api/types/LoyaltyProgramAccrualRuleSpendData.ts index d89798aaa..6c0362f3c 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleSpendData.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleSpendData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents additional data for rules with the `SPEND` accrual type. diff --git a/src/api/types/LoyaltyProgramAccrualRuleTaxMode.ts b/src/api/types/LoyaltyProgramAccrualRuleTaxMode.ts index 0d1bb20b0..706d8cf91 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleTaxMode.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleTaxMode.ts @@ -1,13 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates how taxes should be treated when calculating the purchase amount used for loyalty points accrual. * This setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum spend requirement. */ -export type LoyaltyProgramAccrualRuleTaxMode = "BEFORE_TAX" | "AFTER_TAX"; export const LoyaltyProgramAccrualRuleTaxMode = { BeforeTax: "BEFORE_TAX", AfterTax: "AFTER_TAX", } as const; +export type LoyaltyProgramAccrualRuleTaxMode = + (typeof LoyaltyProgramAccrualRuleTaxMode)[keyof typeof LoyaltyProgramAccrualRuleTaxMode]; diff --git a/src/api/types/LoyaltyProgramAccrualRuleType.ts b/src/api/types/LoyaltyProgramAccrualRuleType.ts index b8159b822..c4f09c43b 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleType.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleType.ts @@ -1,14 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of the accrual rule that defines how buyers can earn points. - */ -export type LoyaltyProgramAccrualRuleType = "VISIT" | "SPEND" | "ITEM_VARIATION" | "CATEGORY"; +/** The type of the accrual rule that defines how buyers can earn points. */ export const LoyaltyProgramAccrualRuleType = { Visit: "VISIT", Spend: "SPEND", ItemVariation: "ITEM_VARIATION", Category: "CATEGORY", } as const; +export type LoyaltyProgramAccrualRuleType = + (typeof LoyaltyProgramAccrualRuleType)[keyof typeof LoyaltyProgramAccrualRuleType]; diff --git a/src/api/types/LoyaltyProgramAccrualRuleVisitData.ts b/src/api/types/LoyaltyProgramAccrualRuleVisitData.ts index ca0a7548a..2d439e6c9 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleVisitData.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleVisitData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents additional data for rules with the `VISIT` accrual type. diff --git a/src/api/types/LoyaltyProgramCreatedEvent.ts b/src/api/types/LoyaltyProgramCreatedEvent.ts index c1acfa5ed..6f676459a 100644 --- a/src/api/types/LoyaltyProgramCreatedEvent.ts +++ b/src/api/types/LoyaltyProgramCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [loyalty program](entity:LoyaltyProgram) is created. diff --git a/src/api/types/LoyaltyProgramCreatedEventData.ts b/src/api/types/LoyaltyProgramCreatedEventData.ts index 3c93f2b74..d50abdb58 100644 --- a/src/api/types/LoyaltyProgramCreatedEventData.ts +++ b/src/api/types/LoyaltyProgramCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `loyalty.program.created` event. diff --git a/src/api/types/LoyaltyProgramCreatedEventObject.ts b/src/api/types/LoyaltyProgramCreatedEventObject.ts index 5a047e101..4931030d0 100644 --- a/src/api/types/LoyaltyProgramCreatedEventObject.ts +++ b/src/api/types/LoyaltyProgramCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the loyalty program associated with a `loyalty.program.created` event. diff --git a/src/api/types/LoyaltyProgramExpirationPolicy.ts b/src/api/types/LoyaltyProgramExpirationPolicy.ts index 8cae0f861..b399301d5 100644 --- a/src/api/types/LoyaltyProgramExpirationPolicy.ts +++ b/src/api/types/LoyaltyProgramExpirationPolicy.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Describes when the loyalty program expires. diff --git a/src/api/types/LoyaltyProgramRewardTier.ts b/src/api/types/LoyaltyProgramRewardTier.ts index 76b4bebf2..1e031d808 100644 --- a/src/api/types/LoyaltyProgramRewardTier.ts +++ b/src/api/types/LoyaltyProgramRewardTier.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a reward tier in a loyalty program. A reward tier defines how buyers can redeem points for a reward, such as the number of points required and the value and scope of the discount. A loyalty program can offer multiple reward tiers. diff --git a/src/api/types/LoyaltyProgramStatus.ts b/src/api/types/LoyaltyProgramStatus.ts index 99cf1c4de..c00a2f118 100644 --- a/src/api/types/LoyaltyProgramStatus.ts +++ b/src/api/types/LoyaltyProgramStatus.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates whether the program is currently active. - */ -export type LoyaltyProgramStatus = "INACTIVE" | "ACTIVE"; +/** Indicates whether the program is currently active. */ export const LoyaltyProgramStatus = { Inactive: "INACTIVE", Active: "ACTIVE", } as const; +export type LoyaltyProgramStatus = (typeof LoyaltyProgramStatus)[keyof typeof LoyaltyProgramStatus]; diff --git a/src/api/types/LoyaltyProgramTerminology.ts b/src/api/types/LoyaltyProgramTerminology.ts index a84f98bd9..d18f19f98 100644 --- a/src/api/types/LoyaltyProgramTerminology.ts +++ b/src/api/types/LoyaltyProgramTerminology.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the naming used for loyalty points. diff --git a/src/api/types/LoyaltyProgramUpdatedEvent.ts b/src/api/types/LoyaltyProgramUpdatedEvent.ts index eba64dade..9d5a86886 100644 --- a/src/api/types/LoyaltyProgramUpdatedEvent.ts +++ b/src/api/types/LoyaltyProgramUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [loyalty program](entity:LoyaltyProgram) is updated. diff --git a/src/api/types/LoyaltyProgramUpdatedEventData.ts b/src/api/types/LoyaltyProgramUpdatedEventData.ts index 4e91d3814..27108cc5f 100644 --- a/src/api/types/LoyaltyProgramUpdatedEventData.ts +++ b/src/api/types/LoyaltyProgramUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `loyalty.program.updated` event. diff --git a/src/api/types/LoyaltyProgramUpdatedEventObject.ts b/src/api/types/LoyaltyProgramUpdatedEventObject.ts index 474f5dea7..ef8ff534e 100644 --- a/src/api/types/LoyaltyProgramUpdatedEventObject.ts +++ b/src/api/types/LoyaltyProgramUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the loyalty program associated with a `loyalty.program.updated` event. diff --git a/src/api/types/LoyaltyPromotion.ts b/src/api/types/LoyaltyPromotion.ts index df8c25093..efa1e7f65 100644 --- a/src/api/types/LoyaltyPromotion.ts +++ b/src/api/types/LoyaltyPromotion.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a promotion for a [loyalty program](entity:LoyaltyProgram). Loyalty promotions enable buyers diff --git a/src/api/types/LoyaltyPromotionAvailableTimeData.ts b/src/api/types/LoyaltyPromotionAvailableTimeData.ts index ef555493f..da7cc60af 100644 --- a/src/api/types/LoyaltyPromotionAvailableTimeData.ts +++ b/src/api/types/LoyaltyPromotionAvailableTimeData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents scheduling information that determines when purchases can qualify to earn points diff --git a/src/api/types/LoyaltyPromotionCreatedEvent.ts b/src/api/types/LoyaltyPromotionCreatedEvent.ts index 5351bf9a9..56f968d1c 100644 --- a/src/api/types/LoyaltyPromotionCreatedEvent.ts +++ b/src/api/types/LoyaltyPromotionCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [loyalty promotion](entity:LoyaltyPromotion) is created. diff --git a/src/api/types/LoyaltyPromotionCreatedEventData.ts b/src/api/types/LoyaltyPromotionCreatedEventData.ts index 6609ce34e..e0082ebd2 100644 --- a/src/api/types/LoyaltyPromotionCreatedEventData.ts +++ b/src/api/types/LoyaltyPromotionCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `loyalty.promotion.created` event. diff --git a/src/api/types/LoyaltyPromotionCreatedEventObject.ts b/src/api/types/LoyaltyPromotionCreatedEventObject.ts index 6385e2e20..07d0f4e8b 100644 --- a/src/api/types/LoyaltyPromotionCreatedEventObject.ts +++ b/src/api/types/LoyaltyPromotionCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the loyalty promotion associated with a `loyalty.promotion.created` event. diff --git a/src/api/types/LoyaltyPromotionIncentive.ts b/src/api/types/LoyaltyPromotionIncentive.ts index 96aafdd44..49d08388a 100644 --- a/src/api/types/LoyaltyPromotionIncentive.ts +++ b/src/api/types/LoyaltyPromotionIncentive.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents how points for a [loyalty promotion](entity:LoyaltyPromotion) are calculated, diff --git a/src/api/types/LoyaltyPromotionIncentivePointsAdditionData.ts b/src/api/types/LoyaltyPromotionIncentivePointsAdditionData.ts index 900a4166a..1edd5e188 100644 --- a/src/api/types/LoyaltyPromotionIncentivePointsAdditionData.ts +++ b/src/api/types/LoyaltyPromotionIncentivePointsAdditionData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive). diff --git a/src/api/types/LoyaltyPromotionIncentivePointsMultiplierData.ts b/src/api/types/LoyaltyPromotionIncentivePointsMultiplierData.ts index 1b89d2986..eb91c7f6e 100644 --- a/src/api/types/LoyaltyPromotionIncentivePointsMultiplierData.ts +++ b/src/api/types/LoyaltyPromotionIncentivePointsMultiplierData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive). diff --git a/src/api/types/LoyaltyPromotionIncentiveType.ts b/src/api/types/LoyaltyPromotionIncentiveType.ts index b60e6882e..33487bf2f 100644 --- a/src/api/types/LoyaltyPromotionIncentiveType.ts +++ b/src/api/types/LoyaltyPromotionIncentiveType.ts @@ -1,13 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the type of points incentive for a [loyalty promotion](entity:LoyaltyPromotion), * which is used to determine how buyers can earn points from the promotion. */ -export type LoyaltyPromotionIncentiveType = "POINTS_MULTIPLIER" | "POINTS_ADDITION"; export const LoyaltyPromotionIncentiveType = { PointsMultiplier: "POINTS_MULTIPLIER", PointsAddition: "POINTS_ADDITION", } as const; +export type LoyaltyPromotionIncentiveType = + (typeof LoyaltyPromotionIncentiveType)[keyof typeof LoyaltyPromotionIncentiveType]; diff --git a/src/api/types/LoyaltyPromotionStatus.ts b/src/api/types/LoyaltyPromotionStatus.ts index fc71b8bd4..6fb58a7cc 100644 --- a/src/api/types/LoyaltyPromotionStatus.ts +++ b/src/api/types/LoyaltyPromotionStatus.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the status of a [loyalty promotion](entity:LoyaltyPromotion). - */ -export type LoyaltyPromotionStatus = "ACTIVE" | "ENDED" | "CANCELED" | "SCHEDULED"; +/** Indicates the status of a [loyalty promotion](entity:LoyaltyPromotion). */ export const LoyaltyPromotionStatus = { Active: "ACTIVE", Ended: "ENDED", Canceled: "CANCELED", Scheduled: "SCHEDULED", } as const; +export type LoyaltyPromotionStatus = (typeof LoyaltyPromotionStatus)[keyof typeof LoyaltyPromotionStatus]; diff --git a/src/api/types/LoyaltyPromotionTriggerLimit.ts b/src/api/types/LoyaltyPromotionTriggerLimit.ts index 940ec80f3..9eb3e9b1f 100644 --- a/src/api/types/LoyaltyPromotionTriggerLimit.ts +++ b/src/api/types/LoyaltyPromotionTriggerLimit.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the number of times a buyer can earn points during a [loyalty promotion](entity:LoyaltyPromotion). diff --git a/src/api/types/LoyaltyPromotionTriggerLimitInterval.ts b/src/api/types/LoyaltyPromotionTriggerLimitInterval.ts index af488c597..776eeca7e 100644 --- a/src/api/types/LoyaltyPromotionTriggerLimitInterval.ts +++ b/src/api/types/LoyaltyPromotionTriggerLimitInterval.ts @@ -1,13 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates the time period that the [trigger limit](entity:LoyaltyPromotionTriggerLimit) applies to, * which is used to determine the number of times a buyer can earn points for a [loyalty promotion](entity:LoyaltyPromotion). */ -export type LoyaltyPromotionTriggerLimitInterval = "ALL_TIME" | "DAY"; export const LoyaltyPromotionTriggerLimitInterval = { AllTime: "ALL_TIME", Day: "DAY", } as const; +export type LoyaltyPromotionTriggerLimitInterval = + (typeof LoyaltyPromotionTriggerLimitInterval)[keyof typeof LoyaltyPromotionTriggerLimitInterval]; diff --git a/src/api/types/LoyaltyPromotionUpdatedEvent.ts b/src/api/types/LoyaltyPromotionUpdatedEvent.ts index 344a7bd25..11bfd5c43 100644 --- a/src/api/types/LoyaltyPromotionUpdatedEvent.ts +++ b/src/api/types/LoyaltyPromotionUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [loyalty promotion](entity:LoyaltyPromotion) is updated. This event is diff --git a/src/api/types/LoyaltyPromotionUpdatedEventData.ts b/src/api/types/LoyaltyPromotionUpdatedEventData.ts index 130e22019..b7fa4644a 100644 --- a/src/api/types/LoyaltyPromotionUpdatedEventData.ts +++ b/src/api/types/LoyaltyPromotionUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The data associated with a `loyalty.promotion.updated` event. diff --git a/src/api/types/LoyaltyPromotionUpdatedEventObject.ts b/src/api/types/LoyaltyPromotionUpdatedEventObject.ts index 1bae561db..d52afeb0d 100644 --- a/src/api/types/LoyaltyPromotionUpdatedEventObject.ts +++ b/src/api/types/LoyaltyPromotionUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that contains the loyalty promotion associated with a `loyalty.promotion.updated` event. diff --git a/src/api/types/LoyaltyReward.ts b/src/api/types/LoyaltyReward.ts index 9168d20b2..5d9d3f3d0 100644 --- a/src/api/types/LoyaltyReward.ts +++ b/src/api/types/LoyaltyReward.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a contract to redeem loyalty points for a [reward tier](entity:LoyaltyProgramRewardTier) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. diff --git a/src/api/types/LoyaltyRewardStatus.ts b/src/api/types/LoyaltyRewardStatus.ts index 2e4593f28..69b60fe3b 100644 --- a/src/api/types/LoyaltyRewardStatus.ts +++ b/src/api/types/LoyaltyRewardStatus.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The status of the loyalty reward. - */ -export type LoyaltyRewardStatus = "ISSUED" | "REDEEMED" | "DELETED"; +/** The status of the loyalty reward. */ export const LoyaltyRewardStatus = { Issued: "ISSUED", Redeemed: "REDEEMED", Deleted: "DELETED", } as const; +export type LoyaltyRewardStatus = (typeof LoyaltyRewardStatus)[keyof typeof LoyaltyRewardStatus]; diff --git a/src/api/types/MeasurementUnit.ts b/src/api/types/MeasurementUnit.ts index 24a146726..73ed5da3e 100644 --- a/src/api/types/MeasurementUnit.ts +++ b/src/api/types/MeasurementUnit.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a unit of measurement to use with a quantity, such as ounces diff --git a/src/api/types/MeasurementUnitArea.ts b/src/api/types/MeasurementUnitArea.ts index b3515d4f6..147030d54 100644 --- a/src/api/types/MeasurementUnitArea.ts +++ b/src/api/types/MeasurementUnitArea.ts @@ -1,19 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Unit of area used to measure a quantity. - */ -export type MeasurementUnitArea = - | "IMPERIAL_ACRE" - | "IMPERIAL_SQUARE_INCH" - | "IMPERIAL_SQUARE_FOOT" - | "IMPERIAL_SQUARE_YARD" - | "IMPERIAL_SQUARE_MILE" - | "METRIC_SQUARE_CENTIMETER" - | "METRIC_SQUARE_METER" - | "METRIC_SQUARE_KILOMETER"; +/** Unit of area used to measure a quantity. */ export const MeasurementUnitArea = { ImperialAcre: "IMPERIAL_ACRE", ImperialSquareInch: "IMPERIAL_SQUARE_INCH", @@ -24,3 +11,4 @@ export const MeasurementUnitArea = { MetricSquareMeter: "METRIC_SQUARE_METER", MetricSquareKilometer: "METRIC_SQUARE_KILOMETER", } as const; +export type MeasurementUnitArea = (typeof MeasurementUnitArea)[keyof typeof MeasurementUnitArea]; diff --git a/src/api/types/MeasurementUnitCustom.ts b/src/api/types/MeasurementUnitCustom.ts index 1a28c4793..4ef6e6711 100644 --- a/src/api/types/MeasurementUnitCustom.ts +++ b/src/api/types/MeasurementUnitCustom.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The information needed to define a custom unit, provided by the seller. diff --git a/src/api/types/MeasurementUnitGeneric.ts b/src/api/types/MeasurementUnitGeneric.ts index 0882b88e3..41d9a6526 100644 --- a/src/api/types/MeasurementUnitGeneric.ts +++ b/src/api/types/MeasurementUnitGeneric.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type MeasurementUnitGeneric = "UNIT"; diff --git a/src/api/types/MeasurementUnitLength.ts b/src/api/types/MeasurementUnitLength.ts index 18208ada5..2c0ae42ab 100644 --- a/src/api/types/MeasurementUnitLength.ts +++ b/src/api/types/MeasurementUnitLength.ts @@ -1,19 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The unit of length used to measure a quantity. - */ -export type MeasurementUnitLength = - | "IMPERIAL_INCH" - | "IMPERIAL_FOOT" - | "IMPERIAL_YARD" - | "IMPERIAL_MILE" - | "METRIC_MILLIMETER" - | "METRIC_CENTIMETER" - | "METRIC_METER" - | "METRIC_KILOMETER"; +/** The unit of length used to measure a quantity. */ export const MeasurementUnitLength = { ImperialInch: "IMPERIAL_INCH", ImperialFoot: "IMPERIAL_FOOT", @@ -24,3 +11,4 @@ export const MeasurementUnitLength = { MetricMeter: "METRIC_METER", MetricKilometer: "METRIC_KILOMETER", } as const; +export type MeasurementUnitLength = (typeof MeasurementUnitLength)[keyof typeof MeasurementUnitLength]; diff --git a/src/api/types/MeasurementUnitTime.ts b/src/api/types/MeasurementUnitTime.ts index 4c8187ae1..b0e938366 100644 --- a/src/api/types/MeasurementUnitTime.ts +++ b/src/api/types/MeasurementUnitTime.ts @@ -1,16 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Unit of time used to measure a quantity (a duration). - */ -export type MeasurementUnitTime = - | "GENERIC_MILLISECOND" - | "GENERIC_SECOND" - | "GENERIC_MINUTE" - | "GENERIC_HOUR" - | "GENERIC_DAY"; +/** Unit of time used to measure a quantity (a duration). */ export const MeasurementUnitTime = { GenericMillisecond: "GENERIC_MILLISECOND", GenericSecond: "GENERIC_SECOND", @@ -18,3 +8,4 @@ export const MeasurementUnitTime = { GenericHour: "GENERIC_HOUR", GenericDay: "GENERIC_DAY", } as const; +export type MeasurementUnitTime = (typeof MeasurementUnitTime)[keyof typeof MeasurementUnitTime]; diff --git a/src/api/types/MeasurementUnitUnitType.ts b/src/api/types/MeasurementUnitUnitType.ts index de29e72ee..d5d700913 100644 --- a/src/api/types/MeasurementUnitUnitType.ts +++ b/src/api/types/MeasurementUnitUnitType.ts @@ -1,17 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. - */ -export type MeasurementUnitUnitType = - | "TYPE_CUSTOM" - | "TYPE_AREA" - | "TYPE_LENGTH" - | "TYPE_VOLUME" - | "TYPE_WEIGHT" - | "TYPE_GENERIC"; +/** Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. */ export const MeasurementUnitUnitType = { TypeCustom: "TYPE_CUSTOM", TypeArea: "TYPE_AREA", @@ -20,3 +9,4 @@ export const MeasurementUnitUnitType = { TypeWeight: "TYPE_WEIGHT", TypeGeneric: "TYPE_GENERIC", } as const; +export type MeasurementUnitUnitType = (typeof MeasurementUnitUnitType)[keyof typeof MeasurementUnitUnitType]; diff --git a/src/api/types/MeasurementUnitVolume.ts b/src/api/types/MeasurementUnitVolume.ts index 64a0f1c50..938b067a7 100644 --- a/src/api/types/MeasurementUnitVolume.ts +++ b/src/api/types/MeasurementUnitVolume.ts @@ -1,22 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The unit of volume used to measure a quantity. - */ -export type MeasurementUnitVolume = - | "GENERIC_FLUID_OUNCE" - | "GENERIC_SHOT" - | "GENERIC_CUP" - | "GENERIC_PINT" - | "GENERIC_QUART" - | "GENERIC_GALLON" - | "IMPERIAL_CUBIC_INCH" - | "IMPERIAL_CUBIC_FOOT" - | "IMPERIAL_CUBIC_YARD" - | "METRIC_MILLILITER" - | "METRIC_LITER"; +/** The unit of volume used to measure a quantity. */ export const MeasurementUnitVolume = { GenericFluidOunce: "GENERIC_FLUID_OUNCE", GenericShot: "GENERIC_SHOT", @@ -30,3 +14,4 @@ export const MeasurementUnitVolume = { MetricMilliliter: "METRIC_MILLILITER", MetricLiter: "METRIC_LITER", } as const; +export type MeasurementUnitVolume = (typeof MeasurementUnitVolume)[keyof typeof MeasurementUnitVolume]; diff --git a/src/api/types/MeasurementUnitWeight.ts b/src/api/types/MeasurementUnitWeight.ts index ed30cac93..e54cbbdf1 100644 --- a/src/api/types/MeasurementUnitWeight.ts +++ b/src/api/types/MeasurementUnitWeight.ts @@ -1,17 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Unit of weight used to measure a quantity. - */ -export type MeasurementUnitWeight = - | "IMPERIAL_WEIGHT_OUNCE" - | "IMPERIAL_POUND" - | "IMPERIAL_STONE" - | "METRIC_MILLIGRAM" - | "METRIC_GRAM" - | "METRIC_KILOGRAM"; +/** Unit of weight used to measure a quantity. */ export const MeasurementUnitWeight = { ImperialWeightOunce: "IMPERIAL_WEIGHT_OUNCE", ImperialPound: "IMPERIAL_POUND", @@ -20,3 +9,4 @@ export const MeasurementUnitWeight = { MetricGram: "METRIC_GRAM", MetricKilogram: "METRIC_KILOGRAM", } as const; +export type MeasurementUnitWeight = (typeof MeasurementUnitWeight)[keyof typeof MeasurementUnitWeight]; diff --git a/src/api/types/Merchant.ts b/src/api/types/Merchant.ts index d57d5dff7..9186857cf 100644 --- a/src/api/types/Merchant.ts +++ b/src/api/types/Merchant.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a business that sells with Square. diff --git a/src/api/types/MerchantCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionOwnedCreatedEvent.ts index b0451b41a..c34cd6c54 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionOwnedDeletedEvent.ts index 533e9c170..288c2c92d 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionOwnedUpdatedEvent.ts index 0b18b5657..ca94af6e4 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionVisibleCreatedEvent.ts index 37e808296..d156c07ee 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionVisibleDeletedEvent.ts index 43aba2dd7..722aac024 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionVisibleUpdatedEvent.ts index 078ff840f..32f314470 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeOwnedDeletedEvent.ts b/src/api/types/MerchantCustomAttributeOwnedDeletedEvent.ts index 3c08c957b..eed12edec 100644 --- a/src/api/types/MerchantCustomAttributeOwnedDeletedEvent.ts +++ b/src/api/types/MerchantCustomAttributeOwnedDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/MerchantCustomAttributeOwnedUpdatedEvent.ts b/src/api/types/MerchantCustomAttributeOwnedUpdatedEvent.ts index af81e52f6..2fcf9dea6 100644 --- a/src/api/types/MerchantCustomAttributeOwnedUpdatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeOwnedUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/MerchantCustomAttributeVisibleDeletedEvent.ts b/src/api/types/MerchantCustomAttributeVisibleDeletedEvent.ts index b83c5ad28..3ac1a7efc 100644 --- a/src/api/types/MerchantCustomAttributeVisibleDeletedEvent.ts +++ b/src/api/types/MerchantCustomAttributeVisibleDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant [custom attribute](entity:CustomAttribute) with diff --git a/src/api/types/MerchantCustomAttributeVisibleUpdatedEvent.ts b/src/api/types/MerchantCustomAttributeVisibleUpdatedEvent.ts index 96b485192..5eb632b13 100644 --- a/src/api/types/MerchantCustomAttributeVisibleUpdatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeVisibleUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant [custom attribute](entity:CustomAttribute) with diff --git a/src/api/types/MerchantSettingsUpdatedEvent.ts b/src/api/types/MerchantSettingsUpdatedEvent.ts index 03e615b56..53007ba78 100644 --- a/src/api/types/MerchantSettingsUpdatedEvent.ts +++ b/src/api/types/MerchantSettingsUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when online checkout merchant settings are updated diff --git a/src/api/types/MerchantSettingsUpdatedEventData.ts b/src/api/types/MerchantSettingsUpdatedEventData.ts index e4d739c63..deb5b5eb7 100644 --- a/src/api/types/MerchantSettingsUpdatedEventData.ts +++ b/src/api/types/MerchantSettingsUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface MerchantSettingsUpdatedEventData { /** Name of the updated object’s type, `"online_checkout.merchant_settings"`. */ diff --git a/src/api/types/MerchantSettingsUpdatedEventObject.ts b/src/api/types/MerchantSettingsUpdatedEventObject.ts index 32b98e67b..bf429d7b3 100644 --- a/src/api/types/MerchantSettingsUpdatedEventObject.ts +++ b/src/api/types/MerchantSettingsUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface MerchantSettingsUpdatedEventObject { /** The updated merchant settings. */ diff --git a/src/api/types/MerchantStatus.ts b/src/api/types/MerchantStatus.ts index 5d20496e2..1a4ba9823 100644 --- a/src/api/types/MerchantStatus.ts +++ b/src/api/types/MerchantStatus.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type MerchantStatus = "ACTIVE" | "INACTIVE"; export const MerchantStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; +export type MerchantStatus = (typeof MerchantStatus)[keyof typeof MerchantStatus]; diff --git a/src/api/types/ModifierLocationOverrides.ts b/src/api/types/ModifierLocationOverrides.ts index fc4f18ebd..16f479991 100644 --- a/src/api/types/ModifierLocationOverrides.ts +++ b/src/api/types/ModifierLocationOverrides.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Location-specific overrides for specified properties of a `CatalogModifier` object. diff --git a/src/api/types/Money.ts b/src/api/types/Money.ts index a49a8633f..24000c580 100644 --- a/src/api/types/Money.ts +++ b/src/api/types/Money.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an amount of money. `Money` fields can be signed or unsigned. diff --git a/src/api/types/OauthAuthorizationRevokedEvent.ts b/src/api/types/OauthAuthorizationRevokedEvent.ts index f10413cce..3fafe2327 100644 --- a/src/api/types/OauthAuthorizationRevokedEvent.ts +++ b/src/api/types/OauthAuthorizationRevokedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a merchant/application revokes all access tokens and refresh tokens granted to an application. diff --git a/src/api/types/OauthAuthorizationRevokedEventData.ts b/src/api/types/OauthAuthorizationRevokedEventData.ts index 3cd2ae5da..ba32ecbfe 100644 --- a/src/api/types/OauthAuthorizationRevokedEventData.ts +++ b/src/api/types/OauthAuthorizationRevokedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OauthAuthorizationRevokedEventData { /** Name of the affected object’s type, `"revocation"`. */ diff --git a/src/api/types/OauthAuthorizationRevokedEventObject.ts b/src/api/types/OauthAuthorizationRevokedEventObject.ts index a95fcc143..fe3bcd281 100644 --- a/src/api/types/OauthAuthorizationRevokedEventObject.ts +++ b/src/api/types/OauthAuthorizationRevokedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OauthAuthorizationRevokedEventObject { /** The revocation event. */ diff --git a/src/api/types/OauthAuthorizationRevokedEventRevocationObject.ts b/src/api/types/OauthAuthorizationRevokedEventRevocationObject.ts index e22a2cfe7..7fbcc5dde 100644 --- a/src/api/types/OauthAuthorizationRevokedEventRevocationObject.ts +++ b/src/api/types/OauthAuthorizationRevokedEventRevocationObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OauthAuthorizationRevokedEventRevocationObject { /** Timestamp of when the revocation event occurred, in RFC 3339 format. */ diff --git a/src/api/types/OauthAuthorizationRevokedEventRevokerType.ts b/src/api/types/OauthAuthorizationRevokedEventRevokerType.ts index c4fbb2e47..630abc397 100644 --- a/src/api/types/OauthAuthorizationRevokedEventRevokerType.ts +++ b/src/api/types/OauthAuthorizationRevokedEventRevokerType.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Defines the possible types for the revoking client. - */ -export type OauthAuthorizationRevokedEventRevokerType = "APPLICATION" | "MERCHANT" | "SQUARE"; +/** Defines the possible types for the revoking client. */ export const OauthAuthorizationRevokedEventRevokerType = { Application: "APPLICATION", Merchant: "MERCHANT", Square: "SQUARE", } as const; +export type OauthAuthorizationRevokedEventRevokerType = + (typeof OauthAuthorizationRevokedEventRevokerType)[keyof typeof OauthAuthorizationRevokedEventRevokerType]; diff --git a/src/api/types/ObtainTokenResponse.ts b/src/api/types/ObtainTokenResponse.ts index 743942131..e6df59048 100644 --- a/src/api/types/ObtainTokenResponse.ts +++ b/src/api/types/ObtainTokenResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) response. diff --git a/src/api/types/OfflinePaymentDetails.ts b/src/api/types/OfflinePaymentDetails.ts index d82128b4a..2a9557630 100644 --- a/src/api/types/OfflinePaymentDetails.ts +++ b/src/api/types/OfflinePaymentDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Details specific to offline payments. diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 4445dcd7d..0cf2e9d87 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Contains all information related to a single order to process with Square, diff --git a/src/api/types/OrderCreated.ts b/src/api/types/OrderCreated.ts index fc76f4128..a7970e9b5 100644 --- a/src/api/types/OrderCreated.ts +++ b/src/api/types/OrderCreated.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OrderCreated { /** The order's unique ID. */ diff --git a/src/api/types/OrderCreatedEvent.ts b/src/api/types/OrderCreatedEvent.ts index 27cbad469..d2f8a9d28 100644 --- a/src/api/types/OrderCreatedEvent.ts +++ b/src/api/types/OrderCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an [Order](entity:Order) is created. This event is diff --git a/src/api/types/OrderCreatedEventData.ts b/src/api/types/OrderCreatedEventData.ts index 5cc34d44f..7d441411b 100644 --- a/src/api/types/OrderCreatedEventData.ts +++ b/src/api/types/OrderCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OrderCreatedEventData { /** Name of the affected object’s type, `"order_created"`. */ diff --git a/src/api/types/OrderCreatedObject.ts b/src/api/types/OrderCreatedObject.ts index 228dfb0dc..511e7c7d3 100644 --- a/src/api/types/OrderCreatedObject.ts +++ b/src/api/types/OrderCreatedObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OrderCreatedObject { /** Information about the created order. */ diff --git a/src/api/types/OrderCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionOwnedCreatedEvent.ts index 5f129058a..62796198c 100644 --- a/src/api/types/OrderCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is created. diff --git a/src/api/types/OrderCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionOwnedDeletedEvent.ts index 87c99a7aa..7c727faa8 100644 --- a/src/api/types/OrderCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted. diff --git a/src/api/types/OrderCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionOwnedUpdatedEvent.ts index beeb443d6..57ac895f0 100644 --- a/src/api/types/OrderCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated. diff --git a/src/api/types/OrderCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionVisibleCreatedEvent.ts index 4dddaa8ef..07e79efec 100644 --- a/src/api/types/OrderCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is created. diff --git a/src/api/types/OrderCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionVisibleDeletedEvent.ts index 6b6dc2e5b..40c49028a 100644 --- a/src/api/types/OrderCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is deleted. diff --git a/src/api/types/OrderCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionVisibleUpdatedEvent.ts index 34d7b3031..96435de80 100644 --- a/src/api/types/OrderCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is updated. diff --git a/src/api/types/OrderCustomAttributeOwnedDeletedEvent.ts b/src/api/types/OrderCustomAttributeOwnedDeletedEvent.ts index 3d31e8a36..3a5051f43 100644 --- a/src/api/types/OrderCustomAttributeOwnedDeletedEvent.ts +++ b/src/api/types/OrderCustomAttributeOwnedDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted. diff --git a/src/api/types/OrderCustomAttributeOwnedUpdatedEvent.ts b/src/api/types/OrderCustomAttributeOwnedUpdatedEvent.ts index 0ec5b4d1a..943089041 100644 --- a/src/api/types/OrderCustomAttributeOwnedUpdatedEvent.ts +++ b/src/api/types/OrderCustomAttributeOwnedUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated. diff --git a/src/api/types/OrderCustomAttributeVisibleDeletedEvent.ts b/src/api/types/OrderCustomAttributeVisibleDeletedEvent.ts index 00b526c6f..cc00314b8 100644 --- a/src/api/types/OrderCustomAttributeVisibleDeletedEvent.ts +++ b/src/api/types/OrderCustomAttributeVisibleDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is deleted. diff --git a/src/api/types/OrderCustomAttributeVisibleUpdatedEvent.ts b/src/api/types/OrderCustomAttributeVisibleUpdatedEvent.ts index 55d63c538..e066af656 100644 --- a/src/api/types/OrderCustomAttributeVisibleUpdatedEvent.ts +++ b/src/api/types/OrderCustomAttributeVisibleUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is updated. diff --git a/src/api/types/OrderEntry.ts b/src/api/types/OrderEntry.ts index 1d662c616..3bb18bfa9 100644 --- a/src/api/types/OrderEntry.ts +++ b/src/api/types/OrderEntry.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A lightweight description of an [order](entity:Order) that is returned when diff --git a/src/api/types/OrderFulfillmentDeliveryDetailsScheduleType.ts b/src/api/types/OrderFulfillmentDeliveryDetailsScheduleType.ts index 54fbf5ddc..3adac1a27 100644 --- a/src/api/types/OrderFulfillmentDeliveryDetailsScheduleType.ts +++ b/src/api/types/OrderFulfillmentDeliveryDetailsScheduleType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The schedule type of the delivery fulfillment. - */ -export type OrderFulfillmentDeliveryDetailsScheduleType = "SCHEDULED" | "ASAP"; +/** The schedule type of the delivery fulfillment. */ export const OrderFulfillmentDeliveryDetailsScheduleType = { Scheduled: "SCHEDULED", Asap: "ASAP", } as const; +export type OrderFulfillmentDeliveryDetailsScheduleType = + (typeof OrderFulfillmentDeliveryDetailsScheduleType)[keyof typeof OrderFulfillmentDeliveryDetailsScheduleType]; diff --git a/src/api/types/OrderFulfillmentFulfillmentLineItemApplication.ts b/src/api/types/OrderFulfillmentFulfillmentLineItemApplication.ts index b88f9010b..ee73e91d9 100644 --- a/src/api/types/OrderFulfillmentFulfillmentLineItemApplication.ts +++ b/src/api/types/OrderFulfillmentFulfillmentLineItemApplication.ts @@ -1,13 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The `line_item_application` describes what order line items this fulfillment applies * to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. */ -export type OrderFulfillmentFulfillmentLineItemApplication = "ALL" | "ENTRY_LIST"; export const OrderFulfillmentFulfillmentLineItemApplication = { All: "ALL", EntryList: "ENTRY_LIST", } as const; +export type OrderFulfillmentFulfillmentLineItemApplication = + (typeof OrderFulfillmentFulfillmentLineItemApplication)[keyof typeof OrderFulfillmentFulfillmentLineItemApplication]; diff --git a/src/api/types/OrderFulfillmentPickupDetailsScheduleType.ts b/src/api/types/OrderFulfillmentPickupDetailsScheduleType.ts index 4a4452749..4fb680952 100644 --- a/src/api/types/OrderFulfillmentPickupDetailsScheduleType.ts +++ b/src/api/types/OrderFulfillmentPickupDetailsScheduleType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The schedule type of the pickup fulfillment. - */ -export type OrderFulfillmentPickupDetailsScheduleType = "SCHEDULED" | "ASAP"; +/** The schedule type of the pickup fulfillment. */ export const OrderFulfillmentPickupDetailsScheduleType = { Scheduled: "SCHEDULED", Asap: "ASAP", } as const; +export type OrderFulfillmentPickupDetailsScheduleType = + (typeof OrderFulfillmentPickupDetailsScheduleType)[keyof typeof OrderFulfillmentPickupDetailsScheduleType]; diff --git a/src/api/types/OrderFulfillmentState.ts b/src/api/types/OrderFulfillmentState.ts index ad143297d..51b9e1c2b 100644 --- a/src/api/types/OrderFulfillmentState.ts +++ b/src/api/types/OrderFulfillmentState.ts @@ -1,11 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The current state of this fulfillment. - */ -export type OrderFulfillmentState = "PROPOSED" | "RESERVED" | "PREPARED" | "COMPLETED" | "CANCELED" | "FAILED"; +/** The current state of this fulfillment. */ export const OrderFulfillmentState = { Proposed: "PROPOSED", Reserved: "RESERVED", @@ -14,3 +9,4 @@ export const OrderFulfillmentState = { Canceled: "CANCELED", Failed: "FAILED", } as const; +export type OrderFulfillmentState = (typeof OrderFulfillmentState)[keyof typeof OrderFulfillmentState]; diff --git a/src/api/types/OrderFulfillmentType.ts b/src/api/types/OrderFulfillmentType.ts index ef8e220f5..98f9d65fa 100644 --- a/src/api/types/OrderFulfillmentType.ts +++ b/src/api/types/OrderFulfillmentType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of fulfillment. - */ -export type OrderFulfillmentType = "PICKUP" | "SHIPMENT" | "DELIVERY"; +/** The type of fulfillment. */ export const OrderFulfillmentType = { Pickup: "PICKUP", Shipment: "SHIPMENT", Delivery: "DELIVERY", } as const; +export type OrderFulfillmentType = (typeof OrderFulfillmentType)[keyof typeof OrderFulfillmentType]; diff --git a/src/api/types/OrderFulfillmentUpdated.ts b/src/api/types/OrderFulfillmentUpdated.ts index 088c57d49..181704853 100644 --- a/src/api/types/OrderFulfillmentUpdated.ts +++ b/src/api/types/OrderFulfillmentUpdated.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OrderFulfillmentUpdated { /** The order's unique ID. */ diff --git a/src/api/types/OrderFulfillmentUpdatedEvent.ts b/src/api/types/OrderFulfillmentUpdatedEvent.ts index c396022e6..f6ca77896 100644 --- a/src/api/types/OrderFulfillmentUpdatedEvent.ts +++ b/src/api/types/OrderFulfillmentUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an [OrderFulfillment](entity:OrderFulfillment) diff --git a/src/api/types/OrderFulfillmentUpdatedEventData.ts b/src/api/types/OrderFulfillmentUpdatedEventData.ts index ea8cfcf5e..db6e4eebf 100644 --- a/src/api/types/OrderFulfillmentUpdatedEventData.ts +++ b/src/api/types/OrderFulfillmentUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OrderFulfillmentUpdatedEventData { /** Name of the affected object’s type, `"order_fulfillment_updated"`. */ diff --git a/src/api/types/OrderFulfillmentUpdatedObject.ts b/src/api/types/OrderFulfillmentUpdatedObject.ts index 5c587e29f..b903f4be1 100644 --- a/src/api/types/OrderFulfillmentUpdatedObject.ts +++ b/src/api/types/OrderFulfillmentUpdatedObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OrderFulfillmentUpdatedObject { /** Information about the updated order fulfillment. */ diff --git a/src/api/types/OrderFulfillmentUpdatedUpdate.ts b/src/api/types/OrderFulfillmentUpdatedUpdate.ts index 266b6d6e4..09f752bd6 100644 --- a/src/api/types/OrderFulfillmentUpdatedUpdate.ts +++ b/src/api/types/OrderFulfillmentUpdatedUpdate.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Information about fulfillment updates. diff --git a/src/api/types/OrderLineItem.ts b/src/api/types/OrderLineItem.ts index bba33a54e..8d8d3f4c9 100644 --- a/src/api/types/OrderLineItem.ts +++ b/src/api/types/OrderLineItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a line item in an order. Each line item describes a different diff --git a/src/api/types/OrderLineItemAppliedDiscount.ts b/src/api/types/OrderLineItemAppliedDiscount.ts index fca878465..c66321fc5 100644 --- a/src/api/types/OrderLineItemAppliedDiscount.ts +++ b/src/api/types/OrderLineItemAppliedDiscount.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an applied portion of a discount to a line item in an order. diff --git a/src/api/types/OrderLineItemAppliedServiceCharge.ts b/src/api/types/OrderLineItemAppliedServiceCharge.ts index a33c341e0..3a13d69d2 100644 --- a/src/api/types/OrderLineItemAppliedServiceCharge.ts +++ b/src/api/types/OrderLineItemAppliedServiceCharge.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OrderLineItemAppliedServiceCharge { /** A unique ID that identifies the applied service charge only within this order. */ diff --git a/src/api/types/OrderLineItemAppliedTax.ts b/src/api/types/OrderLineItemAppliedTax.ts index f858e9670..7155dfcc0 100644 --- a/src/api/types/OrderLineItemAppliedTax.ts +++ b/src/api/types/OrderLineItemAppliedTax.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an applied portion of a tax to a line item in an order. diff --git a/src/api/types/OrderLineItemDiscount.ts b/src/api/types/OrderLineItemDiscount.ts index 25778f56b..4ccd30a5a 100644 --- a/src/api/types/OrderLineItemDiscount.ts +++ b/src/api/types/OrderLineItemDiscount.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a discount that applies to one or more line items in an diff --git a/src/api/types/OrderLineItemDiscountScope.ts b/src/api/types/OrderLineItemDiscountScope.ts index 404306970..afcbc5b04 100644 --- a/src/api/types/OrderLineItemDiscountScope.ts +++ b/src/api/types/OrderLineItemDiscountScope.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates whether this is a line-item or order-level discount. - */ -export type OrderLineItemDiscountScope = "OTHER_DISCOUNT_SCOPE" | "LINE_ITEM" | "ORDER"; +/** Indicates whether this is a line-item or order-level discount. */ export const OrderLineItemDiscountScope = { OtherDiscountScope: "OTHER_DISCOUNT_SCOPE", LineItem: "LINE_ITEM", Order: "ORDER", } as const; +export type OrderLineItemDiscountScope = (typeof OrderLineItemDiscountScope)[keyof typeof OrderLineItemDiscountScope]; diff --git a/src/api/types/OrderLineItemDiscountType.ts b/src/api/types/OrderLineItemDiscountType.ts index 09a7154db..dd8a9b3df 100644 --- a/src/api/types/OrderLineItemDiscountType.ts +++ b/src/api/types/OrderLineItemDiscountType.ts @@ -1,16 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates how the discount is applied to the associated line item or order. - */ -export type OrderLineItemDiscountType = - | "UNKNOWN_DISCOUNT" - | "FIXED_PERCENTAGE" - | "FIXED_AMOUNT" - | "VARIABLE_PERCENTAGE" - | "VARIABLE_AMOUNT"; +/** Indicates how the discount is applied to the associated line item or order. */ export const OrderLineItemDiscountType = { UnknownDiscount: "UNKNOWN_DISCOUNT", FixedPercentage: "FIXED_PERCENTAGE", @@ -18,3 +8,4 @@ export const OrderLineItemDiscountType = { VariablePercentage: "VARIABLE_PERCENTAGE", VariableAmount: "VARIABLE_AMOUNT", } as const; +export type OrderLineItemDiscountType = (typeof OrderLineItemDiscountType)[keyof typeof OrderLineItemDiscountType]; diff --git a/src/api/types/OrderLineItemItemType.ts b/src/api/types/OrderLineItemItemType.ts index f41ab1f62..f88e60b28 100644 --- a/src/api/types/OrderLineItemItemType.ts +++ b/src/api/types/OrderLineItemItemType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Represents the line item type. - */ -export type OrderLineItemItemType = "ITEM" | "CUSTOM_AMOUNT" | "GIFT_CARD"; +/** Represents the line item type. */ export const OrderLineItemItemType = { Item: "ITEM", CustomAmount: "CUSTOM_AMOUNT", GiftCard: "GIFT_CARD", } as const; +export type OrderLineItemItemType = (typeof OrderLineItemItemType)[keyof typeof OrderLineItemItemType]; diff --git a/src/api/types/OrderLineItemModifier.ts b/src/api/types/OrderLineItemModifier.ts index c1c4344b6..651192f32 100644 --- a/src/api/types/OrderLineItemModifier.ts +++ b/src/api/types/OrderLineItemModifier.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A [CatalogModifier](entity:CatalogModifier). diff --git a/src/api/types/OrderLineItemPricingBlocklists.ts b/src/api/types/OrderLineItemPricingBlocklists.ts index 68ac4f5f9..327e37b1a 100644 --- a/src/api/types/OrderLineItemPricingBlocklists.ts +++ b/src/api/types/OrderLineItemPricingBlocklists.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes pricing adjustments that are blocked from automatic diff --git a/src/api/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts b/src/api/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts index 6a89a96d9..183293b8c 100644 --- a/src/api/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts +++ b/src/api/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A discount to block from applying to a line item. The discount must be diff --git a/src/api/types/OrderLineItemPricingBlocklistsBlockedTax.ts b/src/api/types/OrderLineItemPricingBlocklistsBlockedTax.ts index d6fe3da17..c51dcd6c7 100644 --- a/src/api/types/OrderLineItemPricingBlocklistsBlockedTax.ts +++ b/src/api/types/OrderLineItemPricingBlocklistsBlockedTax.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A tax to block from applying to a line item. The tax must be diff --git a/src/api/types/OrderLineItemTax.ts b/src/api/types/OrderLineItemTax.ts index 350cca4f6..46f8582a5 100644 --- a/src/api/types/OrderLineItemTax.ts +++ b/src/api/types/OrderLineItemTax.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a tax that applies to one or more line item in the order. diff --git a/src/api/types/OrderLineItemTaxScope.ts b/src/api/types/OrderLineItemTaxScope.ts index 64efb16ba..a6a36051f 100644 --- a/src/api/types/OrderLineItemTaxScope.ts +++ b/src/api/types/OrderLineItemTaxScope.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates whether this is a line-item or order-level tax. - */ -export type OrderLineItemTaxScope = "OTHER_TAX_SCOPE" | "LINE_ITEM" | "ORDER"; +/** Indicates whether this is a line-item or order-level tax. */ export const OrderLineItemTaxScope = { OtherTaxScope: "OTHER_TAX_SCOPE", LineItem: "LINE_ITEM", Order: "ORDER", } as const; +export type OrderLineItemTaxScope = (typeof OrderLineItemTaxScope)[keyof typeof OrderLineItemTaxScope]; diff --git a/src/api/types/OrderLineItemTaxType.ts b/src/api/types/OrderLineItemTaxType.ts index 12143f5b0..4e8ed8120 100644 --- a/src/api/types/OrderLineItemTaxType.ts +++ b/src/api/types/OrderLineItemTaxType.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates how the tax is applied to the associated line item or order. - */ -export type OrderLineItemTaxType = "UNKNOWN_TAX" | "ADDITIVE" | "INCLUSIVE"; +/** Indicates how the tax is applied to the associated line item or order. */ export const OrderLineItemTaxType = { UnknownTax: "UNKNOWN_TAX", Additive: "ADDITIVE", Inclusive: "INCLUSIVE", } as const; +export type OrderLineItemTaxType = (typeof OrderLineItemTaxType)[keyof typeof OrderLineItemTaxType]; diff --git a/src/api/types/OrderMoneyAmounts.ts b/src/api/types/OrderMoneyAmounts.ts index 39a9d1a5c..392c29114 100644 --- a/src/api/types/OrderMoneyAmounts.ts +++ b/src/api/types/OrderMoneyAmounts.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A collection of various money amounts. diff --git a/src/api/types/OrderPricingOptions.ts b/src/api/types/OrderPricingOptions.ts index b93c380b2..c2ef0930a 100644 --- a/src/api/types/OrderPricingOptions.ts +++ b/src/api/types/OrderPricingOptions.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Pricing options for an order. The options affect how the order's price is calculated. diff --git a/src/api/types/OrderQuantityUnit.ts b/src/api/types/OrderQuantityUnit.ts index a8a12af82..c66952738 100644 --- a/src/api/types/OrderQuantityUnit.ts +++ b/src/api/types/OrderQuantityUnit.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Contains the measurement unit for a quantity and a precision that diff --git a/src/api/types/OrderReturn.ts b/src/api/types/OrderReturn.ts index 81654aaa2..ec48967bd 100644 --- a/src/api/types/OrderReturn.ts +++ b/src/api/types/OrderReturn.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order. diff --git a/src/api/types/OrderReturnDiscount.ts b/src/api/types/OrderReturnDiscount.ts index 7df41273b..f5b6e2327 100644 --- a/src/api/types/OrderReturnDiscount.ts +++ b/src/api/types/OrderReturnDiscount.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a discount being returned that applies to one or more return line items in an diff --git a/src/api/types/OrderReturnLineItem.ts b/src/api/types/OrderReturnLineItem.ts index 94f42b8e1..19972e2e1 100644 --- a/src/api/types/OrderReturnLineItem.ts +++ b/src/api/types/OrderReturnLineItem.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The line item being returned in an order. diff --git a/src/api/types/OrderReturnLineItemModifier.ts b/src/api/types/OrderReturnLineItemModifier.ts index 91f5a1fe0..af6222bd7 100644 --- a/src/api/types/OrderReturnLineItemModifier.ts +++ b/src/api/types/OrderReturnLineItemModifier.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A line item modifier being returned. diff --git a/src/api/types/OrderReturnServiceCharge.ts b/src/api/types/OrderReturnServiceCharge.ts index 6e55c018a..0dbd5c652 100644 --- a/src/api/types/OrderReturnServiceCharge.ts +++ b/src/api/types/OrderReturnServiceCharge.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the service charge applied to the original order. diff --git a/src/api/types/OrderReturnTax.ts b/src/api/types/OrderReturnTax.ts index 62c7ba5f0..bc998bfc2 100644 --- a/src/api/types/OrderReturnTax.ts +++ b/src/api/types/OrderReturnTax.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a tax being returned that applies to one or more return line items in an order. diff --git a/src/api/types/OrderReturnTip.ts b/src/api/types/OrderReturnTip.ts index 3031cee77..494dae732 100644 --- a/src/api/types/OrderReturnTip.ts +++ b/src/api/types/OrderReturnTip.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A tip being returned. diff --git a/src/api/types/OrderReward.ts b/src/api/types/OrderReward.ts index 2ee82beb8..ea237d510 100644 --- a/src/api/types/OrderReward.ts +++ b/src/api/types/OrderReward.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a reward that can be applied to an order if the necessary diff --git a/src/api/types/OrderRoundingAdjustment.ts b/src/api/types/OrderRoundingAdjustment.ts index b14027bf6..1755d82d2 100644 --- a/src/api/types/OrderRoundingAdjustment.ts +++ b/src/api/types/OrderRoundingAdjustment.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A rounding adjustment of the money being returned. Commonly used to apply cash rounding diff --git a/src/api/types/OrderServiceCharge.ts b/src/api/types/OrderServiceCharge.ts index bbf802c55..a1bde321a 100644 --- a/src/api/types/OrderServiceCharge.ts +++ b/src/api/types/OrderServiceCharge.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a service charge applied to an order. diff --git a/src/api/types/OrderServiceChargeCalculationPhase.ts b/src/api/types/OrderServiceChargeCalculationPhase.ts index d267e2ede..691b929c0 100644 --- a/src/api/types/OrderServiceChargeCalculationPhase.ts +++ b/src/api/types/OrderServiceChargeCalculationPhase.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a phase in the process of calculating order totals. @@ -8,14 +6,11 @@ * * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) */ -export type OrderServiceChargeCalculationPhase = - | "SUBTOTAL_PHASE" - | "TOTAL_PHASE" - | "APPORTIONED_PERCENTAGE_PHASE" - | "APPORTIONED_AMOUNT_PHASE"; export const OrderServiceChargeCalculationPhase = { SubtotalPhase: "SUBTOTAL_PHASE", TotalPhase: "TOTAL_PHASE", ApportionedPercentagePhase: "APPORTIONED_PERCENTAGE_PHASE", ApportionedAmountPhase: "APPORTIONED_AMOUNT_PHASE", } as const; +export type OrderServiceChargeCalculationPhase = + (typeof OrderServiceChargeCalculationPhase)[keyof typeof OrderServiceChargeCalculationPhase]; diff --git a/src/api/types/OrderServiceChargeScope.ts b/src/api/types/OrderServiceChargeScope.ts index fdd81f87f..25f159675 100644 --- a/src/api/types/OrderServiceChargeScope.ts +++ b/src/api/types/OrderServiceChargeScope.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates whether this is a line-item or order-level apportioned * service charge. */ -export type OrderServiceChargeScope = "OTHER_SERVICE_CHARGE_SCOPE" | "LINE_ITEM" | "ORDER"; export const OrderServiceChargeScope = { OtherServiceChargeScope: "OTHER_SERVICE_CHARGE_SCOPE", LineItem: "LINE_ITEM", Order: "ORDER", } as const; +export type OrderServiceChargeScope = (typeof OrderServiceChargeScope)[keyof typeof OrderServiceChargeScope]; diff --git a/src/api/types/OrderServiceChargeTreatmentType.ts b/src/api/types/OrderServiceChargeTreatmentType.ts index 212f2d39a..9b03a9e2a 100644 --- a/src/api/types/OrderServiceChargeTreatmentType.ts +++ b/src/api/types/OrderServiceChargeTreatmentType.ts @@ -1,13 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates whether the service charge will be treated as a value-holding line item or * apportioned toward a line item. */ -export type OrderServiceChargeTreatmentType = "LINE_ITEM_TREATMENT" | "APPORTIONED_TREATMENT"; export const OrderServiceChargeTreatmentType = { LineItemTreatment: "LINE_ITEM_TREATMENT", ApportionedTreatment: "APPORTIONED_TREATMENT", } as const; +export type OrderServiceChargeTreatmentType = + (typeof OrderServiceChargeTreatmentType)[keyof typeof OrderServiceChargeTreatmentType]; diff --git a/src/api/types/OrderServiceChargeType.ts b/src/api/types/OrderServiceChargeType.ts index 960b13973..79cc106e5 100644 --- a/src/api/types/OrderServiceChargeType.ts +++ b/src/api/types/OrderServiceChargeType.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type OrderServiceChargeType = "AUTO_GRATUITY" | "CUSTOM"; export const OrderServiceChargeType = { AutoGratuity: "AUTO_GRATUITY", Custom: "CUSTOM", } as const; +export type OrderServiceChargeType = (typeof OrderServiceChargeType)[keyof typeof OrderServiceChargeType]; diff --git a/src/api/types/OrderSource.ts b/src/api/types/OrderSource.ts index c02c1400e..291732685 100644 --- a/src/api/types/OrderSource.ts +++ b/src/api/types/OrderSource.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the origination details of an order. diff --git a/src/api/types/OrderState.ts b/src/api/types/OrderState.ts index 545810af4..46d15ac38 100644 --- a/src/api/types/OrderState.ts +++ b/src/api/types/OrderState.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The state of the order. - */ -export type OrderState = "OPEN" | "COMPLETED" | "CANCELED" | "DRAFT"; +/** The state of the order. */ export const OrderState = { Open: "OPEN", Completed: "COMPLETED", Canceled: "CANCELED", Draft: "DRAFT", } as const; +export type OrderState = (typeof OrderState)[keyof typeof OrderState]; diff --git a/src/api/types/OrderUpdated.ts b/src/api/types/OrderUpdated.ts index e9d9371d4..31d7d1d0f 100644 --- a/src/api/types/OrderUpdated.ts +++ b/src/api/types/OrderUpdated.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OrderUpdated { /** The order's unique ID. */ diff --git a/src/api/types/OrderUpdatedEvent.ts b/src/api/types/OrderUpdatedEvent.ts index 99045bcbb..27be5a81f 100644 --- a/src/api/types/OrderUpdatedEvent.ts +++ b/src/api/types/OrderUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when an [Order](entity:Order) is updated. This diff --git a/src/api/types/OrderUpdatedEventData.ts b/src/api/types/OrderUpdatedEventData.ts index a077e59f3..6f23ba764 100644 --- a/src/api/types/OrderUpdatedEventData.ts +++ b/src/api/types/OrderUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OrderUpdatedEventData { /** Name of the affected object’s type, `"order_updated"`. */ diff --git a/src/api/types/OrderUpdatedObject.ts b/src/api/types/OrderUpdatedObject.ts index 476a7ad60..edd29a9f2 100644 --- a/src/api/types/OrderUpdatedObject.ts +++ b/src/api/types/OrderUpdatedObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface OrderUpdatedObject { /** Information about the updated order. */ diff --git a/src/api/types/PauseSubscriptionResponse.ts b/src/api/types/PauseSubscriptionResponse.ts index 0a0c66a4d..b3f43b1c3 100644 --- a/src/api/types/PauseSubscriptionResponse.ts +++ b/src/api/types/PauseSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/PayOrderResponse.ts b/src/api/types/PayOrderResponse.ts index a1618a8f1..7d01111fb 100644 --- a/src/api/types/PayOrderResponse.ts +++ b/src/api/types/PayOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of a request to the diff --git a/src/api/types/Payment.ts b/src/api/types/Payment.ts index d1cf0a162..2ffb66b93 100644 --- a/src/api/types/Payment.ts +++ b/src/api/types/Payment.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a payment processed by the Square API. diff --git a/src/api/types/PaymentBalanceActivityAppFeeRefundDetail.ts b/src/api/types/PaymentBalanceActivityAppFeeRefundDetail.ts index 8ae3e35b9..fe7e8c709 100644 --- a/src/api/types/PaymentBalanceActivityAppFeeRefundDetail.ts +++ b/src/api/types/PaymentBalanceActivityAppFeeRefundDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityAppFeeRefundDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityAppFeeRevenueDetail.ts b/src/api/types/PaymentBalanceActivityAppFeeRevenueDetail.ts index 3365241f6..dbfc182fa 100644 --- a/src/api/types/PaymentBalanceActivityAppFeeRevenueDetail.ts +++ b/src/api/types/PaymentBalanceActivityAppFeeRevenueDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityAppFeeRevenueDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityAutomaticSavingsDetail.ts b/src/api/types/PaymentBalanceActivityAutomaticSavingsDetail.ts index d74597394..73f56e403 100644 --- a/src/api/types/PaymentBalanceActivityAutomaticSavingsDetail.ts +++ b/src/api/types/PaymentBalanceActivityAutomaticSavingsDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityAutomaticSavingsDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts b/src/api/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts index 2d37f5c08..357fe484a 100644 --- a/src/api/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts +++ b/src/api/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityAutomaticSavingsReversedDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityChargeDetail.ts b/src/api/types/PaymentBalanceActivityChargeDetail.ts index 9c0ebb78b..51b2d4336 100644 --- a/src/api/types/PaymentBalanceActivityChargeDetail.ts +++ b/src/api/types/PaymentBalanceActivityChargeDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityChargeDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityDepositFeeDetail.ts b/src/api/types/PaymentBalanceActivityDepositFeeDetail.ts index 1c2b38a39..521cd17dd 100644 --- a/src/api/types/PaymentBalanceActivityDepositFeeDetail.ts +++ b/src/api/types/PaymentBalanceActivityDepositFeeDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityDepositFeeDetail { /** The ID of the payout that triggered this deposit fee activity. */ diff --git a/src/api/types/PaymentBalanceActivityDepositFeeReversedDetail.ts b/src/api/types/PaymentBalanceActivityDepositFeeReversedDetail.ts index 0c14b36ce..2c53bf092 100644 --- a/src/api/types/PaymentBalanceActivityDepositFeeReversedDetail.ts +++ b/src/api/types/PaymentBalanceActivityDepositFeeReversedDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityDepositFeeReversedDetail { /** The ID of the payout that triggered this deposit fee activity. */ diff --git a/src/api/types/PaymentBalanceActivityDisputeDetail.ts b/src/api/types/PaymentBalanceActivityDisputeDetail.ts index d8650ce27..6a608a2df 100644 --- a/src/api/types/PaymentBalanceActivityDisputeDetail.ts +++ b/src/api/types/PaymentBalanceActivityDisputeDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityDisputeDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityFeeDetail.ts b/src/api/types/PaymentBalanceActivityFeeDetail.ts index 0a718c269..08a7997dc 100644 --- a/src/api/types/PaymentBalanceActivityFeeDetail.ts +++ b/src/api/types/PaymentBalanceActivityFeeDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityFeeDetail { /** diff --git a/src/api/types/PaymentBalanceActivityFreeProcessingDetail.ts b/src/api/types/PaymentBalanceActivityFreeProcessingDetail.ts index 80871927f..369a63e9d 100644 --- a/src/api/types/PaymentBalanceActivityFreeProcessingDetail.ts +++ b/src/api/types/PaymentBalanceActivityFreeProcessingDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityFreeProcessingDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityHoldAdjustmentDetail.ts b/src/api/types/PaymentBalanceActivityHoldAdjustmentDetail.ts index cabfda713..ee00c3599 100644 --- a/src/api/types/PaymentBalanceActivityHoldAdjustmentDetail.ts +++ b/src/api/types/PaymentBalanceActivityHoldAdjustmentDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityHoldAdjustmentDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityOpenDisputeDetail.ts b/src/api/types/PaymentBalanceActivityOpenDisputeDetail.ts index 5a6a4e388..5d9a121c7 100644 --- a/src/api/types/PaymentBalanceActivityOpenDisputeDetail.ts +++ b/src/api/types/PaymentBalanceActivityOpenDisputeDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityOpenDisputeDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityOtherAdjustmentDetail.ts b/src/api/types/PaymentBalanceActivityOtherAdjustmentDetail.ts index 9a23c3c21..f31c8837d 100644 --- a/src/api/types/PaymentBalanceActivityOtherAdjustmentDetail.ts +++ b/src/api/types/PaymentBalanceActivityOtherAdjustmentDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityOtherAdjustmentDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityOtherDetail.ts b/src/api/types/PaymentBalanceActivityOtherDetail.ts index ca0c2015e..7b0fb2df0 100644 --- a/src/api/types/PaymentBalanceActivityOtherDetail.ts +++ b/src/api/types/PaymentBalanceActivityOtherDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityOtherDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityRefundDetail.ts b/src/api/types/PaymentBalanceActivityRefundDetail.ts index edf5fbeac..b764b3124 100644 --- a/src/api/types/PaymentBalanceActivityRefundDetail.ts +++ b/src/api/types/PaymentBalanceActivityRefundDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityRefundDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts b/src/api/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts index 1264c364b..3a89dff18 100644 --- a/src/api/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts +++ b/src/api/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityReleaseAdjustmentDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityReserveHoldDetail.ts b/src/api/types/PaymentBalanceActivityReserveHoldDetail.ts index 8aa150e24..42beb6fe9 100644 --- a/src/api/types/PaymentBalanceActivityReserveHoldDetail.ts +++ b/src/api/types/PaymentBalanceActivityReserveHoldDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityReserveHoldDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityReserveReleaseDetail.ts b/src/api/types/PaymentBalanceActivityReserveReleaseDetail.ts index 11999dd2d..84920cfc2 100644 --- a/src/api/types/PaymentBalanceActivityReserveReleaseDetail.ts +++ b/src/api/types/PaymentBalanceActivityReserveReleaseDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityReserveReleaseDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts b/src/api/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts index faea6cc0a..cd03eac04 100644 --- a/src/api/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts +++ b/src/api/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivitySquareCapitalPaymentDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts b/src/api/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts index b906d7614..a5233e729 100644 --- a/src/api/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts +++ b/src/api/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivitySquareCapitalReversedPaymentDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts b/src/api/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts index 16740b83c..2ac11ccf9 100644 --- a/src/api/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts +++ b/src/api/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivitySquarePayrollTransferDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts b/src/api/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts index 9746b2c10..b9f711f00 100644 --- a/src/api/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts +++ b/src/api/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivitySquarePayrollTransferReversedDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityTaxOnFeeDetail.ts b/src/api/types/PaymentBalanceActivityTaxOnFeeDetail.ts index b85595f25..50c870230 100644 --- a/src/api/types/PaymentBalanceActivityTaxOnFeeDetail.ts +++ b/src/api/types/PaymentBalanceActivityTaxOnFeeDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityTaxOnFeeDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityThirdPartyFeeDetail.ts b/src/api/types/PaymentBalanceActivityThirdPartyFeeDetail.ts index 9f3e4172a..2b32a9c30 100644 --- a/src/api/types/PaymentBalanceActivityThirdPartyFeeDetail.ts +++ b/src/api/types/PaymentBalanceActivityThirdPartyFeeDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityThirdPartyFeeDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts b/src/api/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts index e84a88472..dbd7b0d1e 100644 --- a/src/api/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts +++ b/src/api/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface PaymentBalanceActivityThirdPartyFeeRefundDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentCreatedEvent.ts b/src/api/types/PaymentCreatedEvent.ts index 3e865157b..e5e144255 100644 --- a/src/api/types/PaymentCreatedEvent.ts +++ b/src/api/types/PaymentCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Payment](entity:Payment) is created. diff --git a/src/api/types/PaymentCreatedEventData.ts b/src/api/types/PaymentCreatedEventData.ts index 39936a8d2..f773b246c 100644 --- a/src/api/types/PaymentCreatedEventData.ts +++ b/src/api/types/PaymentCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PaymentCreatedEventData { /** Name of the affected object’s type, `"payment"`. */ diff --git a/src/api/types/PaymentCreatedEventObject.ts b/src/api/types/PaymentCreatedEventObject.ts index 6fe3ce9c8..ce5650c34 100644 --- a/src/api/types/PaymentCreatedEventObject.ts +++ b/src/api/types/PaymentCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PaymentCreatedEventObject { /** The created payment. */ diff --git a/src/api/types/PaymentLink.ts b/src/api/types/PaymentLink.ts index 65ddee385..25d12ad28 100644 --- a/src/api/types/PaymentLink.ts +++ b/src/api/types/PaymentLink.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PaymentLink { /** The Square-assigned ID of the payment link. */ diff --git a/src/api/types/PaymentLinkRelatedResources.ts b/src/api/types/PaymentLinkRelatedResources.ts index 1161d468d..2530fe7b7 100644 --- a/src/api/types/PaymentLinkRelatedResources.ts +++ b/src/api/types/PaymentLinkRelatedResources.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PaymentLinkRelatedResources { /** The order associated with the payment link. */ diff --git a/src/api/types/PaymentOptions.ts b/src/api/types/PaymentOptions.ts index b1ad4dbad..60bcf1f03 100644 --- a/src/api/types/PaymentOptions.ts +++ b/src/api/types/PaymentOptions.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PaymentOptions { /** diff --git a/src/api/types/PaymentOptionsDelayAction.ts b/src/api/types/PaymentOptionsDelayAction.ts index 4b485f015..0deb6463e 100644 --- a/src/api/types/PaymentOptionsDelayAction.ts +++ b/src/api/types/PaymentOptionsDelayAction.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Describes the action to be applied to a delayed capture payment when the delay_duration * has elapsed. */ -export type PaymentOptionsDelayAction = "CANCEL" | "COMPLETE"; export const PaymentOptionsDelayAction = { Cancel: "CANCEL", Complete: "COMPLETE", } as const; +export type PaymentOptionsDelayAction = (typeof PaymentOptionsDelayAction)[keyof typeof PaymentOptionsDelayAction]; diff --git a/src/api/types/PaymentRefund.ts b/src/api/types/PaymentRefund.ts index 7118cb959..a71e28dd2 100644 --- a/src/api/types/PaymentRefund.ts +++ b/src/api/types/PaymentRefund.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a refund of a payment made using Square. Contains information about diff --git a/src/api/types/PaymentUpdatedEvent.ts b/src/api/types/PaymentUpdatedEvent.ts index 60a30a58c..6a16d4e1d 100644 --- a/src/api/types/PaymentUpdatedEvent.ts +++ b/src/api/types/PaymentUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Payment](entity:Payment) is updated. diff --git a/src/api/types/PaymentUpdatedEventData.ts b/src/api/types/PaymentUpdatedEventData.ts index 69310b4da..05d2da047 100644 --- a/src/api/types/PaymentUpdatedEventData.ts +++ b/src/api/types/PaymentUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PaymentUpdatedEventData { /** Name of the affected object’s type, `"payment"`. */ diff --git a/src/api/types/PaymentUpdatedEventObject.ts b/src/api/types/PaymentUpdatedEventObject.ts index 4c3d2fc5b..0db9f5b4f 100644 --- a/src/api/types/PaymentUpdatedEventObject.ts +++ b/src/api/types/PaymentUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PaymentUpdatedEventObject { /** The updated payment. */ diff --git a/src/api/types/Payout.ts b/src/api/types/Payout.ts index bd8aa5bfe..29ade4744 100644 --- a/src/api/types/Payout.ts +++ b/src/api/types/Payout.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An accounting of the amount owed the seller and record of the actual transfer to their diff --git a/src/api/types/PayoutEntry.ts b/src/api/types/PayoutEntry.ts index 50311ca45..c5d426186 100644 --- a/src/api/types/PayoutEntry.ts +++ b/src/api/types/PayoutEntry.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * One or more PayoutEntries that make up a Payout. Each one has a date, amount, and type of activity. diff --git a/src/api/types/PayoutFailedEvent.ts b/src/api/types/PayoutFailedEvent.ts index 02b523dec..00b383ca4 100644 --- a/src/api/types/PayoutFailedEvent.ts +++ b/src/api/types/PayoutFailedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Payout](entity:Payout) has failed. diff --git a/src/api/types/PayoutFailedEventData.ts b/src/api/types/PayoutFailedEventData.ts index c81cca237..515ce8cee 100644 --- a/src/api/types/PayoutFailedEventData.ts +++ b/src/api/types/PayoutFailedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PayoutFailedEventData { /** The name of the affected object's type, `payout`. */ diff --git a/src/api/types/PayoutFailedEventObject.ts b/src/api/types/PayoutFailedEventObject.ts index 92a5df18a..aa2a68d4a 100644 --- a/src/api/types/PayoutFailedEventObject.ts +++ b/src/api/types/PayoutFailedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PayoutFailedEventObject { /** The payout that failed. */ diff --git a/src/api/types/PayoutFee.ts b/src/api/types/PayoutFee.ts index 0535fc9c8..d0c0988dd 100644 --- a/src/api/types/PayoutFee.ts +++ b/src/api/types/PayoutFee.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a payout fee that can incur as part of a payout. diff --git a/src/api/types/PayoutFeeType.ts b/src/api/types/PayoutFeeType.ts index ff40804b9..695fae7b1 100644 --- a/src/api/types/PayoutFeeType.ts +++ b/src/api/types/PayoutFeeType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Represents the type of payout fee that can incur as part of a payout. - */ -export type PayoutFeeType = "TRANSFER_FEE" | "TAX_ON_TRANSFER_FEE"; +/** Represents the type of payout fee that can incur as part of a payout. */ export const PayoutFeeType = { TransferFee: "TRANSFER_FEE", TaxOnTransferFee: "TAX_ON_TRANSFER_FEE", } as const; +export type PayoutFeeType = (typeof PayoutFeeType)[keyof typeof PayoutFeeType]; diff --git a/src/api/types/PayoutPaidEvent.ts b/src/api/types/PayoutPaidEvent.ts index b781c6cdf..45791f04c 100644 --- a/src/api/types/PayoutPaidEvent.ts +++ b/src/api/types/PayoutPaidEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Payout](entity:Payout) is complete. diff --git a/src/api/types/PayoutPaidEventData.ts b/src/api/types/PayoutPaidEventData.ts index f91bfda41..d59a52f14 100644 --- a/src/api/types/PayoutPaidEventData.ts +++ b/src/api/types/PayoutPaidEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PayoutPaidEventData { /** Name of the affected object’s type, `"payout"`. */ diff --git a/src/api/types/PayoutPaidEventObject.ts b/src/api/types/PayoutPaidEventObject.ts index 295d4d3a8..bd57ba64d 100644 --- a/src/api/types/PayoutPaidEventObject.ts +++ b/src/api/types/PayoutPaidEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PayoutPaidEventObject { /** The payout that has completed. */ diff --git a/src/api/types/PayoutSentEvent.ts b/src/api/types/PayoutSentEvent.ts index 8a6bd6f40..a38d1e0c4 100644 --- a/src/api/types/PayoutSentEvent.ts +++ b/src/api/types/PayoutSentEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Payout](entity:Payout) is sent. diff --git a/src/api/types/PayoutSentEventData.ts b/src/api/types/PayoutSentEventData.ts index 5882f125e..a4ad4c807 100644 --- a/src/api/types/PayoutSentEventData.ts +++ b/src/api/types/PayoutSentEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PayoutSentEventData { /** Name of the affected object’s type, `"payout"`. */ diff --git a/src/api/types/PayoutSentEventObject.ts b/src/api/types/PayoutSentEventObject.ts index d776568b3..5baa39e20 100644 --- a/src/api/types/PayoutSentEventObject.ts +++ b/src/api/types/PayoutSentEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface PayoutSentEventObject { /** The payout that was sent. */ diff --git a/src/api/types/PayoutStatus.ts b/src/api/types/PayoutStatus.ts index 47fc558fb..aefff4e4c 100644 --- a/src/api/types/PayoutStatus.ts +++ b/src/api/types/PayoutStatus.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Payout status types - */ -export type PayoutStatus = "SENT" | "FAILED" | "PAID"; +/** Payout status types */ export const PayoutStatus = { Sent: "SENT", Failed: "FAILED", Paid: "PAID", } as const; +export type PayoutStatus = (typeof PayoutStatus)[keyof typeof PayoutStatus]; diff --git a/src/api/types/PayoutType.ts b/src/api/types/PayoutType.ts index d1a6a078f..1bd72308f 100644 --- a/src/api/types/PayoutType.ts +++ b/src/api/types/PayoutType.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The type of payout: “BATCH” or “SIMPLE”. @@ -8,8 +6,8 @@ * SIMPLE payouts do not have any payout entries associated with them * and will show up as one of the payout entries in a future BATCH payout. */ -export type PayoutType = "BATCH" | "SIMPLE"; export const PayoutType = { Batch: "BATCH", Simple: "SIMPLE", } as const; +export type PayoutType = (typeof PayoutType)[keyof typeof PayoutType]; diff --git a/src/api/types/Phase.ts b/src/api/types/Phase.ts index f3e728a97..410a283d8 100644 --- a/src/api/types/Phase.ts +++ b/src/api/types/Phase.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a phase, which can override subscription phases as defined by plan_id diff --git a/src/api/types/PhaseInput.ts b/src/api/types/PhaseInput.ts index 6337c2d0c..6d6b73095 100644 --- a/src/api/types/PhaseInput.ts +++ b/src/api/types/PhaseInput.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the arguments used to construct a new phase. diff --git a/src/api/types/PrePopulatedData.ts b/src/api/types/PrePopulatedData.ts index c44aa1414..6bc23a826 100644 --- a/src/api/types/PrePopulatedData.ts +++ b/src/api/types/PrePopulatedData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes buyer data to prepopulate in the payment form. diff --git a/src/api/types/ProcessingFee.ts b/src/api/types/ProcessingFee.ts index cc656115c..0ba26f94c 100644 --- a/src/api/types/ProcessingFee.ts +++ b/src/api/types/ProcessingFee.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the Square processing fee. diff --git a/src/api/types/Product.ts b/src/api/types/Product.ts index 4255aff87..e2b30dfad 100644 --- a/src/api/types/Product.ts +++ b/src/api/types/Product.ts @@ -1,21 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the Square product used to generate a change. - */ -export type Product = - | "SQUARE_POS" - | "EXTERNAL_API" - | "BILLING" - | "APPOINTMENTS" - | "INVOICES" - | "ONLINE_STORE" - | "PAYROLL" - | "DASHBOARD" - | "ITEM_LIBRARY_IMPORT" - | "OTHER"; +/** Indicates the Square product used to generate a change. */ export const Product = { SquarePos: "SQUARE_POS", ExternalApi: "EXTERNAL_API", @@ -28,3 +13,4 @@ export const Product = { ItemLibraryImport: "ITEM_LIBRARY_IMPORT", Other: "OTHER", } as const; +export type Product = (typeof Product)[keyof typeof Product]; diff --git a/src/api/types/ProductType.ts b/src/api/types/ProductType.ts index 8eb954886..0c279973d 100644 --- a/src/api/types/ProductType.ts +++ b/src/api/types/ProductType.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type ProductType = "TERMINAL_API"; diff --git a/src/api/types/PublishInvoiceResponse.ts b/src/api/types/PublishInvoiceResponse.ts index bdbf60710..88ffd3fa1 100644 --- a/src/api/types/PublishInvoiceResponse.ts +++ b/src/api/types/PublishInvoiceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a `PublishInvoice` response. diff --git a/src/api/types/PublishScheduledShiftResponse.ts b/src/api/types/PublishScheduledShiftResponse.ts index daaa7dcb3..7da53fa91 100644 --- a/src/api/types/PublishScheduledShiftResponse.ts +++ b/src/api/types/PublishScheduledShiftResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) response. diff --git a/src/api/types/QrCodeOptions.ts b/src/api/types/QrCodeOptions.ts index ab7e8b989..33df8e64b 100644 --- a/src/api/types/QrCodeOptions.ts +++ b/src/api/types/QrCodeOptions.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Fields to describe the action that displays QR-Codes. diff --git a/src/api/types/QuickPay.ts b/src/api/types/QuickPay.ts index f0ac1d1d6..293e4b0a4 100644 --- a/src/api/types/QuickPay.ts +++ b/src/api/types/QuickPay.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes an ad hoc item and price to generate a quick pay checkout link. diff --git a/src/api/types/Range.ts b/src/api/types/Range.ts index 041ac1f84..e0f63ca94 100644 --- a/src/api/types/Range.ts +++ b/src/api/types/Range.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The range of a number value between the specified lower and upper bounds. diff --git a/src/api/types/ReceiptOptions.ts b/src/api/types/ReceiptOptions.ts index 28a17e87f..041b94979 100644 --- a/src/api/types/ReceiptOptions.ts +++ b/src/api/types/ReceiptOptions.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Describes receipt action fields. diff --git a/src/api/types/ReceiveTransferOrderResponse.ts b/src/api/types/ReceiveTransferOrderResponse.ts index 090bfc4e6..4dfa8255e 100644 --- a/src/api/types/ReceiveTransferOrderResponse.ts +++ b/src/api/types/ReceiveTransferOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response for receiving items for a transfer order diff --git a/src/api/types/RedeemLoyaltyRewardResponse.ts b/src/api/types/RedeemLoyaltyRewardResponse.ts index b3233091b..714b7c0dd 100644 --- a/src/api/types/RedeemLoyaltyRewardResponse.ts +++ b/src/api/types/RedeemLoyaltyRewardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that includes the `LoyaltyEvent` published for redeeming the reward. diff --git a/src/api/types/Reference.ts b/src/api/types/Reference.ts index 414e8e515..a9ae1dee8 100644 --- a/src/api/types/Reference.ts +++ b/src/api/types/Reference.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface Reference { /** diff --git a/src/api/types/ReferenceType.ts b/src/api/types/ReferenceType.ts index 0dd9de135..7ba9b25e5 100644 --- a/src/api/types/ReferenceType.ts +++ b/src/api/types/ReferenceType.ts @@ -1,26 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The type of platform concept a channel can represent. - */ -export type ReferenceType = - | "UNKNOWN_TYPE" - | "LOCATION" - | "FIRST_PARTY_INTEGRATION" - | "OAUTH_APPLICATION" - | "ONLINE_SITE" - | "ONLINE_CHECKOUT" - | "INVOICE" - | "GIFT_CARD" - | "GIFT_CARD_MARKETPLACE" - | "RECURRING_SUBSCRIPTION" - | "ONLINE_BOOKING_FLOW" - | "SQUARE_ASSISTANT" - | "CASH_LOCAL" - | "POINT_OF_SALE" - | "KIOSK"; +/** The type of platform concept a channel can represent. */ export const ReferenceType = { UnknownType: "UNKNOWN_TYPE", Location: "LOCATION", @@ -38,3 +18,4 @@ export const ReferenceType = { PointOfSale: "POINT_OF_SALE", Kiosk: "KIOSK", } as const; +export type ReferenceType = (typeof ReferenceType)[keyof typeof ReferenceType]; diff --git a/src/api/types/Refund.ts b/src/api/types/Refund.ts index 3614a38f5..0c7cb554c 100644 --- a/src/api/types/Refund.ts +++ b/src/api/types/Refund.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a refund processed for a Square transaction. diff --git a/src/api/types/RefundCreatedEvent.ts b/src/api/types/RefundCreatedEvent.ts index 39ab7bd33..ce88d753a 100644 --- a/src/api/types/RefundCreatedEvent.ts +++ b/src/api/types/RefundCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Refund](entity:PaymentRefund) is created. diff --git a/src/api/types/RefundCreatedEventData.ts b/src/api/types/RefundCreatedEventData.ts index e2b8b8c75..2e87f3e94 100644 --- a/src/api/types/RefundCreatedEventData.ts +++ b/src/api/types/RefundCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface RefundCreatedEventData { /** Name of the affected object’s type, `"refund"`. */ diff --git a/src/api/types/RefundCreatedEventObject.ts b/src/api/types/RefundCreatedEventObject.ts index 4f04f92b8..b81cca471 100644 --- a/src/api/types/RefundCreatedEventObject.ts +++ b/src/api/types/RefundCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface RefundCreatedEventObject { /** The created refund. */ diff --git a/src/api/types/RefundPaymentResponse.ts b/src/api/types/RefundPaymentResponse.ts index 708d54360..fdbe21aff 100644 --- a/src/api/types/RefundPaymentResponse.ts +++ b/src/api/types/RefundPaymentResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response returned by diff --git a/src/api/types/RefundStatus.ts b/src/api/types/RefundStatus.ts index b090b92f1..007dc5249 100644 --- a/src/api/types/RefundStatus.ts +++ b/src/api/types/RefundStatus.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates a refund's current status. - */ -export type RefundStatus = "PENDING" | "APPROVED" | "REJECTED" | "FAILED"; +/** Indicates a refund's current status. */ export const RefundStatus = { Pending: "PENDING", Approved: "APPROVED", Rejected: "REJECTED", Failed: "FAILED", } as const; +export type RefundStatus = (typeof RefundStatus)[keyof typeof RefundStatus]; diff --git a/src/api/types/RefundUpdatedEvent.ts b/src/api/types/RefundUpdatedEvent.ts index 605abdeda..cb387e198 100644 --- a/src/api/types/RefundUpdatedEvent.ts +++ b/src/api/types/RefundUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Refund](entity:PaymentRefund) is updated. diff --git a/src/api/types/RefundUpdatedEventData.ts b/src/api/types/RefundUpdatedEventData.ts index 289303776..067ec2902 100644 --- a/src/api/types/RefundUpdatedEventData.ts +++ b/src/api/types/RefundUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface RefundUpdatedEventData { /** Name of the affected object’s type, `"refund"`. */ diff --git a/src/api/types/RefundUpdatedEventObject.ts b/src/api/types/RefundUpdatedEventObject.ts index acfb97f5b..baa10f146 100644 --- a/src/api/types/RefundUpdatedEventObject.ts +++ b/src/api/types/RefundUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface RefundUpdatedEventObject { /** The updated refund. */ diff --git a/src/api/types/RegisterDomainResponse.ts b/src/api/types/RegisterDomainResponse.ts index 840e6d51d..b5d13395f 100644 --- a/src/api/types/RegisterDomainResponse.ts +++ b/src/api/types/RegisterDomainResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/RegisterDomainResponseStatus.ts b/src/api/types/RegisterDomainResponseStatus.ts index 06dacbaf9..48e792a9c 100644 --- a/src/api/types/RegisterDomainResponseStatus.ts +++ b/src/api/types/RegisterDomainResponseStatus.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The status of the domain registration. - */ -export type RegisterDomainResponseStatus = "PENDING" | "VERIFIED"; +/** The status of the domain registration. */ export const RegisterDomainResponseStatus = { Pending: "PENDING", Verified: "VERIFIED", } as const; +export type RegisterDomainResponseStatus = + (typeof RegisterDomainResponseStatus)[keyof typeof RegisterDomainResponseStatus]; diff --git a/src/api/types/RemoveGroupFromCustomerResponse.ts b/src/api/types/RemoveGroupFromCustomerResponse.ts index 964682649..233b5a097 100644 --- a/src/api/types/RemoveGroupFromCustomerResponse.ts +++ b/src/api/types/RemoveGroupFromCustomerResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ResumeSubscriptionResponse.ts b/src/api/types/ResumeSubscriptionResponse.ts index 286cb12aa..d5be44ae6 100644 --- a/src/api/types/ResumeSubscriptionResponse.ts +++ b/src/api/types/ResumeSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/RetrieveBookingCustomAttributeDefinitionResponse.ts b/src/api/types/RetrieveBookingCustomAttributeDefinitionResponse.ts index a2ba2f0eb..752d28113 100644 --- a/src/api/types/RetrieveBookingCustomAttributeDefinitionResponse.ts +++ b/src/api/types/RetrieveBookingCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttributeDefinition) response. diff --git a/src/api/types/RetrieveBookingCustomAttributeResponse.ts b/src/api/types/RetrieveBookingCustomAttributeResponse.ts index 0664f5398..ed933ffdd 100644 --- a/src/api/types/RetrieveBookingCustomAttributeResponse.ts +++ b/src/api/types/RetrieveBookingCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveBookingCustomAttribute](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttribute) response. diff --git a/src/api/types/RetrieveChannelResponse.ts b/src/api/types/RetrieveChannelResponse.ts index 04a3f8ad2..b67644b63 100644 --- a/src/api/types/RetrieveChannelResponse.ts +++ b/src/api/types/RetrieveChannelResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface RetrieveChannelResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/RetrieveJobResponse.ts b/src/api/types/RetrieveJobResponse.ts index b7609f394..962d429ae 100644 --- a/src/api/types/RetrieveJobResponse.ts +++ b/src/api/types/RetrieveJobResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveJob](api-endpoint:Team-RetrieveJob) response. Either `job` or `errors` diff --git a/src/api/types/RetrieveLocationBookingProfileResponse.ts b/src/api/types/RetrieveLocationBookingProfileResponse.ts index 35e4ae298..9afcb3e94 100644 --- a/src/api/types/RetrieveLocationBookingProfileResponse.ts +++ b/src/api/types/RetrieveLocationBookingProfileResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface RetrieveLocationBookingProfileResponse { /** The requested location booking profile. */ diff --git a/src/api/types/RetrieveLocationCustomAttributeDefinitionResponse.ts b/src/api/types/RetrieveLocationCustomAttributeDefinitionResponse.ts index fa2a38bde..5a4632fd0 100644 --- a/src/api/types/RetrieveLocationCustomAttributeDefinitionResponse.ts +++ b/src/api/types/RetrieveLocationCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttributeDefinition) response. diff --git a/src/api/types/RetrieveLocationCustomAttributeResponse.ts b/src/api/types/RetrieveLocationCustomAttributeResponse.ts index 20f15a340..98e873c6d 100644 --- a/src/api/types/RetrieveLocationCustomAttributeResponse.ts +++ b/src/api/types/RetrieveLocationCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveLocationCustomAttribute](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttribute) response. diff --git a/src/api/types/RetrieveLocationSettingsResponse.ts b/src/api/types/RetrieveLocationSettingsResponse.ts index 41432cd77..c4be1411e 100644 --- a/src/api/types/RetrieveLocationSettingsResponse.ts +++ b/src/api/types/RetrieveLocationSettingsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface RetrieveLocationSettingsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts b/src/api/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts index a751ea6df..9a379dd71 100644 --- a/src/api/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts +++ b/src/api/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttributeDefinition) response. diff --git a/src/api/types/RetrieveMerchantCustomAttributeResponse.ts b/src/api/types/RetrieveMerchantCustomAttributeResponse.ts index 2db96df0f..c134b2d50 100644 --- a/src/api/types/RetrieveMerchantCustomAttributeResponse.ts +++ b/src/api/types/RetrieveMerchantCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttribute) response. diff --git a/src/api/types/RetrieveMerchantSettingsResponse.ts b/src/api/types/RetrieveMerchantSettingsResponse.ts index 2f0065bbe..7482610b6 100644 --- a/src/api/types/RetrieveMerchantSettingsResponse.ts +++ b/src/api/types/RetrieveMerchantSettingsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface RetrieveMerchantSettingsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/RetrieveOrderCustomAttributeDefinitionResponse.ts b/src/api/types/RetrieveOrderCustomAttributeDefinitionResponse.ts index ad84e3d07..3b67fea88 100644 --- a/src/api/types/RetrieveOrderCustomAttributeDefinitionResponse.ts +++ b/src/api/types/RetrieveOrderCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from getting an order custom attribute definition. diff --git a/src/api/types/RetrieveOrderCustomAttributeResponse.ts b/src/api/types/RetrieveOrderCustomAttributeResponse.ts index 0d8556525..62525e7fe 100644 --- a/src/api/types/RetrieveOrderCustomAttributeResponse.ts +++ b/src/api/types/RetrieveOrderCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from getting an order custom attribute. diff --git a/src/api/types/RetrieveScheduledShiftResponse.ts b/src/api/types/RetrieveScheduledShiftResponse.ts index 277fa98b4..d2c5030ad 100644 --- a/src/api/types/RetrieveScheduledShiftResponse.ts +++ b/src/api/types/RetrieveScheduledShiftResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [RetrieveScheduledShift](api-endpoint:Labor-RetrieveScheduledShift) response. diff --git a/src/api/types/RetrieveTimecardResponse.ts b/src/api/types/RetrieveTimecardResponse.ts index a3b172908..9e66fc386 100644 --- a/src/api/types/RetrieveTimecardResponse.ts +++ b/src/api/types/RetrieveTimecardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response to a request to get a `Timecard`. The response contains diff --git a/src/api/types/RetrieveTokenStatusResponse.ts b/src/api/types/RetrieveTokenStatusResponse.ts index 36f64d7c8..5c818baba 100644 --- a/src/api/types/RetrieveTokenStatusResponse.ts +++ b/src/api/types/RetrieveTokenStatusResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/RetrieveTransferOrderResponse.ts b/src/api/types/RetrieveTransferOrderResponse.ts index f122e6979..140a40b67 100644 --- a/src/api/types/RetrieveTransferOrderResponse.ts +++ b/src/api/types/RetrieveTransferOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response containing the requested transfer order diff --git a/src/api/types/RevokeTokenResponse.ts b/src/api/types/RevokeTokenResponse.ts index fe48f8c9e..10de32c37 100644 --- a/src/api/types/RevokeTokenResponse.ts +++ b/src/api/types/RevokeTokenResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface RevokeTokenResponse { /** If the request is successful, this is `true`. */ diff --git a/src/api/types/RiskEvaluation.ts b/src/api/types/RiskEvaluation.ts index b672456bc..764817688 100644 --- a/src/api/types/RiskEvaluation.ts +++ b/src/api/types/RiskEvaluation.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents fraud risk information for the associated payment. diff --git a/src/api/types/RiskEvaluationRiskLevel.ts b/src/api/types/RiskEvaluationRiskLevel.ts index 8f693e9b0..9449409f9 100644 --- a/src/api/types/RiskEvaluationRiskLevel.ts +++ b/src/api/types/RiskEvaluationRiskLevel.ts @@ -1,11 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type RiskEvaluationRiskLevel = "PENDING" | "NORMAL" | "MODERATE" | "HIGH"; export const RiskEvaluationRiskLevel = { Pending: "PENDING", Normal: "NORMAL", Moderate: "MODERATE", High: "HIGH", } as const; +export type RiskEvaluationRiskLevel = (typeof RiskEvaluationRiskLevel)[keyof typeof RiskEvaluationRiskLevel]; diff --git a/src/api/types/SaveCardOptions.ts b/src/api/types/SaveCardOptions.ts index 78f8c0223..fbec5bc0f 100644 --- a/src/api/types/SaveCardOptions.ts +++ b/src/api/types/SaveCardOptions.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Describes save-card action fields. diff --git a/src/api/types/ScheduledShift.ts b/src/api/types/ScheduledShift.ts index 77abb571a..1db9cb57c 100644 --- a/src/api/types/ScheduledShift.ts +++ b/src/api/types/ScheduledShift.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a specific time slot in a work schedule. This object is used to manage the diff --git a/src/api/types/ScheduledShiftDetails.ts b/src/api/types/ScheduledShiftDetails.ts index 0e3900e68..6419c7908 100644 --- a/src/api/types/ScheduledShiftDetails.ts +++ b/src/api/types/ScheduledShiftDetails.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents shift details for draft and published versions of a [scheduled shift](entity:ScheduledShift), diff --git a/src/api/types/ScheduledShiftFilter.ts b/src/api/types/ScheduledShiftFilter.ts index 5a9ca9dd0..f7c2c36aa 100644 --- a/src/api/types/ScheduledShiftFilter.ts +++ b/src/api/types/ScheduledShiftFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines filter criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) diff --git a/src/api/types/ScheduledShiftFilterAssignmentStatus.ts b/src/api/types/ScheduledShiftFilterAssignmentStatus.ts index 4a950891a..0c01b1bc6 100644 --- a/src/api/types/ScheduledShiftFilterAssignmentStatus.ts +++ b/src/api/types/ScheduledShiftFilterAssignmentStatus.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Defines valid values for the `assignment_status` filter in a @@ -8,8 +6,9 @@ * Assignment status is based on the `draft_shift_details.team_member_id` and * `published_shift_details.team_member_id` fields of the scheduled shift. */ -export type ScheduledShiftFilterAssignmentStatus = "ASSIGNED" | "UNASSIGNED"; export const ScheduledShiftFilterAssignmentStatus = { Assigned: "ASSIGNED", Unassigned: "UNASSIGNED", } as const; +export type ScheduledShiftFilterAssignmentStatus = + (typeof ScheduledShiftFilterAssignmentStatus)[keyof typeof ScheduledShiftFilterAssignmentStatus]; diff --git a/src/api/types/ScheduledShiftFilterScheduledShiftStatus.ts b/src/api/types/ScheduledShiftFilterScheduledShiftStatus.ts index 523a07dec..9887b1378 100644 --- a/src/api/types/ScheduledShiftFilterScheduledShiftStatus.ts +++ b/src/api/types/ScheduledShiftFilterScheduledShiftStatus.ts @@ -1,13 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Defines valid values for the `scheduled_shift_statuses` filter in a * [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. */ -export type ScheduledShiftFilterScheduledShiftStatus = "DRAFT" | "PUBLISHED"; export const ScheduledShiftFilterScheduledShiftStatus = { Draft: "DRAFT", Published: "PUBLISHED", } as const; +export type ScheduledShiftFilterScheduledShiftStatus = + (typeof ScheduledShiftFilterScheduledShiftStatus)[keyof typeof ScheduledShiftFilterScheduledShiftStatus]; diff --git a/src/api/types/ScheduledShiftNotificationAudience.ts b/src/api/types/ScheduledShiftNotificationAudience.ts index fac85e8bf..90e62c7f2 100644 --- a/src/api/types/ScheduledShiftNotificationAudience.ts +++ b/src/api/types/ScheduledShiftNotificationAudience.ts @@ -1,14 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Indicates whether Square sends an email notification to team members * when a scheduled shift is published and which team members receive the notification. */ -export type ScheduledShiftNotificationAudience = "ALL" | "AFFECTED" | "NONE"; export const ScheduledShiftNotificationAudience = { All: "ALL", Affected: "AFFECTED", None: "NONE", } as const; +export type ScheduledShiftNotificationAudience = + (typeof ScheduledShiftNotificationAudience)[keyof typeof ScheduledShiftNotificationAudience]; diff --git a/src/api/types/ScheduledShiftQuery.ts b/src/api/types/ScheduledShiftQuery.ts index ad1b5005d..eebae1ddf 100644 --- a/src/api/types/ScheduledShiftQuery.ts +++ b/src/api/types/ScheduledShiftQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents filter and sort criteria for the `query` field in a diff --git a/src/api/types/ScheduledShiftSort.ts b/src/api/types/ScheduledShiftSort.ts index 41126ffd1..1ec7bf8e3 100644 --- a/src/api/types/ScheduledShiftSort.ts +++ b/src/api/types/ScheduledShiftSort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines sort criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) diff --git a/src/api/types/ScheduledShiftSortField.ts b/src/api/types/ScheduledShiftSortField.ts index 224510267..966ea2a4d 100644 --- a/src/api/types/ScheduledShiftSortField.ts +++ b/src/api/types/ScheduledShiftSortField.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Defines valid values for the `field` sort setting in a * [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. */ -export type ScheduledShiftSortField = "START_AT" | "END_AT" | "CREATED_AT" | "UPDATED_AT"; export const ScheduledShiftSortField = { StartAt: "START_AT", EndAt: "END_AT", CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; +export type ScheduledShiftSortField = (typeof ScheduledShiftSortField)[keyof typeof ScheduledShiftSortField]; diff --git a/src/api/types/ScheduledShiftWorkday.ts b/src/api/types/ScheduledShiftWorkday.ts index ea90c2756..fef48bd16 100644 --- a/src/api/types/ScheduledShiftWorkday.ts +++ b/src/api/types/ScheduledShiftWorkday.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A `ScheduledShift` search query filter parameter that sets a range of days that diff --git a/src/api/types/ScheduledShiftWorkdayMatcher.ts b/src/api/types/ScheduledShiftWorkdayMatcher.ts index ae4bcee20..c6a3f104f 100644 --- a/src/api/types/ScheduledShiftWorkdayMatcher.ts +++ b/src/api/types/ScheduledShiftWorkdayMatcher.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Defines the logic used to apply a workday filter. - */ -export type ScheduledShiftWorkdayMatcher = "START_AT" | "END_AT" | "INTERSECTION"; +/** Defines the logic used to apply a workday filter. */ export const ScheduledShiftWorkdayMatcher = { StartAt: "START_AT", EndAt: "END_AT", Intersection: "INTERSECTION", } as const; +export type ScheduledShiftWorkdayMatcher = + (typeof ScheduledShiftWorkdayMatcher)[keyof typeof ScheduledShiftWorkdayMatcher]; diff --git a/src/api/types/SearchAvailabilityFilter.ts b/src/api/types/SearchAvailabilityFilter.ts index 41099dbd3..eb3a7fd2b 100644 --- a/src/api/types/SearchAvailabilityFilter.ts +++ b/src/api/types/SearchAvailabilityFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A query filter to search for buyer-accessible availabilities by. diff --git a/src/api/types/SearchAvailabilityQuery.ts b/src/api/types/SearchAvailabilityQuery.ts index 5314cfebb..63b633021 100644 --- a/src/api/types/SearchAvailabilityQuery.ts +++ b/src/api/types/SearchAvailabilityQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The query used to search for buyer-accessible availabilities of bookings. diff --git a/src/api/types/SearchAvailabilityResponse.ts b/src/api/types/SearchAvailabilityResponse.ts index a6fafea09..3ff09f61e 100644 --- a/src/api/types/SearchAvailabilityResponse.ts +++ b/src/api/types/SearchAvailabilityResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SearchAvailabilityResponse { /** List of appointment slots available for booking. */ diff --git a/src/api/types/SearchCatalogItemsRequestStockLevel.ts b/src/api/types/SearchCatalogItemsRequestStockLevel.ts index 15c5d8475..d45ae7867 100644 --- a/src/api/types/SearchCatalogItemsRequestStockLevel.ts +++ b/src/api/types/SearchCatalogItemsRequestStockLevel.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Defines supported stock levels of the item inventory. - */ -export type SearchCatalogItemsRequestStockLevel = "OUT" | "LOW"; +/** Defines supported stock levels of the item inventory. */ export const SearchCatalogItemsRequestStockLevel = { Out: "OUT", Low: "LOW", } as const; +export type SearchCatalogItemsRequestStockLevel = + (typeof SearchCatalogItemsRequestStockLevel)[keyof typeof SearchCatalogItemsRequestStockLevel]; diff --git a/src/api/types/SearchCatalogItemsResponse.ts b/src/api/types/SearchCatalogItemsResponse.ts index 71e916d48..3df785fbb 100644 --- a/src/api/types/SearchCatalogItemsResponse.ts +++ b/src/api/types/SearchCatalogItemsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response body returned from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. diff --git a/src/api/types/SearchCatalogObjectsResponse.ts b/src/api/types/SearchCatalogObjectsResponse.ts index daa11c3af..f9bdc5aae 100644 --- a/src/api/types/SearchCatalogObjectsResponse.ts +++ b/src/api/types/SearchCatalogObjectsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SearchCatalogObjectsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/SearchCustomersResponse.ts b/src/api/types/SearchCustomersResponse.ts index 5667827f2..73af633f4 100644 --- a/src/api/types/SearchCustomersResponse.ts +++ b/src/api/types/SearchCustomersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/SearchEventsFilter.ts b/src/api/types/SearchEventsFilter.ts index ccbb04b26..448514a81 100644 --- a/src/api/types/SearchEventsFilter.ts +++ b/src/api/types/SearchEventsFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Criteria to filter events by. diff --git a/src/api/types/SearchEventsQuery.ts b/src/api/types/SearchEventsQuery.ts index c4923434d..59e4319bf 100644 --- a/src/api/types/SearchEventsQuery.ts +++ b/src/api/types/SearchEventsQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Contains query criteria for the search. diff --git a/src/api/types/SearchEventsResponse.ts b/src/api/types/SearchEventsResponse.ts index d28d5ee28..0b51beb7f 100644 --- a/src/api/types/SearchEventsResponse.ts +++ b/src/api/types/SearchEventsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/SearchEventsSort.ts b/src/api/types/SearchEventsSort.ts index 2bedcf9cc..81c4bf31a 100644 --- a/src/api/types/SearchEventsSort.ts +++ b/src/api/types/SearchEventsSort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Criteria to sort events by. diff --git a/src/api/types/SearchEventsSortField.ts b/src/api/types/SearchEventsSortField.ts index 7995d34cb..f9329a3e7 100644 --- a/src/api/types/SearchEventsSortField.ts +++ b/src/api/types/SearchEventsSortField.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Specifies the sort key for events returned from a search. diff --git a/src/api/types/SearchInvoicesResponse.ts b/src/api/types/SearchInvoicesResponse.ts index d8a9d2bd1..8e27f90b0 100644 --- a/src/api/types/SearchInvoicesResponse.ts +++ b/src/api/types/SearchInvoicesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a `SearchInvoices` response. diff --git a/src/api/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts b/src/api/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts index 01bd91e80..3fa33a4e9 100644 --- a/src/api/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts +++ b/src/api/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The search criteria for the loyalty accounts. diff --git a/src/api/types/SearchLoyaltyAccountsResponse.ts b/src/api/types/SearchLoyaltyAccountsResponse.ts index e3b9e6ea4..8e7fec6b3 100644 --- a/src/api/types/SearchLoyaltyAccountsResponse.ts +++ b/src/api/types/SearchLoyaltyAccountsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that includes loyalty accounts that satisfy the search criteria. diff --git a/src/api/types/SearchLoyaltyEventsResponse.ts b/src/api/types/SearchLoyaltyEventsResponse.ts index 035520dad..9ee8896b1 100644 --- a/src/api/types/SearchLoyaltyEventsResponse.ts +++ b/src/api/types/SearchLoyaltyEventsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains loyalty events that satisfy the search diff --git a/src/api/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts b/src/api/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts index 387555f18..071abdc46 100644 --- a/src/api/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts +++ b/src/api/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The set of search requirements. diff --git a/src/api/types/SearchLoyaltyRewardsResponse.ts b/src/api/types/SearchLoyaltyRewardsResponse.ts index 4227870d5..7f2d69d14 100644 --- a/src/api/types/SearchLoyaltyRewardsResponse.ts +++ b/src/api/types/SearchLoyaltyRewardsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that includes the loyalty rewards satisfying the search criteria. diff --git a/src/api/types/SearchOrdersCustomerFilter.ts b/src/api/types/SearchOrdersCustomerFilter.ts index 167772657..e326bd623 100644 --- a/src/api/types/SearchOrdersCustomerFilter.ts +++ b/src/api/types/SearchOrdersCustomerFilter.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A filter based on the order `customer_id` and any tender `customer_id` diff --git a/src/api/types/SearchOrdersDateTimeFilter.ts b/src/api/types/SearchOrdersDateTimeFilter.ts index 8895aee16..311d88540 100644 --- a/src/api/types/SearchOrdersDateTimeFilter.ts +++ b/src/api/types/SearchOrdersDateTimeFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Filter for `Order` objects based on whether their `CREATED_AT`, diff --git a/src/api/types/SearchOrdersFilter.ts b/src/api/types/SearchOrdersFilter.ts index f7999cca0..c5feb11bc 100644 --- a/src/api/types/SearchOrdersFilter.ts +++ b/src/api/types/SearchOrdersFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Filtering criteria to use for a `SearchOrders` request. Multiple filters diff --git a/src/api/types/SearchOrdersFulfillmentFilter.ts b/src/api/types/SearchOrdersFulfillmentFilter.ts index 9ba85a337..e675fbc31 100644 --- a/src/api/types/SearchOrdersFulfillmentFilter.ts +++ b/src/api/types/SearchOrdersFulfillmentFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Filter based on [order fulfillment](entity:Fulfillment) information. diff --git a/src/api/types/SearchOrdersQuery.ts b/src/api/types/SearchOrdersQuery.ts index 8e0d23b82..cbb97f9de 100644 --- a/src/api/types/SearchOrdersQuery.ts +++ b/src/api/types/SearchOrdersQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Contains query criteria for the search. diff --git a/src/api/types/SearchOrdersResponse.ts b/src/api/types/SearchOrdersResponse.ts index 750a9606f..9ee27ebc5 100644 --- a/src/api/types/SearchOrdersResponse.ts +++ b/src/api/types/SearchOrdersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Either the `order_entries` or `orders` field is set, depending on whether diff --git a/src/api/types/SearchOrdersSort.ts b/src/api/types/SearchOrdersSort.ts index a2137e503..f50185503 100644 --- a/src/api/types/SearchOrdersSort.ts +++ b/src/api/types/SearchOrdersSort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Sorting criteria for a `SearchOrders` request. Results can only be sorted diff --git a/src/api/types/SearchOrdersSortField.ts b/src/api/types/SearchOrdersSortField.ts index 54123aa92..d522c43d5 100644 --- a/src/api/types/SearchOrdersSortField.ts +++ b/src/api/types/SearchOrdersSortField.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Specifies which timestamp to use to sort `SearchOrder` results. - */ -export type SearchOrdersSortField = "CREATED_AT" | "UPDATED_AT" | "CLOSED_AT"; +/** Specifies which timestamp to use to sort `SearchOrder` results. */ export const SearchOrdersSortField = { CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", ClosedAt: "CLOSED_AT", } as const; +export type SearchOrdersSortField = (typeof SearchOrdersSortField)[keyof typeof SearchOrdersSortField]; diff --git a/src/api/types/SearchOrdersSourceFilter.ts b/src/api/types/SearchOrdersSourceFilter.ts index 0b1475c9d..8b9578249 100644 --- a/src/api/types/SearchOrdersSourceFilter.ts +++ b/src/api/types/SearchOrdersSourceFilter.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A filter based on order `source` information. diff --git a/src/api/types/SearchOrdersStateFilter.ts b/src/api/types/SearchOrdersStateFilter.ts index fa5759b0b..a1e05f0fa 100644 --- a/src/api/types/SearchOrdersStateFilter.ts +++ b/src/api/types/SearchOrdersStateFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Filter by the current order `state`. diff --git a/src/api/types/SearchScheduledShiftsResponse.ts b/src/api/types/SearchScheduledShiftsResponse.ts index 895464c09..e22c6482e 100644 --- a/src/api/types/SearchScheduledShiftsResponse.ts +++ b/src/api/types/SearchScheduledShiftsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) response. diff --git a/src/api/types/SearchShiftsResponse.ts b/src/api/types/SearchShiftsResponse.ts index 427926dc2..e2c3c1cd1 100644 --- a/src/api/types/SearchShiftsResponse.ts +++ b/src/api/types/SearchShiftsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request for `Shift` objects. The response contains diff --git a/src/api/types/SearchSubscriptionsFilter.ts b/src/api/types/SearchSubscriptionsFilter.ts index 41b97918d..ba1ceae91 100644 --- a/src/api/types/SearchSubscriptionsFilter.ts +++ b/src/api/types/SearchSubscriptionsFilter.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions returned by diff --git a/src/api/types/SearchSubscriptionsQuery.ts b/src/api/types/SearchSubscriptionsQuery.ts index 224516676..837e1601b 100644 --- a/src/api/types/SearchSubscriptionsQuery.ts +++ b/src/api/types/SearchSubscriptionsQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a query, consisting of specified query expressions, used to search for subscriptions. diff --git a/src/api/types/SearchSubscriptionsResponse.ts b/src/api/types/SearchSubscriptionsResponse.ts index 4e71da01a..05a7926d9 100644 --- a/src/api/types/SearchSubscriptionsResponse.ts +++ b/src/api/types/SearchSubscriptionsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/SearchTeamMembersFilter.ts b/src/api/types/SearchTeamMembersFilter.ts index c21df9ad8..bf2e45f31 100644 --- a/src/api/types/SearchTeamMembersFilter.ts +++ b/src/api/types/SearchTeamMembersFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a filter used in a search for `TeamMember` objects. `AND` logic is applied diff --git a/src/api/types/SearchTeamMembersQuery.ts b/src/api/types/SearchTeamMembersQuery.ts index 657d67159..928b1fbc6 100644 --- a/src/api/types/SearchTeamMembersQuery.ts +++ b/src/api/types/SearchTeamMembersQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the parameters in a search for `TeamMember` objects. diff --git a/src/api/types/SearchTeamMembersResponse.ts b/src/api/types/SearchTeamMembersResponse.ts index 0b84c9c15..2e641babd 100644 --- a/src/api/types/SearchTeamMembersResponse.ts +++ b/src/api/types/SearchTeamMembersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from a search request containing a filtered list of `TeamMember` objects. diff --git a/src/api/types/SearchTerminalActionsResponse.ts b/src/api/types/SearchTerminalActionsResponse.ts index 243a6fb58..9a6e4304c 100644 --- a/src/api/types/SearchTerminalActionsResponse.ts +++ b/src/api/types/SearchTerminalActionsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SearchTerminalActionsResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/SearchTerminalCheckoutsResponse.ts b/src/api/types/SearchTerminalCheckoutsResponse.ts index 764c4b2f9..f84c6db00 100644 --- a/src/api/types/SearchTerminalCheckoutsResponse.ts +++ b/src/api/types/SearchTerminalCheckoutsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SearchTerminalCheckoutsResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/SearchTerminalRefundsResponse.ts b/src/api/types/SearchTerminalRefundsResponse.ts index 0beaece31..c88593777 100644 --- a/src/api/types/SearchTerminalRefundsResponse.ts +++ b/src/api/types/SearchTerminalRefundsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SearchTerminalRefundsResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/SearchTimecardsResponse.ts b/src/api/types/SearchTimecardsResponse.ts index 7d83caa1c..48b3a1b2c 100644 --- a/src/api/types/SearchTimecardsResponse.ts +++ b/src/api/types/SearchTimecardsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request for `Timecard` objects. The response contains diff --git a/src/api/types/SearchTransferOrdersResponse.ts b/src/api/types/SearchTransferOrdersResponse.ts index 2e0de46ed..f1b2e79de 100644 --- a/src/api/types/SearchTransferOrdersResponse.ts +++ b/src/api/types/SearchTransferOrdersResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response for searching transfer orders diff --git a/src/api/types/SearchVendorsRequestFilter.ts b/src/api/types/SearchVendorsRequestFilter.ts index 973b97569..caae2bba0 100644 --- a/src/api/types/SearchVendorsRequestFilter.ts +++ b/src/api/types/SearchVendorsRequestFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines supported query expressions to search for vendors by. diff --git a/src/api/types/SearchVendorsRequestSort.ts b/src/api/types/SearchVendorsRequestSort.ts index 99caa763d..772eb2105 100644 --- a/src/api/types/SearchVendorsRequestSort.ts +++ b/src/api/types/SearchVendorsRequestSort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines a sorter used to sort results from [SearchVendors](api-endpoint:Vendors-SearchVendors). diff --git a/src/api/types/SearchVendorsRequestSortField.ts b/src/api/types/SearchVendorsRequestSortField.ts index daa069ea4..5a36387ec 100644 --- a/src/api/types/SearchVendorsRequestSortField.ts +++ b/src/api/types/SearchVendorsRequestSortField.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The field to sort the returned [Vendor](entity:Vendor) objects by. - */ -export type SearchVendorsRequestSortField = "NAME" | "CREATED_AT"; +/** The field to sort the returned [Vendor](entity:Vendor) objects by. */ export const SearchVendorsRequestSortField = { Name: "NAME", CreatedAt: "CREATED_AT", } as const; +export type SearchVendorsRequestSortField = + (typeof SearchVendorsRequestSortField)[keyof typeof SearchVendorsRequestSortField]; diff --git a/src/api/types/SearchVendorsResponse.ts b/src/api/types/SearchVendorsResponse.ts index 3b001cbba..b2bd64b94 100644 --- a/src/api/types/SearchVendorsResponse.ts +++ b/src/api/types/SearchVendorsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an output from a call to [SearchVendors](api-endpoint:Vendors-SearchVendors). diff --git a/src/api/types/SegmentFilter.ts b/src/api/types/SegmentFilter.ts index 65e099271..94f28209c 100644 --- a/src/api/types/SegmentFilter.ts +++ b/src/api/types/SegmentFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A query filter to search for buyer-accessible appointment segments by. diff --git a/src/api/types/SelectOption.ts b/src/api/types/SelectOption.ts index 2cb33751a..e9599a034 100644 --- a/src/api/types/SelectOption.ts +++ b/src/api/types/SelectOption.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface SelectOption { /** The reference id for the option. */ diff --git a/src/api/types/SelectOptions.ts b/src/api/types/SelectOptions.ts index 26d3b1af5..11dc6e58b 100644 --- a/src/api/types/SelectOptions.ts +++ b/src/api/types/SelectOptions.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SelectOptions { /** The title text to display in the select flow on the Terminal. */ diff --git a/src/api/types/Shift.ts b/src/api/types/Shift.ts index 4b53daf35..0c3367b3d 100644 --- a/src/api/types/Shift.ts +++ b/src/api/types/Shift.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A record of the hourly rate, start, and end times for a single work shift diff --git a/src/api/types/ShiftFilter.ts b/src/api/types/ShiftFilter.ts index 09bde57b1..0c64caf63 100644 --- a/src/api/types/ShiftFilter.ts +++ b/src/api/types/ShiftFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines a filter used in a search for `Shift` records. `AND` logic is diff --git a/src/api/types/ShiftFilterStatus.ts b/src/api/types/ShiftFilterStatus.ts index 093144e95..72ebf9414 100644 --- a/src/api/types/ShiftFilterStatus.ts +++ b/src/api/types/ShiftFilterStatus.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Specifies the `status` of `Shift` records to be returned. * * Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */ -export type ShiftFilterStatus = "OPEN" | "CLOSED"; export const ShiftFilterStatus = { Open: "OPEN", Closed: "CLOSED", } as const; +export type ShiftFilterStatus = (typeof ShiftFilterStatus)[keyof typeof ShiftFilterStatus]; diff --git a/src/api/types/ShiftQuery.ts b/src/api/types/ShiftQuery.ts index 7b977e3a3..561eb47e8 100644 --- a/src/api/types/ShiftQuery.ts +++ b/src/api/types/ShiftQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The parameters of a `Shift` search query, which includes filter and sort options. diff --git a/src/api/types/ShiftSort.ts b/src/api/types/ShiftSort.ts index d12abc47d..f28086e2f 100644 --- a/src/api/types/ShiftSort.ts +++ b/src/api/types/ShiftSort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Sets the sort order of search results. diff --git a/src/api/types/ShiftSortField.ts b/src/api/types/ShiftSortField.ts index db3077922..56ac8b2a0 100644 --- a/src/api/types/ShiftSortField.ts +++ b/src/api/types/ShiftSortField.ts @@ -1,16 +1,14 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Enumerates the `Shift` fields to sort on. * * Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */ -export type ShiftSortField = "START_AT" | "END_AT" | "CREATED_AT" | "UPDATED_AT"; export const ShiftSortField = { StartAt: "START_AT", EndAt: "END_AT", CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; +export type ShiftSortField = (typeof ShiftSortField)[keyof typeof ShiftSortField]; diff --git a/src/api/types/ShiftStatus.ts b/src/api/types/ShiftStatus.ts index 037efdb2d..391123452 100644 --- a/src/api/types/ShiftStatus.ts +++ b/src/api/types/ShiftStatus.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Enumerates the possible status of a `Shift`. * * Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */ -export type ShiftStatus = "OPEN" | "CLOSED"; export const ShiftStatus = { Open: "OPEN", Closed: "CLOSED", } as const; +export type ShiftStatus = (typeof ShiftStatus)[keyof typeof ShiftStatus]; diff --git a/src/api/types/ShiftWage.ts b/src/api/types/ShiftWage.ts index ad082a8cc..a3dc08653 100644 --- a/src/api/types/ShiftWage.ts +++ b/src/api/types/ShiftWage.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The hourly wage rate used to compensate an employee for this shift. diff --git a/src/api/types/ShiftWorkday.ts b/src/api/types/ShiftWorkday.ts index dcfc185f5..d6c831bcc 100644 --- a/src/api/types/ShiftWorkday.ts +++ b/src/api/types/ShiftWorkday.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A `Shift` search query filter parameter that sets a range of days that diff --git a/src/api/types/ShiftWorkdayMatcher.ts b/src/api/types/ShiftWorkdayMatcher.ts index 6decb98a7..b54dc1533 100644 --- a/src/api/types/ShiftWorkdayMatcher.ts +++ b/src/api/types/ShiftWorkdayMatcher.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Defines the logic used to apply a workday filter. - */ -export type ShiftWorkdayMatcher = "START_AT" | "END_AT" | "INTERSECTION"; +/** Defines the logic used to apply a workday filter. */ export const ShiftWorkdayMatcher = { StartAt: "START_AT", EndAt: "END_AT", Intersection: "INTERSECTION", } as const; +export type ShiftWorkdayMatcher = (typeof ShiftWorkdayMatcher)[keyof typeof ShiftWorkdayMatcher]; diff --git a/src/api/types/ShippingFee.ts b/src/api/types/ShippingFee.ts index 9418d0a85..b23a45ed0 100644 --- a/src/api/types/ShippingFee.ts +++ b/src/api/types/ShippingFee.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface ShippingFee { /** The name for the shipping fee. */ diff --git a/src/api/types/SignatureImage.ts b/src/api/types/SignatureImage.ts index 8147a46eb..711dc1b84 100644 --- a/src/api/types/SignatureImage.ts +++ b/src/api/types/SignatureImage.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface SignatureImage { /** diff --git a/src/api/types/SignatureOptions.ts b/src/api/types/SignatureOptions.ts index 0f8c1dd8c..b0740850f 100644 --- a/src/api/types/SignatureOptions.ts +++ b/src/api/types/SignatureOptions.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SignatureOptions { /** The title text to display in the signature capture flow on the Terminal. */ diff --git a/src/api/types/Site.ts b/src/api/types/Site.ts index 2980bd188..31b5d143f 100644 --- a/src/api/types/Site.ts +++ b/src/api/types/Site.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a Square Online site, which is an online store for a Square seller. diff --git a/src/api/types/Snippet.ts b/src/api/types/Snippet.ts index 912e3fd6e..8e414fa35 100644 --- a/src/api/types/Snippet.ts +++ b/src/api/types/Snippet.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. diff --git a/src/api/types/SortOrder.ts b/src/api/types/SortOrder.ts index 8a6aeadfa..171d4b3ab 100644 --- a/src/api/types/SortOrder.ts +++ b/src/api/types/SortOrder.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The order (e.g., chronological or alphabetical) in which results from a request are returned. - */ -export type SortOrder = "DESC" | "ASC"; +/** The order (e.g., chronological or alphabetical) in which results from a request are returned. */ export const SortOrder = { Desc: "DESC", Asc: "ASC", } as const; +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]; diff --git a/src/api/types/SourceApplication.ts b/src/api/types/SourceApplication.ts index 5cbddc36b..bc9e37214 100644 --- a/src/api/types/SourceApplication.ts +++ b/src/api/types/SourceApplication.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents information about the application used to generate a change. diff --git a/src/api/types/SquareAccountDetails.ts b/src/api/types/SquareAccountDetails.ts index edacd3d33..76b5f055f 100644 --- a/src/api/types/SquareAccountDetails.ts +++ b/src/api/types/SquareAccountDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Additional details about Square Account payments. diff --git a/src/api/types/StandardUnitDescription.ts b/src/api/types/StandardUnitDescription.ts index 66e3a9ab2..d91e1caa4 100644 --- a/src/api/types/StandardUnitDescription.ts +++ b/src/api/types/StandardUnitDescription.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Contains the name and abbreviation for standard measurement unit. diff --git a/src/api/types/StandardUnitDescriptionGroup.ts b/src/api/types/StandardUnitDescriptionGroup.ts index 55625e4c6..6f5d77410 100644 --- a/src/api/types/StandardUnitDescriptionGroup.ts +++ b/src/api/types/StandardUnitDescriptionGroup.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Group of standard measurement units. diff --git a/src/api/types/StartTransferOrderResponse.ts b/src/api/types/StartTransferOrderResponse.ts index a58c3d150..839bbb0c7 100644 --- a/src/api/types/StartTransferOrderResponse.ts +++ b/src/api/types/StartTransferOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response for starting a transfer order. diff --git a/src/api/types/SubmitEvidenceResponse.ts b/src/api/types/SubmitEvidenceResponse.ts index 5e647ee24..1a880f673 100644 --- a/src/api/types/SubmitEvidenceResponse.ts +++ b/src/api/types/SubmitEvidenceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields in a `SubmitEvidence` response. diff --git a/src/api/types/Subscription.ts b/src/api/types/Subscription.ts index 8da617ab7..6d1c1dc7f 100644 --- a/src/api/types/Subscription.ts +++ b/src/api/types/Subscription.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a subscription purchased by a customer. diff --git a/src/api/types/SubscriptionAction.ts b/src/api/types/SubscriptionAction.ts index a9542aced..0b1e3e60f 100644 --- a/src/api/types/SubscriptionAction.ts +++ b/src/api/types/SubscriptionAction.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an action as a pending change to a subscription. diff --git a/src/api/types/SubscriptionActionType.ts b/src/api/types/SubscriptionActionType.ts index 260e56333..007796243 100644 --- a/src/api/types/SubscriptionActionType.ts +++ b/src/api/types/SubscriptionActionType.ts @@ -1,17 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Supported types of an action as a pending change to a subscription. - */ -export type SubscriptionActionType = - | "CANCEL" - | "PAUSE" - | "RESUME" - | "SWAP_PLAN" - | "CHANGE_BILLING_ANCHOR_DATE" - | "COMPLETE"; +/** Supported types of an action as a pending change to a subscription. */ export const SubscriptionActionType = { Cancel: "CANCEL", Pause: "PAUSE", @@ -20,3 +9,4 @@ export const SubscriptionActionType = { ChangeBillingAnchorDate: "CHANGE_BILLING_ANCHOR_DATE", Complete: "COMPLETE", } as const; +export type SubscriptionActionType = (typeof SubscriptionActionType)[keyof typeof SubscriptionActionType]; diff --git a/src/api/types/SubscriptionCadence.ts b/src/api/types/SubscriptionCadence.ts index 3cf285f5f..d2c30f58a 100644 --- a/src/api/types/SubscriptionCadence.ts +++ b/src/api/types/SubscriptionCadence.ts @@ -1,24 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Determines the billing cadence of a [Subscription](entity:Subscription) - */ -export type SubscriptionCadence = - | "DAILY" - | "WEEKLY" - | "EVERY_TWO_WEEKS" - | "THIRTY_DAYS" - | "SIXTY_DAYS" - | "NINETY_DAYS" - | "MONTHLY" - | "EVERY_TWO_MONTHS" - | "QUARTERLY" - | "EVERY_FOUR_MONTHS" - | "EVERY_SIX_MONTHS" - | "ANNUAL" - | "EVERY_TWO_YEARS"; +/** Determines the billing cadence of a [Subscription](entity:Subscription) */ export const SubscriptionCadence = { Daily: "DAILY", Weekly: "WEEKLY", @@ -34,3 +16,4 @@ export const SubscriptionCadence = { Annual: "ANNUAL", EveryTwoYears: "EVERY_TWO_YEARS", } as const; +export type SubscriptionCadence = (typeof SubscriptionCadence)[keyof typeof SubscriptionCadence]; diff --git a/src/api/types/SubscriptionCreatedEvent.ts b/src/api/types/SubscriptionCreatedEvent.ts index 438c22f09..9b936c44a 100644 --- a/src/api/types/SubscriptionCreatedEvent.ts +++ b/src/api/types/SubscriptionCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Subscription](entity:Subscription) is created. diff --git a/src/api/types/SubscriptionCreatedEventData.ts b/src/api/types/SubscriptionCreatedEventData.ts index 560b27b55..39815dc62 100644 --- a/src/api/types/SubscriptionCreatedEventData.ts +++ b/src/api/types/SubscriptionCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SubscriptionCreatedEventData { /** Name of the affected object’s type, `"subscription"`. */ diff --git a/src/api/types/SubscriptionCreatedEventObject.ts b/src/api/types/SubscriptionCreatedEventObject.ts index d9c964abc..afbaa5321 100644 --- a/src/api/types/SubscriptionCreatedEventObject.ts +++ b/src/api/types/SubscriptionCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SubscriptionCreatedEventObject { /** The created subscription. */ diff --git a/src/api/types/SubscriptionEvent.ts b/src/api/types/SubscriptionEvent.ts index d5e54af48..c98992180 100644 --- a/src/api/types/SubscriptionEvent.ts +++ b/src/api/types/SubscriptionEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes changes to a subscription and the subscription status. diff --git a/src/api/types/SubscriptionEventInfo.ts b/src/api/types/SubscriptionEventInfo.ts index 4b46a5784..cd4b6d0ab 100644 --- a/src/api/types/SubscriptionEventInfo.ts +++ b/src/api/types/SubscriptionEventInfo.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Provides information about the subscription event. diff --git a/src/api/types/SubscriptionEventInfoCode.ts b/src/api/types/SubscriptionEventInfoCode.ts index 60d6365e8..e68adf727 100644 --- a/src/api/types/SubscriptionEventInfoCode.ts +++ b/src/api/types/SubscriptionEventInfoCode.ts @@ -1,17 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Supported info codes of a subscription event. - */ -export type SubscriptionEventInfoCode = - | "LOCATION_NOT_ACTIVE" - | "LOCATION_CANNOT_ACCEPT_PAYMENT" - | "CUSTOMER_DELETED" - | "CUSTOMER_NO_EMAIL" - | "CUSTOMER_NO_NAME" - | "USER_PROVIDED"; +/** Supported info codes of a subscription event. */ export const SubscriptionEventInfoCode = { LocationNotActive: "LOCATION_NOT_ACTIVE", LocationCannotAcceptPayment: "LOCATION_CANNOT_ACCEPT_PAYMENT", @@ -20,3 +9,4 @@ export const SubscriptionEventInfoCode = { CustomerNoName: "CUSTOMER_NO_NAME", UserProvided: "USER_PROVIDED", } as const; +export type SubscriptionEventInfoCode = (typeof SubscriptionEventInfoCode)[keyof typeof SubscriptionEventInfoCode]; diff --git a/src/api/types/SubscriptionEventSubscriptionEventType.ts b/src/api/types/SubscriptionEventSubscriptionEventType.ts index 75f229c4a..689535dd1 100644 --- a/src/api/types/SubscriptionEventSubscriptionEventType.ts +++ b/src/api/types/SubscriptionEventSubscriptionEventType.ts @@ -1,18 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Supported types of an event occurred to a subscription. - */ -export type SubscriptionEventSubscriptionEventType = - | "START_SUBSCRIPTION" - | "PLAN_CHANGE" - | "STOP_SUBSCRIPTION" - | "DEACTIVATE_SUBSCRIPTION" - | "RESUME_SUBSCRIPTION" - | "PAUSE_SUBSCRIPTION" - | "BILLING_ANCHOR_DATE_CHANGED"; +/** Supported types of an event occurred to a subscription. */ export const SubscriptionEventSubscriptionEventType = { StartSubscription: "START_SUBSCRIPTION", PlanChange: "PLAN_CHANGE", @@ -22,3 +10,5 @@ export const SubscriptionEventSubscriptionEventType = { PauseSubscription: "PAUSE_SUBSCRIPTION", BillingAnchorDateChanged: "BILLING_ANCHOR_DATE_CHANGED", } as const; +export type SubscriptionEventSubscriptionEventType = + (typeof SubscriptionEventSubscriptionEventType)[keyof typeof SubscriptionEventSubscriptionEventType]; diff --git a/src/api/types/SubscriptionPhase.ts b/src/api/types/SubscriptionPhase.ts index d12e92001..7466f9337 100644 --- a/src/api/types/SubscriptionPhase.ts +++ b/src/api/types/SubscriptionPhase.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a phase in a subscription plan variation. For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). diff --git a/src/api/types/SubscriptionPricing.ts b/src/api/types/SubscriptionPricing.ts index 26fdc06f0..18f56de8c 100644 --- a/src/api/types/SubscriptionPricing.ts +++ b/src/api/types/SubscriptionPricing.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes the pricing for the subscription. diff --git a/src/api/types/SubscriptionPricingType.ts b/src/api/types/SubscriptionPricingType.ts index 02e717ce1..44b2375ed 100644 --- a/src/api/types/SubscriptionPricingType.ts +++ b/src/api/types/SubscriptionPricingType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Determines the pricing of a [Subscription](entity:Subscription) - */ -export type SubscriptionPricingType = "STATIC" | "RELATIVE"; +/** Determines the pricing of a [Subscription](entity:Subscription) */ export const SubscriptionPricingType = { Static: "STATIC", Relative: "RELATIVE", } as const; +export type SubscriptionPricingType = (typeof SubscriptionPricingType)[keyof typeof SubscriptionPricingType]; diff --git a/src/api/types/SubscriptionSource.ts b/src/api/types/SubscriptionSource.ts index 4ca4db7df..b19bc6954 100644 --- a/src/api/types/SubscriptionSource.ts +++ b/src/api/types/SubscriptionSource.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The origination details of the subscription. diff --git a/src/api/types/SubscriptionStatus.ts b/src/api/types/SubscriptionStatus.ts index 80e63932d..1f91caf88 100644 --- a/src/api/types/SubscriptionStatus.ts +++ b/src/api/types/SubscriptionStatus.ts @@ -1,11 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Supported subscription statuses. - */ -export type SubscriptionStatus = "PENDING" | "ACTIVE" | "CANCELED" | "DEACTIVATED" | "PAUSED" | "COMPLETED"; +/** Supported subscription statuses. */ export const SubscriptionStatus = { Pending: "PENDING", Active: "ACTIVE", @@ -14,3 +9,4 @@ export const SubscriptionStatus = { Paused: "PAUSED", Completed: "COMPLETED", } as const; +export type SubscriptionStatus = (typeof SubscriptionStatus)[keyof typeof SubscriptionStatus]; diff --git a/src/api/types/SubscriptionTestResult.ts b/src/api/types/SubscriptionTestResult.ts index dcaa70218..df2a6fa23 100644 --- a/src/api/types/SubscriptionTestResult.ts +++ b/src/api/types/SubscriptionTestResult.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the details of a webhook subscription, including notification URL, diff --git a/src/api/types/SubscriptionUpdatedEvent.ts b/src/api/types/SubscriptionUpdatedEvent.ts index 6e2b3ceaa..a1103d737 100644 --- a/src/api/types/SubscriptionUpdatedEvent.ts +++ b/src/api/types/SubscriptionUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Subscription](entity:Subscription) is updated. diff --git a/src/api/types/SubscriptionUpdatedEventData.ts b/src/api/types/SubscriptionUpdatedEventData.ts index 5d66a89cc..67b5964c1 100644 --- a/src/api/types/SubscriptionUpdatedEventData.ts +++ b/src/api/types/SubscriptionUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SubscriptionUpdatedEventData { /** Name of the affected object’s type, `"subscription"`. */ diff --git a/src/api/types/SubscriptionUpdatedEventObject.ts b/src/api/types/SubscriptionUpdatedEventObject.ts index e284b9256..8f9f01e06 100644 --- a/src/api/types/SubscriptionUpdatedEventObject.ts +++ b/src/api/types/SubscriptionUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface SubscriptionUpdatedEventObject { /** The updated subscription. */ diff --git a/src/api/types/SwapPlanResponse.ts b/src/api/types/SwapPlanResponse.ts index d431f6471..e3309947f 100644 --- a/src/api/types/SwapPlanResponse.ts +++ b/src/api/types/SwapPlanResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response of the diff --git a/src/api/types/TaxCalculationPhase.ts b/src/api/types/TaxCalculationPhase.ts index 9627c3bd7..a21f764a2 100644 --- a/src/api/types/TaxCalculationPhase.ts +++ b/src/api/types/TaxCalculationPhase.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * When to calculate the taxes due on a cart. - */ -export type TaxCalculationPhase = "TAX_SUBTOTAL_PHASE" | "TAX_TOTAL_PHASE"; +/** When to calculate the taxes due on a cart. */ export const TaxCalculationPhase = { TaxSubtotalPhase: "TAX_SUBTOTAL_PHASE", TaxTotalPhase: "TAX_TOTAL_PHASE", } as const; +export type TaxCalculationPhase = (typeof TaxCalculationPhase)[keyof typeof TaxCalculationPhase]; diff --git a/src/api/types/TaxIds.ts b/src/api/types/TaxIds.ts index 42ce0d3f6..16b9ab6e1 100644 --- a/src/api/types/TaxIds.ts +++ b/src/api/types/TaxIds.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Identifiers for the location used by various governments for tax purposes. diff --git a/src/api/types/TaxInclusionType.ts b/src/api/types/TaxInclusionType.ts index c9ef446b9..1ea79f63c 100644 --- a/src/api/types/TaxInclusionType.ts +++ b/src/api/types/TaxInclusionType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Whether to the tax amount should be additional to or included in the CatalogItem price. - */ -export type TaxInclusionType = "ADDITIVE" | "INCLUSIVE"; +/** Whether to the tax amount should be additional to or included in the CatalogItem price. */ export const TaxInclusionType = { Additive: "ADDITIVE", Inclusive: "INCLUSIVE", } as const; +export type TaxInclusionType = (typeof TaxInclusionType)[keyof typeof TaxInclusionType]; diff --git a/src/api/types/TeamMember.ts b/src/api/types/TeamMember.ts index b878cb8b5..5d8e244c5 100644 --- a/src/api/types/TeamMember.ts +++ b/src/api/types/TeamMember.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A record representing an individual team member for a business. diff --git a/src/api/types/TeamMemberAssignedLocations.ts b/src/api/types/TeamMemberAssignedLocations.ts index c55f08566..26d598737 100644 --- a/src/api/types/TeamMemberAssignedLocations.ts +++ b/src/api/types/TeamMemberAssignedLocations.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * An object that represents a team member's assignment to locations. diff --git a/src/api/types/TeamMemberAssignedLocationsAssignmentType.ts b/src/api/types/TeamMemberAssignedLocationsAssignmentType.ts index 599714a16..38418f6d8 100644 --- a/src/api/types/TeamMemberAssignedLocationsAssignmentType.ts +++ b/src/api/types/TeamMemberAssignedLocationsAssignmentType.ts @@ -1,12 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Enumerates the possible assignment types that the team member can have. - */ -export type TeamMemberAssignedLocationsAssignmentType = "ALL_CURRENT_AND_FUTURE_LOCATIONS" | "EXPLICIT_LOCATIONS"; +/** Enumerates the possible assignment types that the team member can have. */ export const TeamMemberAssignedLocationsAssignmentType = { AllCurrentAndFutureLocations: "ALL_CURRENT_AND_FUTURE_LOCATIONS", ExplicitLocations: "EXPLICIT_LOCATIONS", } as const; +export type TeamMemberAssignedLocationsAssignmentType = + (typeof TeamMemberAssignedLocationsAssignmentType)[keyof typeof TeamMemberAssignedLocationsAssignmentType]; diff --git a/src/api/types/TeamMemberBookingProfile.ts b/src/api/types/TeamMemberBookingProfile.ts index 2ac2d2a8c..17b3a5703 100644 --- a/src/api/types/TeamMemberBookingProfile.ts +++ b/src/api/types/TeamMemberBookingProfile.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The booking profile of a seller's team member, including the team member's ID, display name, description and whether the team member can be booked as a service provider. diff --git a/src/api/types/TeamMemberCreatedEvent.ts b/src/api/types/TeamMemberCreatedEvent.ts index f7dfbae12..aeff4df26 100644 --- a/src/api/types/TeamMemberCreatedEvent.ts +++ b/src/api/types/TeamMemberCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a Team Member is created. diff --git a/src/api/types/TeamMemberCreatedEventData.ts b/src/api/types/TeamMemberCreatedEventData.ts index af2f3edfc..dcf29bb2d 100644 --- a/src/api/types/TeamMemberCreatedEventData.ts +++ b/src/api/types/TeamMemberCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TeamMemberCreatedEventData { /** Name of the affected object’s type, `"team_member"`. */ diff --git a/src/api/types/TeamMemberCreatedEventObject.ts b/src/api/types/TeamMemberCreatedEventObject.ts index 5b001c88e..803697d8f 100644 --- a/src/api/types/TeamMemberCreatedEventObject.ts +++ b/src/api/types/TeamMemberCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TeamMemberCreatedEventObject { /** The created team member. */ diff --git a/src/api/types/TeamMemberInvitationStatus.ts b/src/api/types/TeamMemberInvitationStatus.ts index 4335971bb..519faed64 100644 --- a/src/api/types/TeamMemberInvitationStatus.ts +++ b/src/api/types/TeamMemberInvitationStatus.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Enumerates the possible invitation statuses the team member can have within a business. - */ -export type TeamMemberInvitationStatus = "UNINVITED" | "PENDING" | "ACCEPTED"; +/** Enumerates the possible invitation statuses the team member can have within a business. */ export const TeamMemberInvitationStatus = { Uninvited: "UNINVITED", Pending: "PENDING", Accepted: "ACCEPTED", } as const; +export type TeamMemberInvitationStatus = (typeof TeamMemberInvitationStatus)[keyof typeof TeamMemberInvitationStatus]; diff --git a/src/api/types/TeamMemberStatus.ts b/src/api/types/TeamMemberStatus.ts index 6ad59b666..36a3c90d3 100644 --- a/src/api/types/TeamMemberStatus.ts +++ b/src/api/types/TeamMemberStatus.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Enumerates the possible statuses the team member can have within a business. - */ -export type TeamMemberStatus = "ACTIVE" | "INACTIVE"; +/** Enumerates the possible statuses the team member can have within a business. */ export const TeamMemberStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; +export type TeamMemberStatus = (typeof TeamMemberStatus)[keyof typeof TeamMemberStatus]; diff --git a/src/api/types/TeamMemberUpdatedEvent.ts b/src/api/types/TeamMemberUpdatedEvent.ts index dc8c82260..28d1cde76 100644 --- a/src/api/types/TeamMemberUpdatedEvent.ts +++ b/src/api/types/TeamMemberUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a Team Member is updated. diff --git a/src/api/types/TeamMemberUpdatedEventData.ts b/src/api/types/TeamMemberUpdatedEventData.ts index 4d7f14acc..59899d37d 100644 --- a/src/api/types/TeamMemberUpdatedEventData.ts +++ b/src/api/types/TeamMemberUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TeamMemberUpdatedEventData { /** Name of the affected object’s type, `"team_member"`. */ diff --git a/src/api/types/TeamMemberUpdatedEventObject.ts b/src/api/types/TeamMemberUpdatedEventObject.ts index ce01e2842..1a1b7f9f7 100644 --- a/src/api/types/TeamMemberUpdatedEventObject.ts +++ b/src/api/types/TeamMemberUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TeamMemberUpdatedEventObject { /** The updated team member. */ diff --git a/src/api/types/TeamMemberWage.ts b/src/api/types/TeamMemberWage.ts index a1e255c78..0ac3c3e1a 100644 --- a/src/api/types/TeamMemberWage.ts +++ b/src/api/types/TeamMemberWage.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Job and wage information for a [team member](entity:TeamMember). diff --git a/src/api/types/TeamMemberWageSettingUpdatedEvent.ts b/src/api/types/TeamMemberWageSettingUpdatedEvent.ts index a307690d4..ae52f72c4 100644 --- a/src/api/types/TeamMemberWageSettingUpdatedEvent.ts +++ b/src/api/types/TeamMemberWageSettingUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a Wage Setting is updated. diff --git a/src/api/types/TeamMemberWageSettingUpdatedEventData.ts b/src/api/types/TeamMemberWageSettingUpdatedEventData.ts index 29d21b315..a57ccfc18 100644 --- a/src/api/types/TeamMemberWageSettingUpdatedEventData.ts +++ b/src/api/types/TeamMemberWageSettingUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TeamMemberWageSettingUpdatedEventData { /** Name of the affected object’s type, `"wage_setting"`. */ diff --git a/src/api/types/TeamMemberWageSettingUpdatedEventObject.ts b/src/api/types/TeamMemberWageSettingUpdatedEventObject.ts index 5c51b6ca5..346542a14 100644 --- a/src/api/types/TeamMemberWageSettingUpdatedEventObject.ts +++ b/src/api/types/TeamMemberWageSettingUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TeamMemberWageSettingUpdatedEventObject { /** The updated team member wage setting. */ diff --git a/src/api/types/Tender.ts b/src/api/types/Tender.ts index d0b7b1c0a..95852af6e 100644 --- a/src/api/types/Tender.ts +++ b/src/api/types/Tender.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a tender (i.e., a method of payment) used in a Square transaction. diff --git a/src/api/types/TenderBankAccountDetails.ts b/src/api/types/TenderBankAccountDetails.ts index 1199c1800..a6dd97549 100644 --- a/src/api/types/TenderBankAccountDetails.ts +++ b/src/api/types/TenderBankAccountDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the details of a tender with `type` `BANK_ACCOUNT`. diff --git a/src/api/types/TenderBankAccountDetailsStatus.ts b/src/api/types/TenderBankAccountDetailsStatus.ts index ac29a9563..756eef3dc 100644 --- a/src/api/types/TenderBankAccountDetailsStatus.ts +++ b/src/api/types/TenderBankAccountDetailsStatus.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the bank account payment's current status. - */ -export type TenderBankAccountDetailsStatus = "PENDING" | "COMPLETED" | "FAILED"; +/** Indicates the bank account payment's current status. */ export const TenderBankAccountDetailsStatus = { Pending: "PENDING", Completed: "COMPLETED", Failed: "FAILED", } as const; +export type TenderBankAccountDetailsStatus = + (typeof TenderBankAccountDetailsStatus)[keyof typeof TenderBankAccountDetailsStatus]; diff --git a/src/api/types/TenderBuyNowPayLaterDetails.ts b/src/api/types/TenderBuyNowPayLaterDetails.ts index 0fd644977..756083df0 100644 --- a/src/api/types/TenderBuyNowPayLaterDetails.ts +++ b/src/api/types/TenderBuyNowPayLaterDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. diff --git a/src/api/types/TenderBuyNowPayLaterDetailsBrand.ts b/src/api/types/TenderBuyNowPayLaterDetailsBrand.ts index 20d091150..8a387bc91 100644 --- a/src/api/types/TenderBuyNowPayLaterDetailsBrand.ts +++ b/src/api/types/TenderBuyNowPayLaterDetailsBrand.ts @@ -1,9 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type TenderBuyNowPayLaterDetailsBrand = "OTHER_BRAND" | "AFTERPAY"; export const TenderBuyNowPayLaterDetailsBrand = { OtherBrand: "OTHER_BRAND", Afterpay: "AFTERPAY", } as const; +export type TenderBuyNowPayLaterDetailsBrand = + (typeof TenderBuyNowPayLaterDetailsBrand)[keyof typeof TenderBuyNowPayLaterDetailsBrand]; diff --git a/src/api/types/TenderBuyNowPayLaterDetailsStatus.ts b/src/api/types/TenderBuyNowPayLaterDetailsStatus.ts index 64ee06f4e..7167b01c5 100644 --- a/src/api/types/TenderBuyNowPayLaterDetailsStatus.ts +++ b/src/api/types/TenderBuyNowPayLaterDetailsStatus.ts @@ -1,11 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type TenderBuyNowPayLaterDetailsStatus = "AUTHORIZED" | "CAPTURED" | "VOIDED" | "FAILED"; export const TenderBuyNowPayLaterDetailsStatus = { Authorized: "AUTHORIZED", Captured: "CAPTURED", Voided: "VOIDED", Failed: "FAILED", } as const; +export type TenderBuyNowPayLaterDetailsStatus = + (typeof TenderBuyNowPayLaterDetailsStatus)[keyof typeof TenderBuyNowPayLaterDetailsStatus]; diff --git a/src/api/types/TenderCardDetails.ts b/src/api/types/TenderCardDetails.ts index e31bec1c8..47737da84 100644 --- a/src/api/types/TenderCardDetails.ts +++ b/src/api/types/TenderCardDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` diff --git a/src/api/types/TenderCardDetailsEntryMethod.ts b/src/api/types/TenderCardDetailsEntryMethod.ts index d90918f9e..87e489311 100644 --- a/src/api/types/TenderCardDetailsEntryMethod.ts +++ b/src/api/types/TenderCardDetailsEntryMethod.ts @@ -1,11 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the method used to enter the card's details. - */ -export type TenderCardDetailsEntryMethod = "SWIPED" | "KEYED" | "EMV" | "ON_FILE" | "CONTACTLESS"; +/** Indicates the method used to enter the card's details. */ export const TenderCardDetailsEntryMethod = { Swiped: "SWIPED", Keyed: "KEYED", @@ -13,3 +8,5 @@ export const TenderCardDetailsEntryMethod = { OnFile: "ON_FILE", Contactless: "CONTACTLESS", } as const; +export type TenderCardDetailsEntryMethod = + (typeof TenderCardDetailsEntryMethod)[keyof typeof TenderCardDetailsEntryMethod]; diff --git a/src/api/types/TenderCardDetailsStatus.ts b/src/api/types/TenderCardDetailsStatus.ts index cc694fbd5..7242faab1 100644 --- a/src/api/types/TenderCardDetailsStatus.ts +++ b/src/api/types/TenderCardDetailsStatus.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the card transaction's current status. - */ -export type TenderCardDetailsStatus = "AUTHORIZED" | "CAPTURED" | "VOIDED" | "FAILED"; +/** Indicates the card transaction's current status. */ export const TenderCardDetailsStatus = { Authorized: "AUTHORIZED", Captured: "CAPTURED", Voided: "VOIDED", Failed: "FAILED", } as const; +export type TenderCardDetailsStatus = (typeof TenderCardDetailsStatus)[keyof typeof TenderCardDetailsStatus]; diff --git a/src/api/types/TenderCashDetails.ts b/src/api/types/TenderCashDetails.ts index 423925958..bfb8fba6e 100644 --- a/src/api/types/TenderCashDetails.ts +++ b/src/api/types/TenderCashDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the details of a tender with `type` `CASH`. diff --git a/src/api/types/TenderSquareAccountDetails.ts b/src/api/types/TenderSquareAccountDetails.ts index 7b340004c..84ae82c80 100644 --- a/src/api/types/TenderSquareAccountDetails.ts +++ b/src/api/types/TenderSquareAccountDetails.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents the details of a tender with `type` `SQUARE_ACCOUNT`. diff --git a/src/api/types/TenderSquareAccountDetailsStatus.ts b/src/api/types/TenderSquareAccountDetailsStatus.ts index 811f47cb2..fd5fe8a34 100644 --- a/src/api/types/TenderSquareAccountDetailsStatus.ts +++ b/src/api/types/TenderSquareAccountDetailsStatus.ts @@ -1,11 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type TenderSquareAccountDetailsStatus = "AUTHORIZED" | "CAPTURED" | "VOIDED" | "FAILED"; export const TenderSquareAccountDetailsStatus = { Authorized: "AUTHORIZED", Captured: "CAPTURED", Voided: "VOIDED", Failed: "FAILED", } as const; +export type TenderSquareAccountDetailsStatus = + (typeof TenderSquareAccountDetailsStatus)[keyof typeof TenderSquareAccountDetailsStatus]; diff --git a/src/api/types/TenderType.ts b/src/api/types/TenderType.ts index 36f3223f3..93b9fc856 100644 --- a/src/api/types/TenderType.ts +++ b/src/api/types/TenderType.ts @@ -1,21 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates a tender's type. - */ -export type TenderType = - | "CARD" - | "CASH" - | "THIRD_PARTY_CARD" - | "SQUARE_GIFT_CARD" - | "NO_SALE" - | "BANK_ACCOUNT" - | "WALLET" - | "BUY_NOW_PAY_LATER" - | "SQUARE_ACCOUNT" - | "OTHER"; +/** Indicates a tender's type. */ export const TenderType = { Card: "CARD", Cash: "CASH", @@ -28,3 +13,4 @@ export const TenderType = { SquareAccount: "SQUARE_ACCOUNT", Other: "OTHER", } as const; +export type TenderType = (typeof TenderType)[keyof typeof TenderType]; diff --git a/src/api/types/TerminalAction.ts b/src/api/types/TerminalAction.ts index 0bc88412d..7c09f61ca 100644 --- a/src/api/types/TerminalAction.ts +++ b/src/api/types/TerminalAction.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an action processed by the Square Terminal. diff --git a/src/api/types/TerminalActionActionType.ts b/src/api/types/TerminalActionActionType.ts index 3eea1e7c4..34a8e6162 100644 --- a/src/api/types/TerminalActionActionType.ts +++ b/src/api/types/TerminalActionActionType.ts @@ -1,19 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. - */ -export type TerminalActionActionType = - | "QR_CODE" - | "PING" - | "SAVE_CARD" - | "SIGNATURE" - | "CONFIRMATION" - | "RECEIPT" - | "DATA_COLLECTION" - | "SELECT"; +/** Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. */ export const TerminalActionActionType = { QrCode: "QR_CODE", Ping: "PING", @@ -24,3 +11,4 @@ export const TerminalActionActionType = { DataCollection: "DATA_COLLECTION", Select: "SELECT", } as const; +export type TerminalActionActionType = (typeof TerminalActionActionType)[keyof typeof TerminalActionActionType]; diff --git a/src/api/types/TerminalActionCreatedEvent.ts b/src/api/types/TerminalActionCreatedEvent.ts index f2adf234a..d5e29af44 100644 --- a/src/api/types/TerminalActionCreatedEvent.ts +++ b/src/api/types/TerminalActionCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a TerminalAction is created. diff --git a/src/api/types/TerminalActionCreatedEventData.ts b/src/api/types/TerminalActionCreatedEventData.ts index cc97f575a..1a7b730ae 100644 --- a/src/api/types/TerminalActionCreatedEventData.ts +++ b/src/api/types/TerminalActionCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalActionCreatedEventData { /** Name of the created object’s type, `"action"`. */ diff --git a/src/api/types/TerminalActionCreatedEventObject.ts b/src/api/types/TerminalActionCreatedEventObject.ts index abc06f71c..2ed2a2c81 100644 --- a/src/api/types/TerminalActionCreatedEventObject.ts +++ b/src/api/types/TerminalActionCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalActionCreatedEventObject { /** The created terminal action. */ diff --git a/src/api/types/TerminalActionQuery.ts b/src/api/types/TerminalActionQuery.ts index 8dcd1d695..9415334a8 100644 --- a/src/api/types/TerminalActionQuery.ts +++ b/src/api/types/TerminalActionQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalActionQuery { /** Options for filtering returned `TerminalAction`s */ diff --git a/src/api/types/TerminalActionQueryFilter.ts b/src/api/types/TerminalActionQueryFilter.ts index b37e776e7..c96518698 100644 --- a/src/api/types/TerminalActionQueryFilter.ts +++ b/src/api/types/TerminalActionQueryFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalActionQueryFilter { /** diff --git a/src/api/types/TerminalActionQuerySort.ts b/src/api/types/TerminalActionQuerySort.ts index 9bd211967..b86f125f1 100644 --- a/src/api/types/TerminalActionQuerySort.ts +++ b/src/api/types/TerminalActionQuerySort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalActionQuerySort { /** diff --git a/src/api/types/TerminalActionUpdatedEvent.ts b/src/api/types/TerminalActionUpdatedEvent.ts index df9adb9ad..a088c272b 100644 --- a/src/api/types/TerminalActionUpdatedEvent.ts +++ b/src/api/types/TerminalActionUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a TerminalAction is updated. diff --git a/src/api/types/TerminalActionUpdatedEventData.ts b/src/api/types/TerminalActionUpdatedEventData.ts index 785ba72e8..8ce3b78ae 100644 --- a/src/api/types/TerminalActionUpdatedEventData.ts +++ b/src/api/types/TerminalActionUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalActionUpdatedEventData { /** Name of the updated object’s type, `"action"`. */ diff --git a/src/api/types/TerminalActionUpdatedEventObject.ts b/src/api/types/TerminalActionUpdatedEventObject.ts index e287bb58d..90443407e 100644 --- a/src/api/types/TerminalActionUpdatedEventObject.ts +++ b/src/api/types/TerminalActionUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalActionUpdatedEventObject { /** The updated terminal action. */ diff --git a/src/api/types/TerminalCheckout.ts b/src/api/types/TerminalCheckout.ts index 1247ec526..9935a3fff 100644 --- a/src/api/types/TerminalCheckout.ts +++ b/src/api/types/TerminalCheckout.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a checkout processed by the Square Terminal. diff --git a/src/api/types/TerminalCheckoutCreatedEvent.ts b/src/api/types/TerminalCheckoutCreatedEvent.ts index 882e22032..f65178344 100644 --- a/src/api/types/TerminalCheckoutCreatedEvent.ts +++ b/src/api/types/TerminalCheckoutCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [TerminalCheckout](entity:TerminalCheckout) is created. diff --git a/src/api/types/TerminalCheckoutCreatedEventData.ts b/src/api/types/TerminalCheckoutCreatedEventData.ts index 185540003..37a8ba5a0 100644 --- a/src/api/types/TerminalCheckoutCreatedEventData.ts +++ b/src/api/types/TerminalCheckoutCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalCheckoutCreatedEventData { /** Name of the created object’s type, `"checkout"`. */ diff --git a/src/api/types/TerminalCheckoutCreatedEventObject.ts b/src/api/types/TerminalCheckoutCreatedEventObject.ts index 95871ff27..85e93c3b5 100644 --- a/src/api/types/TerminalCheckoutCreatedEventObject.ts +++ b/src/api/types/TerminalCheckoutCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalCheckoutCreatedEventObject { /** The created terminal checkout */ diff --git a/src/api/types/TerminalCheckoutQuery.ts b/src/api/types/TerminalCheckoutQuery.ts index ff31643bc..ebeb298a0 100644 --- a/src/api/types/TerminalCheckoutQuery.ts +++ b/src/api/types/TerminalCheckoutQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalCheckoutQuery { /** Options for filtering returned `TerminalCheckout` objects. */ diff --git a/src/api/types/TerminalCheckoutQueryFilter.ts b/src/api/types/TerminalCheckoutQueryFilter.ts index 0bad649c3..e576423af 100644 --- a/src/api/types/TerminalCheckoutQueryFilter.ts +++ b/src/api/types/TerminalCheckoutQueryFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalCheckoutQueryFilter { /** diff --git a/src/api/types/TerminalCheckoutQuerySort.ts b/src/api/types/TerminalCheckoutQuerySort.ts index f9cec6434..dc6f63662 100644 --- a/src/api/types/TerminalCheckoutQuerySort.ts +++ b/src/api/types/TerminalCheckoutQuerySort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalCheckoutQuerySort { /** diff --git a/src/api/types/TerminalCheckoutUpdatedEvent.ts b/src/api/types/TerminalCheckoutUpdatedEvent.ts index 5a3e54993..92c23e301 100644 --- a/src/api/types/TerminalCheckoutUpdatedEvent.ts +++ b/src/api/types/TerminalCheckoutUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [TerminalCheckout](entity:TerminalCheckout) is updated. diff --git a/src/api/types/TerminalCheckoutUpdatedEventData.ts b/src/api/types/TerminalCheckoutUpdatedEventData.ts index eec1ee3d3..7f365cce0 100644 --- a/src/api/types/TerminalCheckoutUpdatedEventData.ts +++ b/src/api/types/TerminalCheckoutUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalCheckoutUpdatedEventData { /** Name of the updated object’s type, `"checkout"`. */ diff --git a/src/api/types/TerminalCheckoutUpdatedEventObject.ts b/src/api/types/TerminalCheckoutUpdatedEventObject.ts index 7a51fb290..2553baf16 100644 --- a/src/api/types/TerminalCheckoutUpdatedEventObject.ts +++ b/src/api/types/TerminalCheckoutUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalCheckoutUpdatedEventObject { /** The updated terminal checkout */ diff --git a/src/api/types/TerminalRefund.ts b/src/api/types/TerminalRefund.ts index eb858f1e9..6d3d07efc 100644 --- a/src/api/types/TerminalRefund.ts +++ b/src/api/types/TerminalRefund.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. diff --git a/src/api/types/TerminalRefundCreatedEvent.ts b/src/api/types/TerminalRefundCreatedEvent.ts index 4b4dab55a..9e0b8a9b3 100644 --- a/src/api/types/TerminalRefundCreatedEvent.ts +++ b/src/api/types/TerminalRefundCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a Terminal API refund is created. diff --git a/src/api/types/TerminalRefundCreatedEventData.ts b/src/api/types/TerminalRefundCreatedEventData.ts index f8477f22a..3a9b33bb3 100644 --- a/src/api/types/TerminalRefundCreatedEventData.ts +++ b/src/api/types/TerminalRefundCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalRefundCreatedEventData { /** Name of the created object’s type, `"refund"`. */ diff --git a/src/api/types/TerminalRefundCreatedEventObject.ts b/src/api/types/TerminalRefundCreatedEventObject.ts index 5cc3e3ac0..b3bead4c6 100644 --- a/src/api/types/TerminalRefundCreatedEventObject.ts +++ b/src/api/types/TerminalRefundCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalRefundCreatedEventObject { /** The created terminal refund. */ diff --git a/src/api/types/TerminalRefundQuery.ts b/src/api/types/TerminalRefundQuery.ts index 99a8c3ebd..a17a12d53 100644 --- a/src/api/types/TerminalRefundQuery.ts +++ b/src/api/types/TerminalRefundQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalRefundQuery { /** The filter for the Terminal refund query. */ diff --git a/src/api/types/TerminalRefundQueryFilter.ts b/src/api/types/TerminalRefundQueryFilter.ts index 8afc83ed8..82812a0b1 100644 --- a/src/api/types/TerminalRefundQueryFilter.ts +++ b/src/api/types/TerminalRefundQueryFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalRefundQueryFilter { /** diff --git a/src/api/types/TerminalRefundQuerySort.ts b/src/api/types/TerminalRefundQuerySort.ts index 277d8f115..7e2a40b2b 100644 --- a/src/api/types/TerminalRefundQuerySort.ts +++ b/src/api/types/TerminalRefundQuerySort.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface TerminalRefundQuerySort { /** diff --git a/src/api/types/TerminalRefundUpdatedEvent.ts b/src/api/types/TerminalRefundUpdatedEvent.ts index fd38c9e1d..8b6a14e97 100644 --- a/src/api/types/TerminalRefundUpdatedEvent.ts +++ b/src/api/types/TerminalRefundUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a Terminal API refund is updated. diff --git a/src/api/types/TerminalRefundUpdatedEventData.ts b/src/api/types/TerminalRefundUpdatedEventData.ts index ec64faf3a..6f170d172 100644 --- a/src/api/types/TerminalRefundUpdatedEventData.ts +++ b/src/api/types/TerminalRefundUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalRefundUpdatedEventData { /** Name of the updated object’s type, `"refund"`. */ diff --git a/src/api/types/TerminalRefundUpdatedEventObject.ts b/src/api/types/TerminalRefundUpdatedEventObject.ts index 2f20e8473..668583283 100644 --- a/src/api/types/TerminalRefundUpdatedEventObject.ts +++ b/src/api/types/TerminalRefundUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TerminalRefundUpdatedEventObject { /** The updated terminal refund. */ diff --git a/src/api/types/TestWebhookSubscriptionResponse.ts b/src/api/types/TestWebhookSubscriptionResponse.ts index 01af77619..e0894b973 100644 --- a/src/api/types/TestWebhookSubscriptionResponse.ts +++ b/src/api/types/TestWebhookSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/TimeRange.ts b/src/api/types/TimeRange.ts index f0624288c..9c2fe5e69 100644 --- a/src/api/types/TimeRange.ts +++ b/src/api/types/TimeRange.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a generic time range. The start and end values are diff --git a/src/api/types/Timecard.ts b/src/api/types/Timecard.ts index 5e7ff025f..37008e0d4 100644 --- a/src/api/types/Timecard.ts +++ b/src/api/types/Timecard.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A record of the hourly rate, start time, and end time of a single timecard (shift) diff --git a/src/api/types/TimecardFilter.ts b/src/api/types/TimecardFilter.ts index b81f5f90f..11c651c03 100644 --- a/src/api/types/TimecardFilter.ts +++ b/src/api/types/TimecardFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines a filter used in a search for `Timecard` records. `AND` logic is diff --git a/src/api/types/TimecardFilterStatus.ts b/src/api/types/TimecardFilterStatus.ts index d22fcad21..6fb11bbe8 100644 --- a/src/api/types/TimecardFilterStatus.ts +++ b/src/api/types/TimecardFilterStatus.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Specifies the `status` of `Timecard` records to be returned. - */ -export type TimecardFilterStatus = "OPEN" | "CLOSED"; +/** Specifies the `status` of `Timecard` records to be returned. */ export const TimecardFilterStatus = { Open: "OPEN", Closed: "CLOSED", } as const; +export type TimecardFilterStatus = (typeof TimecardFilterStatus)[keyof typeof TimecardFilterStatus]; diff --git a/src/api/types/TimecardQuery.ts b/src/api/types/TimecardQuery.ts index 17307416c..439c1583c 100644 --- a/src/api/types/TimecardQuery.ts +++ b/src/api/types/TimecardQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The parameters of a `Timecard` search query, which includes filter and sort options. diff --git a/src/api/types/TimecardSort.ts b/src/api/types/TimecardSort.ts index 5d2e15ebc..31cf03f10 100644 --- a/src/api/types/TimecardSort.ts +++ b/src/api/types/TimecardSort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Sets the sort order of search results. diff --git a/src/api/types/TimecardSortField.ts b/src/api/types/TimecardSortField.ts index 920b24412..d53d3eafa 100644 --- a/src/api/types/TimecardSortField.ts +++ b/src/api/types/TimecardSortField.ts @@ -1,14 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Enumerates the `Timecard` fields to sort on. - */ -export type TimecardSortField = "START_AT" | "END_AT" | "CREATED_AT" | "UPDATED_AT"; +/** Enumerates the `Timecard` fields to sort on. */ export const TimecardSortField = { StartAt: "START_AT", EndAt: "END_AT", CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; +export type TimecardSortField = (typeof TimecardSortField)[keyof typeof TimecardSortField]; diff --git a/src/api/types/TimecardStatus.ts b/src/api/types/TimecardStatus.ts index bdebe5c48..52aeee448 100644 --- a/src/api/types/TimecardStatus.ts +++ b/src/api/types/TimecardStatus.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * **Read only** Enumerates the possible status of a [timecard](entity:Timecard). - */ -export type TimecardStatus = "OPEN" | "CLOSED"; +/** **Read only** Enumerates the possible status of a [timecard](entity:Timecard). */ export const TimecardStatus = { Open: "OPEN", Closed: "CLOSED", } as const; +export type TimecardStatus = (typeof TimecardStatus)[keyof typeof TimecardStatus]; diff --git a/src/api/types/TimecardWage.ts b/src/api/types/TimecardWage.ts index 1a0a11148..f6e498e8e 100644 --- a/src/api/types/TimecardWage.ts +++ b/src/api/types/TimecardWage.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The hourly wage rate used to compensate a team member for a [timecard](entity:Timecard). diff --git a/src/api/types/TimecardWorkday.ts b/src/api/types/TimecardWorkday.ts index 260d01157..c7db45631 100644 --- a/src/api/types/TimecardWorkday.ts +++ b/src/api/types/TimecardWorkday.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A `Timecard` search query filter parameter that sets a range of days that diff --git a/src/api/types/TimecardWorkdayMatcher.ts b/src/api/types/TimecardWorkdayMatcher.ts index 9c3285812..88b397ec7 100644 --- a/src/api/types/TimecardWorkdayMatcher.ts +++ b/src/api/types/TimecardWorkdayMatcher.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Defines the logic used to apply a workday filter. - */ -export type TimecardWorkdayMatcher = "START_AT" | "END_AT" | "INTERSECTION"; +/** Defines the logic used to apply a workday filter. */ export const TimecardWorkdayMatcher = { StartAt: "START_AT", EndAt: "END_AT", Intersection: "INTERSECTION", } as const; +export type TimecardWorkdayMatcher = (typeof TimecardWorkdayMatcher)[keyof typeof TimecardWorkdayMatcher]; diff --git a/src/api/types/TipSettings.ts b/src/api/types/TipSettings.ts index 00b18e986..d261b60d7 100644 --- a/src/api/types/TipSettings.ts +++ b/src/api/types/TipSettings.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface TipSettings { /** Indicates whether tipping is enabled for this checkout. Defaults to false. */ diff --git a/src/api/types/Transaction.ts b/src/api/types/Transaction.ts index 50ccaf1a3..c7ccdbbd1 100644 --- a/src/api/types/Transaction.ts +++ b/src/api/types/Transaction.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a transaction processed with Square, either with the diff --git a/src/api/types/TransactionProduct.ts b/src/api/types/TransactionProduct.ts index 4d481f24d..2b1fd275f 100644 --- a/src/api/types/TransactionProduct.ts +++ b/src/api/types/TransactionProduct.ts @@ -1,19 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Indicates the Square product used to process a transaction. - */ -export type TransactionProduct = - | "REGISTER" - | "EXTERNAL_API" - | "BILLING" - | "APPOINTMENTS" - | "INVOICES" - | "ONLINE_STORE" - | "PAYROLL" - | "OTHER"; +/** Indicates the Square product used to process a transaction. */ export const TransactionProduct = { Register: "REGISTER", ExternalApi: "EXTERNAL_API", @@ -24,3 +11,4 @@ export const TransactionProduct = { Payroll: "PAYROLL", Other: "OTHER", } as const; +export type TransactionProduct = (typeof TransactionProduct)[keyof typeof TransactionProduct]; diff --git a/src/api/types/TransactionType.ts b/src/api/types/TransactionType.ts index c9e6b3317..7ef1d5ad0 100644 --- a/src/api/types/TransactionType.ts +++ b/src/api/types/TransactionType.ts @@ -1,12 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The transaction type used in the disputed payment. - */ -export type TransactionType = "DEBIT" | "CREDIT"; +/** The transaction type used in the disputed payment. */ export const TransactionType = { Debit: "DEBIT", Credit: "CREDIT", } as const; +export type TransactionType = (typeof TransactionType)[keyof typeof TransactionType]; diff --git a/src/api/types/TransferOrder.ts b/src/api/types/TransferOrder.ts index 38e9be59d..b8f235370 100644 --- a/src/api/types/TransferOrder.ts +++ b/src/api/types/TransferOrder.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a transfer order for moving [CatalogItemVariation](entity:CatalogItemVariation)s diff --git a/src/api/types/TransferOrderCreatedEvent.ts b/src/api/types/TransferOrderCreatedEvent.ts index 1d5b14e75..91c7a5f05 100644 --- a/src/api/types/TransferOrderCreatedEvent.ts +++ b/src/api/types/TransferOrderCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a transfer_order is created. diff --git a/src/api/types/TransferOrderCreatedEventData.ts b/src/api/types/TransferOrderCreatedEventData.ts index 18dc372b5..bf319f75c 100644 --- a/src/api/types/TransferOrderCreatedEventData.ts +++ b/src/api/types/TransferOrderCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TransferOrderCreatedEventData { /** Name of the affected object’s type, `"transfer_order"`. */ diff --git a/src/api/types/TransferOrderCreatedEventObject.ts b/src/api/types/TransferOrderCreatedEventObject.ts index 66358281f..2fd486b18 100644 --- a/src/api/types/TransferOrderCreatedEventObject.ts +++ b/src/api/types/TransferOrderCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TransferOrderCreatedEventObject { /** The created transfer_order. */ diff --git a/src/api/types/TransferOrderDeletedEvent.ts b/src/api/types/TransferOrderDeletedEvent.ts index b6826d923..1396e345d 100644 --- a/src/api/types/TransferOrderDeletedEvent.ts +++ b/src/api/types/TransferOrderDeletedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a transfer_order is deleted. diff --git a/src/api/types/TransferOrderDeletedEventData.ts b/src/api/types/TransferOrderDeletedEventData.ts index f2359ac43..bbd6be345 100644 --- a/src/api/types/TransferOrderDeletedEventData.ts +++ b/src/api/types/TransferOrderDeletedEventData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface TransferOrderDeletedEventData { /** Name of the affected object’s type, `"transfer_order"`. */ diff --git a/src/api/types/TransferOrderFilter.ts b/src/api/types/TransferOrderFilter.ts index 1df1a25fe..2712b6509 100644 --- a/src/api/types/TransferOrderFilter.ts +++ b/src/api/types/TransferOrderFilter.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Filter criteria for searching transfer orders diff --git a/src/api/types/TransferOrderGoodsReceipt.ts b/src/api/types/TransferOrderGoodsReceipt.ts index ad44aca8c..834639d9e 100644 --- a/src/api/types/TransferOrderGoodsReceipt.ts +++ b/src/api/types/TransferOrderGoodsReceipt.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The goods receipt details for a transfer order. This object represents a single receipt diff --git a/src/api/types/TransferOrderGoodsReceiptLineItem.ts b/src/api/types/TransferOrderGoodsReceiptLineItem.ts index e22fafd1e..54ff5b5a6 100644 --- a/src/api/types/TransferOrderGoodsReceiptLineItem.ts +++ b/src/api/types/TransferOrderGoodsReceiptLineItem.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * A simplified line item for goods receipts in transfer orders diff --git a/src/api/types/TransferOrderLine.ts b/src/api/types/TransferOrderLine.ts index 2dc146fe3..599a22445 100644 --- a/src/api/types/TransferOrderLine.ts +++ b/src/api/types/TransferOrderLine.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a line item in a transfer order. Each line item tracks a specific diff --git a/src/api/types/TransferOrderQuery.ts b/src/api/types/TransferOrderQuery.ts index 13e3a282b..be8f3ddc4 100644 --- a/src/api/types/TransferOrderQuery.ts +++ b/src/api/types/TransferOrderQuery.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Query parameters for searching transfer orders diff --git a/src/api/types/TransferOrderSort.ts b/src/api/types/TransferOrderSort.ts index 64a794fdf..0fa8c6175 100644 --- a/src/api/types/TransferOrderSort.ts +++ b/src/api/types/TransferOrderSort.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Sort configuration for search results diff --git a/src/api/types/TransferOrderSortField.ts b/src/api/types/TransferOrderSortField.ts index b704e8b4f..f14b92d79 100644 --- a/src/api/types/TransferOrderSortField.ts +++ b/src/api/types/TransferOrderSortField.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Fields that can be used for sorting [TransferOrder](entity:TransferOrder)s in search results. * Used with [SearchTransferOrders](api-endpoint:TransferOrders-SearchTransferOrders) to control * the order of returned results. */ -export type TransferOrderSortField = "CREATED_AT" | "UPDATED_AT"; export const TransferOrderSortField = { CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; +export type TransferOrderSortField = (typeof TransferOrderSortField)[keyof typeof TransferOrderSortField]; diff --git a/src/api/types/TransferOrderStatus.ts b/src/api/types/TransferOrderStatus.ts index b3eb9eb2d..23bf9f7a7 100644 --- a/src/api/types/TransferOrderStatus.ts +++ b/src/api/types/TransferOrderStatus.ts @@ -1,13 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Status values for transfer orders. Represents the current state of a * [TransferOrder](entity:TransferOrder) in its lifecycle from creation to completion. * Each status determines what actions are available and how inventory is affected. */ -export type TransferOrderStatus = "DRAFT" | "STARTED" | "PARTIALLY_RECEIVED" | "COMPLETED" | "CANCELED"; export const TransferOrderStatus = { Draft: "DRAFT", Started: "STARTED", @@ -15,3 +12,4 @@ export const TransferOrderStatus = { Completed: "COMPLETED", Canceled: "CANCELED", } as const; +export type TransferOrderStatus = (typeof TransferOrderStatus)[keyof typeof TransferOrderStatus]; diff --git a/src/api/types/TransferOrderUpdatedEvent.ts b/src/api/types/TransferOrderUpdatedEvent.ts index ae0203992..25a5c3352 100644 --- a/src/api/types/TransferOrderUpdatedEvent.ts +++ b/src/api/types/TransferOrderUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a transfer_order is updated. diff --git a/src/api/types/TransferOrderUpdatedEventData.ts b/src/api/types/TransferOrderUpdatedEventData.ts index bf6998995..71839f8e5 100644 --- a/src/api/types/TransferOrderUpdatedEventData.ts +++ b/src/api/types/TransferOrderUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TransferOrderUpdatedEventData { /** Name of the affected object’s type, `"transfer_order"`. */ diff --git a/src/api/types/TransferOrderUpdatedEventObject.ts b/src/api/types/TransferOrderUpdatedEventObject.ts index 198e8811d..823eb477d 100644 --- a/src/api/types/TransferOrderUpdatedEventObject.ts +++ b/src/api/types/TransferOrderUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface TransferOrderUpdatedEventObject { /** The updated transfer_order. */ diff --git a/src/api/types/UnlinkCustomerFromGiftCardResponse.ts b/src/api/types/UnlinkCustomerFromGiftCardResponse.ts index f8dec48c7..ed26de129 100644 --- a/src/api/types/UnlinkCustomerFromGiftCardResponse.ts +++ b/src/api/types/UnlinkCustomerFromGiftCardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response that contains the unlinked `GiftCard` object. If the request resulted in errors, diff --git a/src/api/types/UpdateBookingCustomAttributeDefinitionResponse.ts b/src/api/types/UpdateBookingCustomAttributeDefinitionResponse.ts index 1313eb17f..920fca044 100644 --- a/src/api/types/UpdateBookingCustomAttributeDefinitionResponse.ts +++ b/src/api/types/UpdateBookingCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) response. diff --git a/src/api/types/UpdateBookingResponse.ts b/src/api/types/UpdateBookingResponse.ts index 519c8dc71..e4cca5eea 100644 --- a/src/api/types/UpdateBookingResponse.ts +++ b/src/api/types/UpdateBookingResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface UpdateBookingResponse { /** The booking that was updated. */ diff --git a/src/api/types/UpdateBreakTypeResponse.ts b/src/api/types/UpdateBreakTypeResponse.ts index 094813247..352c2a088 100644 --- a/src/api/types/UpdateBreakTypeResponse.ts +++ b/src/api/types/UpdateBreakTypeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A response to a request to update a `BreakType`. The response contains diff --git a/src/api/types/UpdateCatalogImageRequest.ts b/src/api/types/UpdateCatalogImageRequest.ts index 89b7091d7..04a87cf16 100644 --- a/src/api/types/UpdateCatalogImageRequest.ts +++ b/src/api/types/UpdateCatalogImageRequest.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export interface UpdateCatalogImageRequest { /** diff --git a/src/api/types/UpdateCatalogImageResponse.ts b/src/api/types/UpdateCatalogImageResponse.ts index c574bcbf0..6f24b5223 100644 --- a/src/api/types/UpdateCatalogImageResponse.ts +++ b/src/api/types/UpdateCatalogImageResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface UpdateCatalogImageResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/UpdateCustomerCustomAttributeDefinitionResponse.ts b/src/api/types/UpdateCustomerCustomAttributeDefinitionResponse.ts index b5760da5b..bfe267a14 100644 --- a/src/api/types/UpdateCustomerCustomAttributeDefinitionResponse.ts +++ b/src/api/types/UpdateCustomerCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) response. diff --git a/src/api/types/UpdateCustomerGroupResponse.ts b/src/api/types/UpdateCustomerGroupResponse.ts index 913d8c6f4..fde43363f 100644 --- a/src/api/types/UpdateCustomerGroupResponse.ts +++ b/src/api/types/UpdateCustomerGroupResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/UpdateCustomerResponse.ts b/src/api/types/UpdateCustomerResponse.ts index 7f949f940..1212e35bb 100644 --- a/src/api/types/UpdateCustomerResponse.ts +++ b/src/api/types/UpdateCustomerResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/UpdateInvoiceResponse.ts b/src/api/types/UpdateInvoiceResponse.ts index d6f79f3e3..af2690e24 100644 --- a/src/api/types/UpdateInvoiceResponse.ts +++ b/src/api/types/UpdateInvoiceResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Describes a `UpdateInvoice` response. diff --git a/src/api/types/UpdateItemModifierListsResponse.ts b/src/api/types/UpdateItemModifierListsResponse.ts index 0559418e8..4a13ac226 100644 --- a/src/api/types/UpdateItemModifierListsResponse.ts +++ b/src/api/types/UpdateItemModifierListsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface UpdateItemModifierListsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/UpdateItemTaxesResponse.ts b/src/api/types/UpdateItemTaxesResponse.ts index d0f11d28b..02761f4ed 100644 --- a/src/api/types/UpdateItemTaxesResponse.ts +++ b/src/api/types/UpdateItemTaxesResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface UpdateItemTaxesResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/UpdateJobResponse.ts b/src/api/types/UpdateJobResponse.ts index a07019f8e..256824356 100644 --- a/src/api/types/UpdateJobResponse.ts +++ b/src/api/types/UpdateJobResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [UpdateJob](api-endpoint:Team-UpdateJob) response. Either `job` or `errors` diff --git a/src/api/types/UpdateLocationCustomAttributeDefinitionResponse.ts b/src/api/types/UpdateLocationCustomAttributeDefinitionResponse.ts index 0c649bc07..64bfbf8cb 100644 --- a/src/api/types/UpdateLocationCustomAttributeDefinitionResponse.ts +++ b/src/api/types/UpdateLocationCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) response. diff --git a/src/api/types/UpdateLocationResponse.ts b/src/api/types/UpdateLocationResponse.ts index 25aede1c6..9f875deef 100644 --- a/src/api/types/UpdateLocationResponse.ts +++ b/src/api/types/UpdateLocationResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response object returned by the [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint. diff --git a/src/api/types/UpdateLocationSettingsResponse.ts b/src/api/types/UpdateLocationSettingsResponse.ts index f6d4a37d2..5556e1f82 100644 --- a/src/api/types/UpdateLocationSettingsResponse.ts +++ b/src/api/types/UpdateLocationSettingsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface UpdateLocationSettingsResponse { /** Any errors that occurred when updating the location settings. */ diff --git a/src/api/types/UpdateMerchantCustomAttributeDefinitionResponse.ts b/src/api/types/UpdateMerchantCustomAttributeDefinitionResponse.ts index c6f872588..49f87b262 100644 --- a/src/api/types/UpdateMerchantCustomAttributeDefinitionResponse.ts +++ b/src/api/types/UpdateMerchantCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) response. diff --git a/src/api/types/UpdateMerchantSettingsResponse.ts b/src/api/types/UpdateMerchantSettingsResponse.ts index 51b94b7f1..2412c7281 100644 --- a/src/api/types/UpdateMerchantSettingsResponse.ts +++ b/src/api/types/UpdateMerchantSettingsResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface UpdateMerchantSettingsResponse { /** Any errors that occurred when updating the merchant settings. */ diff --git a/src/api/types/UpdateOrderCustomAttributeDefinitionResponse.ts b/src/api/types/UpdateOrderCustomAttributeDefinitionResponse.ts index 85b32051f..1cc2dbf69 100644 --- a/src/api/types/UpdateOrderCustomAttributeDefinitionResponse.ts +++ b/src/api/types/UpdateOrderCustomAttributeDefinitionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from updating an order custom attribute definition. diff --git a/src/api/types/UpdateOrderResponse.ts b/src/api/types/UpdateOrderResponse.ts index 50f3ff049..ddfe56d96 100644 --- a/src/api/types/UpdateOrderResponse.ts +++ b/src/api/types/UpdateOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/UpdatePaymentLinkResponse.ts b/src/api/types/UpdatePaymentLinkResponse.ts index 5db98657d..d43a05056 100644 --- a/src/api/types/UpdatePaymentLinkResponse.ts +++ b/src/api/types/UpdatePaymentLinkResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface UpdatePaymentLinkResponse { /** Any errors that occurred when updating the payment link. */ diff --git a/src/api/types/UpdatePaymentResponse.ts b/src/api/types/UpdatePaymentResponse.ts index 13c975379..167f3b512 100644 --- a/src/api/types/UpdatePaymentResponse.ts +++ b/src/api/types/UpdatePaymentResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the response returned by diff --git a/src/api/types/UpdateScheduledShiftResponse.ts b/src/api/types/UpdateScheduledShiftResponse.ts index eca29e68b..ed9ab1509 100644 --- a/src/api/types/UpdateScheduledShiftResponse.ts +++ b/src/api/types/UpdateScheduledShiftResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [UpdateScheduledShift](api-endpoint:Labor-UpdateScheduledShift) response. diff --git a/src/api/types/UpdateShiftResponse.ts b/src/api/types/UpdateShiftResponse.ts index 0acfcc969..05501782a 100644 --- a/src/api/types/UpdateShiftResponse.ts +++ b/src/api/types/UpdateShiftResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request to update a `Shift`. The response contains diff --git a/src/api/types/UpdateSubscriptionResponse.ts b/src/api/types/UpdateSubscriptionResponse.ts index 134a6ac96..c0898d95c 100644 --- a/src/api/types/UpdateSubscriptionResponse.ts +++ b/src/api/types/UpdateSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/UpdateTeamMemberRequest.ts b/src/api/types/UpdateTeamMemberRequest.ts index 4944b1cf6..ad8efa32c 100644 --- a/src/api/types/UpdateTeamMemberRequest.ts +++ b/src/api/types/UpdateTeamMemberRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an update request for a `TeamMember` object. diff --git a/src/api/types/UpdateTeamMemberResponse.ts b/src/api/types/UpdateTeamMemberResponse.ts index 498af27a0..be1633ac1 100644 --- a/src/api/types/UpdateTeamMemberResponse.ts +++ b/src/api/types/UpdateTeamMemberResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from an update request containing the updated `TeamMember` object or error messages. diff --git a/src/api/types/UpdateTimecardResponse.ts b/src/api/types/UpdateTimecardResponse.ts index b7fc67224..af1bb2e00 100644 --- a/src/api/types/UpdateTimecardResponse.ts +++ b/src/api/types/UpdateTimecardResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request to update a `Timecard`. The response contains diff --git a/src/api/types/UpdateTransferOrderData.ts b/src/api/types/UpdateTransferOrderData.ts index 3308e4fa1..ca341ee83 100644 --- a/src/api/types/UpdateTransferOrderData.ts +++ b/src/api/types/UpdateTransferOrderData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Data model for updating a transfer order. All fields are optional. diff --git a/src/api/types/UpdateTransferOrderLineData.ts b/src/api/types/UpdateTransferOrderLineData.ts index c12b58f0a..515f26cc9 100644 --- a/src/api/types/UpdateTransferOrderLineData.ts +++ b/src/api/types/UpdateTransferOrderLineData.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a line item update in a transfer order diff --git a/src/api/types/UpdateTransferOrderResponse.ts b/src/api/types/UpdateTransferOrderResponse.ts index d83cdba68..7bb997a5d 100644 --- a/src/api/types/UpdateTransferOrderResponse.ts +++ b/src/api/types/UpdateTransferOrderResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Response for updating a transfer order diff --git a/src/api/types/UpdateVendorRequest.ts b/src/api/types/UpdateVendorRequest.ts index dcb85e48b..b261c750c 100644 --- a/src/api/types/UpdateVendorRequest.ts +++ b/src/api/types/UpdateVendorRequest.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an input to a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor). diff --git a/src/api/types/UpdateVendorResponse.ts b/src/api/types/UpdateVendorResponse.ts index 644dbe1c5..6a4b62447 100644 --- a/src/api/types/UpdateVendorResponse.ts +++ b/src/api/types/UpdateVendorResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an output from a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor). diff --git a/src/api/types/UpdateWageSettingResponse.ts b/src/api/types/UpdateWageSettingResponse.ts index 62348f77e..0701c749e 100644 --- a/src/api/types/UpdateWageSettingResponse.ts +++ b/src/api/types/UpdateWageSettingResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from an update request containing the updated `WageSetting` object diff --git a/src/api/types/UpdateWebhookSubscriptionResponse.ts b/src/api/types/UpdateWebhookSubscriptionResponse.ts index c54292ac6..1324668ed 100644 --- a/src/api/types/UpdateWebhookSubscriptionResponse.ts +++ b/src/api/types/UpdateWebhookSubscriptionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts b/src/api/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts index 675854985..7ede9285a 100644 --- a/src/api/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts +++ b/src/api/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/UpdateWorkweekConfigResponse.ts b/src/api/types/UpdateWorkweekConfigResponse.ts index 20a17afca..b0f591e76 100644 --- a/src/api/types/UpdateWorkweekConfigResponse.ts +++ b/src/api/types/UpdateWorkweekConfigResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * The response to a request to update a `WorkweekConfig` object. The response contains diff --git a/src/api/types/UpsertBookingCustomAttributeResponse.ts b/src/api/types/UpsertBookingCustomAttributeResponse.ts index 8197bcbcb..90fbd6caf 100644 --- a/src/api/types/UpsertBookingCustomAttributeResponse.ts +++ b/src/api/types/UpsertBookingCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) response. diff --git a/src/api/types/UpsertCatalogObjectResponse.ts b/src/api/types/UpsertCatalogObjectResponse.ts index 8fafabd00..deb3e3a98 100644 --- a/src/api/types/UpsertCatalogObjectResponse.ts +++ b/src/api/types/UpsertCatalogObjectResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface UpsertCatalogObjectResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/UpsertCustomerCustomAttributeResponse.ts b/src/api/types/UpsertCustomerCustomAttributeResponse.ts index 0f76c7631..e66ba0e4b 100644 --- a/src/api/types/UpsertCustomerCustomAttributeResponse.ts +++ b/src/api/types/UpsertCustomerCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) response. diff --git a/src/api/types/UpsertLocationCustomAttributeResponse.ts b/src/api/types/UpsertLocationCustomAttributeResponse.ts index 131868814..3e52196e0 100644 --- a/src/api/types/UpsertLocationCustomAttributeResponse.ts +++ b/src/api/types/UpsertLocationCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) response. diff --git a/src/api/types/UpsertMerchantCustomAttributeResponse.ts b/src/api/types/UpsertMerchantCustomAttributeResponse.ts index 9dc89c1a8..49d3ca1a7 100644 --- a/src/api/types/UpsertMerchantCustomAttributeResponse.ts +++ b/src/api/types/UpsertMerchantCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) response. diff --git a/src/api/types/UpsertOrderCustomAttributeResponse.ts b/src/api/types/UpsertOrderCustomAttributeResponse.ts index b6e8e1664..0366cf4fa 100644 --- a/src/api/types/UpsertOrderCustomAttributeResponse.ts +++ b/src/api/types/UpsertOrderCustomAttributeResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a response from upserting order custom attribute definitions. diff --git a/src/api/types/UpsertSnippetResponse.ts b/src/api/types/UpsertSnippetResponse.ts index 27e12d945..0e35d101d 100644 --- a/src/api/types/UpsertSnippetResponse.ts +++ b/src/api/types/UpsertSnippetResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents an `UpsertSnippet` response. The response can include either `snippet` or `errors`. diff --git a/src/api/types/V1GetPaymentRequest.ts b/src/api/types/V1GetPaymentRequest.ts index fb4bbb8fa..461233c6c 100644 --- a/src/api/types/V1GetPaymentRequest.ts +++ b/src/api/types/V1GetPaymentRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type V1GetPaymentRequest = unknown; diff --git a/src/api/types/V1GetSettlementRequest.ts b/src/api/types/V1GetSettlementRequest.ts index cca5a78b5..d7417c42f 100644 --- a/src/api/types/V1GetSettlementRequest.ts +++ b/src/api/types/V1GetSettlementRequest.ts @@ -1,5 +1,3 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export type V1GetSettlementRequest = unknown; diff --git a/src/api/types/V1Money.ts b/src/api/types/V1Money.ts index 3cdcdae09..cce1eddbd 100644 --- a/src/api/types/V1Money.ts +++ b/src/api/types/V1Money.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface V1Money { /** diff --git a/src/api/types/V1Order.ts b/src/api/types/V1Order.ts index 106ac9982..b3e10b04c 100644 --- a/src/api/types/V1Order.ts +++ b/src/api/types/V1Order.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * V1Order diff --git a/src/api/types/V1OrderHistoryEntry.ts b/src/api/types/V1OrderHistoryEntry.ts index 9781f5148..e9fea8e76 100644 --- a/src/api/types/V1OrderHistoryEntry.ts +++ b/src/api/types/V1OrderHistoryEntry.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * V1OrderHistoryEntry diff --git a/src/api/types/V1OrderHistoryEntryAction.ts b/src/api/types/V1OrderHistoryEntryAction.ts index 228dbe95f..7d52d13ef 100644 --- a/src/api/types/V1OrderHistoryEntryAction.ts +++ b/src/api/types/V1OrderHistoryEntryAction.ts @@ -1,15 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type V1OrderHistoryEntryAction = - | "ORDER_PLACED" - | "DECLINED" - | "PAYMENT_RECEIVED" - | "CANCELED" - | "COMPLETED" - | "REFUNDED" - | "EXPIRED"; export const V1OrderHistoryEntryAction = { OrderPlaced: "ORDER_PLACED", Declined: "DECLINED", @@ -19,3 +9,4 @@ export const V1OrderHistoryEntryAction = { Refunded: "REFUNDED", Expired: "EXPIRED", } as const; +export type V1OrderHistoryEntryAction = (typeof V1OrderHistoryEntryAction)[keyof typeof V1OrderHistoryEntryAction]; diff --git a/src/api/types/V1OrderState.ts b/src/api/types/V1OrderState.ts index c11830bda..fc40f6fa7 100644 --- a/src/api/types/V1OrderState.ts +++ b/src/api/types/V1OrderState.ts @@ -1,8 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type V1OrderState = "PENDING" | "OPEN" | "COMPLETED" | "CANCELED" | "REFUNDED" | "REJECTED"; export const V1OrderState = { Pending: "PENDING", Open: "OPEN", @@ -11,3 +8,4 @@ export const V1OrderState = { Refunded: "REFUNDED", Rejected: "REJECTED", } as const; +export type V1OrderState = (typeof V1OrderState)[keyof typeof V1OrderState]; diff --git a/src/api/types/V1Tender.ts b/src/api/types/V1Tender.ts index 95e244291..4e0adb4cb 100644 --- a/src/api/types/V1Tender.ts +++ b/src/api/types/V1Tender.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * A tender represents a discrete monetary exchange. Square represents this diff --git a/src/api/types/V1TenderCardBrand.ts b/src/api/types/V1TenderCardBrand.ts index 9087fa6e3..130774a03 100644 --- a/src/api/types/V1TenderCardBrand.ts +++ b/src/api/types/V1TenderCardBrand.ts @@ -1,20 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The brand of a credit card. - */ -export type V1TenderCardBrand = - | "OTHER_BRAND" - | "VISA" - | "MASTER_CARD" - | "AMERICAN_EXPRESS" - | "DISCOVER" - | "DISCOVER_DINERS" - | "JCB" - | "CHINA_UNIONPAY" - | "SQUARE_GIFT_CARD"; +/** The brand of a credit card. */ export const V1TenderCardBrand = { OtherBrand: "OTHER_BRAND", Visa: "VISA", @@ -26,3 +12,4 @@ export const V1TenderCardBrand = { ChinaUnionpay: "CHINA_UNIONPAY", SquareGiftCard: "SQUARE_GIFT_CARD", } as const; +export type V1TenderCardBrand = (typeof V1TenderCardBrand)[keyof typeof V1TenderCardBrand]; diff --git a/src/api/types/V1TenderEntryMethod.ts b/src/api/types/V1TenderEntryMethod.ts index d567aee00..04c0ed565 100644 --- a/src/api/types/V1TenderEntryMethod.ts +++ b/src/api/types/V1TenderEntryMethod.ts @@ -1,15 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type V1TenderEntryMethod = - | "MANUAL" - | "SCANNED" - | "SQUARE_CASH" - | "SQUARE_WALLET" - | "SWIPED" - | "WEB_FORM" - | "OTHER"; export const V1TenderEntryMethod = { Manual: "MANUAL", Scanned: "SCANNED", @@ -19,3 +9,4 @@ export const V1TenderEntryMethod = { WebForm: "WEB_FORM", Other: "OTHER", } as const; +export type V1TenderEntryMethod = (typeof V1TenderEntryMethod)[keyof typeof V1TenderEntryMethod]; diff --git a/src/api/types/V1TenderType.ts b/src/api/types/V1TenderType.ts index 1f6d4569a..55441a503 100644 --- a/src/api/types/V1TenderType.ts +++ b/src/api/types/V1TenderType.ts @@ -1,16 +1,5 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type V1TenderType = - | "CREDIT_CARD" - | "CASH" - | "THIRD_PARTY_CARD" - | "NO_SALE" - | "SQUARE_WALLET" - | "SQUARE_GIFT_CARD" - | "UNKNOWN" - | "OTHER"; export const V1TenderType = { CreditCard: "CREDIT_CARD", Cash: "CASH", @@ -21,3 +10,4 @@ export const V1TenderType = { Unknown: "UNKNOWN", Other: "OTHER", } as const; +export type V1TenderType = (typeof V1TenderType)[keyof typeof V1TenderType]; diff --git a/src/api/types/V1UpdateOrderRequestAction.ts b/src/api/types/V1UpdateOrderRequestAction.ts index 4b4434d3b..22e05b7d2 100644 --- a/src/api/types/V1UpdateOrderRequestAction.ts +++ b/src/api/types/V1UpdateOrderRequestAction.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -export type V1UpdateOrderRequestAction = "COMPLETE" | "CANCEL" | "REFUND"; export const V1UpdateOrderRequestAction = { Complete: "COMPLETE", Cancel: "CANCEL", Refund: "REFUND", } as const; +export type V1UpdateOrderRequestAction = (typeof V1UpdateOrderRequestAction)[keyof typeof V1UpdateOrderRequestAction]; diff --git a/src/api/types/Vendor.ts b/src/api/types/Vendor.ts index b8b908a2a..9da656a37 100644 --- a/src/api/types/Vendor.ts +++ b/src/api/types/Vendor.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents a supplier to a seller. diff --git a/src/api/types/VendorContact.ts b/src/api/types/VendorContact.ts index e965078c5..299b11528 100644 --- a/src/api/types/VendorContact.ts +++ b/src/api/types/VendorContact.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents a contact of a [Vendor](entity:Vendor). diff --git a/src/api/types/VendorCreatedEvent.ts b/src/api/types/VendorCreatedEvent.ts index 640126d7b..e5f145959 100644 --- a/src/api/types/VendorCreatedEvent.ts +++ b/src/api/types/VendorCreatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Vendor](entity:Vendor) is created. diff --git a/src/api/types/VendorCreatedEventData.ts b/src/api/types/VendorCreatedEventData.ts index da0989ecc..b891a586e 100644 --- a/src/api/types/VendorCreatedEventData.ts +++ b/src/api/types/VendorCreatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the `vendor.created` event data structure. diff --git a/src/api/types/VendorCreatedEventObject.ts b/src/api/types/VendorCreatedEventObject.ts index 67c918471..146397e0e 100644 --- a/src/api/types/VendorCreatedEventObject.ts +++ b/src/api/types/VendorCreatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface VendorCreatedEventObject { /** diff --git a/src/api/types/VendorCreatedEventObjectOperation.ts b/src/api/types/VendorCreatedEventObjectOperation.ts index 03a3e2265..e13b6caef 100644 --- a/src/api/types/VendorCreatedEventObjectOperation.ts +++ b/src/api/types/VendorCreatedEventObjectOperation.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The operation that can be performed against a vendor to cause the event to be published. diff --git a/src/api/types/VendorStatus.ts b/src/api/types/VendorStatus.ts index dc11fc135..2d825af59 100644 --- a/src/api/types/VendorStatus.ts +++ b/src/api/types/VendorStatus.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The status of the [Vendor](entity:Vendor), * whether a [Vendor](entity:Vendor) is active or inactive. */ -export type VendorStatus = "ACTIVE" | "INACTIVE"; export const VendorStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; +export type VendorStatus = (typeof VendorStatus)[keyof typeof VendorStatus]; diff --git a/src/api/types/VendorUpdatedEvent.ts b/src/api/types/VendorUpdatedEvent.ts index 1afc531b4..4abe2c4db 100644 --- a/src/api/types/VendorUpdatedEvent.ts +++ b/src/api/types/VendorUpdatedEvent.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Published when a [Vendor](entity:Vendor) is updated. diff --git a/src/api/types/VendorUpdatedEventData.ts b/src/api/types/VendorUpdatedEventData.ts index fd4562112..b34fd4df3 100644 --- a/src/api/types/VendorUpdatedEventData.ts +++ b/src/api/types/VendorUpdatedEventData.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the `vendor.updated` event data structure. diff --git a/src/api/types/VendorUpdatedEventObject.ts b/src/api/types/VendorUpdatedEventObject.ts index 21f421374..b30060fbb 100644 --- a/src/api/types/VendorUpdatedEventObject.ts +++ b/src/api/types/VendorUpdatedEventObject.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; export interface VendorUpdatedEventObject { /** diff --git a/src/api/types/VendorUpdatedEventObjectOperation.ts b/src/api/types/VendorUpdatedEventObjectOperation.ts index 58abba863..7ceef20b5 100644 --- a/src/api/types/VendorUpdatedEventObjectOperation.ts +++ b/src/api/types/VendorUpdatedEventObjectOperation.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * The operation that can be performed against a vendor to cause the event to be published. diff --git a/src/api/types/VisibilityFilter.ts b/src/api/types/VisibilityFilter.ts index 7660e6b1c..5fe2bcff2 100644 --- a/src/api/types/VisibilityFilter.ts +++ b/src/api/types/VisibilityFilter.ts @@ -1,13 +1,9 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. - */ -export type VisibilityFilter = "ALL" | "READ" | "READ_WRITE"; +/** Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. */ export const VisibilityFilter = { All: "ALL", Read: "READ", ReadWrite: "READ_WRITE", } as const; +export type VisibilityFilter = (typeof VisibilityFilter)[keyof typeof VisibilityFilter]; diff --git a/src/api/types/VoidTransactionResponse.ts b/src/api/types/VoidTransactionResponse.ts index ad3847dbb..d9f520d09 100644 --- a/src/api/types/VoidTransactionResponse.ts +++ b/src/api/types/VoidTransactionResponse.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/WageSetting.ts b/src/api/types/WageSetting.ts index eb4401a99..ada6d6d6a 100644 --- a/src/api/types/WageSetting.ts +++ b/src/api/types/WageSetting.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Represents information about the overtime exemption status, job assignments, and compensation diff --git a/src/api/types/WebhookSubscription.ts b/src/api/types/WebhookSubscription.ts index 5691d95e2..e84811873 100644 --- a/src/api/types/WebhookSubscription.ts +++ b/src/api/types/WebhookSubscription.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. /** * Represents the details of a webhook subscription, including notification URL, diff --git a/src/api/types/Weekday.ts b/src/api/types/Weekday.ts index f944a12bf..7ea611f8e 100644 --- a/src/api/types/Weekday.ts +++ b/src/api/types/Weekday.ts @@ -1,11 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -/** - * The days of the week. - */ -export type Weekday = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN"; +/** The days of the week. */ export const Weekday = { Mon: "MON", Tue: "TUE", @@ -15,3 +10,4 @@ export const Weekday = { Sat: "SAT", Sun: "SUN", } as const; +export type Weekday = (typeof Weekday)[keyof typeof Weekday]; diff --git a/src/api/types/WorkweekConfig.ts b/src/api/types/WorkweekConfig.ts index 5d26dd907..ddf3003c5 100644 --- a/src/api/types/WorkweekConfig.ts +++ b/src/api/types/WorkweekConfig.ts @@ -1,8 +1,6 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as Square from "../index"; +import type * as Square from "../index"; /** * Sets the day of the week and hour of the day that a business starts a diff --git a/src/api/types/index.ts b/src/api/types/index.ts index a6114f07f..7b318b1af 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,7 +1,7 @@ -export * from "./AchDetails"; export * from "./AcceptDisputeResponse"; export * from "./AcceptedPaymentMethods"; export * from "./AccumulateLoyaltyPointsResponse"; +export * from "./AchDetails"; export * from "./ActionCancelReason"; export * from "./ActivityType"; export * from "./AddGroupToCustomerResponse"; @@ -30,14 +30,22 @@ export * from "./BankAccountVerifiedEventData"; export * from "./BankAccountVerifiedEventObject"; export * from "./BatchChangeInventoryRequest"; export * from "./BatchChangeInventoryResponse"; +export * from "./BatchCreateTeamMembersResponse"; +export * from "./BatchCreateVendorsResponse"; export * from "./BatchDeleteCatalogObjectsResponse"; export * from "./BatchGetCatalogObjectsResponse"; -export * from "./BatchRetrieveInventoryChangesRequest"; export * from "./BatchGetInventoryChangesResponse"; export * from "./BatchGetInventoryCountsRequest"; export * from "./BatchGetInventoryCountsResponse"; export * from "./BatchGetOrdersResponse"; +export * from "./BatchGetVendorsResponse"; +export * from "./BatchRetrieveInventoryChangesRequest"; +export * from "./BatchUpdateTeamMembersResponse"; +export * from "./BatchUpdateVendorsResponse"; export * from "./BatchUpsertCatalogObjectsResponse"; +export * from "./BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest"; +export * from "./BatchUpsertCustomerCustomAttributesResponse"; +export * from "./BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse"; export * from "./Booking"; export * from "./BookingBookingSource"; export * from "./BookingCreatedEvent"; @@ -67,8 +75,6 @@ export * from "./Break"; export * from "./BreakType"; export * from "./BulkCreateCustomerData"; export * from "./BulkCreateCustomersResponse"; -export * from "./BatchCreateTeamMembersResponse"; -export * from "./BatchCreateVendorsResponse"; export * from "./BulkDeleteBookingCustomAttributesResponse"; export * from "./BulkDeleteCustomersResponse"; export * from "./BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest"; @@ -86,16 +92,10 @@ export * from "./BulkRetrieveChannelsRequestConstants"; export * from "./BulkRetrieveChannelsResponse"; export * from "./BulkRetrieveCustomersResponse"; export * from "./BulkRetrieveTeamMemberBookingProfilesResponse"; -export * from "./BatchGetVendorsResponse"; export * from "./BulkSwapPlanResponse"; export * from "./BulkUpdateCustomerData"; export * from "./BulkUpdateCustomersResponse"; -export * from "./BatchUpdateTeamMembersResponse"; -export * from "./BatchUpdateVendorsResponse"; export * from "./BulkUpsertBookingCustomAttributesResponse"; -export * from "./BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest"; -export * from "./BatchUpsertCustomerCustomAttributesResponse"; -export * from "./BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse"; export * from "./BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest"; export * from "./BulkUpsertLocationCustomAttributesResponse"; export * from "./BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse"; @@ -201,29 +201,47 @@ export * from "./CatalogModifierListModifierType"; export * from "./CatalogModifierListSelectionType"; export * from "./CatalogModifierOverride"; export * from "./CatalogObject"; +export * from "./CatalogObjectAvailabilityPeriod"; +export * from "./CatalogObjectBase"; export * from "./CatalogObjectBatch"; export * from "./CatalogObjectCategory"; -export * from "./CatalogObjectBase"; +export * from "./CatalogObjectCustomAttributeDefinition"; +export * from "./CatalogObjectDiscount"; +export * from "./CatalogObjectImage"; +export * from "./CatalogObjectItem"; +export * from "./CatalogObjectItemOption"; +export * from "./CatalogObjectItemOptionValue"; +export * from "./CatalogObjectItemVariation"; +export * from "./CatalogObjectMeasurementUnit"; +export * from "./CatalogObjectModifier"; +export * from "./CatalogObjectModifierList"; +export * from "./CatalogObjectPricingRule"; +export * from "./CatalogObjectProductSet"; +export * from "./CatalogObjectQuickAmountsSettings"; export * from "./CatalogObjectReference"; +export * from "./CatalogObjectSubscriptionPlan"; +export * from "./CatalogObjectSubscriptionPlanVariation"; +export * from "./CatalogObjectTax"; +export * from "./CatalogObjectTimePeriod"; export * from "./CatalogObjectType"; export * from "./CatalogPricingRule"; export * from "./CatalogPricingType"; export * from "./CatalogProductSet"; export * from "./CatalogQuery"; export * from "./CatalogQueryExact"; -export * from "./CatalogQueryItemVariationsForItemOptionValues"; export * from "./CatalogQueryItemsForItemOptions"; export * from "./CatalogQueryItemsForModifierList"; export * from "./CatalogQueryItemsForTax"; +export * from "./CatalogQueryItemVariationsForItemOptionValues"; export * from "./CatalogQueryPrefix"; export * from "./CatalogQueryRange"; export * from "./CatalogQuerySet"; export * from "./CatalogQuerySortedAttribute"; export * from "./CatalogQueryText"; export * from "./CatalogQuickAmount"; -export * from "./CatalogQuickAmountType"; export * from "./CatalogQuickAmountsSettings"; export * from "./CatalogQuickAmountsSettingsOption"; +export * from "./CatalogQuickAmountType"; export * from "./CatalogStockConversion"; export * from "./CatalogSubscriptionPlan"; export * from "./CatalogSubscriptionPlanVariation"; @@ -321,7 +339,6 @@ export * from "./CustomAttributeDefinitionVisibility"; export * from "./CustomAttributeEventData"; export * from "./CustomAttributeEventDataObject"; export * from "./CustomAttributeFilter"; -export * from "./CustomField"; export * from "./Customer"; export * from "./CustomerAddressFilter"; export * from "./CustomerCreatedEvent"; @@ -346,8 +363,8 @@ export * from "./CustomerCustomAttributeDefinitionVisibleUpdatedEvent"; export * from "./CustomerCustomAttributeDeletedEvent"; export * from "./CustomerCustomAttributeDeletedPublicEvent"; export * from "./CustomerCustomAttributeFilter"; -export * from "./CustomerCustomAttributeFilterValue"; export * from "./CustomerCustomAttributeFilters"; +export * from "./CustomerCustomAttributeFilterValue"; export * from "./CustomerCustomAttributeOwnedDeletedEvent"; export * from "./CustomerCustomAttributeOwnedUpdatedEvent"; export * from "./CustomerCustomAttributeUpdatedEvent"; @@ -373,6 +390,7 @@ export * from "./CustomerTextFilter"; export * from "./CustomerUpdatedEvent"; export * from "./CustomerUpdatedEventData"; export * from "./CustomerUpdatedEventObject"; +export * from "./CustomField"; export * from "./DataCollectionOptions"; export * from "./DataCollectionOptionsInputType"; export * from "./DateRange"; @@ -442,6 +460,7 @@ export * from "./Dispute"; export * from "./DisputeCreatedEvent"; export * from "./DisputeCreatedEventData"; export * from "./DisputeCreatedEventObject"; +export * from "./DisputedPayment"; export * from "./DisputeEvidence"; export * from "./DisputeEvidenceAddedEvent"; export * from "./DisputeEvidenceAddedEventData"; @@ -465,7 +484,6 @@ export * from "./DisputeStateChangedEventObject"; export * from "./DisputeStateUpdatedEvent"; export * from "./DisputeStateUpdatedEventData"; export * from "./DisputeStateUpdatedEventObject"; -export * from "./DisputedPayment"; export * from "./EcomVisibility"; export * from "./Employee"; export * from "./EmployeeStatus"; @@ -496,19 +514,84 @@ export * from "./FulfillmentState"; export * from "./FulfillmentType"; export * from "./GetBankAccountByV1IdResponse"; export * from "./GetBankAccountResponse"; +export * from "./GetBookingRequest"; +export * from "./GetBookingResponse"; export * from "./GetBreakTypeResponse"; +export * from "./GetBusinessBookingProfileRequest"; +export * from "./GetBusinessBookingProfileResponse"; +export * from "./GetCardRequest"; +export * from "./GetCardResponse"; +export * from "./GetCashDrawerShiftResponse"; +export * from "./GetCatalogObjectResponse"; +export * from "./GetCustomerCustomAttributeDefinitionResponse"; +export * from "./GetCustomerCustomAttributeResponse"; +export * from "./GetCustomerGroupRequest"; +export * from "./GetCustomerGroupResponse"; +export * from "./GetCustomerRequest"; +export * from "./GetCustomerResponse"; +export * from "./GetCustomerSegmentRequest"; +export * from "./GetCustomerSegmentResponse"; export * from "./GetDeviceCodeResponse"; export * from "./GetDeviceResponse"; +export * from "./GetDisputeEvidenceRequest"; +export * from "./GetDisputeEvidenceResponse"; +export * from "./GetDisputeRequest"; +export * from "./GetDisputeResponse"; +export * from "./GetEmployeeRequest"; +export * from "./GetEmployeeResponse"; export * from "./GetEmployeeWageResponse"; +export * from "./GetGiftCardFromGanResponse"; +export * from "./GetGiftCardFromNonceResponse"; +export * from "./GetGiftCardRequest"; +export * from "./GetGiftCardResponse"; +export * from "./GetInventoryAdjustmentRequest"; +export * from "./GetInventoryAdjustmentResponse"; +export * from "./GetInventoryChangesResponse"; +export * from "./GetInventoryCountResponse"; +export * from "./GetInventoryPhysicalCountRequest"; +export * from "./GetInventoryPhysicalCountResponse"; +export * from "./GetInventoryTransferRequest"; +export * from "./GetInventoryTransferResponse"; export * from "./GetInvoiceResponse"; +export * from "./GetLocationRequest"; +export * from "./GetLocationResponse"; +export * from "./GetLoyaltyAccountRequest"; +export * from "./GetLoyaltyAccountResponse"; +export * from "./GetLoyaltyProgramRequest"; +export * from "./GetLoyaltyProgramResponse"; +export * from "./GetLoyaltyPromotionRequest"; +export * from "./GetLoyaltyPromotionResponse"; +export * from "./GetLoyaltyRewardRequest"; +export * from "./GetLoyaltyRewardResponse"; +export * from "./GetMerchantRequest"; +export * from "./GetMerchantResponse"; +export * from "./GetOrderRequest"; +export * from "./GetOrderResponse"; +export * from "./GetPaymentLinkRequest"; +export * from "./GetPaymentLinkResponse"; export * from "./GetPaymentRefundResponse"; export * from "./GetPaymentResponse"; export * from "./GetPayoutResponse"; export * from "./GetShiftResponse"; +export * from "./GetSnippetRequest"; +export * from "./GetSnippetResponse"; +export * from "./GetSubscriptionResponse"; +export * from "./GetTeamMemberBookingProfileRequest"; +export * from "./GetTeamMemberBookingProfileResponse"; +export * from "./GetTeamMemberRequest"; +export * from "./GetTeamMemberResponse"; export * from "./GetTeamMemberWageResponse"; export * from "./GetTerminalActionResponse"; export * from "./GetTerminalCheckoutResponse"; export * from "./GetTerminalRefundResponse"; +export * from "./GetTransactionRequest"; +export * from "./GetTransactionResponse"; +export * from "./GetVendorRequest"; +export * from "./GetVendorResponse"; +export * from "./GetWageSettingRequest"; +export * from "./GetWageSettingResponse"; +export * from "./GetWebhookSubscriptionRequest"; +export * from "./GetWebhookSubscriptionResponse"; export * from "./GiftCard"; export * from "./GiftCardActivity"; export * from "./GiftCardActivityActivate"; @@ -667,8 +750,8 @@ export * from "./ListDeviceCodesResponse"; export * from "./ListDevicesResponse"; export * from "./ListDisputeEvidenceResponse"; export * from "./ListDisputesResponse"; -export * from "./ListEmployeeWagesResponse"; export * from "./ListEmployeesResponse"; +export * from "./ListEmployeeWagesResponse"; export * from "./ListEventTypesResponse"; export * from "./ListGiftCardActivitiesResponse"; export * from "./ListGiftCardsResponse"; @@ -739,10 +822,10 @@ export * from "./LoyaltyEvent"; export * from "./LoyaltyEventAccumulatePoints"; export * from "./LoyaltyEventAccumulatePromotionPoints"; export * from "./LoyaltyEventAdjustPoints"; -export * from "./LoyaltyEventCreateReward"; export * from "./LoyaltyEventCreatedEvent"; export * from "./LoyaltyEventCreatedEventData"; export * from "./LoyaltyEventCreatedEventObject"; +export * from "./LoyaltyEventCreateReward"; export * from "./LoyaltyEventDateTimeFilter"; export * from "./LoyaltyEventDeleteReward"; export * from "./LoyaltyEventExpirePoints"; @@ -889,7 +972,6 @@ export * from "./OrderUpdatedEvent"; export * from "./OrderUpdatedEventData"; export * from "./OrderUpdatedObject"; export * from "./PauseSubscriptionResponse"; -export * from "./PayOrderResponse"; export * from "./Payment"; export * from "./PaymentBalanceActivityAppFeeRefundDetail"; export * from "./PaymentBalanceActivityAppFeeRevenueDetail"; @@ -927,6 +1009,7 @@ export * from "./PaymentRefund"; export * from "./PaymentUpdatedEvent"; export * from "./PaymentUpdatedEventData"; export * from "./PaymentUpdatedEventObject"; +export * from "./PayOrderResponse"; export * from "./Payout"; export * from "./PayoutEntry"; export * from "./PayoutFailedEvent"; @@ -973,58 +1056,21 @@ export * from "./RemoveGroupFromCustomerResponse"; export * from "./ResumeSubscriptionResponse"; export * from "./RetrieveBookingCustomAttributeDefinitionResponse"; export * from "./RetrieveBookingCustomAttributeResponse"; -export * from "./GetBookingResponse"; -export * from "./GetBusinessBookingProfileResponse"; -export * from "./GetCardResponse"; -export * from "./GetCashDrawerShiftResponse"; -export * from "./GetCatalogObjectResponse"; export * from "./RetrieveChannelResponse"; -export * from "./GetCustomerCustomAttributeDefinitionResponse"; -export * from "./GetCustomerCustomAttributeResponse"; -export * from "./GetCustomerGroupResponse"; -export * from "./GetCustomerResponse"; -export * from "./GetCustomerSegmentResponse"; -export * from "./GetDisputeEvidenceResponse"; -export * from "./GetDisputeResponse"; -export * from "./GetEmployeeResponse"; -export * from "./GetGiftCardFromGanResponse"; -export * from "./GetGiftCardFromNonceResponse"; -export * from "./GetGiftCardResponse"; -export * from "./GetInventoryAdjustmentResponse"; -export * from "./GetInventoryChangesResponse"; -export * from "./GetInventoryCountResponse"; -export * from "./GetInventoryPhysicalCountResponse"; -export * from "./GetInventoryTransferResponse"; export * from "./RetrieveJobResponse"; export * from "./RetrieveLocationBookingProfileResponse"; export * from "./RetrieveLocationCustomAttributeDefinitionResponse"; export * from "./RetrieveLocationCustomAttributeResponse"; -export * from "./GetLocationResponse"; export * from "./RetrieveLocationSettingsResponse"; -export * from "./GetLoyaltyAccountResponse"; -export * from "./GetLoyaltyProgramResponse"; -export * from "./GetLoyaltyPromotionResponse"; -export * from "./GetLoyaltyRewardResponse"; export * from "./RetrieveMerchantCustomAttributeDefinitionResponse"; export * from "./RetrieveMerchantCustomAttributeResponse"; -export * from "./GetMerchantResponse"; export * from "./RetrieveMerchantSettingsResponse"; export * from "./RetrieveOrderCustomAttributeDefinitionResponse"; export * from "./RetrieveOrderCustomAttributeResponse"; -export * from "./GetOrderResponse"; -export * from "./GetPaymentLinkResponse"; export * from "./RetrieveScheduledShiftResponse"; -export * from "./GetSnippetResponse"; -export * from "./GetSubscriptionResponse"; -export * from "./GetTeamMemberBookingProfileResponse"; -export * from "./GetTeamMemberResponse"; export * from "./RetrieveTimecardResponse"; export * from "./RetrieveTokenStatusResponse"; -export * from "./GetTransactionResponse"; export * from "./RetrieveTransferOrderResponse"; -export * from "./GetVendorResponse"; -export * from "./GetWageSettingResponse"; -export * from "./GetWebhookSubscriptionResponse"; export * from "./RevokeTokenResponse"; export * from "./RiskEvaluation"; export * from "./RiskEvaluationRiskLevel"; @@ -1195,7 +1241,6 @@ export * from "./TerminalRefundUpdatedEvent"; export * from "./TerminalRefundUpdatedEventData"; export * from "./TerminalRefundUpdatedEventObject"; export * from "./TestWebhookSubscriptionResponse"; -export * from "./TimeRange"; export * from "./Timecard"; export * from "./TimecardFilter"; export * from "./TimecardFilterStatus"; @@ -1206,6 +1251,7 @@ export * from "./TimecardStatus"; export * from "./TimecardWage"; export * from "./TimecardWorkday"; export * from "./TimecardWorkdayMatcher"; +export * from "./TimeRange"; export * from "./TipSettings"; export * from "./Transaction"; export * from "./TransactionProduct"; @@ -1271,6 +1317,8 @@ export * from "./UpsertLocationCustomAttributeResponse"; export * from "./UpsertMerchantCustomAttributeResponse"; export * from "./UpsertOrderCustomAttributeResponse"; export * from "./UpsertSnippetResponse"; +export * from "./V1GetPaymentRequest"; +export * from "./V1GetSettlementRequest"; export * from "./V1Money"; export * from "./V1Order"; export * from "./V1OrderHistoryEntry"; @@ -1298,51 +1346,3 @@ export * from "./WageSetting"; export * from "./WebhookSubscription"; export * from "./Weekday"; export * from "./WorkweekConfig"; -export * from "./CatalogObjectItem"; -export * from "./CatalogObjectImage"; -export * from "./CatalogObjectItemVariation"; -export * from "./CatalogObjectTax"; -export * from "./CatalogObjectDiscount"; -export * from "./CatalogObjectModifierList"; -export * from "./CatalogObjectModifier"; -export * from "./CatalogObjectPricingRule"; -export * from "./CatalogObjectProductSet"; -export * from "./CatalogObjectTimePeriod"; -export * from "./CatalogObjectMeasurementUnit"; -export * from "./CatalogObjectSubscriptionPlanVariation"; -export * from "./CatalogObjectItemOption"; -export * from "./CatalogObjectItemOptionValue"; -export * from "./CatalogObjectCustomAttributeDefinition"; -export * from "./CatalogObjectQuickAmountsSettings"; -export * from "./CatalogObjectSubscriptionPlan"; -export * from "./CatalogObjectAvailabilityPeriod"; -export * from "./GetLoyaltyAccountRequest"; -export * from "./GetLoyaltyProgramRequest"; -export * from "./GetLoyaltyPromotionRequest"; -export * from "./GetLoyaltyRewardRequest"; -export * from "./GetCardRequest"; -export * from "./GetDisputeEvidenceRequest"; -export * from "./GetDisputeRequest"; -export * from "./V1GetPaymentRequest"; -export * from "./V1GetSettlementRequest"; -export * from "./GetCustomerGroupRequest"; -export * from "./GetCustomerRequest"; -export * from "./GetCustomerSegmentRequest"; -export * from "./GetTransactionRequest"; -export * from "./GetBookingRequest"; -export * from "./GetBusinessBookingProfileRequest"; -export * from "./GetTeamMemberBookingProfileRequest"; -export * from "./GetSnippetRequest"; -export * from "./GetInventoryAdjustmentRequest"; -export * from "./GetInventoryPhysicalCountRequest"; -export * from "./GetInventoryTransferRequest"; -export * from "./GetVendorRequest"; -export * from "./GetPaymentLinkRequest"; -export * from "./GetGiftCardRequest"; -export * from "./GetOrderRequest"; -export * from "./GetEmployeeRequest"; -export * from "./GetLocationRequest"; -export * from "./GetMerchantRequest"; -export * from "./GetTeamMemberRequest"; -export * from "./GetWageSettingRequest"; -export * from "./GetWebhookSubscriptionRequest"; diff --git a/src/core/auth/AuthProvider.ts b/src/core/auth/AuthProvider.ts new file mode 100644 index 000000000..ed076ec5d --- /dev/null +++ b/src/core/auth/AuthProvider.ts @@ -0,0 +1,5 @@ +import type { AuthRequest } from "./AuthRequest"; + +export interface AuthProvider { + getAuthRequest(): Promise; +} diff --git a/src/core/auth/AuthRequest.ts b/src/core/auth/AuthRequest.ts new file mode 100644 index 000000000..f6218b422 --- /dev/null +++ b/src/core/auth/AuthRequest.ts @@ -0,0 +1,9 @@ +/** + * Request parameters for authentication requests. + */ +export interface AuthRequest { + /** + * The headers to be included in the request. + */ + headers: Record; +} diff --git a/src/core/auth/BasicAuth.ts b/src/core/auth/BasicAuth.ts index 89a3dadae..c6efa5e26 100644 --- a/src/core/auth/BasicAuth.ts +++ b/src/core/auth/BasicAuth.ts @@ -18,7 +18,8 @@ export const BasicAuth = { fromAuthorizationHeader: (header: string): BasicAuth => { const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, ""); const decoded = base64Decode(credentials); - const [username, password] = decoded.split(":", 2); + const [username, ...passwordParts] = decoded.split(":"); + const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined; if (username == null || password == null) { throw new Error("Invalid basic auth"); diff --git a/src/core/auth/index.ts b/src/core/auth/index.ts index ee293b343..c7786e5ba 100644 --- a/src/core/auth/index.ts +++ b/src/core/auth/index.ts @@ -1,2 +1,4 @@ +export type { AuthProvider } from "./AuthProvider"; +export type { AuthRequest } from "./AuthRequest"; export { BasicAuth } from "./BasicAuth"; export { BearerToken } from "./BearerToken"; diff --git a/src/core/crypto/createHmacOverride.ts b/src/core/crypto/createHmacOverride.ts index 12aceaa5b..b875eae46 100644 --- a/src/core/crypto/createHmacOverride.ts +++ b/src/core/crypto/createHmacOverride.ts @@ -1,54 +1,49 @@ export async function createHmacOverride(payload: string, key: string): Promise { try { - const crypto = require('crypto'); - const hmac = crypto.createHmac('sha256', key); - hmac.update(payload, 'utf8'); - return hmac.digest('base64'); - } - catch (err) { + const crypto = require("crypto"); + const hmac = crypto.createHmac("sha256", key); + hmac.update(payload, "utf8"); + return hmac.digest("base64"); + } catch (_err) { // Not in Node environmnet; use subtle crypto. } const subtleCrypto = getSubtleCrypto(); if (!subtleCrypto) { - throw new Error('No crypto implementation available'); + throw new Error("No crypto implementation available"); } const encoder = new TextEncoder(); const cryptoKey = await subtleCrypto.importKey( - 'raw', + "raw", encoder.encode(key), { - name: 'HMAC', - hash: { name: 'SHA-256' } + name: "HMAC", + hash: { name: "SHA-256" }, }, false, - ['sign'] - ); - const signatureBuffer = await subtleCrypto.sign( - 'HMAC', - cryptoKey, - encoder.encode(payload) + ["sign"], ); + const signatureBuffer = await subtleCrypto.sign("HMAC", cryptoKey, encoder.encode(payload)); return arrayBufferToBase64(signatureBuffer); } function getSubtleCrypto(): SubtleCrypto | undefined { - if (typeof window !== 'undefined' && window?.crypto?.subtle) { + if (typeof window !== "undefined" && window?.crypto?.subtle) { return window.crypto.subtle; } return undefined; } function arrayBufferToBase64(buffer: ArrayBuffer): string { - if (typeof btoa === 'function') { + if (typeof btoa === "function") { // Browser environment const bytes = new Uint8Array(buffer); - let binary = ''; + let binary = ""; for (let i = 0; i < bytes.byteLength; i++) { binary += String.fromCharCode(bytes[i]); } return btoa(binary); } else { // Node environment - return Buffer.from(buffer).toString('base64'); + return Buffer.from(buffer).toString("base64"); } -} \ No newline at end of file +} diff --git a/src/core/exports.ts b/src/core/exports.ts new file mode 100644 index 000000000..2cf7c7092 --- /dev/null +++ b/src/core/exports.ts @@ -0,0 +1 @@ +export * from "./file/exports"; diff --git a/src/core/fetcher/APIResponse.ts b/src/core/fetcher/APIResponse.ts index 6335291bb..b703b0a4b 100644 --- a/src/core/fetcher/APIResponse.ts +++ b/src/core/fetcher/APIResponse.ts @@ -1,4 +1,4 @@ -import { RawResponse } from "./RawResponse"; +import type { RawResponse } from "./RawResponse"; /** * The response of an API call. diff --git a/src/core/fetcher/BinaryResponse.ts b/src/core/fetcher/BinaryResponse.ts index 614cb59b1..4b4d0e891 100644 --- a/src/core/fetcher/BinaryResponse.ts +++ b/src/core/fetcher/BinaryResponse.ts @@ -1,4 +1,4 @@ -import { ResponseWithBody } from "./ResponseWithBody.js"; +import type { ResponseWithBody } from "./ResponseWithBody.js"; export type BinaryResponse = { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */ diff --git a/src/core/fetcher/EndpointMetadata.ts b/src/core/fetcher/EndpointMetadata.ts new file mode 100644 index 000000000..998d68f5c --- /dev/null +++ b/src/core/fetcher/EndpointMetadata.ts @@ -0,0 +1,13 @@ +export type SecuritySchemeKey = string; +/** + * A collection of security schemes, where the key is the name of the security scheme and the value is the list of scopes required for that scheme. + * All schemes in the collection must be satisfied for authentication to be successful. + */ +export type SecuritySchemeCollection = Record; +export type AuthScope = string; +export type EndpointMetadata = { + /** + * An array of security scheme collections. Each collection represents an alternative way to authenticate. + */ + security?: SecuritySchemeCollection[]; +}; diff --git a/src/core/fetcher/EndpointSupplier.ts b/src/core/fetcher/EndpointSupplier.ts new file mode 100644 index 000000000..f4a997838 --- /dev/null +++ b/src/core/fetcher/EndpointSupplier.ts @@ -0,0 +1,14 @@ +import type { EndpointMetadata } from "./EndpointMetadata"; +import type { Supplier } from "./Supplier"; + +type EndpointSupplierFn = (arg: { endpointMetadata: EndpointMetadata }) => T | Promise; +export type EndpointSupplier = Supplier | EndpointSupplierFn; +export const EndpointSupplier = { + get: async (supplier: EndpointSupplier, arg: { endpointMetadata: EndpointMetadata }): Promise => { + if (typeof supplier === "function") { + return (supplier as EndpointSupplierFn)(arg); + } else { + return supplier; + } + }, +}; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 88347cfbd..6c6107248 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -1,13 +1,14 @@ import { toJson } from "../json"; -import { APIResponse } from "./APIResponse"; -import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; -import { Supplier } from "./Supplier"; +import type { APIResponse } from "./APIResponse"; import { createRequestUrl } from "./createRequestUrl"; +import type { EndpointMetadata } from "./EndpointMetadata"; +import { EndpointSupplier } from "./EndpointSupplier"; import { getErrorResponseBody } from "./getErrorResponseBody"; import { getFetchFn } from "./getFetchFn"; import { getRequestBody } from "./getRequestBody"; import { getResponseBody } from "./getResponseBody"; import { makeRequest } from "./makeRequest"; +import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; import { requestWithRetries } from "./requestWithRetries"; export type FetchFunction = (args: Fetcher.Args) => Promise>; @@ -17,8 +18,8 @@ export declare namespace Fetcher { url: string; method: string; contentType?: string; - headers?: Record | undefined>; - queryParameters?: Record; + headers?: Record | null | undefined>; + queryParameters?: Record; body?: unknown; timeoutMs?: number; maxRetries?: number; @@ -27,6 +28,7 @@ export declare namespace Fetcher { requestType?: "json" | "file" | "bytes"; responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response"; duplex?: "half"; + endpointMetadata?: EndpointMetadata; } export type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError; @@ -64,7 +66,7 @@ async function getHeaders(args: Fetcher.Args): Promise> { } for (const [key, value] of Object.entries(args.headers)) { - const result = await Supplier.get(value); + const result = await EndpointSupplier.get(value, { endpointMetadata: args.endpointMetadata ?? {} }); if (typeof result === "string") { newHeaders[key] = result; continue; @@ -121,7 +123,7 @@ export async function fetcherImpl(args: Fetcher.Args): Promise case "application/ld+json": case "application/problem+json": case "application/vnd.api+json": - case "text/json": + case "text/json": { const text = await response.text(); return text.length > 0 ? fromJson(text) : undefined; + } default: if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) { const text = await response.text(); diff --git a/src/core/fetcher/getFetchFn.ts b/src/core/fetcher/getFetchFn.ts index 8f4cf5e19..0900cab18 100644 --- a/src/core/fetcher/getFetchFn.ts +++ b/src/core/fetcher/getFetchFn.ts @@ -16,7 +16,7 @@ export async function getFetchFn(): Promise { // Otherwise the SDK uses global fetch if available, // and falls back to node-fetch. - if (typeof fetch == "function") { + if (typeof fetch === "function") { return fetch; } diff --git a/src/core/fetcher/getResponseBody.ts b/src/core/fetcher/getResponseBody.ts index ba03f424a..c103c6aa0 100644 --- a/src/core/fetcher/getResponseBody.ts +++ b/src/core/fetcher/getResponseBody.ts @@ -1,6 +1,6 @@ +import { fromJson } from "../json"; import { getBinaryResponse } from "./BinaryResponse"; import { isResponseWithBody } from "./ResponseWithBody"; -import { fromJson } from "../json"; import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; @@ -28,9 +28,9 @@ export async function getResponseBody(response: Response, responseType?: string) const text = await response.text(); if (text.length > 0) { try { - let responseBody = fromJson(text); + const responseBody = fromJson(text); return responseBody; - } catch (err) { + } catch (_err) { return { ok: false, error: { diff --git a/src/core/fetcher/index.ts b/src/core/fetcher/index.ts index 9fffe7494..2f32091ef 100644 --- a/src/core/fetcher/index.ts +++ b/src/core/fetcher/index.ts @@ -1,9 +1,11 @@ export type { APIResponse } from "./APIResponse"; -export { fetcher } from "./Fetcher"; +export type { BinaryResponse } from "./BinaryResponse"; +export type { EndpointMetadata } from "./EndpointMetadata"; +export { EndpointSupplier } from "./EndpointSupplier"; export type { Fetcher, FetchFunction } from "./Fetcher"; +export { fetcher } from "./Fetcher"; export { getHeader } from "./getHeader"; -export { Supplier } from "./Supplier"; -export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; -export type { RawResponse, WithRawResponse } from "./RawResponse"; export { HttpResponsePromise } from "./HttpResponsePromise"; -export { BinaryResponse } from "./BinaryResponse"; +export type { RawResponse, WithRawResponse } from "./RawResponse"; +export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; +export { Supplier } from "./Supplier"; diff --git a/src/core/fetcher/makeRequest.ts b/src/core/fetcher/makeRequest.ts index 1af42bb9f..8788d1bb0 100644 --- a/src/core/fetcher/makeRequest.ts +++ b/src/core/fetcher/makeRequest.ts @@ -14,7 +14,7 @@ export const makeRequest = async ( const signals: AbortSignal[] = []; // Add timeout signal - let timeoutAbortId: NodeJS.Timeout | undefined = undefined; + let timeoutAbortId: NodeJS.Timeout | undefined; if (timeoutMs != null) { const { signal, abortId } = getTimeoutSignal(timeoutMs); timeoutAbortId = abortId; @@ -25,7 +25,7 @@ export const makeRequest = async ( if (abortSignal != null) { signals.push(abortSignal); } - let newSignals = anySignal(signals); + const newSignals = anySignal(signals); const response = await fetchFn(url, { method: method, headers, diff --git a/src/core/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts index add3cce02..3d30bd1cf 100644 --- a/src/core/fetcher/requestWithRetries.ts +++ b/src/core/fetcher/requestWithRetries.ts @@ -3,12 +3,55 @@ const MAX_RETRY_DELAY = 60000; // in milliseconds const DEFAULT_MAX_RETRIES = 2; const JITTER_FACTOR = 0.2; // 20% random jitter -function addJitter(delay: number): number { - // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR - const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR; +function addPositiveJitter(delay: number): number { + // Generate a random value between 0 and +JITTER_FACTOR + const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR; return delay * jitterMultiplier; } +function addSymmetricJitter(delay: number): number { + // Generate a random value in a JITTER_FACTOR-sized percentage range around delay + const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR; + return delay * jitterMultiplier; +} + +function getRetryDelayFromHeaders(response: Response, retryAttempt: number): number { + // Check for Retry-After header first (RFC 7231), with no jitter + const retryAfter = response.headers.get("Retry-After"); + if (retryAfter) { + // Parse as number of seconds... + const retryAfterSeconds = parseInt(retryAfter, 10); + if (!Number.isNaN(retryAfterSeconds) && retryAfterSeconds > 0) { + return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY); + } + + // ...or as an HTTP date; both are valid + const retryAfterDate = new Date(retryAfter); + if (!Number.isNaN(retryAfterDate.getTime())) { + const delay = retryAfterDate.getTime() - Date.now(); + if (delay > 0) { + return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY); + } + } + } + + // Then check for industry-standard X-RateLimit-Reset header, with positive jitter + const rateLimitReset = response.headers.get("X-RateLimit-Reset"); + if (rateLimitReset) { + const resetTime = parseInt(rateLimitReset, 10); + if (!Number.isNaN(resetTime)) { + // Assume Unix timestamp in epoch seconds + const delay = resetTime * 1000 - Date.now(); + if (delay > 0) { + return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY)); + } + } + } + + // Fall back to exponential backoff, with symmetric jitter + return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * 2 ** retryAttempt, MAX_RETRY_DELAY)); +} + export async function requestWithRetries( requestFn: () => Promise, maxRetries: number = DEFAULT_MAX_RETRIES, @@ -17,13 +60,10 @@ export async function requestWithRetries( for (let i = 0; i < maxRetries; ++i) { if ([408, 429].includes(response.status) || response.status >= 500) { - // Calculate base delay using exponential backoff (in milliseconds) - const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY); - - // Add jitter to the delay - const delayWithJitter = addJitter(baseDelay); + // Get delay with appropriate jitter applied + const delay = getRetryDelayFromHeaders(response, i); - await new Promise((resolve) => setTimeout(resolve, delayWithJitter)); + await new Promise((resolve) => setTimeout(resolve, delay)); response = await requestFn(); } else { break; diff --git a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 6f1a82e96..aae72d2f2 100644 --- a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -1,6 +1,6 @@ import type { Writable } from "readable-stream"; -import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; +import type { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; export class Node18UniversalStreamWrapper implements diff --git a/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts b/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts index 23c01a1a7..e0896d9ce 100644 --- a/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts @@ -1,6 +1,6 @@ import type { Readable, Writable } from "readable-stream"; -import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; +import type { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; export class NodePre18StreamWrapper implements StreamWrapper { private readableStream: Readable; diff --git a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 091e2a7f3..262ac1303 100644 --- a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -1,4 +1,4 @@ -import { StreamWrapper } from "./chooseStreamWrapper"; +import type { StreamWrapper } from "./chooseStreamWrapper"; type EventCallback = (data?: any) => void; diff --git a/src/core/file/exports.ts b/src/core/file/exports.ts new file mode 100644 index 000000000..c957cdf60 --- /dev/null +++ b/src/core/file/exports.ts @@ -0,0 +1 @@ +export type { Uploadable } from "./types"; diff --git a/src/core/file/file.ts b/src/core/file/file.ts new file mode 100644 index 000000000..35044a220 --- /dev/null +++ b/src/core/file/file.ts @@ -0,0 +1,217 @@ +import type { Uploadable } from "./types"; + +export async function toBinaryUploadRequest( + file: Uploadable, +): Promise<{ body: Uploadable.FileLike; headers?: Record }> { + const { data, filename, contentLength, contentType } = await getFileWithMetadata(file); + const request = { + body: data, + headers: {} as Record, + }; + if (filename) { + request.headers["Content-Disposition"] = `attachment; filename="${filename}"`; + } + if (contentType) { + request.headers["Content-Type"] = contentType; + } + if (contentLength != null) { + request.headers["Content-Length"] = contentLength.toString(); + } + return request; +} + +export async function toMultipartDataPart( + file: Uploadable, +): Promise<{ data: Uploadable.FileLike; filename?: string; contentType?: string }> { + const { data, filename, contentType } = await getFileWithMetadata(file, { + noSniffFileSize: true, + }); + return { + data, + filename, + contentType, + }; +} + +async function getFileWithMetadata( + file: Uploadable, + { noSniffFileSize }: { noSniffFileSize?: boolean } = {}, +): Promise { + if (isFileLike(file)) { + return getFileWithMetadata( + { + data: file, + }, + { noSniffFileSize }, + ); + } + + if ("path" in file) { + const fs = await import("fs"); + if (!fs || !fs.createReadStream) { + throw new Error("File path uploads are not supported in this environment."); + } + const data = fs.createReadStream(file.path); + const contentLength = + file.contentLength ?? (noSniffFileSize === true ? undefined : await tryGetFileSizeFromPath(file.path)); + const filename = file.filename ?? getNameFromPath(file.path); + return { + data, + filename, + contentType: file.contentType, + contentLength, + }; + } + if ("data" in file) { + const data = file.data; + const contentLength = + file.contentLength ?? + (await tryGetContentLengthFromFileLike(data, { + noSniffFileSize, + })); + const filename = file.filename ?? tryGetNameFromFileLike(data); + return { + data, + filename, + contentType: file.contentType ?? tryGetContentTypeFromFileLike(data), + contentLength, + }; + } + + throw new Error(`Invalid FileUpload of type ${typeof file}: ${JSON.stringify(file)}`); +} + +function isFileLike(value: unknown): value is Uploadable.FileLike { + return ( + isBuffer(value) || + isArrayBufferView(value) || + isArrayBuffer(value) || + isUint8Array(value) || + isBlob(value) || + isFile(value) || + isStreamLike(value) || + isReadableStream(value) + ); +} + +async function tryGetFileSizeFromPath(path: string): Promise { + try { + const fs = await import("fs"); + if (!fs || !fs.promises || !fs.promises.stat) { + return undefined; + } + const fileStat = await fs.promises.stat(path); + return fileStat.size; + } catch (_fallbackError) { + return undefined; + } +} + +function tryGetNameFromFileLike(data: Uploadable.FileLike): string | undefined { + if (isNamedValue(data)) { + return data.name; + } + if (isPathedValue(data)) { + return getNameFromPath(data.path.toString()); + } + return undefined; +} + +async function tryGetContentLengthFromFileLike( + data: Uploadable.FileLike, + { noSniffFileSize }: { noSniffFileSize?: boolean } = {}, +): Promise { + if (isBuffer(data)) { + return data.length; + } + if (isArrayBufferView(data)) { + return data.byteLength; + } + if (isArrayBuffer(data)) { + return data.byteLength; + } + if (isBlob(data)) { + return data.size; + } + if (isFile(data)) { + return data.size; + } + if (noSniffFileSize === true) { + return undefined; + } + if (isPathedValue(data)) { + return await tryGetFileSizeFromPath(data.path.toString()); + } + return undefined; +} + +function tryGetContentTypeFromFileLike(data: Uploadable.FileLike): string | undefined { + if (isBlob(data)) { + return data.type; + } + if (isFile(data)) { + return data.type; + } + + return undefined; +} + +function getNameFromPath(path: string): string | undefined { + const lastForwardSlash = path.lastIndexOf("/"); + const lastBackSlash = path.lastIndexOf("\\"); + const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash); + return lastSlashIndex >= 0 ? path.substring(lastSlashIndex + 1) : path; +} + +type NamedValue = { + name: string; +} & unknown; + +type PathedValue = { + path: string | { toString(): string }; +} & unknown; + +type StreamLike = { + read?: () => unknown; + pipe?: (dest: unknown) => unknown; +} & unknown; + +function isNamedValue(value: unknown): value is NamedValue { + return typeof value === "object" && value != null && "name" in value; +} + +function isPathedValue(value: unknown): value is PathedValue { + return typeof value === "object" && value != null && "path" in value; +} + +function isStreamLike(value: unknown): value is StreamLike { + return typeof value === "object" && value != null && ("read" in value || "pipe" in value); +} + +function isReadableStream(value: unknown): value is ReadableStream { + return typeof value === "object" && value != null && "getReader" in value; +} + +function isBuffer(value: unknown): value is Buffer { + return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value); +} + +function isArrayBufferView(value: unknown): value is ArrayBufferView { + return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value); +} + +function isArrayBuffer(value: unknown): value is ArrayBuffer { + return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer; +} + +function isUint8Array(value: unknown): value is Uint8Array { + return typeof Uint8Array !== "undefined" && value instanceof Uint8Array; +} + +function isBlob(value: unknown): value is Blob { + return typeof Blob !== "undefined" && value instanceof Blob; +} + +function isFile(value: unknown): value is File { + return typeof File !== "undefined" && value instanceof File; +} diff --git a/src/core/file/index.ts b/src/core/file/index.ts new file mode 100644 index 000000000..611ebe206 --- /dev/null +++ b/src/core/file/index.ts @@ -0,0 +1,2 @@ +export * from "./file"; +export * from "./types"; diff --git a/src/core/file/types.ts b/src/core/file/types.ts new file mode 100644 index 000000000..531b6927f --- /dev/null +++ b/src/core/file/types.ts @@ -0,0 +1,81 @@ +/** + * A file that can be uploaded. Can be a file-like object (stream, buffer, blob, etc.), + * a path to a file, or an object with a file-like object and metadata. + */ +export type Uploadable = Uploadable.FileLike | Uploadable.FromPath | Uploadable.WithMetadata; + +export namespace Uploadable { + /** + * Various file-like objects that can be used to upload a file. + */ + export type FileLike = + | ArrayBuffer + | ArrayBufferLike + | ArrayBufferView + | Uint8Array + | import("buffer").Buffer + | import("buffer").Blob + | import("buffer").File + | import("stream").Readable + | import("stream/web").ReadableStream + | globalThis.Blob + | globalThis.File + | ReadableStream; + + /** + * A file path with optional metadata, used for uploading a file from the file system. + */ + export type FromPath = { + /** The path to the file to upload */ + path: string; + /** + * Optional override for the file name (defaults to basename of path). + * This is used to set the `Content-Disposition` header in upload requests. + */ + filename?: string; + /** + * Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain'). + * This is used to set the `Content-Type` header in upload requests. + */ + contentType?: string; + /** + * Optional file size in bytes. + * If not provided, the file size will be determined from the file system. + * The content length is used to set the `Content-Length` header in upload requests. + */ + contentLength?: number; + }; + + /** + * A file-like object with metadata, used for uploading files. + */ + export type WithMetadata = { + /** The file data */ + data: FileLike; + /** + * Optional override for the file name (defaults to basename of path). + * This is used to set the `Content-Disposition` header in upload requests. + */ + filename?: string; + /** + * Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain'). + * This is used to set the `Content-Type` header in upload requests. + * + * If not provided, the content type may be determined from the data itself. + * * If the data is a `File`, `Blob`, or similar, the content type will be determined from the file itself, if the type is set. + * * Any other data type will not have a content type set, and the upload request will use `Content-Type: application/octet-stream` instead. + */ + contentType?: string; + /** + * Optional file size in bytes. + * The content length is used to set the `Content-Length` header in upload requests. + * If the content length is not provided and cannot be determined, the upload request will not include the `Content-Length` header, but will use `Transfer-Encoding: chunked` instead. + * + * If not provided, the file size will be determined depending on the data type. + * * If the data is of type `fs.ReadStream` (`createReadStream`), the size will be determined from the file system. + * * If the data is a `Buffer`, `ArrayBuffer`, `Uint8Array`, `Blob`, `File`, or similar, the size will be determined from the data itself. + * * If the data is a `Readable` or `ReadableStream`, the size will not be determined. + */ + contentLength?: number; + }; +} diff --git a/src/core/form-data-utils/FormDataWrapper.ts b/src/core/form-data-utils/FormDataWrapper.ts index 2becf2e56..5e5ddc142 100644 --- a/src/core/form-data-utils/FormDataWrapper.ts +++ b/src/core/form-data-utils/FormDataWrapper.ts @@ -1,6 +1,10 @@ +import { toMultipartDataPart, type Uploadable } from "../../core/file/index"; +import { toJson } from "../../core/json"; import { RUNTIME } from "../runtime/index"; -export async function toReadableStream(encoder: import("form-data-encoder").FormDataEncoder) { +export async function toReadableStream( + encoder: import("form-data-encoder").FormDataEncoder, +): Promise { return (await import("readable-stream")).Readable.from(encoder); } @@ -12,36 +16,24 @@ interface FormDataRequest { duplex?: "half"; } -function isNamedValue(value: unknown): value is { name: string } { - return typeof value === "object" && value != null && "name" in value; -} -function isPathedValue(value: unknown): value is { path: unknown } { - return typeof value === "object" && value != null && "path" in value; -} - -function getLastPathSegment(pathStr: string): string { - const lastForwardSlash = pathStr.lastIndexOf("/"); - const lastBackSlash = pathStr.lastIndexOf("\\"); - const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash); - return lastSlashIndex >= 0 ? pathStr.substring(lastSlashIndex + 1) : pathStr; -} - export interface CrossPlatformFormData { setup(): Promise; append(key: string, value: unknown): void; - appendFile(key: string, value: unknown, fileName?: string): Promise; + appendFile(key: string, value: Uploadable): Promise; getRequest(): MaybePromise>; } export async function newFormData(): Promise { let formdata: CrossPlatformFormData; - if (RUNTIME.type === "node" && RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { - formdata = new Node18FormData(); - } else if (RUNTIME.type === "node") { - formdata = new Node16FormData(); + if (RUNTIME.type === "node") { + if (RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { + formdata = new Node18FormData(); + } else { + formdata = new Node16FormData(); + } } else { formdata = new WebFormData(); } @@ -51,7 +43,7 @@ export async function newFormData(): Promise { export type Node18FormDataFd = | { - append(name: string, value: unknown, fileName?: string): void; + append(name: string, value: unknown, filename?: string): void; } | undefined; @@ -61,7 +53,7 @@ export type Node18FormDataFd = export class Node18FormData implements CrossPlatformFormData { private fd: Node18FormDataFd; - public async setup() { + public async setup(): Promise { this.fd = new (await import("formdata-node")).FormData(); } @@ -69,31 +61,18 @@ export class Node18FormData implements CrossPlatformFormData { this.fd?.append(key, value); } - private getFileName(value: any, filename?: string): string | undefined { - if (filename != null) { - return filename; - } - if (isNamedValue(value)) { - return value.name; - } - if (isPathedValue(value) && value.path) { - return getLastPathSegment(value.path.toString()); - } - return undefined; - } + public async appendFile(key: string, value: Uploadable): Promise { + const { data, filename } = await toMultipartDataPart(value); - public async appendFile(key: string, value: unknown, fileName?: string): Promise { - fileName = this.getFileName(value, fileName); - - if (value instanceof Blob) { - this.fd?.append(key, value, fileName); + if (data instanceof Blob) { + this.fd?.append(key, data, filename); } else { this.fd?.append(key, { type: undefined, - name: fileName, + name: filename, [Symbol.toStringTag]: "File", stream() { - return value; + return data; }, }); } @@ -143,33 +122,20 @@ export class Node16FormData implements CrossPlatformFormData { this.fd?.append(key, value); } - private getFileName(value: any, filename?: string): string | undefined { - if (filename != null) { - return filename; - } - if (isNamedValue(value)) { - return value.name; - } - if (isPathedValue(value) && value.path) { - return getLastPathSegment(value.path.toString()); - } - return undefined; - } - - public async appendFile(key: string, value: unknown, fileName?: string): Promise { - fileName = this.getFileName(value, fileName); + public async appendFile(key: string, value: Uploadable): Promise { + const { data, filename } = await toMultipartDataPart(value); let bufferedValue; - if (value instanceof Blob) { - bufferedValue = Buffer.from(await (value as any).arrayBuffer()); + if (data instanceof Blob) { + bufferedValue = Buffer.from(await (data as any).arrayBuffer()); } else { - bufferedValue = value; + bufferedValue = data; } - if (fileName == null) { + if (filename == null) { this.fd?.append(key, bufferedValue); } else { - this.fd?.append(key, bufferedValue, { filename: fileName }); + this.fd?.append(key, bufferedValue, { filename }); } } @@ -181,7 +147,7 @@ export class Node16FormData implements CrossPlatformFormData { } } -export type WebFormDataFd = { append(name: string, value: string | Blob, fileName?: string): void } | undefined; +export type WebFormDataFd = { append(name: string, value: string | Blob, filename?: string): void } | undefined; /** * Form Data Implementation for Web @@ -197,27 +163,14 @@ export class WebFormData implements CrossPlatformFormData { this.fd?.append(key, value); } - private getFileName(value: any, filename?: string): string | undefined { - if (filename != null) { - return filename; - } - if (isNamedValue(value)) { - return value.name; - } - if (isPathedValue(value) && value.path) { - return getLastPathSegment(value.path.toString()); - } - return undefined; - } - - public async appendFile(key: string, value: any, fileName?: string): Promise { - fileName = this.getFileName(value, fileName); + public async appendFile(key: string, value: Uploadable): Promise { + const { data, filename, contentType } = await toMultipartDataPart(value); - if (value instanceof Blob) { - this.fd?.append(key, value, fileName); + if (data instanceof Blob) { + this.fd?.append(key, data, filename); return; } - this.fd?.append(key, new Blob([value]), fileName); + this.fd?.append(key, await convertToBlob(data, contentType), filename); } public getRequest(): FormDataRequest { @@ -227,3 +180,100 @@ export class WebFormData implements CrossPlatformFormData { }; } } + +type StreamLike = { + read?: () => unknown; + pipe?: (dest: unknown) => unknown; +} & unknown; + +function isStreamLike(value: unknown): value is StreamLike { + return typeof value === "object" && value != null && ("read" in value || "pipe" in value); +} + +function isReadableStream(value: unknown): value is ReadableStream { + return typeof value === "object" && value != null && "getReader" in value; +} + +function isBuffer(value: unknown): value is Buffer { + return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value); +} + +function isArrayBufferView(value: unknown): value is ArrayBufferView { + return ArrayBuffer.isView(value); +} + +async function streamToBuffer(stream: unknown): Promise { + if (RUNTIME.type === "node") { + const { Readable } = await import("stream"); + + if (stream instanceof Readable) { + const chunks: Buffer[] = []; + for await (const chunk of stream) { + chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)); + } + return Buffer.concat(chunks); + } + } + + if (isReadableStream(stream)) { + const reader = stream.getReader(); + const chunks: Uint8Array[] = []; + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + chunks.push(value); + } + } finally { + reader.releaseLock(); + } + + const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0); + const result = new Uint8Array(totalLength); + let offset = 0; + for (const chunk of chunks) { + result.set(chunk, offset); + offset += chunk.length; + } + + return Buffer.from(result); + } + + throw new Error( + `Unsupported stream type: ${typeof stream}. Expected Node.js Readable stream or Web ReadableStream.`, + ); +} + +async function convertToBlob(value: unknown, contentType?: string): Promise { + if (isStreamLike(value) || isReadableStream(value)) { + const buffer = await streamToBuffer(value); + return new Blob([buffer], { type: contentType }); + } + + if (value instanceof Blob) { + return value; + } + + if (isBuffer(value)) { + return new Blob([value], { type: contentType }); + } + + if (value instanceof ArrayBuffer) { + return new Blob([value], { type: contentType }); + } + + if (isArrayBufferView(value)) { + return new Blob([value], { type: contentType }); + } + + if (typeof value === "string") { + return new Blob([value], { type: contentType }); + } + + if (typeof value === "object" && value !== null) { + return new Blob([toJson(value)], { type: contentType ?? "application/json" }); + } + + return new Blob([String(value)], { type: contentType }); +} diff --git a/src/core/headers.ts b/src/core/headers.ts index 1b4d3308d..a723d2283 100644 --- a/src/core/headers.ts +++ b/src/core/headers.ts @@ -1,9 +1,7 @@ -import * as core from "./index"; - -export function mergeHeaders( - ...headersArray: (Record | undefined> | undefined)[] -): Record> { - const result: Record> = {}; +export function mergeHeaders( + ...headersArray: (Record | null | undefined)[] +): Record { + const result: Record = {}; for (const [key, value] of headersArray .filter((headers) => headers != null) @@ -18,10 +16,10 @@ export function mergeHeaders( return result; } -export function mergeOnlyDefinedHeaders( - ...headersArray: (Record | undefined> | undefined)[] -): Record> { - const result: Record> = {}; +export function mergeOnlyDefinedHeaders( + ...headersArray: (Record | null | undefined)[] +): Record { + const result: Record = {}; for (const [key, value] of headersArray .filter((headers) => headers != null) diff --git a/src/core/index.ts b/src/core/index.ts index c8bf52015..0dd785c34 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -1,8 +1,11 @@ -export * from "./fetcher"; -export * from "./auth"; -export * from "./runtime"; -export * from "./utils"; -export * from "./pagination"; -export * from "./form-data-utils"; -export * as url from "./url"; -export * as serialization from "./schemas"; +export * from "./auth/index.js"; +export * from "./base64.js"; +export * from "./crypto/index.js"; +export * from "./fetcher/index.js"; +export * as file from "./file/index.js"; +export * from "./form-data-utils/index.js"; +export * from "./pagination/index.js"; +export * from "./runtime/index.js"; +export * as serialization from "./schemas/index.js"; +export * as url from "./url/index.js"; +export * from "./utils/index.js"; diff --git a/src/core/json.ts b/src/core/json.ts index f5e294921..9070644c1 100644 --- a/src/core/json.ts +++ b/src/core/json.ts @@ -1,156 +1,370 @@ -// Credit to Ivan Korolenko -// Code adopted from https://github.com/Ivan-Korolenko/json-with-bigint -// Based on upstream commit 79f8c9eec0017eff0b89b371c045962e5c2da709 (v3.4.4, April 2025) +const BIGINT_MARKER = "#bigint#"; +const CC_0 = 0x30, + CC_9 = 0x39; +const CC_SPACE = 0x20, + CC_TAB = 0x09, + CC_LF = 0x0a, + CC_CR = 0x0d; +const CC_MINUS = 0x2d, + CC_PLUS = 0x2b, + CC_DOT = 0x2e; +const CC_QUOTE = 0x22, + CC_BACKSLASH = 0x5c; +const CC_COMMA = 0x2c, + CC_COLON = 0x3a; +const CC_LBRACE = 0x7b, + CC_RBRACE = 0x7d; +const CC_LBRACKET = 0x5b, + CC_RBRACKET = 0x5d; +const CC_E_LOWER = 0x65, + CC_E_UPPER = 0x45; +const CC_T = 0x74, + CC_R = 0x72, + CC_U = 0x75, + CC_E = 0x65; // 'true' +const CC_F = 0x66, + CC_A = 0x61, + CC_L = 0x6c, + CC_S = 0x73; // 'false' +const CC_N = 0x6e; // 'null' +const isWhitespace = (c: number) => c === CC_SPACE || c === CC_TAB || c === CC_LF || c === CC_CR; +const isDigit = (c: number) => c >= CC_0 && c <= CC_9; -const noiseValue = /^-?\d+n+$/; // Noise - strings that match the custom format before being converted to it -const originalStringify = JSON.stringify; -const originalParse = JSON.parse; - -/* - Function to serialize value to a JSON string. - Converts BigInt values to a custom format (strings with digits and "n" at the end) and then converts them to proper big integers in a JSON string. -*/ +// Cache the regex for better performance +const BIGINT_REGEX = new RegExp(`"(-?\\d+)${BIGINT_MARKER.replace(/[#]/g, "\\$&")}"`, "g"); /** * Serialize a value to JSON * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results, or an array of strings and numbers that acts as an approved list for selecting object properties. + * @param replacer A function that transforms the results. * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. * @returns JSON string */ export const toJson = ( - value: unknown, - replacer?: ((this: unknown, key: string, value: unknown) => unknown) | (string | number)[] | null, - space?: string | number, + data: unknown, + replacer?: (key: string, value: unknown) => unknown, + space?: string | number ): string => { - // Use native JSON.rawJSON if available (Node 20.12+, Chrome 114+) - if ('rawJSON' in JSON) { - return originalStringify( - value, - (key, val) => { - if (typeof val === 'bigint') { - return (JSON as unknown as { rawJSON: (text: string) => unknown }).rawJSON(val.toString()); - } + // Use native JSON.stringify with a custom replacer for BigInt + const preliminaryJSON = JSON.stringify( + data, + (key: string, value: unknown) => { + if (typeof value === "bigint") { + return value.toString() + BIGINT_MARKER; + } + return replacer ? replacer(key, value) : value; + }, + space + ); - if (typeof replacer === 'function') { - return replacer.call(this, key, val); - } + // Strip quotes around numbers with marker: "123#bigint#" → 123 + return preliminaryJSON.replace(BIGINT_REGEX, "$1"); +}; - if (Array.isArray(replacer) && replacer.includes(key)) { - return val; - } +/** + * Parse JSON string to object, array, or other type + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is. + * @returns Parsed object, array, or other type + */ + +export function fromJson( + json: string, + reviver?: (this: unknown, key: string, value: unknown) => unknown +): T { + let i = 0; + const len = json.length; - return val; - }, - space, - ); + function skipWhitespace() { + while (i < len && isWhitespace(json.charCodeAt(i))) i++; } - if (!value) { - return originalStringify(value, replacer as never, space); + function parseValue(): unknown { + skipWhitespace(); + const c = json.charCodeAt(i); + + if (c === CC_QUOTE) return parseString(); + if (c === CC_LBRACE) return parseObject(); + if (c === CC_LBRACKET) return parseArray(); + if (c === CC_MINUS || isDigit(c)) return parseNumber(); + + // Check for true/false/null using character codes + if (c === CC_T) { + if (json.charCodeAt(i + 1) === CC_R && json.charCodeAt(i + 2) === CC_U && json.charCodeAt(i + 3) === CC_E) { + i += 4; + return true; + } + } else if (c === CC_F) { + if ( + json.charCodeAt(i + 1) === CC_A && + json.charCodeAt(i + 2) === CC_L && + json.charCodeAt(i + 3) === CC_S && + json.charCodeAt(i + 4) === CC_E + ) { + i += 5; + return false; + } + } else if (c === CC_N) { + if (json.charCodeAt(i + 1) === CC_U && json.charCodeAt(i + 2) === CC_L && json.charCodeAt(i + 3) === CC_L) { + i += 4; + return null; + } + } + + throw new SyntaxError(`Unexpected character at position ${i}: ${json[i]}`); } - const bigInts = /([\[:])?"(-?\d+)n"($|\s*[,\}\]])/g; - const noise = /([\[:])?("-?\d+n+)n("$|"\s*[,\}\]])/g; - const convertedToCustomJSON = originalStringify( - value, - (key, val) => { - const isNoise = typeof val === 'string' && Boolean(val.match(noiseValue)); + function parseString(): string { + i++; // skip opening quote + const start = i; - if (isNoise) { - return val.toString() + 'n'; // Mark noise values with additional "n" to offset the deletion of one "n" during the processing + // Fast path: scan for end quote without escapes + while (i < len) { + const c = json.charCodeAt(i); + if (c === CC_QUOTE) { + const result = json.slice(start, i); + i++; + return result; + } + if (c === CC_BACKSLASH) { + break; // Hit an escape, fall through to slow path } + i++; + } - if (typeof val === 'bigint') { - return val.toString() + 'n'; + // Slow path: handle escapes using array for better performance + const parts = [json.slice(start, i)]; + while (i < len) { + const c = json.charCodeAt(i); + if (c === CC_QUOTE) { + i++; + return parts.join(""); } + if (c === CC_BACKSLASH) { + i++; + const next = json.charCodeAt(i); + switch (next) { + case CC_QUOTE: + parts.push('"'); + break; + case CC_BACKSLASH: + parts.push("\\"); + break; + case 0x2f: // '/' + parts.push("/"); + break; + case 0x62: // 'b' + parts.push("\b"); + break; + case 0x66: // 'f' + parts.push("\f"); + break; + case CC_N: // 'n' + parts.push("\n"); + break; + case CC_R: // 'r' + parts.push("\r"); + break; + case CC_T: // 't' + parts.push("\t"); + break; + case CC_U: // 'u' + parts.push(String.fromCharCode(parseInt(json.slice(i + 1, i + 5), 16))); + i += 4; + break; + default: + throw new SyntaxError(`Invalid escape sequence at position ${i}`); + } + i++; + } else { + // Accumulate regular characters + const chunkStart = i; + while (i < len) { + const cc = json.charCodeAt(i); + if (cc === CC_QUOTE || cc === CC_BACKSLASH) break; + i++; + } + parts.push(json.slice(chunkStart, i)); + } + } + throw new SyntaxError("Unterminated string"); + } + + function parseNumber(): number | bigint { + const start = i; + + // Optional minus + if (json.charCodeAt(i) === CC_MINUS) i++; + + // Integer part + const digitStart = i; + if (json.charCodeAt(i) === CC_0) { + i++; + } else if (isDigit(json.charCodeAt(i))) { + while (i < len && isDigit(json.charCodeAt(i))) i++; + } + const intEnd = i; + + // Fraction part + let hasFrac = false; + if (json.charCodeAt(i) === CC_DOT) { + hasFrac = true; + i++; + while (i < len && isDigit(json.charCodeAt(i))) i++; + } + + // Exponent part + let hasExp = false; + const c = json.charCodeAt(i); + if (c === CC_E_LOWER || c === CC_E_UPPER) { + hasExp = true; + i++; + const sign = json.charCodeAt(i); + if (sign === CC_MINUS || sign === CC_PLUS) i++; + while (i < len && isDigit(json.charCodeAt(i))) i++; + } - if (typeof replacer === 'function') { - return replacer.call(this, key, val); + const numStr = json.slice(start, i); + + // If it's a pure integer, check if we should use BigInt + if (!hasFrac && !hasExp) { + const digitCount = intEnd - digitStart; + + // Quick length check - numbers > 16 digits are definitely unsafe + if (digitCount > 16) { + return BigInt(numStr); } - if (Array.isArray(replacer) && replacer.includes(key)) { - return val; + // Numbers < 15 digits are always safe + if (digitCount < 15) { + return Number(numStr); } - return val; - }, - space, - ); - const processedJSON = convertedToCustomJSON.replace(bigInts, '$1$2$3'); // Delete one "n" off the end of every BigInt value - const denoisedJSON = processedJSON.replace(noise, '$1$2$3'); // Remove one "n" off the end of every noisy string + // For 15-16 digit numbers, convert and check + const num = Number(numStr); + if (!Number.isSafeInteger(num)) { + return BigInt(numStr); + } + return num; + } - return denoisedJSON; -}; + return Number(numStr); + } -/* - Function to parse JSON. - If JSON has number values greater than Number.MAX_SAFE_INTEGER, we convert those values to a custom format, then parse them to BigInt values. - Other types of values are not affected and parsed as native JSON.parse() would parse them. -*/ + function parseObject(): Record { + i++; // skip opening brace + skipWhitespace(); -/** - * Parse JSON string to object, array, or other type - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is. - * @returns Parsed object, array, or other type - */ -export function fromJson( - text: string, - reviver?: (this: unknown, key: string, value: unknown) => unknown, -): T { - if (!text) { - return originalParse(text, reviver); - } + const obj: Record = {}; - const MAX_INT = Number.MAX_SAFE_INTEGER.toString(); - const MAX_DIGITS = MAX_INT.length; - const stringsOrLargeNumbers = /"(?:[^"\\]|\\.)*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g; - const noiseValueWithQuotes = /^"-?\d+n+"$/; // Noise - strings that match the custom format before being converted to it - const customFormat = /^-?\d+n$/; + if (json.charCodeAt(i) === CC_RBRACE) { + i++; + return obj; + } - // Find and mark big numbers with "n" - const serializedData = text.replace( - stringsOrLargeNumbers, - (match, digits, fractional, exponential) => { - const isString = match[0] === '"'; - const isNoise = isString && Boolean(match.match(noiseValueWithQuotes)); + while (true) { + skipWhitespace(); + const key = parseString(); + skipWhitespace(); - if (isNoise) { - return match.substring(0, match.length - 1) + 'n"'; // Mark noise values with additional "n" to offset the deletion of one "n" during the processing + if (json.charCodeAt(i) !== CC_COLON) { + throw new SyntaxError(`Expected ':' at position ${i}`); } + i++; - const isFractionalOrExponential = fractional || exponential; - const isLessThanMaxSafeInt = - digits && - (digits.length < MAX_DIGITS || (digits.length === MAX_DIGITS && digits <= MAX_INT)); // With a fixed number of digits, we can correctly use lexicographical comparison to do a numeric comparison + const value = parseValue(); + obj[key] = value; - if (isString || isFractionalOrExponential || isLessThanMaxSafeInt) { - return match; + skipWhitespace(); + const c = json.charCodeAt(i); + if (c === CC_RBRACE) { + i++; + return obj; + } + if (c === CC_COMMA) { + i++; + continue; } + throw new SyntaxError(`Expected ',' or '}' at position ${i}`); + } + } - return '"' + match + 'n"'; - }, - ); + function parseArray(): unknown[] { + i++; // skip opening bracket + skipWhitespace(); - // Convert marked big numbers to BigInt - return originalParse(serializedData, function (key, value) { - const isCustomFormatBigInt = typeof value === 'string' && Boolean(value.match(customFormat)); + const arr: unknown[] = []; - if (isCustomFormatBigInt) { - return BigInt(value.substring(0, value.length - 1)); + if (json.charCodeAt(i) === CC_RBRACKET) { + i++; + return arr; } - const isNoiseValue = typeof value === 'string' && Boolean(value.match(noiseValue)); + while (true) { + arr.push(parseValue()); + skipWhitespace(); - if (isNoiseValue) { - return value.substring(0, value.length - 1); // Remove one "n" off the end of the noisy string + const c = json.charCodeAt(i); + if (c === CC_RBRACKET) { + i++; + return arr; + } + if (c === CC_COMMA) { + i++; + continue; + } + throw new SyntaxError(`Expected ',' or ']' at position ${i}`); } + } + + const result = parseValue(); + skipWhitespace(); + + if (i < json.length) { + throw new SyntaxError(`Unexpected content at position ${i}`); + } - if (typeof reviver !== 'function') { - return value; + // Apply reviver if provided + if (!reviver) return result as T; + + function reviveRecursive(holder: Record | unknown[], key: string): unknown { + let value: unknown; + if (Array.isArray(holder)) { + const idx = Number(key); + if (Number.isInteger(idx)) { + value = holder[idx]; + } else { + value = (holder as unknown as Record)[key]; + } + } else { + value = holder[key]; } - return reviver.call(this, key, value); - }); + if (value && typeof value === "object") { + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + const newValue = reviveRecursive(value, String(i)); + if (newValue !== undefined) { + value[i] = newValue; + } else { + delete value[i]; + } + } + } else { + const obj = value as Record; + for (const k of Object.keys(obj)) { + const newValue = reviveRecursive(obj, k); + if (newValue !== undefined) { + obj[k] = newValue; + } else { + delete obj[k]; + } + } + } + } + + return reviver?.call(holder, key, value); + } + + return reviveRecursive({ "": result }, "") as T; } diff --git a/src/core/pagination/Page.ts b/src/core/pagination/Page.ts index 30df7280b..9c748ec18 100644 --- a/src/core/pagination/Page.ts +++ b/src/core/pagination/Page.ts @@ -1,4 +1,4 @@ -import { HttpResponsePromise, RawResponse } from "../fetcher"; +import type { HttpResponsePromise, RawResponse } from "../fetcher/index"; /** * A page of results from a paginated API. diff --git a/src/core/pagination/Pageable.ts b/src/core/pagination/Pageable.ts index 3a5220ebd..162c9ceae 100644 --- a/src/core/pagination/Pageable.ts +++ b/src/core/pagination/Pageable.ts @@ -1,4 +1,4 @@ -import { RawResponse } from "../fetcher"; +import type { RawResponse } from "../fetcher/index"; import { Page } from "./Page"; export declare namespace Pageable { diff --git a/src/core/schemas/Schema.ts b/src/core/schemas/Schema.ts index 921a15466..57b782b0e 100644 --- a/src/core/schemas/Schema.ts +++ b/src/core/schemas/Schema.ts @@ -1,4 +1,4 @@ -import { SchemaUtils } from "./builders"; +import type { SchemaUtils } from "./builders/index"; export type Schema = BaseSchema & SchemaUtils; diff --git a/src/core/schemas/builders/bigint/bigint.ts b/src/core/schemas/builders/bigint/bigint.ts index e69bb791e..9d8a63d45 100644 --- a/src/core/schemas/builders/bigint/bigint.ts +++ b/src/core/schemas/builders/bigint/bigint.ts @@ -1,7 +1,7 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; +import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; +import { getSchemaUtils } from "../schema-utils/index"; export function bigint(): Schema { const baseSchema: BaseSchema = { diff --git a/src/core/schemas/builders/date/date.ts b/src/core/schemas/builders/date/date.ts index b70f24b04..bc507e085 100644 --- a/src/core/schemas/builders/date/date.ts +++ b/src/core/schemas/builders/date/date.ts @@ -1,7 +1,7 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; +import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; +import { getSchemaUtils } from "../schema-utils/index"; // https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime const ISO_8601_REGEX = diff --git a/src/core/schemas/builders/enum/enum.ts b/src/core/schemas/builders/enum/enum.ts index 69aced6be..c2c49a323 100644 --- a/src/core/schemas/builders/enum/enum.ts +++ b/src/core/schemas/builders/enum/enum.ts @@ -1,4 +1,4 @@ -import { Schema, SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/index.ts b/src/core/schemas/builders/index.ts index 65211f925..be23de258 100644 --- a/src/core/schemas/builders/index.ts +++ b/src/core/schemas/builders/index.ts @@ -1,14 +1,14 @@ -export * from "./bigint"; -export * from "./date"; -export * from "./enum"; -export * from "./lazy"; -export * from "./list"; -export * from "./literals"; -export * from "./object"; -export * from "./object-like"; -export * from "./primitives"; -export * from "./record"; -export * from "./schema-utils"; -export * from "./set"; -export * from "./undiscriminated-union"; -export * from "./union"; +export * from "./bigint/index"; +export * from "./date/index"; +export * from "./enum/index"; +export * from "./lazy/index"; +export * from "./list/index"; +export * from "./literals/index"; +export * from "./object/index"; +export * from "./object-like/index"; +export * from "./primitives/index"; +export * from "./record/index"; +export * from "./schema-utils/index"; +export * from "./set/index"; +export * from "./undiscriminated-union/index"; +export * from "./union/index"; diff --git a/src/core/schemas/builders/lazy/index.ts b/src/core/schemas/builders/lazy/index.ts index 77420fb03..2221abd88 100644 --- a/src/core/schemas/builders/lazy/index.ts +++ b/src/core/schemas/builders/lazy/index.ts @@ -1,3 +1,3 @@ -export { lazy } from "./lazy"; export type { SchemaGetter } from "./lazy"; +export { lazy } from "./lazy"; export { lazyObject } from "./lazyObject"; diff --git a/src/core/schemas/builders/lazy/lazy.ts b/src/core/schemas/builders/lazy/lazy.ts index 2962bdfe0..a72735184 100644 --- a/src/core/schemas/builders/lazy/lazy.ts +++ b/src/core/schemas/builders/lazy/lazy.ts @@ -1,5 +1,5 @@ -import { BaseSchema, Schema } from "../../Schema"; -import { getSchemaUtils } from "../schema-utils"; +import type { BaseSchema, Schema } from "../../Schema"; +import { getSchemaUtils } from "../schema-utils/index"; export type SchemaGetter> = () => SchemaType; diff --git a/src/core/schemas/builders/lazy/lazyObject.ts b/src/core/schemas/builders/lazy/lazyObject.ts index d8ee6ec5d..2a58a2abb 100644 --- a/src/core/schemas/builders/lazy/lazyObject.ts +++ b/src/core/schemas/builders/lazy/lazyObject.ts @@ -1,8 +1,8 @@ -import { getObjectUtils } from "../object"; -import { getObjectLikeUtils } from "../object-like"; -import { BaseObjectSchema, ObjectSchema } from "../object/types"; -import { getSchemaUtils } from "../schema-utils"; -import { SchemaGetter, constructLazyBaseSchema, getMemoizedSchema } from "./lazy"; +import { getObjectUtils } from "../object/index"; +import type { BaseObjectSchema, ObjectSchema } from "../object/types"; +import { getObjectLikeUtils } from "../object-like/index"; +import { getSchemaUtils } from "../schema-utils/index"; +import { constructLazyBaseSchema, getMemoizedSchema, type SchemaGetter } from "./lazy"; export function lazyObject(getter: SchemaGetter>): ObjectSchema { const baseSchema: BaseObjectSchema = { diff --git a/src/core/schemas/builders/list/list.ts b/src/core/schemas/builders/list/list.ts index a6167a5be..7c8fd6e87 100644 --- a/src/core/schemas/builders/list/list.ts +++ b/src/core/schemas/builders/list/list.ts @@ -1,7 +1,7 @@ -import { BaseSchema, MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { type BaseSchema, type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; +import { getSchemaUtils } from "../schema-utils/index"; export function list(schema: Schema): Schema { const baseSchema: BaseSchema = { diff --git a/src/core/schemas/builders/literals/booleanLiteral.ts b/src/core/schemas/builders/literals/booleanLiteral.ts index 5c004133d..fb06cc00f 100644 --- a/src/core/schemas/builders/literals/booleanLiteral.ts +++ b/src/core/schemas/builders/literals/booleanLiteral.ts @@ -1,4 +1,4 @@ -import { Schema, SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/literals/index.ts b/src/core/schemas/builders/literals/index.ts index d2bf08fc6..ae7389065 100644 --- a/src/core/schemas/builders/literals/index.ts +++ b/src/core/schemas/builders/literals/index.ts @@ -1,2 +1,2 @@ -export { stringLiteral } from "./stringLiteral"; export { booleanLiteral } from "./booleanLiteral"; +export { stringLiteral } from "./stringLiteral"; diff --git a/src/core/schemas/builders/literals/stringLiteral.ts b/src/core/schemas/builders/literals/stringLiteral.ts index 334bbdc46..98fe06223 100644 --- a/src/core/schemas/builders/literals/stringLiteral.ts +++ b/src/core/schemas/builders/literals/stringLiteral.ts @@ -1,4 +1,4 @@ -import { Schema, SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts index 8885586e2..ed96cf771 100644 --- a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts @@ -1,9 +1,9 @@ -import { BaseSchema } from "../../Schema"; +import type { BaseSchema } from "../../Schema"; import { filterObject } from "../../utils/filterObject"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; -import { getSchemaUtils } from "../schema-utils"; -import { ObjectLikeSchema, ObjectLikeUtils } from "./types"; +import { getSchemaUtils } from "../schema-utils/index"; +import type { ObjectLikeSchema, ObjectLikeUtils } from "./types"; export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { return { diff --git a/src/core/schemas/builders/object-like/types.ts b/src/core/schemas/builders/object-like/types.ts index 75b369872..a8401d7cf 100644 --- a/src/core/schemas/builders/object-like/types.ts +++ b/src/core/schemas/builders/object-like/types.ts @@ -1,11 +1,13 @@ -import { BaseSchema, Schema } from "../../Schema"; +import type { BaseSchema, Schema } from "../../Schema"; export type ObjectLikeSchema = Schema & BaseSchema & ObjectLikeUtils; export interface ObjectLikeUtils { - withParsedProperties: >(properties: { - [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); - }) => ObjectLikeSchema; + withParsedProperties: >( + properties: { + [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); + }, + ) => ObjectLikeSchema; } diff --git a/src/core/schemas/builders/object/index.ts b/src/core/schemas/builders/object/index.ts index e3f4388db..58ce0b48b 100644 --- a/src/core/schemas/builders/object/index.ts +++ b/src/core/schemas/builders/object/index.ts @@ -1,11 +1,11 @@ export { getObjectUtils, object } from "./object"; -export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; export type { inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, } from "./objectWithoutOptionalProperties"; -export { isProperty, property } from "./property"; +export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; export type { Property } from "./property"; +export { isProperty, property } from "./property"; export type { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, diff --git a/src/core/schemas/builders/object/object.ts b/src/core/schemas/builders/object/object.ts index 05fbca8a1..c239249e2 100644 --- a/src/core/schemas/builders/object/object.ts +++ b/src/core/schemas/builders/object/object.ts @@ -1,4 +1,4 @@ -import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; import { entries } from "../../utils/entries"; import { filterObject } from "../../utils/filterObject"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; @@ -6,17 +6,17 @@ import { isPlainObject } from "../../utils/isPlainObject"; import { keys } from "../../utils/keys"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; import { partition } from "../../utils/partition"; -import { getObjectLikeUtils } from "../object-like"; -import { getSchemaUtils } from "../schema-utils"; +import { getObjectLikeUtils } from "../object-like/index"; +import { getSchemaUtils } from "../schema-utils/index"; import { isProperty } from "./property"; -import { +import type { BaseObjectSchema, - ObjectSchema, - ObjectUtils, - PropertySchemas, inferObjectSchemaFromPropertySchemas, inferParsedObjectFromPropertySchemas, inferRawObjectFromPropertySchemas, + ObjectSchema, + ObjectUtils, + PropertySchemas, } from "./types"; interface ObjectPropertyWithRawKey { diff --git a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts index ce4d3edca..bac2e1e1a 100644 --- a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts +++ b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts @@ -1,5 +1,10 @@ import { object } from "./object"; -import { ObjectSchema, PropertySchemas, inferParsedPropertySchema, inferRawObjectFromPropertySchemas } from "./types"; +import type { + inferParsedPropertySchema, + inferRawObjectFromPropertySchemas, + ObjectSchema, + PropertySchemas, +} from "./types"; export function objectWithoutOptionalProperties>( schemas: T, diff --git a/src/core/schemas/builders/object/property.ts b/src/core/schemas/builders/object/property.ts index fa9a9be84..ef07c2a79 100644 --- a/src/core/schemas/builders/object/property.ts +++ b/src/core/schemas/builders/object/property.ts @@ -1,4 +1,4 @@ -import { Schema } from "../../Schema"; +import type { Schema } from "../../Schema"; export function property( rawKey: RawKey, diff --git a/src/core/schemas/builders/object/types.ts b/src/core/schemas/builders/object/types.ts index b4f49c884..57f874869 100644 --- a/src/core/schemas/builders/object/types.ts +++ b/src/core/schemas/builders/object/types.ts @@ -1,8 +1,8 @@ -import { BaseSchema, Schema, inferParsed, inferRaw } from "../../Schema"; -import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; -import { ObjectLikeUtils } from "../object-like"; -import { SchemaUtils } from "../schema-utils"; -import { Property } from "./property"; +import type { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema"; +import type { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; +import type { ObjectLikeUtils } from "../object-like/index"; +import type { SchemaUtils } from "../schema-utils/index"; +import type { Property } from "./property"; export type ObjectSchema = BaseObjectSchema & ObjectLikeUtils & @@ -23,8 +23,9 @@ export interface ObjectUtils { export type inferRawObject> = O extends ObjectSchema ? Raw : never; -export type inferParsedObject> = - O extends ObjectSchema ? Parsed : never; +export type inferParsedObject> = O extends ObjectSchema + ? Parsed + : never; export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< inferRawObjectFromPropertySchemas, @@ -46,11 +47,25 @@ export type PropertySchemas = Recor Property | Schema >; -export type inferRawPropertySchema

| Schema> = - P extends Property ? Raw : P extends Schema ? inferRaw

: never; +export type inferRawPropertySchema

| Schema> = P extends Property< + any, + infer Raw, + any +> + ? Raw + : P extends Schema + ? inferRaw

+ : never; -export type inferParsedPropertySchema

| Schema> = - P extends Property ? Parsed : P extends Schema ? inferParsed

: never; +export type inferParsedPropertySchema

| Schema> = P extends Property< + any, + any, + infer Parsed +> + ? Parsed + : P extends Schema + ? inferParsed

+ : never; export type inferRawKey< ParsedKey extends string | number | symbol, diff --git a/src/core/schemas/builders/primitives/any.ts b/src/core/schemas/builders/primitives/any.ts index fcaeb0425..0652f8934 100644 --- a/src/core/schemas/builders/primitives/any.ts +++ b/src/core/schemas/builders/primitives/any.ts @@ -1,4 +1,7 @@ -import { SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -export const any = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ ok: true, value })); +export const any: () => Schema = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ + ok: true, + value, +})); diff --git a/src/core/schemas/builders/primitives/boolean.ts b/src/core/schemas/builders/primitives/boolean.ts index 2b5598810..d90a6924f 100644 --- a/src/core/schemas/builders/primitives/boolean.ts +++ b/src/core/schemas/builders/primitives/boolean.ts @@ -1,8 +1,8 @@ -import { SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const boolean = createIdentitySchemaCreator( +export const boolean: () => Schema = createIdentitySchemaCreator( SchemaType.BOOLEAN, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "boolean") { diff --git a/src/core/schemas/builders/primitives/number.ts b/src/core/schemas/builders/primitives/number.ts index 3d6be6ff7..8b3b32cdc 100644 --- a/src/core/schemas/builders/primitives/number.ts +++ b/src/core/schemas/builders/primitives/number.ts @@ -1,8 +1,8 @@ -import { SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const number = createIdentitySchemaCreator( +export const number: () => Schema = createIdentitySchemaCreator( SchemaType.NUMBER, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "number") { diff --git a/src/core/schemas/builders/primitives/string.ts b/src/core/schemas/builders/primitives/string.ts index e09aceeca..f9f8e4779 100644 --- a/src/core/schemas/builders/primitives/string.ts +++ b/src/core/schemas/builders/primitives/string.ts @@ -1,8 +1,8 @@ -import { SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const string = createIdentitySchemaCreator( +export const string: () => Schema = createIdentitySchemaCreator( SchemaType.STRING, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "string") { diff --git a/src/core/schemas/builders/primitives/unknown.ts b/src/core/schemas/builders/primitives/unknown.ts index 4d5249571..41c9d770b 100644 --- a/src/core/schemas/builders/primitives/unknown.ts +++ b/src/core/schemas/builders/primitives/unknown.ts @@ -1,4 +1,7 @@ -import { SchemaType } from "../../Schema"; +import { type Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -export const unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value })); +export const unknown: () => Schema = createIdentitySchemaCreator( + SchemaType.UNKNOWN, + (value) => ({ ok: true, value }), +); diff --git a/src/core/schemas/builders/record/record.ts b/src/core/schemas/builders/record/record.ts index eb3e9a999..ba5307a6a 100644 --- a/src/core/schemas/builders/record/record.ts +++ b/src/core/schemas/builders/record/record.ts @@ -1,10 +1,10 @@ -import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; import { entries } from "../../utils/entries"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; -import { BaseRecordSchema, RecordSchema } from "./types"; +import { getSchemaUtils } from "../schema-utils/index"; +import type { BaseRecordSchema, RecordSchema } from "./types"; export function record( keySchema: Schema, @@ -90,7 +90,7 @@ function validateAndTransformRecord 0 ? Number(stringKey) : NaN; - if (!isNaN(numberKey)) { + if (!Number.isNaN(numberKey)) { key = numberKey; } } diff --git a/src/core/schemas/builders/record/types.ts b/src/core/schemas/builders/record/types.ts index fec431d43..b99bb9d87 100644 --- a/src/core/schemas/builders/record/types.ts +++ b/src/core/schemas/builders/record/types.ts @@ -1,5 +1,5 @@ -import { BaseSchema } from "../../Schema"; -import { SchemaUtils } from "../schema-utils"; +import type { BaseSchema } from "../../Schema"; +import type { SchemaUtils } from "../schema-utils/index"; export type RecordSchema< RawKey extends string | number, diff --git a/src/core/schemas/builders/schema-utils/JsonError.ts b/src/core/schemas/builders/schema-utils/JsonError.ts index 2b89ca0e7..7573c76be 100644 --- a/src/core/schemas/builders/schema-utils/JsonError.ts +++ b/src/core/schemas/builders/schema-utils/JsonError.ts @@ -1,4 +1,4 @@ -import { ValidationError } from "../../Schema"; +import type { ValidationError } from "../../Schema"; import { stringifyValidationError } from "./stringifyValidationErrors"; export class JsonError extends Error { diff --git a/src/core/schemas/builders/schema-utils/ParseError.ts b/src/core/schemas/builders/schema-utils/ParseError.ts index d056eb45c..f1914b596 100644 --- a/src/core/schemas/builders/schema-utils/ParseError.ts +++ b/src/core/schemas/builders/schema-utils/ParseError.ts @@ -1,4 +1,4 @@ -import { ValidationError } from "../../Schema"; +import type { ValidationError } from "../../Schema"; import { stringifyValidationError } from "./stringifyValidationErrors"; export class ParseError extends Error { diff --git a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts index d5e7a955d..91381a1d6 100644 --- a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts +++ b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts @@ -1,4 +1,4 @@ -import { BaseSchema, Schema, SchemaOptions, SchemaType } from "../../Schema"; +import { type BaseSchema, type Schema, type SchemaOptions, SchemaType } from "../../Schema"; import { JsonError } from "./JsonError"; import { ParseError } from "./ParseError"; diff --git a/src/core/schemas/builders/schema-utils/index.ts b/src/core/schemas/builders/schema-utils/index.ts index aa04e051d..9d0eed7ae 100644 --- a/src/core/schemas/builders/schema-utils/index.ts +++ b/src/core/schemas/builders/schema-utils/index.ts @@ -1,4 +1,4 @@ -export { getSchemaUtils, optional, transform } from "./getSchemaUtils"; export type { SchemaUtils } from "./getSchemaUtils"; +export { getSchemaUtils, optional, transform } from "./getSchemaUtils"; export { JsonError } from "./JsonError"; export { ParseError } from "./ParseError"; diff --git a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts index 4160f0a26..1066d0038 100644 --- a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts +++ b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts @@ -1,4 +1,4 @@ -import { ValidationError } from "../../Schema"; +import type { ValidationError } from "../../Schema"; export function stringifyValidationError(error: ValidationError): string { if (error.path.length === 0) { diff --git a/src/core/schemas/builders/set/set.ts b/src/core/schemas/builders/set/set.ts index e9e6bb7e5..bf31bc5fd 100644 --- a/src/core/schemas/builders/set/set.ts +++ b/src/core/schemas/builders/set/set.ts @@ -1,8 +1,8 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; +import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { list } from "../list"; -import { getSchemaUtils } from "../schema-utils"; +import { list } from "../list/index"; +import { getSchemaUtils } from "../schema-utils/index"; export function set(schema: Schema): Schema> { const listSchema = list(schema); diff --git a/src/core/schemas/builders/undiscriminated-union/types.ts b/src/core/schemas/builders/undiscriminated-union/types.ts index 4f0888aaf..3ef19e2c0 100644 --- a/src/core/schemas/builders/undiscriminated-union/types.ts +++ b/src/core/schemas/builders/undiscriminated-union/types.ts @@ -1,4 +1,4 @@ -import { Schema, inferParsed, inferRaw } from "../../Schema"; +import type { inferParsed, inferRaw, Schema } from "../../Schema"; export type UndiscriminatedUnionSchema = Schema< inferRawUnidiscriminatedUnionSchema, diff --git a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts index a5cf01fa5..26ad5f9b9 100644 --- a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts +++ b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts @@ -1,7 +1,14 @@ -import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType, ValidationError } from "../../Schema"; +import { + type BaseSchema, + type MaybeValid, + type Schema, + type SchemaOptions, + SchemaType, + type ValidationError, +} from "../../Schema"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; -import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; +import { getSchemaUtils } from "../schema-utils/index"; +import type { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; export function undiscriminatedUnion, ...Schema[]]>( schemas: Schemas, diff --git a/src/core/schemas/builders/union/index.ts b/src/core/schemas/builders/union/index.ts index 85fc008a2..22289b667 100644 --- a/src/core/schemas/builders/union/index.ts +++ b/src/core/schemas/builders/union/index.ts @@ -1,5 +1,5 @@ -export { discriminant } from "./discriminant"; export type { Discriminant } from "./discriminant"; +export { discriminant } from "./discriminant"; export type { inferParsedDiscriminant, inferParsedUnion, diff --git a/src/core/schemas/builders/union/types.ts b/src/core/schemas/builders/union/types.ts index 7ac9d16d6..79753436d 100644 --- a/src/core/schemas/builders/union/types.ts +++ b/src/core/schemas/builders/union/types.ts @@ -1,5 +1,5 @@ -import { ObjectSchema, inferParsedObject, inferRawObject } from "../object"; -import { Discriminant } from "./discriminant"; +import type { inferParsedObject, inferRawObject, ObjectSchema } from "../object/index"; +import type { Discriminant } from "./discriminant"; export type UnionSubtypes = { [K in DiscriminantValues]: ObjectSchema; diff --git a/src/core/schemas/builders/union/union.ts b/src/core/schemas/builders/union/union.ts index afdd5a1f5..7da4271a2 100644 --- a/src/core/schemas/builders/union/union.ts +++ b/src/core/schemas/builders/union/union.ts @@ -1,14 +1,20 @@ -import { BaseSchema, MaybeValid, SchemaType } from "../../Schema"; +import { type BaseSchema, type MaybeValid, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; import { keys } from "../../utils/keys"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { enum_ } from "../enum"; -import { ObjectSchema } from "../object"; -import { ObjectLikeSchema, getObjectLikeUtils } from "../object-like"; -import { getSchemaUtils } from "../schema-utils"; -import { Discriminant } from "./discriminant"; -import { UnionSubtypes, inferParsedDiscriminant, inferParsedUnion, inferRawDiscriminant, inferRawUnion } from "./types"; +import { enum_ } from "../enum/index"; +import type { ObjectSchema } from "../object/index"; +import { getObjectLikeUtils, type ObjectLikeSchema } from "../object-like"; +import { getSchemaUtils } from "../schema-utils/index"; +import type { Discriminant } from "./discriminant"; +import type { + inferParsedDiscriminant, + inferParsedUnion, + inferRawDiscriminant, + inferRawUnion, + UnionSubtypes, +} from "./types"; export function union, U extends UnionSubtypes>( discriminant: D, diff --git a/src/core/schemas/index.ts b/src/core/schemas/index.ts index 5429d8b43..60c0b5988 100644 --- a/src/core/schemas/index.ts +++ b/src/core/schemas/index.ts @@ -1,2 +1,2 @@ -export * from "./builders"; +export * from "./builders/index"; export type { inferParsed, inferRaw, Schema, SchemaOptions } from "./Schema"; diff --git a/src/core/schemas/utils/createIdentitySchemaCreator.ts b/src/core/schemas/utils/createIdentitySchemaCreator.ts index 4db71be4a..d299ada74 100644 --- a/src/core/schemas/utils/createIdentitySchemaCreator.ts +++ b/src/core/schemas/utils/createIdentitySchemaCreator.ts @@ -1,5 +1,5 @@ -import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; -import { getSchemaUtils } from "../builders/schema-utils"; +import { getSchemaUtils } from "../builders/schema-utils/index"; +import type { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; import { maybeSkipValidation } from "./maybeSkipValidation"; export function createIdentitySchemaCreator( diff --git a/src/core/schemas/utils/maybeSkipValidation.ts b/src/core/schemas/utils/maybeSkipValidation.ts index 950d5f9c5..70be6478b 100644 --- a/src/core/schemas/utils/maybeSkipValidation.ts +++ b/src/core/schemas/utils/maybeSkipValidation.ts @@ -1,4 +1,4 @@ -import { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; +import type { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; export function maybeSkipValidation, Raw, Parsed>(schema: S): S { return { @@ -15,7 +15,7 @@ function transformAndMaybeSkipValidation( const transformed = transform(value, opts); const { skipValidation = false } = opts ?? {}; if (!transformed.ok && skipValidation) { - // eslint-disable-next-line no-console + // biome-ignore lint/suspicious/noConsole: allow console console.warn( [ "Failed to validate.", diff --git a/src/core/url/join.ts b/src/core/url/join.ts index 1dda77923..b872a90a4 100644 --- a/src/core/url/join.ts +++ b/src/core/url/join.ts @@ -3,6 +3,10 @@ export function join(base: string, ...segments: string[]): string { return ""; } + if (segments.length === 0) { + return base; + } + if (base.includes("://")) { let url: URL; try { @@ -12,6 +16,9 @@ export function join(base: string, ...segments: string[]): string { return joinPath(base, ...segments); } + const lastSegment = segments[segments.length - 1]; + const shouldPreserveTrailingSlash = lastSegment?.endsWith("/"); + for (const segment of segments) { const cleanSegment = trimSlashes(segment); if (cleanSegment) { @@ -19,6 +26,10 @@ export function join(base: string, ...segments: string[]): string { } } + if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) { + url.pathname += "/"; + } + return url.toString(); } @@ -26,8 +37,15 @@ export function join(base: string, ...segments: string[]): string { } function joinPath(base: string, ...segments: string[]): string { + if (segments.length === 0) { + return base; + } + let result = base; + const lastSegment = segments[segments.length - 1]; + const shouldPreserveTrailingSlash = lastSegment?.endsWith("/"); + for (const segment of segments) { const cleanSegment = trimSlashes(segment); if (cleanSegment) { @@ -35,6 +53,10 @@ function joinPath(base: string, ...segments: string[]): string { } } + if (shouldPreserveTrailingSlash && !result.endsWith("/")) { + result += "/"; + } + return result; } @@ -42,14 +64,17 @@ function joinPathSegments(left: string, right: string): string { if (left.endsWith("/")) { return left + right; } - return left + "/" + right; + return `${left}/${right}`; } function trimSlashes(str: string): string { if (!str) return str; - let start = str.startsWith("/") ? 1 : 0; - let end = str.endsWith("/") ? str.length - 1 : str.length; + let start = 0; + let end = str.length; + + if (str.startsWith("/")) start = 1; + if (str.endsWith("/")) end = str.length - 1; - return str.slice(start, end); + return start === 0 && end === str.length ? str : str.slice(start, end); } diff --git a/src/environments.ts b/src/environments.ts index 3f579afbe..5b1f7f5bf 100644 --- a/src/environments.ts +++ b/src/environments.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export const SquareEnvironment = { Production: "https://connect.squareup.com", diff --git a/src/errors/SquareError.ts b/src/errors/SquareError.ts index e563a1e53..eb4c4d8aa 100644 --- a/src/errors/SquareError.ts +++ b/src/errors/SquareError.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ +import { type Error_, ErrorCategory as GeneratedErrorCategory, ErrorCode as GeneratedErrorCode } from "../api"; +import type * as core from "../core/index.js"; import { toJson } from "../core/json"; -import * as core from "../core"; -import { Error_, ErrorCategory as GeneratedErrorCategory, ErrorCode as GeneratedErrorCode } from "../api"; const fallbackError = { category: "V1_ERROR", @@ -22,16 +22,14 @@ export class SquareError extends Error { statusCode, body, rawResponse, - }: { - message?: string; - statusCode?: number; - body?: unknown; - rawResponse?: core.RawResponse; - }) { + }: { message?: string; statusCode?: number; body?: unknown; rawResponse?: core.RawResponse }) { super(buildMessage({ message, statusCode, body })); Object.setPrototypeOf(this, SquareError.prototype); - this.statusCode = statusCode; + if (statusCode != null) { + this.statusCode = statusCode; + } this.rawResponse = rawResponse; + this.body = body; if (body != null && typeof body === "object") { if ("errors" in body) { @@ -62,7 +60,7 @@ function buildMessage({ statusCode: number | undefined; body: unknown | undefined; }): string { - let lines: string[] = []; + const lines: string[] = []; if (message != null) { lines.push(message); } @@ -93,13 +91,13 @@ export namespace SquareError { } & Omit; export type ErrorCategory = GeneratedErrorCategory | "V1_ERROR"; - export const ErrorCategory = { + export const ErrorCategory: typeof GeneratedErrorCategory & { readonly V1Error: "V1_ERROR" } = { ...GeneratedErrorCategory, V1Error: "V1_ERROR", } as const; export type ErrorCode = GeneratedErrorCode | "Unknown" | string; - export const ErrorCode = { + export const ErrorCode: typeof GeneratedErrorCode & { readonly Unknown: "Unknown" } = { ...GeneratedErrorCode, Unknown: "Unknown", } as const; @@ -113,4 +111,4 @@ interface V1Error { type?: string; message: string; field: string; -} \ No newline at end of file +} diff --git a/src/errors/SquareTimeoutError.ts b/src/errors/SquareTimeoutError.ts index fb095ec5d..d56259097 100644 --- a/src/errors/SquareTimeoutError.ts +++ b/src/errors/SquareTimeoutError.ts @@ -1,6 +1,4 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. export class SquareTimeoutError extends Error { constructor(message: string) { diff --git a/src/exports.ts b/src/exports.ts new file mode 100644 index 000000000..3a8ebd66b --- /dev/null +++ b/src/exports.ts @@ -0,0 +1 @@ +export * from "./core/exports"; diff --git a/src/index.ts b/src/index.ts index 424130d0e..3a598ab85 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,8 @@ -export * as Square from "./api"; -export * as serialization from "./serialization"; -export { SquareClient } from "./Client"; -export { SquareEnvironment } from "./environments"; -export { SquareError, SquareTimeoutError } from "./errors"; +export * as Square from "./api/index.js"; +export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js"; +export { SquareClient } from "./Client.js"; +export { SquareEnvironment } from "./environments.js"; +export { SquareError, SquareTimeoutError } from "./errors/index.js"; +export * from "./exports.js"; +export * as serialization from "./serialization/index.js"; export { WebhooksHelper } from "./wrapper/WebhooksHelper"; diff --git a/src/serialization/index.ts b/src/serialization/index.ts index 3ce0a3e38..3e15e2907 100644 --- a/src/serialization/index.ts +++ b/src/serialization/index.ts @@ -1,2 +1,2 @@ -export * from "./types"; export * from "./resources"; +export * from "./types"; diff --git a/src/serialization/resources/applePay/client/requests/RegisterDomainRequest.ts b/src/serialization/resources/applePay/client/requests/RegisterDomainRequest.ts index 97287234c..bf48c589d 100644 --- a/src/serialization/resources/applePay/client/requests/RegisterDomainRequest.ts +++ b/src/serialization/resources/applePay/client/requests/RegisterDomainRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const RegisterDomainRequest: core.serialization.Schema< serializers.RegisterDomainRequest.Raw, diff --git a/src/serialization/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts b/src/serialization/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts index e6488498f..43ce95964 100644 --- a/src/serialization/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts +++ b/src/serialization/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const BulkRetrieveBookingsRequest: core.serialization.Schema< serializers.BulkRetrieveBookingsRequest.Raw, diff --git a/src/serialization/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts b/src/serialization/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts index 539faef24..230088a37 100644 --- a/src/serialization/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts +++ b/src/serialization/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const BulkRetrieveTeamMemberBookingProfilesRequest: core.serialization.Schema< serializers.BulkRetrieveTeamMemberBookingProfilesRequest.Raw, diff --git a/src/serialization/resources/bookings/client/requests/CancelBookingRequest.ts b/src/serialization/resources/bookings/client/requests/CancelBookingRequest.ts index f56a21f2b..454883046 100644 --- a/src/serialization/resources/bookings/client/requests/CancelBookingRequest.ts +++ b/src/serialization/resources/bookings/client/requests/CancelBookingRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const CancelBookingRequest: core.serialization.Schema< serializers.CancelBookingRequest.Raw, @@ -16,7 +14,7 @@ export const CancelBookingRequest: core.serialization.Schema< export declare namespace CancelBookingRequest { export interface Raw { - idempotency_key?: (string | null) | null; - booking_version?: (number | null) | null; + idempotency_key?: (string | null | undefined) | null; + booking_version?: (number | null | undefined) | null; } } diff --git a/src/serialization/resources/bookings/client/requests/CreateBookingRequest.ts b/src/serialization/resources/bookings/client/requests/CreateBookingRequest.ts index 922b63ca0..c0a288e64 100644 --- a/src/serialization/resources/bookings/client/requests/CreateBookingRequest.ts +++ b/src/serialization/resources/bookings/client/requests/CreateBookingRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Booking } from "../../../../types/Booking"; export const CreateBookingRequest: core.serialization.Schema< diff --git a/src/serialization/resources/bookings/client/requests/SearchAvailabilityRequest.ts b/src/serialization/resources/bookings/client/requests/SearchAvailabilityRequest.ts index 6b06472e8..479c44c35 100644 --- a/src/serialization/resources/bookings/client/requests/SearchAvailabilityRequest.ts +++ b/src/serialization/resources/bookings/client/requests/SearchAvailabilityRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { SearchAvailabilityQuery } from "../../../../types/SearchAvailabilityQuery"; export const SearchAvailabilityRequest: core.serialization.Schema< diff --git a/src/serialization/resources/bookings/client/requests/UpdateBookingRequest.ts b/src/serialization/resources/bookings/client/requests/UpdateBookingRequest.ts index 2aa348a18..11964d010 100644 --- a/src/serialization/resources/bookings/client/requests/UpdateBookingRequest.ts +++ b/src/serialization/resources/bookings/client/requests/UpdateBookingRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Booking } from "../../../../types/Booking"; export const UpdateBookingRequest: core.serialization.Schema< @@ -17,7 +15,7 @@ export const UpdateBookingRequest: core.serialization.Schema< export declare namespace UpdateBookingRequest { export interface Raw { - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; booking: Booking.Raw; } } diff --git a/src/serialization/resources/bookings/client/requests/index.ts b/src/serialization/resources/bookings/client/requests/index.ts index 1aaa5675b..dbfd4aed2 100644 --- a/src/serialization/resources/bookings/client/requests/index.ts +++ b/src/serialization/resources/bookings/client/requests/index.ts @@ -1,6 +1,6 @@ -export { CreateBookingRequest } from "./CreateBookingRequest"; -export { SearchAvailabilityRequest } from "./SearchAvailabilityRequest"; export { BulkRetrieveBookingsRequest } from "./BulkRetrieveBookingsRequest"; export { BulkRetrieveTeamMemberBookingProfilesRequest } from "./BulkRetrieveTeamMemberBookingProfilesRequest"; -export { UpdateBookingRequest } from "./UpdateBookingRequest"; export { CancelBookingRequest } from "./CancelBookingRequest"; +export { CreateBookingRequest } from "./CreateBookingRequest"; +export { SearchAvailabilityRequest } from "./SearchAvailabilityRequest"; +export { UpdateBookingRequest } from "./UpdateBookingRequest"; diff --git a/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts b/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts index a52133bc1..59ef9785d 100644 --- a/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const CreateBookingCustomAttributeDefinitionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts b/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts index 03dbdbd47..38ed10702 100644 --- a/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const UpdateBookingCustomAttributeDefinitionRequest: core.serialization.Schema< @@ -18,6 +16,6 @@ export const UpdateBookingCustomAttributeDefinitionRequest: core.serialization.S export declare namespace UpdateBookingCustomAttributeDefinitionRequest { export interface Raw { custom_attribute_definition: CustomAttributeDefinition.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts b/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts index 5e7d7c93b..be26c49a4 100644 --- a/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts +++ b/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BookingCustomAttributeDeleteRequest } from "../../../../../../types/BookingCustomAttributeDeleteRequest"; export const BulkDeleteBookingCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts b/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts index 0c2323579..d10f55ec0 100644 --- a/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts +++ b/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BookingCustomAttributeUpsertRequest } from "../../../../../../types/BookingCustomAttributeUpsertRequest"; export const BulkUpsertBookingCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts b/src/serialization/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts index 178e21f1e..ba6ad659f 100644 --- a/src/serialization/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts +++ b/src/serialization/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttribute } from "../../../../../../types/CustomAttribute"; export const UpsertBookingCustomAttributeRequest: core.serialization.Schema< @@ -18,6 +16,6 @@ export const UpsertBookingCustomAttributeRequest: core.serialization.Schema< export declare namespace UpsertBookingCustomAttributeRequest { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/cards/client/requests/CreateCardRequest.ts b/src/serialization/resources/cards/client/requests/CreateCardRequest.ts index 73ff67ad7..9a05da154 100644 --- a/src/serialization/resources/cards/client/requests/CreateCardRequest.ts +++ b/src/serialization/resources/cards/client/requests/CreateCardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Card } from "../../../../types/Card"; export const CreateCardRequest: core.serialization.Schema = diff --git a/src/serialization/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts b/src/serialization/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts index 4f103bc79..835d76b91 100644 --- a/src/serialization/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const BatchDeleteCatalogObjectsRequest: core.serialization.Schema< serializers.BatchDeleteCatalogObjectsRequest.Raw, diff --git a/src/serialization/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts b/src/serialization/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts index f926078f4..f8042b3a3 100644 --- a/src/serialization/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const BatchGetCatalogObjectsRequest: core.serialization.Schema< serializers.BatchGetCatalogObjectsRequest.Raw, @@ -29,9 +27,9 @@ export const BatchGetCatalogObjectsRequest: core.serialization.Schema< export declare namespace BatchGetCatalogObjectsRequest { export interface Raw { object_ids: string[]; - include_related_objects?: (boolean | null) | null; - catalog_version?: ((bigint | number) | null) | null; - include_deleted_objects?: (boolean | null) | null; - include_category_path_to_root?: (boolean | null) | null; + include_related_objects?: (boolean | null | undefined) | null; + catalog_version?: ((bigint | number) | null | undefined) | null; + include_deleted_objects?: (boolean | null | undefined) | null; + include_category_path_to_root?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts b/src/serialization/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts index 406212100..b0f749826 100644 --- a/src/serialization/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { CatalogObjectBatch } from "../../../../types/CatalogObjectBatch"; export const BatchUpsertCatalogObjectsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/catalog/client/requests/SearchCatalogItemsRequest.ts b/src/serialization/resources/catalog/client/requests/SearchCatalogItemsRequest.ts index cee9e8946..8f317af1a 100644 --- a/src/serialization/resources/catalog/client/requests/SearchCatalogItemsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/SearchCatalogItemsRequest.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import { SearchCatalogItemsRequestStockLevel } from "../../../../types/SearchCatalogItemsRequestStockLevel"; -import { SortOrder } from "../../../../types/SortOrder"; +import type * as serializers from "../../../../index"; +import { ArchivedState } from "../../../../types/ArchivedState"; import { CatalogItemProductType } from "../../../../types/CatalogItemProductType"; import { CustomAttributeFilter } from "../../../../types/CustomAttributeFilter"; -import { ArchivedState } from "../../../../types/ArchivedState"; +import { SearchCatalogItemsRequestStockLevel } from "../../../../types/SearchCatalogItemsRequestStockLevel"; +import { SortOrder } from "../../../../types/SortOrder"; export const SearchCatalogItemsRequest: core.serialization.Schema< serializers.SearchCatalogItemsRequest.Raw, diff --git a/src/serialization/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts b/src/serialization/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts index 12c4e5e08..aec46cc92 100644 --- a/src/serialization/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { CatalogObjectType } from "../../../../types/CatalogObjectType"; import { CatalogQuery } from "../../../../types/CatalogQuery"; diff --git a/src/serialization/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts b/src/serialization/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts index 21947e2ce..45c3c6103 100644 --- a/src/serialization/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const UpdateItemModifierListsRequest: core.serialization.Schema< serializers.UpdateItemModifierListsRequest.Raw, @@ -24,7 +22,7 @@ export const UpdateItemModifierListsRequest: core.serialization.Schema< export declare namespace UpdateItemModifierListsRequest { export interface Raw { item_ids: string[]; - modifier_lists_to_enable?: (string[] | null) | null; - modifier_lists_to_disable?: (string[] | null) | null; + modifier_lists_to_enable?: (string[] | null | undefined) | null; + modifier_lists_to_disable?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/resources/catalog/client/requests/UpdateItemTaxesRequest.ts b/src/serialization/resources/catalog/client/requests/UpdateItemTaxesRequest.ts index c73ede6bf..1df9dc5b2 100644 --- a/src/serialization/resources/catalog/client/requests/UpdateItemTaxesRequest.ts +++ b/src/serialization/resources/catalog/client/requests/UpdateItemTaxesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const UpdateItemTaxesRequest: core.serialization.Schema< serializers.UpdateItemTaxesRequest.Raw, @@ -24,7 +22,7 @@ export const UpdateItemTaxesRequest: core.serialization.Schema< export declare namespace UpdateItemTaxesRequest { export interface Raw { item_ids: string[]; - taxes_to_enable?: (string[] | null) | null; - taxes_to_disable?: (string[] | null) | null; + taxes_to_enable?: (string[] | null | undefined) | null; + taxes_to_disable?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/resources/catalog/client/requests/index.ts b/src/serialization/resources/catalog/client/requests/index.ts index b6dd6da9f..1d253ff9d 100644 --- a/src/serialization/resources/catalog/client/requests/index.ts +++ b/src/serialization/resources/catalog/client/requests/index.ts @@ -1,7 +1,7 @@ export { BatchDeleteCatalogObjectsRequest } from "./BatchDeleteCatalogObjectsRequest"; export { BatchGetCatalogObjectsRequest } from "./BatchGetCatalogObjectsRequest"; export { BatchUpsertCatalogObjectsRequest } from "./BatchUpsertCatalogObjectsRequest"; -export { SearchCatalogObjectsRequest } from "./SearchCatalogObjectsRequest"; export { SearchCatalogItemsRequest } from "./SearchCatalogItemsRequest"; +export { SearchCatalogObjectsRequest } from "./SearchCatalogObjectsRequest"; export { UpdateItemModifierListsRequest } from "./UpdateItemModifierListsRequest"; export { UpdateItemTaxesRequest } from "./UpdateItemTaxesRequest"; diff --git a/src/serialization/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts b/src/serialization/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts index 23e780a0c..a099e90bc 100644 --- a/src/serialization/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts +++ b/src/serialization/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import * as serializers from "../../../../../../index"; export const UpsertCatalogObjectRequest: core.serialization.Schema< serializers.catalog.UpsertCatalogObjectRequest.Raw, diff --git a/src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts b/src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts index 1d6074e88..3510ad653 100644 --- a/src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts +++ b/src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const BulkRetrieveChannelsRequest: core.serialization.Schema< serializers.BulkRetrieveChannelsRequest.Raw, diff --git a/src/serialization/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts b/src/serialization/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts index f6714b1b2..c95ec97cb 100644 --- a/src/serialization/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts +++ b/src/serialization/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { CheckoutLocationSettings } from "../../../../types/CheckoutLocationSettings"; export const UpdateLocationSettingsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts b/src/serialization/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts index 669eefeb1..bbedcbfda 100644 --- a/src/serialization/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts +++ b/src/serialization/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { CheckoutMerchantSettings } from "../../../../types/CheckoutMerchantSettings"; export const UpdateMerchantSettingsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts b/src/serialization/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts index be573a9cd..8bbb67333 100644 --- a/src/serialization/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts +++ b/src/serialization/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import { QuickPay } from "../../../../../../types/QuickPay"; -import { Order } from "../../../../../../types/Order"; +import type * as serializers from "../../../../../../index"; import { CheckoutOptions } from "../../../../../../types/CheckoutOptions"; +import { Order } from "../../../../../../types/Order"; import { PrePopulatedData } from "../../../../../../types/PrePopulatedData"; +import { QuickPay } from "../../../../../../types/QuickPay"; export const CreatePaymentLinkRequest: core.serialization.Schema< serializers.checkout.CreatePaymentLinkRequest.Raw, diff --git a/src/serialization/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts b/src/serialization/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts index 6e19fa86d..dae5b0687 100644 --- a/src/serialization/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts +++ b/src/serialization/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { PaymentLink } from "../../../../../../types/PaymentLink"; export const UpdatePaymentLinkRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/client/requests/BulkCreateCustomersRequest.ts b/src/serialization/resources/customers/client/requests/BulkCreateCustomersRequest.ts index d42b1ff21..a519ab423 100644 --- a/src/serialization/resources/customers/client/requests/BulkCreateCustomersRequest.ts +++ b/src/serialization/resources/customers/client/requests/BulkCreateCustomersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { BulkCreateCustomerData } from "../../../../types/BulkCreateCustomerData"; export const BulkCreateCustomersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/client/requests/BulkDeleteCustomersRequest.ts b/src/serialization/resources/customers/client/requests/BulkDeleteCustomersRequest.ts index 8894849f1..db04e30a1 100644 --- a/src/serialization/resources/customers/client/requests/BulkDeleteCustomersRequest.ts +++ b/src/serialization/resources/customers/client/requests/BulkDeleteCustomersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const BulkDeleteCustomersRequest: core.serialization.Schema< serializers.BulkDeleteCustomersRequest.Raw, diff --git a/src/serialization/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts b/src/serialization/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts index d37cd7f6d..266d79a42 100644 --- a/src/serialization/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts +++ b/src/serialization/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const BulkRetrieveCustomersRequest: core.serialization.Schema< serializers.BulkRetrieveCustomersRequest.Raw, diff --git a/src/serialization/resources/customers/client/requests/BulkUpdateCustomersRequest.ts b/src/serialization/resources/customers/client/requests/BulkUpdateCustomersRequest.ts index 510ce5a1b..0877084f7 100644 --- a/src/serialization/resources/customers/client/requests/BulkUpdateCustomersRequest.ts +++ b/src/serialization/resources/customers/client/requests/BulkUpdateCustomersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { BulkUpdateCustomerData } from "../../../../types/BulkUpdateCustomerData"; export const BulkUpdateCustomersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/client/requests/CreateCustomerRequest.ts b/src/serialization/resources/customers/client/requests/CreateCustomerRequest.ts index 95935b7f1..9542d7b51 100644 --- a/src/serialization/resources/customers/client/requests/CreateCustomerRequest.ts +++ b/src/serialization/resources/customers/client/requests/CreateCustomerRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Address } from "../../../../types/Address"; import { CustomerTaxIds } from "../../../../types/CustomerTaxIds"; diff --git a/src/serialization/resources/customers/client/requests/SearchCustomersRequest.ts b/src/serialization/resources/customers/client/requests/SearchCustomersRequest.ts index 349ab95d6..b823cc0e8 100644 --- a/src/serialization/resources/customers/client/requests/SearchCustomersRequest.ts +++ b/src/serialization/resources/customers/client/requests/SearchCustomersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { CustomerQuery } from "../../../../types/CustomerQuery"; export const SearchCustomersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/client/requests/UpdateCustomerRequest.ts b/src/serialization/resources/customers/client/requests/UpdateCustomerRequest.ts index bbf9cb37f..b9fb2b856 100644 --- a/src/serialization/resources/customers/client/requests/UpdateCustomerRequest.ts +++ b/src/serialization/resources/customers/client/requests/UpdateCustomerRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Address } from "../../../../types/Address"; import { CustomerTaxIds } from "../../../../types/CustomerTaxIds"; @@ -28,16 +26,16 @@ export const UpdateCustomerRequest: core.serialization.Schema< export declare namespace UpdateCustomerRequest { export interface Raw { - given_name?: (string | null) | null; - family_name?: (string | null) | null; - company_name?: (string | null) | null; - nickname?: (string | null) | null; - email_address?: (string | null) | null; + given_name?: (string | null | undefined) | null; + family_name?: (string | null | undefined) | null; + company_name?: (string | null | undefined) | null; + nickname?: (string | null | undefined) | null; + email_address?: (string | null | undefined) | null; address?: Address.Raw | null; - phone_number?: (string | null) | null; - reference_id?: (string | null) | null; - note?: (string | null) | null; - birthday?: (string | null) | null; + phone_number?: (string | null | undefined) | null; + reference_id?: (string | null | undefined) | null; + note?: (string | null | undefined) | null; + birthday?: (string | null | undefined) | null; version?: (bigint | number) | null; tax_ids?: CustomerTaxIds.Raw | null; } diff --git a/src/serialization/resources/customers/client/requests/index.ts b/src/serialization/resources/customers/client/requests/index.ts index 636aa1ff9..9e37d39ff 100644 --- a/src/serialization/resources/customers/client/requests/index.ts +++ b/src/serialization/resources/customers/client/requests/index.ts @@ -1,7 +1,7 @@ -export { CreateCustomerRequest } from "./CreateCustomerRequest"; export { BulkCreateCustomersRequest } from "./BulkCreateCustomersRequest"; export { BulkDeleteCustomersRequest } from "./BulkDeleteCustomersRequest"; export { BulkRetrieveCustomersRequest } from "./BulkRetrieveCustomersRequest"; export { BulkUpdateCustomersRequest } from "./BulkUpdateCustomersRequest"; +export { CreateCustomerRequest } from "./CreateCustomerRequest"; export { SearchCustomersRequest } from "./SearchCustomersRequest"; export { UpdateCustomerRequest } from "./UpdateCustomerRequest"; diff --git a/src/serialization/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts b/src/serialization/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts index 0ea65fbb0..1357f7fd3 100644 --- a/src/serialization/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts +++ b/src/serialization/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { Address } from "../../../../../../types/Address"; export const CreateCustomerCardRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts index 23170882a..deb61dbe4 100644 --- a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts +++ b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest } from "../../../../../../types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest"; export const BatchUpsertCustomerCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts index 43afb4dfe..7636c102b 100644 --- a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const CreateCustomerCustomAttributeDefinitionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts index f68b95d9b..5be6af2e8 100644 --- a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const UpdateCustomerCustomAttributeDefinitionRequest: core.serialization.Schema< @@ -18,6 +16,6 @@ export const UpdateCustomerCustomAttributeDefinitionRequest: core.serialization. export declare namespace UpdateCustomerCustomAttributeDefinitionRequest { export interface Raw { custom_attribute_definition: CustomAttributeDefinition.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts index 3e6e7c1f4..15bd6da63 100644 --- a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,3 +1,3 @@ +export { BatchUpsertCustomerCustomAttributesRequest } from "./BatchUpsertCustomerCustomAttributesRequest"; export { CreateCustomerCustomAttributeDefinitionRequest } from "./CreateCustomerCustomAttributeDefinitionRequest"; export { UpdateCustomerCustomAttributeDefinitionRequest } from "./UpdateCustomerCustomAttributeDefinitionRequest"; -export { BatchUpsertCustomerCustomAttributesRequest } from "./BatchUpsertCustomerCustomAttributesRequest"; diff --git a/src/serialization/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts b/src/serialization/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts index b7fb5cecf..c172e2ff0 100644 --- a/src/serialization/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts +++ b/src/serialization/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttribute } from "../../../../../../types/CustomAttribute"; export const UpsertCustomerCustomAttributeRequest: core.serialization.Schema< @@ -18,6 +16,6 @@ export const UpsertCustomerCustomAttributeRequest: core.serialization.Schema< export declare namespace UpsertCustomerCustomAttributeRequest { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts b/src/serialization/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts index 489367bda..3d7c82268 100644 --- a/src/serialization/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts +++ b/src/serialization/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomerGroup } from "../../../../../../types/CustomerGroup"; export const CreateCustomerGroupRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts b/src/serialization/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts index 763aaf1cc..7f72f61e7 100644 --- a/src/serialization/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts +++ b/src/serialization/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomerGroup } from "../../../../../../types/CustomerGroup"; export const UpdateCustomerGroupRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/resources/index.ts b/src/serialization/resources/customers/resources/index.ts index 033a7b15f..7f3f151e2 100644 --- a/src/serialization/resources/customers/resources/index.ts +++ b/src/serialization/resources/customers/resources/index.ts @@ -1,8 +1,8 @@ -export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * from "./customAttributeDefinitions/client/requests"; -export * as groups from "./groups"; -export * from "./groups/client/requests"; export * as cards from "./cards"; export * from "./cards/client/requests"; +export * as customAttributeDefinitions from "./customAttributeDefinitions"; +export * from "./customAttributeDefinitions/client/requests"; export * as customAttributes from "./customAttributes"; export * from "./customAttributes/client/requests"; +export * as groups from "./groups"; +export * from "./groups/client/requests"; diff --git a/src/serialization/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts b/src/serialization/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts index de9feaac0..51a11e789 100644 --- a/src/serialization/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts +++ b/src/serialization/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { DeviceCode } from "../../../../../../types/DeviceCode"; export const CreateDeviceCodeRequest: core.serialization.Schema< diff --git a/src/serialization/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts b/src/serialization/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts index bcb89e5ab..264ffb28d 100644 --- a/src/serialization/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts +++ b/src/serialization/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { DisputeEvidenceType } from "../../../../types/DisputeEvidenceType"; export const CreateDisputeEvidenceTextRequest: core.serialization.Schema< diff --git a/src/serialization/resources/events/client/requests/SearchEventsRequest.ts b/src/serialization/resources/events/client/requests/SearchEventsRequest.ts index 9b03e2afd..d36eeb93b 100644 --- a/src/serialization/resources/events/client/requests/SearchEventsRequest.ts +++ b/src/serialization/resources/events/client/requests/SearchEventsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { SearchEventsQuery } from "../../../../types/SearchEventsQuery"; export const SearchEventsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/giftCards/client/requests/CreateGiftCardRequest.ts b/src/serialization/resources/giftCards/client/requests/CreateGiftCardRequest.ts index dfbbc7aa6..490f53dd9 100644 --- a/src/serialization/resources/giftCards/client/requests/CreateGiftCardRequest.ts +++ b/src/serialization/resources/giftCards/client/requests/CreateGiftCardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { GiftCard } from "../../../../types/GiftCard"; export const CreateGiftCardRequest: core.serialization.Schema< diff --git a/src/serialization/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts b/src/serialization/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts index 809c07825..1aefc9114 100644 --- a/src/serialization/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts +++ b/src/serialization/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const GetGiftCardFromGanRequest: core.serialization.Schema< serializers.GetGiftCardFromGanRequest.Raw, diff --git a/src/serialization/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts b/src/serialization/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts index 7bb8cfb6b..a0089a1d4 100644 --- a/src/serialization/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts +++ b/src/serialization/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const GetGiftCardFromNonceRequest: core.serialization.Schema< serializers.GetGiftCardFromNonceRequest.Raw, diff --git a/src/serialization/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts b/src/serialization/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts index e04b837c1..cc392782e 100644 --- a/src/serialization/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts +++ b/src/serialization/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const LinkCustomerToGiftCardRequest: core.serialization.Schema< serializers.LinkCustomerToGiftCardRequest.Raw, diff --git a/src/serialization/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts b/src/serialization/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts index bd9fba99e..41aabd583 100644 --- a/src/serialization/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts +++ b/src/serialization/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const UnlinkCustomerFromGiftCardRequest: core.serialization.Schema< serializers.UnlinkCustomerFromGiftCardRequest.Raw, diff --git a/src/serialization/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts b/src/serialization/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts index 9b8efe404..80781bc21 100644 --- a/src/serialization/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts +++ b/src/serialization/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { GiftCardActivity } from "../../../../../../types/GiftCardActivity"; export const CreateGiftCardActivityRequest: core.serialization.Schema< diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index 51fc24220..a8631a021 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,9 +1,3 @@ -export * as v1Transactions from "./v1Transactions"; -export * as mobile from "./mobile"; -export * from "./mobile/client/requests"; -export * as oAuth from "./oAuth"; -export * from "./oAuth/client/requests"; -export * from "./v1Transactions/client/requests"; export * as applePay from "./applePay"; export * from "./applePay/client/requests"; export * as bookings from "./bookings"; @@ -14,8 +8,11 @@ export * as catalog from "./catalog"; export * from "./catalog/client/requests"; export * as channels from "./channels"; export * from "./channels/client/requests"; +export * as checkout from "./checkout"; +export * from "./checkout/client/requests"; export * as customers from "./customers"; export * from "./customers/client/requests"; +export * as devices from "./devices"; export * as disputes from "./disputes"; export * from "./disputes/client/requests"; export * as events from "./events"; @@ -30,8 +27,11 @@ export * as locations from "./locations"; export * from "./locations/client/requests"; export * as loyalty from "./loyalty"; export * from "./loyalty/client/requests"; -export * as checkout from "./checkout"; -export * from "./checkout/client/requests"; +export * as merchants from "./merchants"; +export * as mobile from "./mobile"; +export * from "./mobile/client/requests"; +export * as oAuth from "./oAuth"; +export * from "./oAuth/client/requests"; export * as orders from "./orders"; export * from "./orders/client/requests"; export * as payments from "./payments"; @@ -42,15 +42,15 @@ export * as snippets from "./snippets"; export * from "./snippets/client/requests"; export * as subscriptions from "./subscriptions"; export * from "./subscriptions/client/requests"; -export * as teamMembers from "./teamMembers"; -export * from "./teamMembers/client/requests"; export * as team from "./team"; export * from "./team/client/requests"; +export * as teamMembers from "./teamMembers"; +export * from "./teamMembers/client/requests"; +export * as terminal from "./terminal"; export * as transferOrders from "./transferOrders"; export * from "./transferOrders/client/requests"; +export * as v1Transactions from "./v1Transactions"; +export * from "./v1Transactions/client/requests"; export * as vendors from "./vendors"; export * from "./vendors/client/requests"; -export * as devices from "./devices"; -export * as merchants from "./merchants"; -export * as terminal from "./terminal"; export * as webhooks from "./webhooks"; diff --git a/src/serialization/resources/invoices/client/requests/CancelInvoiceRequest.ts b/src/serialization/resources/invoices/client/requests/CancelInvoiceRequest.ts index 6500b6ab0..80a79e5cd 100644 --- a/src/serialization/resources/invoices/client/requests/CancelInvoiceRequest.ts +++ b/src/serialization/resources/invoices/client/requests/CancelInvoiceRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const CancelInvoiceRequest: core.serialization.Schema< serializers.CancelInvoiceRequest.Raw, diff --git a/src/serialization/resources/invoices/client/requests/CreateInvoiceRequest.ts b/src/serialization/resources/invoices/client/requests/CreateInvoiceRequest.ts index 42bcf7e22..fd8f278b0 100644 --- a/src/serialization/resources/invoices/client/requests/CreateInvoiceRequest.ts +++ b/src/serialization/resources/invoices/client/requests/CreateInvoiceRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Invoice } from "../../../../types/Invoice"; export const CreateInvoiceRequest: core.serialization.Schema< diff --git a/src/serialization/resources/invoices/client/requests/PublishInvoiceRequest.ts b/src/serialization/resources/invoices/client/requests/PublishInvoiceRequest.ts index 28315e6e4..fe2b726f6 100644 --- a/src/serialization/resources/invoices/client/requests/PublishInvoiceRequest.ts +++ b/src/serialization/resources/invoices/client/requests/PublishInvoiceRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const PublishInvoiceRequest: core.serialization.Schema< serializers.PublishInvoiceRequest.Raw, @@ -17,6 +15,6 @@ export const PublishInvoiceRequest: core.serialization.Schema< export declare namespace PublishInvoiceRequest { export interface Raw { version: number; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/invoices/client/requests/SearchInvoicesRequest.ts b/src/serialization/resources/invoices/client/requests/SearchInvoicesRequest.ts index e4dee2e6b..4409b09d0 100644 --- a/src/serialization/resources/invoices/client/requests/SearchInvoicesRequest.ts +++ b/src/serialization/resources/invoices/client/requests/SearchInvoicesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { InvoiceQuery } from "../../../../types/InvoiceQuery"; export const SearchInvoicesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/invoices/client/requests/UpdateInvoiceRequest.ts b/src/serialization/resources/invoices/client/requests/UpdateInvoiceRequest.ts index 750087321..463ee7cc3 100644 --- a/src/serialization/resources/invoices/client/requests/UpdateInvoiceRequest.ts +++ b/src/serialization/resources/invoices/client/requests/UpdateInvoiceRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Invoice } from "../../../../types/Invoice"; export const UpdateInvoiceRequest: core.serialization.Schema< @@ -22,7 +20,7 @@ export const UpdateInvoiceRequest: core.serialization.Schema< export declare namespace UpdateInvoiceRequest { export interface Raw { invoice: Invoice.Raw; - idempotency_key?: (string | null) | null; - fields_to_clear?: (string[] | null) | null; + idempotency_key?: (string | null | undefined) | null; + fields_to_clear?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/resources/invoices/client/requests/index.ts b/src/serialization/resources/invoices/client/requests/index.ts index ecb9f5b77..0fda37ffa 100644 --- a/src/serialization/resources/invoices/client/requests/index.ts +++ b/src/serialization/resources/invoices/client/requests/index.ts @@ -1,5 +1,5 @@ +export { CancelInvoiceRequest } from "./CancelInvoiceRequest"; export { CreateInvoiceRequest } from "./CreateInvoiceRequest"; +export { PublishInvoiceRequest } from "./PublishInvoiceRequest"; export { SearchInvoicesRequest } from "./SearchInvoicesRequest"; export { UpdateInvoiceRequest } from "./UpdateInvoiceRequest"; -export { CancelInvoiceRequest } from "./CancelInvoiceRequest"; -export { PublishInvoiceRequest } from "./PublishInvoiceRequest"; diff --git a/src/serialization/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts b/src/serialization/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts index 2236c24ee..170c4f527 100644 --- a/src/serialization/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts +++ b/src/serialization/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { BulkPublishScheduledShiftsData } from "../../../../types/BulkPublishScheduledShiftsData"; import { ScheduledShiftNotificationAudience } from "../../../../types/ScheduledShiftNotificationAudience"; diff --git a/src/serialization/resources/labor/client/requests/CreateScheduledShiftRequest.ts b/src/serialization/resources/labor/client/requests/CreateScheduledShiftRequest.ts index ad6f00fd1..f65d04fce 100644 --- a/src/serialization/resources/labor/client/requests/CreateScheduledShiftRequest.ts +++ b/src/serialization/resources/labor/client/requests/CreateScheduledShiftRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { ScheduledShift } from "../../../../types/ScheduledShift"; export const CreateScheduledShiftRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/CreateTimecardRequest.ts b/src/serialization/resources/labor/client/requests/CreateTimecardRequest.ts index 847411fd1..fe17721f7 100644 --- a/src/serialization/resources/labor/client/requests/CreateTimecardRequest.ts +++ b/src/serialization/resources/labor/client/requests/CreateTimecardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Timecard } from "../../../../types/Timecard"; export const CreateTimecardRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/PublishScheduledShiftRequest.ts b/src/serialization/resources/labor/client/requests/PublishScheduledShiftRequest.ts index e2582095f..c24c8ed3b 100644 --- a/src/serialization/resources/labor/client/requests/PublishScheduledShiftRequest.ts +++ b/src/serialization/resources/labor/client/requests/PublishScheduledShiftRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { ScheduledShiftNotificationAudience } from "../../../../types/ScheduledShiftNotificationAudience"; export const PublishScheduledShiftRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/SearchScheduledShiftsRequest.ts b/src/serialization/resources/labor/client/requests/SearchScheduledShiftsRequest.ts index dc15134fc..a4d91d106 100644 --- a/src/serialization/resources/labor/client/requests/SearchScheduledShiftsRequest.ts +++ b/src/serialization/resources/labor/client/requests/SearchScheduledShiftsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { ScheduledShiftQuery } from "../../../../types/ScheduledShiftQuery"; export const SearchScheduledShiftsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/SearchTimecardsRequest.ts b/src/serialization/resources/labor/client/requests/SearchTimecardsRequest.ts index afdc5165d..b28a24ebc 100644 --- a/src/serialization/resources/labor/client/requests/SearchTimecardsRequest.ts +++ b/src/serialization/resources/labor/client/requests/SearchTimecardsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { TimecardQuery } from "../../../../types/TimecardQuery"; export const SearchTimecardsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/UpdateScheduledShiftRequest.ts b/src/serialization/resources/labor/client/requests/UpdateScheduledShiftRequest.ts index 7805fc348..e9302bde9 100644 --- a/src/serialization/resources/labor/client/requests/UpdateScheduledShiftRequest.ts +++ b/src/serialization/resources/labor/client/requests/UpdateScheduledShiftRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { ScheduledShift } from "../../../../types/ScheduledShift"; export const UpdateScheduledShiftRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/UpdateTimecardRequest.ts b/src/serialization/resources/labor/client/requests/UpdateTimecardRequest.ts index c7adb43f5..235ad36bb 100644 --- a/src/serialization/resources/labor/client/requests/UpdateTimecardRequest.ts +++ b/src/serialization/resources/labor/client/requests/UpdateTimecardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Timecard } from "../../../../types/Timecard"; export const UpdateTimecardRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/index.ts b/src/serialization/resources/labor/client/requests/index.ts index 86f313e34..c571c9f12 100644 --- a/src/serialization/resources/labor/client/requests/index.ts +++ b/src/serialization/resources/labor/client/requests/index.ts @@ -1,8 +1,8 @@ -export { CreateScheduledShiftRequest } from "./CreateScheduledShiftRequest"; export { BulkPublishScheduledShiftsRequest } from "./BulkPublishScheduledShiftsRequest"; -export { SearchScheduledShiftsRequest } from "./SearchScheduledShiftsRequest"; -export { UpdateScheduledShiftRequest } from "./UpdateScheduledShiftRequest"; -export { PublishScheduledShiftRequest } from "./PublishScheduledShiftRequest"; +export { CreateScheduledShiftRequest } from "./CreateScheduledShiftRequest"; export { CreateTimecardRequest } from "./CreateTimecardRequest"; +export { PublishScheduledShiftRequest } from "./PublishScheduledShiftRequest"; +export { SearchScheduledShiftsRequest } from "./SearchScheduledShiftsRequest"; export { SearchTimecardsRequest } from "./SearchTimecardsRequest"; +export { UpdateScheduledShiftRequest } from "./UpdateScheduledShiftRequest"; export { UpdateTimecardRequest } from "./UpdateTimecardRequest"; diff --git a/src/serialization/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts b/src/serialization/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts index 61d162374..55525449e 100644 --- a/src/serialization/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts +++ b/src/serialization/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BreakType } from "../../../../../../types/BreakType"; export const CreateBreakTypeRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts b/src/serialization/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts index 4fbe34a90..d9611fbfb 100644 --- a/src/serialization/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts +++ b/src/serialization/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BreakType } from "../../../../../../types/BreakType"; export const UpdateBreakTypeRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts b/src/serialization/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts index 60eda2e1c..f854da107 100644 --- a/src/serialization/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts +++ b/src/serialization/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { Shift } from "../../../../../../types/Shift"; export const CreateShiftRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts b/src/serialization/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts index 867f740ed..952a237c6 100644 --- a/src/serialization/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts +++ b/src/serialization/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { ShiftQuery } from "../../../../../../types/ShiftQuery"; export const SearchShiftsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts b/src/serialization/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts index 42026820b..dd9c7d93b 100644 --- a/src/serialization/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts +++ b/src/serialization/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { Shift } from "../../../../../../types/Shift"; export const UpdateShiftRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts b/src/serialization/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts index 605b45209..8e8f01510 100644 --- a/src/serialization/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts +++ b/src/serialization/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { WorkweekConfig } from "../../../../../../types/WorkweekConfig"; export const UpdateWorkweekConfigRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/client/requests/CreateCheckoutRequest.ts b/src/serialization/resources/locations/client/requests/CreateCheckoutRequest.ts index b72bce12d..d3bf045cf 100644 --- a/src/serialization/resources/locations/client/requests/CreateCheckoutRequest.ts +++ b/src/serialization/resources/locations/client/requests/CreateCheckoutRequest.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import { CreateOrderRequest } from "../../../../types/CreateOrderRequest"; +import type * as serializers from "../../../../index"; import { Address } from "../../../../types/Address"; import { ChargeRequestAdditionalRecipient } from "../../../../types/ChargeRequestAdditionalRecipient"; +import { CreateOrderRequest } from "../../../../types/CreateOrderRequest"; export const CreateCheckoutRequest: core.serialization.Schema< serializers.CreateCheckoutRequest.Raw, diff --git a/src/serialization/resources/locations/client/requests/CreateLocationRequest.ts b/src/serialization/resources/locations/client/requests/CreateLocationRequest.ts index 8f2206ff5..d6589a1fa 100644 --- a/src/serialization/resources/locations/client/requests/CreateLocationRequest.ts +++ b/src/serialization/resources/locations/client/requests/CreateLocationRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Location } from "../../../../types/Location"; export const CreateLocationRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/client/requests/UpdateLocationRequest.ts b/src/serialization/resources/locations/client/requests/UpdateLocationRequest.ts index 994c21745..4c9eb86c6 100644 --- a/src/serialization/resources/locations/client/requests/UpdateLocationRequest.ts +++ b/src/serialization/resources/locations/client/requests/UpdateLocationRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Location } from "../../../../types/Location"; export const UpdateLocationRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/client/requests/index.ts b/src/serialization/resources/locations/client/requests/index.ts index 7527b14b5..957353b7a 100644 --- a/src/serialization/resources/locations/client/requests/index.ts +++ b/src/serialization/resources/locations/client/requests/index.ts @@ -1,3 +1,3 @@ +export { CreateCheckoutRequest } from "./CreateCheckoutRequest"; export { CreateLocationRequest } from "./CreateLocationRequest"; export { UpdateLocationRequest } from "./UpdateLocationRequest"; -export { CreateCheckoutRequest } from "./CreateCheckoutRequest"; diff --git a/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts b/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts index 00faaf3fb..99e91ad47 100644 --- a/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const CreateLocationCustomAttributeDefinitionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts b/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts index 8b6169e08..659714523 100644 --- a/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const UpdateLocationCustomAttributeDefinitionRequest: core.serialization.Schema< @@ -18,6 +16,6 @@ export const UpdateLocationCustomAttributeDefinitionRequest: core.serialization. export declare namespace UpdateLocationCustomAttributeDefinitionRequest { export interface Raw { custom_attribute_definition: CustomAttributeDefinition.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts b/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts index bf41571ed..3d25b5465 100644 --- a/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts +++ b/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest } from "../../../../../../types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest"; export const BulkDeleteLocationCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts b/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts index 57f14749a..f05929fb9 100644 --- a/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts +++ b/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest } from "../../../../../../types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest"; export const BulkUpsertLocationCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts b/src/serialization/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts index c20535527..970f7f15b 100644 --- a/src/serialization/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts +++ b/src/serialization/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttribute } from "../../../../../../types/CustomAttribute"; export const UpsertLocationCustomAttributeRequest: core.serialization.Schema< @@ -18,6 +16,6 @@ export const UpsertLocationCustomAttributeRequest: core.serialization.Schema< export declare namespace UpsertLocationCustomAttributeRequest { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts b/src/serialization/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts index 4a9cb5831..854f3df9a 100644 --- a/src/serialization/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts +++ b/src/serialization/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { LoyaltyEventQuery } from "../../../../types/LoyaltyEventQuery"; export const SearchLoyaltyEventsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts b/src/serialization/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts index 82798bad6..9216efa49 100644 --- a/src/serialization/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts +++ b/src/serialization/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { LoyaltyEventAccumulatePoints } from "../../../../../../types/LoyaltyEventAccumulatePoints"; export const AccumulateLoyaltyPointsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts b/src/serialization/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts index dd917764d..161fdb830 100644 --- a/src/serialization/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts +++ b/src/serialization/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { LoyaltyEventAdjustPoints } from "../../../../../../types/LoyaltyEventAdjustPoints"; export const AdjustLoyaltyPointsRequest: core.serialization.Schema< @@ -23,6 +21,6 @@ export declare namespace AdjustLoyaltyPointsRequest { export interface Raw { idempotency_key: string; adjust_points: LoyaltyEventAdjustPoints.Raw; - allow_negative_balance?: (boolean | null) | null; + allow_negative_balance?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts b/src/serialization/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts index ed4e98e0a..d0e596dc9 100644 --- a/src/serialization/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts +++ b/src/serialization/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { LoyaltyAccount } from "../../../../../../types/LoyaltyAccount"; export const CreateLoyaltyAccountRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts b/src/serialization/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts index 45d7d4b8b..50ce73aa8 100644 --- a/src/serialization/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts +++ b/src/serialization/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { SearchLoyaltyAccountsRequestLoyaltyAccountQuery } from "../../../../../../types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery"; export const SearchLoyaltyAccountsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/accounts/client/requests/index.ts b/src/serialization/resources/loyalty/resources/accounts/client/requests/index.ts index 03227b225..b900ccd2c 100644 --- a/src/serialization/resources/loyalty/resources/accounts/client/requests/index.ts +++ b/src/serialization/resources/loyalty/resources/accounts/client/requests/index.ts @@ -1,4 +1,4 @@ -export { CreateLoyaltyAccountRequest } from "./CreateLoyaltyAccountRequest"; -export { SearchLoyaltyAccountsRequest } from "./SearchLoyaltyAccountsRequest"; export { AccumulateLoyaltyPointsRequest } from "./AccumulateLoyaltyPointsRequest"; export { AdjustLoyaltyPointsRequest } from "./AdjustLoyaltyPointsRequest"; +export { CreateLoyaltyAccountRequest } from "./CreateLoyaltyAccountRequest"; +export { SearchLoyaltyAccountsRequest } from "./SearchLoyaltyAccountsRequest"; diff --git a/src/serialization/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts b/src/serialization/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts index 5f95c2425..c7b29d652 100644 --- a/src/serialization/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts +++ b/src/serialization/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { Money } from "../../../../../../types/Money"; export const CalculateLoyaltyPointsRequest: core.serialization.Schema< @@ -18,8 +16,8 @@ export const CalculateLoyaltyPointsRequest: core.serialization.Schema< export declare namespace CalculateLoyaltyPointsRequest { export interface Raw { - order_id?: (string | null) | null; + order_id?: (string | null | undefined) | null; transaction_amount_money?: Money.Raw | null; - loyalty_account_id?: (string | null) | null; + loyalty_account_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts b/src/serialization/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts index 06a38c038..60cd02ed9 100644 --- a/src/serialization/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts +++ b/src/serialization/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../../../index"; -import * as Square from "../../../../../../../../../api/index"; +import type * as Square from "../../../../../../../../../api/index"; import * as core from "../../../../../../../../../core"; +import type * as serializers from "../../../../../../../../index"; import { LoyaltyPromotion } from "../../../../../../../../types/LoyaltyPromotion"; export const CreateLoyaltyPromotionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts b/src/serialization/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts index 488fc35d8..60d1fa539 100644 --- a/src/serialization/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts +++ b/src/serialization/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { LoyaltyReward } from "../../../../../../types/LoyaltyReward"; export const CreateLoyaltyRewardRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts b/src/serialization/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts index 4531f813d..3afb3a0b8 100644 --- a/src/serialization/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts +++ b/src/serialization/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; export const RedeemLoyaltyRewardRequest: core.serialization.Schema< serializers.loyalty.RedeemLoyaltyRewardRequest.Raw, diff --git a/src/serialization/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts b/src/serialization/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts index d29fbf38d..8532f667c 100644 --- a/src/serialization/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts +++ b/src/serialization/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { SearchLoyaltyRewardsRequestLoyaltyRewardQuery } from "../../../../../../types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery"; export const SearchLoyaltyRewardsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/rewards/client/requests/index.ts b/src/serialization/resources/loyalty/resources/rewards/client/requests/index.ts index 73d200ec3..4d08239b4 100644 --- a/src/serialization/resources/loyalty/resources/rewards/client/requests/index.ts +++ b/src/serialization/resources/loyalty/resources/rewards/client/requests/index.ts @@ -1,3 +1,3 @@ export { CreateLoyaltyRewardRequest } from "./CreateLoyaltyRewardRequest"; -export { SearchLoyaltyRewardsRequest } from "./SearchLoyaltyRewardsRequest"; export { RedeemLoyaltyRewardRequest } from "./RedeemLoyaltyRewardRequest"; +export { SearchLoyaltyRewardsRequest } from "./SearchLoyaltyRewardsRequest"; diff --git a/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts b/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts index 77146cbdd..a7009511e 100644 --- a/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const CreateMerchantCustomAttributeDefinitionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts b/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts index 786d2c616..bd8eb5b1b 100644 --- a/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const UpdateMerchantCustomAttributeDefinitionRequest: core.serialization.Schema< @@ -18,6 +16,6 @@ export const UpdateMerchantCustomAttributeDefinitionRequest: core.serialization. export declare namespace UpdateMerchantCustomAttributeDefinitionRequest { export interface Raw { custom_attribute_definition: CustomAttributeDefinition.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts b/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts index c78a982c9..35062a679 100644 --- a/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts +++ b/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest } from "../../../../../../types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest"; export const BulkDeleteMerchantCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts b/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts index 68b2a4675..d105c4094 100644 --- a/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts +++ b/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest } from "../../../../../../types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest"; export const BulkUpsertMerchantCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts b/src/serialization/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts index fd3d3f1f9..ae67566b0 100644 --- a/src/serialization/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts +++ b/src/serialization/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttribute } from "../../../../../../types/CustomAttribute"; export const UpsertMerchantCustomAttributeRequest: core.serialization.Schema< @@ -18,6 +16,6 @@ export const UpsertMerchantCustomAttributeRequest: core.serialization.Schema< export declare namespace UpsertMerchantCustomAttributeRequest { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts b/src/serialization/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts index 0d33f8179..5e86ddca5 100644 --- a/src/serialization/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts +++ b/src/serialization/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const CreateMobileAuthorizationCodeRequest: core.serialization.Schema< serializers.CreateMobileAuthorizationCodeRequest.Raw, diff --git a/src/serialization/resources/oAuth/client/requests/ObtainTokenRequest.ts b/src/serialization/resources/oAuth/client/requests/ObtainTokenRequest.ts index cbde8c0d5..566efbfae 100644 --- a/src/serialization/resources/oAuth/client/requests/ObtainTokenRequest.ts +++ b/src/serialization/resources/oAuth/client/requests/ObtainTokenRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const ObtainTokenRequest: core.serialization.Schema< serializers.ObtainTokenRequest.Raw, @@ -25,14 +23,14 @@ export const ObtainTokenRequest: core.serialization.Schema< export declare namespace ObtainTokenRequest { export interface Raw { client_id: string; - client_secret?: (string | null) | null; - code?: (string | null) | null; - redirect_uri?: (string | null) | null; + client_secret?: (string | null | undefined) | null; + code?: (string | null | undefined) | null; + redirect_uri?: (string | null | undefined) | null; grant_type: string; - refresh_token?: (string | null) | null; - migration_token?: (string | null) | null; - scopes?: (string[] | null) | null; - short_lived?: (boolean | null) | null; - code_verifier?: (string | null) | null; + refresh_token?: (string | null | undefined) | null; + migration_token?: (string | null | undefined) | null; + scopes?: (string[] | null | undefined) | null; + short_lived?: (boolean | null | undefined) | null; + code_verifier?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/oAuth/client/requests/RevokeTokenRequest.ts b/src/serialization/resources/oAuth/client/requests/RevokeTokenRequest.ts index a1546b6fe..89663a357 100644 --- a/src/serialization/resources/oAuth/client/requests/RevokeTokenRequest.ts +++ b/src/serialization/resources/oAuth/client/requests/RevokeTokenRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const RevokeTokenRequest: core.serialization.Schema< serializers.RevokeTokenRequest.Raw, @@ -21,9 +19,9 @@ export const RevokeTokenRequest: core.serialization.Schema< export declare namespace RevokeTokenRequest { export interface Raw { - client_id?: (string | null) | null; - access_token?: (string | null) | null; - merchant_id?: (string | null) | null; - revoke_only_access_token?: (boolean | null) | null; + client_id?: (string | null | undefined) | null; + access_token?: (string | null | undefined) | null; + merchant_id?: (string | null | undefined) | null; + revoke_only_access_token?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/oAuth/client/requests/index.ts b/src/serialization/resources/oAuth/client/requests/index.ts index 3adbffa40..140a92267 100644 --- a/src/serialization/resources/oAuth/client/requests/index.ts +++ b/src/serialization/resources/oAuth/client/requests/index.ts @@ -1,2 +1,2 @@ -export { RevokeTokenRequest } from "./RevokeTokenRequest"; export { ObtainTokenRequest } from "./ObtainTokenRequest"; +export { RevokeTokenRequest } from "./RevokeTokenRequest"; diff --git a/src/serialization/resources/orders/client/requests/BatchGetOrdersRequest.ts b/src/serialization/resources/orders/client/requests/BatchGetOrdersRequest.ts index 9231fb858..2bc9e4efd 100644 --- a/src/serialization/resources/orders/client/requests/BatchGetOrdersRequest.ts +++ b/src/serialization/resources/orders/client/requests/BatchGetOrdersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const BatchGetOrdersRequest: core.serialization.Schema< serializers.BatchGetOrdersRequest.Raw, @@ -16,7 +14,7 @@ export const BatchGetOrdersRequest: core.serialization.Schema< export declare namespace BatchGetOrdersRequest { export interface Raw { - location_id?: (string | null) | null; + location_id?: (string | null | undefined) | null; order_ids: string[]; } } diff --git a/src/serialization/resources/orders/client/requests/CalculateOrderRequest.ts b/src/serialization/resources/orders/client/requests/CalculateOrderRequest.ts index f45aa627c..4b34b34b7 100644 --- a/src/serialization/resources/orders/client/requests/CalculateOrderRequest.ts +++ b/src/serialization/resources/orders/client/requests/CalculateOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Order } from "../../../../types/Order"; import { OrderReward } from "../../../../types/OrderReward"; @@ -22,6 +20,6 @@ export const CalculateOrderRequest: core.serialization.Schema< export declare namespace CalculateOrderRequest { export interface Raw { order: Order.Raw; - proposed_rewards?: (OrderReward.Raw[] | null) | null; + proposed_rewards?: (OrderReward.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/resources/orders/client/requests/CloneOrderRequest.ts b/src/serialization/resources/orders/client/requests/CloneOrderRequest.ts index 859bd99e2..86f6eb77e 100644 --- a/src/serialization/resources/orders/client/requests/CloneOrderRequest.ts +++ b/src/serialization/resources/orders/client/requests/CloneOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const CloneOrderRequest: core.serialization.Schema = core.serialization.object({ @@ -17,6 +15,6 @@ export declare namespace CloneOrderRequest { export interface Raw { order_id: string; version?: number | null; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/orders/client/requests/PayOrderRequest.ts b/src/serialization/resources/orders/client/requests/PayOrderRequest.ts index bf220bf26..bb3a08224 100644 --- a/src/serialization/resources/orders/client/requests/PayOrderRequest.ts +++ b/src/serialization/resources/orders/client/requests/PayOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const PayOrderRequest: core.serialization.Schema< serializers.PayOrderRequest.Raw, @@ -21,7 +19,7 @@ export const PayOrderRequest: core.serialization.Schema< export declare namespace PayOrderRequest { export interface Raw { idempotency_key: string; - order_version?: (number | null) | null; - payment_ids?: (string[] | null) | null; + order_version?: (number | null | undefined) | null; + payment_ids?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/resources/orders/client/requests/SearchOrdersRequest.ts b/src/serialization/resources/orders/client/requests/SearchOrdersRequest.ts index fd836c0ad..958b0b162 100644 --- a/src/serialization/resources/orders/client/requests/SearchOrdersRequest.ts +++ b/src/serialization/resources/orders/client/requests/SearchOrdersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { SearchOrdersQuery } from "../../../../types/SearchOrdersQuery"; export const SearchOrdersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/orders/client/requests/UpdateOrderRequest.ts b/src/serialization/resources/orders/client/requests/UpdateOrderRequest.ts index e67aa8934..83a0ebce2 100644 --- a/src/serialization/resources/orders/client/requests/UpdateOrderRequest.ts +++ b/src/serialization/resources/orders/client/requests/UpdateOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Order } from "../../../../types/Order"; export const UpdateOrderRequest: core.serialization.Schema< @@ -22,7 +20,7 @@ export const UpdateOrderRequest: core.serialization.Schema< export declare namespace UpdateOrderRequest { export interface Raw { order?: Order.Raw | null; - fields_to_clear?: (string[] | null) | null; - idempotency_key?: (string | null) | null; + fields_to_clear?: (string[] | null | undefined) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/orders/client/requests/index.ts b/src/serialization/resources/orders/client/requests/index.ts index cad486739..7dc6823c7 100644 --- a/src/serialization/resources/orders/client/requests/index.ts +++ b/src/serialization/resources/orders/client/requests/index.ts @@ -1,6 +1,6 @@ export { BatchGetOrdersRequest } from "./BatchGetOrdersRequest"; export { CalculateOrderRequest } from "./CalculateOrderRequest"; export { CloneOrderRequest } from "./CloneOrderRequest"; +export { PayOrderRequest } from "./PayOrderRequest"; export { SearchOrdersRequest } from "./SearchOrdersRequest"; export { UpdateOrderRequest } from "./UpdateOrderRequest"; -export { PayOrderRequest } from "./PayOrderRequest"; diff --git a/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts b/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts index d41721b2f..cfcbcb9d7 100644 --- a/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const CreateOrderCustomAttributeDefinitionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts b/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts index 1f23cef83..cae570e4c 100644 --- a/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const UpdateOrderCustomAttributeDefinitionRequest: core.serialization.Schema< @@ -18,6 +16,6 @@ export const UpdateOrderCustomAttributeDefinitionRequest: core.serialization.Sch export declare namespace UpdateOrderCustomAttributeDefinitionRequest { export interface Raw { custom_attribute_definition: CustomAttributeDefinition.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts b/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts index 16ed1b7f3..08547f639 100644 --- a/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts +++ b/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute } from "../../../../../../types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute"; export const BulkDeleteOrderCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts b/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts index 2999133ec..d2965ada3 100644 --- a/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts +++ b/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute } from "../../../../../../types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute"; export const BulkUpsertOrderCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts b/src/serialization/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts index cd5451bfd..7fbbb4414 100644 --- a/src/serialization/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts +++ b/src/serialization/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { CustomAttribute } from "../../../../../../types/CustomAttribute"; export const UpsertOrderCustomAttributeRequest: core.serialization.Schema< @@ -18,6 +16,6 @@ export const UpsertOrderCustomAttributeRequest: core.serialization.Schema< export declare namespace UpsertOrderCustomAttributeRequest { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts b/src/serialization/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts index 0efa29d7c..8c158b3b5 100644 --- a/src/serialization/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts +++ b/src/serialization/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const CancelPaymentByIdempotencyKeyRequest: core.serialization.Schema< serializers.CancelPaymentByIdempotencyKeyRequest.Raw, diff --git a/src/serialization/resources/payments/client/requests/CompletePaymentRequest.ts b/src/serialization/resources/payments/client/requests/CompletePaymentRequest.ts index 7c78bc1f1..830cf86ab 100644 --- a/src/serialization/resources/payments/client/requests/CompletePaymentRequest.ts +++ b/src/serialization/resources/payments/client/requests/CompletePaymentRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const CompletePaymentRequest: core.serialization.Schema< serializers.CompletePaymentRequest.Raw, @@ -15,6 +13,6 @@ export const CompletePaymentRequest: core.serialization.Schema< export declare namespace CompletePaymentRequest { export interface Raw { - version_token?: (string | null) | null; + version_token?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/payments/client/requests/CreatePaymentRequest.ts b/src/serialization/resources/payments/client/requests/CreatePaymentRequest.ts index 35c740983..415c665b1 100644 --- a/src/serialization/resources/payments/client/requests/CreatePaymentRequest.ts +++ b/src/serialization/resources/payments/client/requests/CreatePaymentRequest.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import { Money } from "../../../../types/Money"; +import type * as serializers from "../../../../index"; import { Address } from "../../../../types/Address"; import { CashPaymentDetails } from "../../../../types/CashPaymentDetails"; -import { ExternalPaymentDetails } from "../../../../types/ExternalPaymentDetails"; import { CustomerDetails } from "../../../../types/CustomerDetails"; +import { ExternalPaymentDetails } from "../../../../types/ExternalPaymentDetails"; +import { Money } from "../../../../types/Money"; import { OfflinePaymentDetails } from "../../../../types/OfflinePaymentDetails"; export const CreatePaymentRequest: core.serialization.Schema< diff --git a/src/serialization/resources/payments/client/requests/UpdatePaymentRequest.ts b/src/serialization/resources/payments/client/requests/UpdatePaymentRequest.ts index 12d129e2f..d0c0ff542 100644 --- a/src/serialization/resources/payments/client/requests/UpdatePaymentRequest.ts +++ b/src/serialization/resources/payments/client/requests/UpdatePaymentRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Payment } from "../../../../types/Payment"; export const UpdatePaymentRequest: core.serialization.Schema< diff --git a/src/serialization/resources/payments/client/requests/index.ts b/src/serialization/resources/payments/client/requests/index.ts index 4332ec649..da5a6a559 100644 --- a/src/serialization/resources/payments/client/requests/index.ts +++ b/src/serialization/resources/payments/client/requests/index.ts @@ -1,4 +1,4 @@ -export { CreatePaymentRequest } from "./CreatePaymentRequest"; export { CancelPaymentByIdempotencyKeyRequest } from "./CancelPaymentByIdempotencyKeyRequest"; -export { UpdatePaymentRequest } from "./UpdatePaymentRequest"; export { CompletePaymentRequest } from "./CompletePaymentRequest"; +export { CreatePaymentRequest } from "./CreatePaymentRequest"; +export { UpdatePaymentRequest } from "./UpdatePaymentRequest"; diff --git a/src/serialization/resources/refunds/client/requests/RefundPaymentRequest.ts b/src/serialization/resources/refunds/client/requests/RefundPaymentRequest.ts index 7f36428a0..4850d64f5 100644 --- a/src/serialization/resources/refunds/client/requests/RefundPaymentRequest.ts +++ b/src/serialization/resources/refunds/client/requests/RefundPaymentRequest.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import { Money } from "../../../../types/Money"; +import type * as serializers from "../../../../index"; import { DestinationDetailsCashRefundDetails } from "../../../../types/DestinationDetailsCashRefundDetails"; import { DestinationDetailsExternalRefundDetails } from "../../../../types/DestinationDetailsExternalRefundDetails"; +import { Money } from "../../../../types/Money"; export const RefundPaymentRequest: core.serialization.Schema< serializers.RefundPaymentRequest.Raw, @@ -39,14 +37,14 @@ export declare namespace RefundPaymentRequest { idempotency_key: string; amount_money: Money.Raw; app_fee_money?: Money.Raw | null; - payment_id?: (string | null) | null; - destination_id?: (string | null) | null; - unlinked?: (boolean | null) | null; - location_id?: (string | null) | null; - customer_id?: (string | null) | null; - reason?: (string | null) | null; - payment_version_token?: (string | null) | null; - team_member_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; + destination_id?: (string | null | undefined) | null; + unlinked?: (boolean | null | undefined) | null; + location_id?: (string | null | undefined) | null; + customer_id?: (string | null | undefined) | null; + reason?: (string | null | undefined) | null; + payment_version_token?: (string | null | undefined) | null; + team_member_id?: (string | null | undefined) | null; cash_details?: DestinationDetailsCashRefundDetails.Raw | null; external_details?: DestinationDetailsExternalRefundDetails.Raw | null; } diff --git a/src/serialization/resources/snippets/client/requests/UpsertSnippetRequest.ts b/src/serialization/resources/snippets/client/requests/UpsertSnippetRequest.ts index 4e637b87f..da9ffb04f 100644 --- a/src/serialization/resources/snippets/client/requests/UpsertSnippetRequest.ts +++ b/src/serialization/resources/snippets/client/requests/UpsertSnippetRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Snippet } from "../../../../types/Snippet"; export const UpsertSnippetRequest: core.serialization.Schema< diff --git a/src/serialization/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts b/src/serialization/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts index aa87601d5..a4826deff 100644 --- a/src/serialization/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const BulkSwapPlanRequest: core.serialization.Schema< serializers.BulkSwapPlanRequest.Raw, diff --git a/src/serialization/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts b/src/serialization/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts index 53291970d..0aa5fc1ef 100644 --- a/src/serialization/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const ChangeBillingAnchorDateRequest: core.serialization.Schema< serializers.ChangeBillingAnchorDateRequest.Raw, @@ -19,7 +17,7 @@ export const ChangeBillingAnchorDateRequest: core.serialization.Schema< export declare namespace ChangeBillingAnchorDateRequest { export interface Raw { - monthly_billing_anchor_date?: (number | null) | null; - effective_date?: (string | null) | null; + monthly_billing_anchor_date?: (number | null | undefined) | null; + effective_date?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts b/src/serialization/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts index f622c8ea4..9e5c53f75 100644 --- a/src/serialization/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Money } from "../../../../types/Money"; -import { SubscriptionSource } from "../../../../types/SubscriptionSource"; import { Phase } from "../../../../types/Phase"; +import { SubscriptionSource } from "../../../../types/SubscriptionSource"; export const CreateSubscriptionRequest: core.serialization.Schema< serializers.CreateSubscriptionRequest.Raw, diff --git a/src/serialization/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts b/src/serialization/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts index 384d35024..288fbdd04 100644 --- a/src/serialization/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { ChangeTiming } from "../../../../types/ChangeTiming"; export const PauseSubscriptionRequest: core.serialization.Schema< @@ -29,10 +27,10 @@ export const PauseSubscriptionRequest: core.serialization.Schema< export declare namespace PauseSubscriptionRequest { export interface Raw { - pause_effective_date?: (string | null) | null; - pause_cycle_duration?: ((bigint | number) | null) | null; - resume_effective_date?: (string | null) | null; + pause_effective_date?: (string | null | undefined) | null; + pause_cycle_duration?: ((bigint | number) | null | undefined) | null; + resume_effective_date?: (string | null | undefined) | null; resume_change_timing?: ChangeTiming.Raw | null; - pause_reason?: (string | null) | null; + pause_reason?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts b/src/serialization/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts index 47f788ac0..4b0727cf4 100644 --- a/src/serialization/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { ChangeTiming } from "../../../../types/ChangeTiming"; export const ResumeSubscriptionRequest: core.serialization.Schema< @@ -20,7 +18,7 @@ export const ResumeSubscriptionRequest: core.serialization.Schema< export declare namespace ResumeSubscriptionRequest { export interface Raw { - resume_effective_date?: (string | null) | null; + resume_effective_date?: (string | null | undefined) | null; resume_change_timing?: ChangeTiming.Raw | null; } } diff --git a/src/serialization/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts b/src/serialization/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts index 6bc67aa04..e447ce863 100644 --- a/src/serialization/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { SearchSubscriptionsQuery } from "../../../../types/SearchSubscriptionsQuery"; export const SearchSubscriptionsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/subscriptions/client/requests/SwapPlanRequest.ts b/src/serialization/resources/subscriptions/client/requests/SwapPlanRequest.ts index 20b4035e0..93165e5a7 100644 --- a/src/serialization/resources/subscriptions/client/requests/SwapPlanRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/SwapPlanRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { PhaseInput } from "../../../../types/PhaseInput"; export const SwapPlanRequest: core.serialization.Schema< @@ -20,7 +18,7 @@ export const SwapPlanRequest: core.serialization.Schema< export declare namespace SwapPlanRequest { export interface Raw { - new_plan_variation_id?: (string | null) | null; - phases?: (PhaseInput.Raw[] | null) | null; + new_plan_variation_id?: (string | null | undefined) | null; + phases?: (PhaseInput.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts b/src/serialization/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts index ec6826f50..8ffe58090 100644 --- a/src/serialization/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Subscription } from "../../../../types/Subscription"; export const UpdateSubscriptionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/subscriptions/client/requests/index.ts b/src/serialization/resources/subscriptions/client/requests/index.ts index b48070509..53abf84bf 100644 --- a/src/serialization/resources/subscriptions/client/requests/index.ts +++ b/src/serialization/resources/subscriptions/client/requests/index.ts @@ -1,8 +1,8 @@ -export { CreateSubscriptionRequest } from "./CreateSubscriptionRequest"; export { BulkSwapPlanRequest } from "./BulkSwapPlanRequest"; -export { SearchSubscriptionsRequest } from "./SearchSubscriptionsRequest"; -export { UpdateSubscriptionRequest } from "./UpdateSubscriptionRequest"; export { ChangeBillingAnchorDateRequest } from "./ChangeBillingAnchorDateRequest"; +export { CreateSubscriptionRequest } from "./CreateSubscriptionRequest"; export { PauseSubscriptionRequest } from "./PauseSubscriptionRequest"; export { ResumeSubscriptionRequest } from "./ResumeSubscriptionRequest"; +export { SearchSubscriptionsRequest } from "./SearchSubscriptionsRequest"; export { SwapPlanRequest } from "./SwapPlanRequest"; +export { UpdateSubscriptionRequest } from "./UpdateSubscriptionRequest"; diff --git a/src/serialization/resources/team/client/requests/CreateJobRequest.ts b/src/serialization/resources/team/client/requests/CreateJobRequest.ts index 7ab21c8a9..77b51866b 100644 --- a/src/serialization/resources/team/client/requests/CreateJobRequest.ts +++ b/src/serialization/resources/team/client/requests/CreateJobRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Job } from "../../../../types/Job"; export const CreateJobRequest: core.serialization.Schema = diff --git a/src/serialization/resources/team/client/requests/UpdateJobRequest.ts b/src/serialization/resources/team/client/requests/UpdateJobRequest.ts index a4b0ff74a..638150000 100644 --- a/src/serialization/resources/team/client/requests/UpdateJobRequest.ts +++ b/src/serialization/resources/team/client/requests/UpdateJobRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Job } from "../../../../types/Job"; export const UpdateJobRequest: core.serialization.Schema< diff --git a/src/serialization/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts b/src/serialization/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts index 2484c48dd..2819e0a94 100644 --- a/src/serialization/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts +++ b/src/serialization/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { CreateTeamMemberRequest } from "../../../../types/CreateTeamMemberRequest"; export const BatchCreateTeamMembersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts b/src/serialization/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts index 69b652a7c..ad0244d09 100644 --- a/src/serialization/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts +++ b/src/serialization/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { UpdateTeamMemberRequest } from "../../../../types/UpdateTeamMemberRequest"; export const BatchUpdateTeamMembersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts b/src/serialization/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts index 46826c908..4631fb4e7 100644 --- a/src/serialization/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts +++ b/src/serialization/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { SearchTeamMembersQuery } from "../../../../types/SearchTeamMembersQuery"; export const SearchTeamMembersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts b/src/serialization/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts index e09c0ea2b..3b8c3591c 100644 --- a/src/serialization/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts +++ b/src/serialization/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { WageSetting } from "../../../../../../types/WageSetting"; export const UpdateWageSettingRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts b/src/serialization/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts index 1dbf1be21..28ab35c9a 100644 --- a/src/serialization/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts +++ b/src/serialization/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { TerminalAction } from "../../../../../../types/TerminalAction"; export const CreateTerminalActionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts b/src/serialization/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts index 0c5fc148c..373edeab6 100644 --- a/src/serialization/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts +++ b/src/serialization/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { TerminalActionQuery } from "../../../../../../types/TerminalActionQuery"; export const SearchTerminalActionsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts b/src/serialization/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts index 467299dbc..1d8d6e0a1 100644 --- a/src/serialization/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts +++ b/src/serialization/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { TerminalCheckout } from "../../../../../../types/TerminalCheckout"; export const CreateTerminalCheckoutRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts b/src/serialization/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts index 0ba1d4581..63e3a8874 100644 --- a/src/serialization/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts +++ b/src/serialization/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { TerminalCheckoutQuery } from "../../../../../../types/TerminalCheckoutQuery"; export const SearchTerminalCheckoutsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts b/src/serialization/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts index a871e1058..87a011727 100644 --- a/src/serialization/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts +++ b/src/serialization/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { TerminalRefund } from "../../../../../../types/TerminalRefund"; export const CreateTerminalRefundRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts b/src/serialization/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts index c2d5fff3e..d756e2d1a 100644 --- a/src/serialization/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts +++ b/src/serialization/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { TerminalRefundQuery } from "../../../../../../types/TerminalRefundQuery"; export const SearchTerminalRefundsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts index 1642cb61d..3653cf613 100644 --- a/src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts +++ b/src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const CancelTransferOrderRequest: core.serialization.Schema< serializers.CancelTransferOrderRequest.Raw, diff --git a/src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts index 29f8ae59d..a3e091de5 100644 --- a/src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts +++ b/src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { CreateTransferOrderData } from "../../../../types/CreateTransferOrderData"; export const CreateTransferOrderRequest: core.serialization.Schema< diff --git a/src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts index 8c52fdd2b..aa8d2a942 100644 --- a/src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts +++ b/src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { TransferOrderGoodsReceipt } from "../../../../types/TransferOrderGoodsReceipt"; export const ReceiveTransferOrderRequest: core.serialization.Schema< diff --git a/src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts b/src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts index 3e933e01b..35de928b6 100644 --- a/src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts +++ b/src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { TransferOrderQuery } from "../../../../types/TransferOrderQuery"; export const SearchTransferOrdersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts index f3b558d7c..1df46c7c1 100644 --- a/src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts +++ b/src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const StartTransferOrderRequest: core.serialization.Schema< serializers.StartTransferOrderRequest.Raw, diff --git a/src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts index f6d398ecd..c64ca08cc 100644 --- a/src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts +++ b/src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { UpdateTransferOrderData } from "../../../../types/UpdateTransferOrderData"; export const UpdateTransferOrderRequest: core.serialization.Schema< diff --git a/src/serialization/resources/transferOrders/client/requests/index.ts b/src/serialization/resources/transferOrders/client/requests/index.ts index 8c4b45ffa..cd1755751 100644 --- a/src/serialization/resources/transferOrders/client/requests/index.ts +++ b/src/serialization/resources/transferOrders/client/requests/index.ts @@ -1,6 +1,6 @@ -export { CreateTransferOrderRequest } from "./CreateTransferOrderRequest"; -export { SearchTransferOrdersRequest } from "./SearchTransferOrdersRequest"; -export { UpdateTransferOrderRequest } from "./UpdateTransferOrderRequest"; export { CancelTransferOrderRequest } from "./CancelTransferOrderRequest"; +export { CreateTransferOrderRequest } from "./CreateTransferOrderRequest"; export { ReceiveTransferOrderRequest } from "./ReceiveTransferOrderRequest"; +export { SearchTransferOrdersRequest } from "./SearchTransferOrdersRequest"; export { StartTransferOrderRequest } from "./StartTransferOrderRequest"; +export { UpdateTransferOrderRequest } from "./UpdateTransferOrderRequest"; diff --git a/src/serialization/resources/v1Transactions/client/index.ts b/src/serialization/resources/v1Transactions/client/index.ts index 989c4b62f..65c136ea7 100644 --- a/src/serialization/resources/v1Transactions/client/index.ts +++ b/src/serialization/resources/v1Transactions/client/index.ts @@ -1,2 +1,2 @@ -export * as v1ListOrders from "./v1ListOrders"; export * from "./requests"; +export * as v1ListOrders from "./v1ListOrders"; diff --git a/src/serialization/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts b/src/serialization/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts index bb759291f..0b399e370 100644 --- a/src/serialization/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts +++ b/src/serialization/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { V1UpdateOrderRequestAction } from "../../../../types/V1UpdateOrderRequestAction"; export const V1UpdateOrderRequest: core.serialization.Schema< @@ -24,9 +22,9 @@ export const V1UpdateOrderRequest: core.serialization.Schema< export declare namespace V1UpdateOrderRequest { export interface Raw { action: V1UpdateOrderRequestAction.Raw; - shipped_tracking_number?: (string | null) | null; - completed_note?: (string | null) | null; - refunded_note?: (string | null) | null; - canceled_note?: (string | null) | null; + shipped_tracking_number?: (string | null | undefined) | null; + completed_note?: (string | null | undefined) | null; + refunded_note?: (string | null | undefined) | null; + canceled_note?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/v1Transactions/client/v1ListOrders.ts b/src/serialization/resources/v1Transactions/client/v1ListOrders.ts index 76b301b14..74da2f8d0 100644 --- a/src/serialization/resources/v1Transactions/client/v1ListOrders.ts +++ b/src/serialization/resources/v1Transactions/client/v1ListOrders.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../index"; -import * as Square from "../../../../api/index"; +import type * as Square from "../../../../api/index"; import * as core from "../../../../core"; +import type * as serializers from "../../../index"; import { V1Order } from "../../../types/V1Order"; export const Response: core.serialization.Schema< diff --git a/src/serialization/resources/vendors/client/requests/BatchCreateVendorsRequest.ts b/src/serialization/resources/vendors/client/requests/BatchCreateVendorsRequest.ts index 35197e5df..8faf41034 100644 --- a/src/serialization/resources/vendors/client/requests/BatchCreateVendorsRequest.ts +++ b/src/serialization/resources/vendors/client/requests/BatchCreateVendorsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Vendor } from "../../../../types/Vendor"; export const BatchCreateVendorsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/vendors/client/requests/BatchGetVendorsRequest.ts b/src/serialization/resources/vendors/client/requests/BatchGetVendorsRequest.ts index fc7005729..757a405b4 100644 --- a/src/serialization/resources/vendors/client/requests/BatchGetVendorsRequest.ts +++ b/src/serialization/resources/vendors/client/requests/BatchGetVendorsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; export const BatchGetVendorsRequest: core.serialization.Schema< serializers.BatchGetVendorsRequest.Raw, @@ -18,6 +16,6 @@ export const BatchGetVendorsRequest: core.serialization.Schema< export declare namespace BatchGetVendorsRequest { export interface Raw { - vendor_ids?: (string[] | null) | null; + vendor_ids?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts b/src/serialization/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts index d9cdd6c78..d9706b819 100644 --- a/src/serialization/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts +++ b/src/serialization/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { UpdateVendorRequest } from "../../../../types/UpdateVendorRequest"; export const BatchUpdateVendorsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/vendors/client/requests/CreateVendorRequest.ts b/src/serialization/resources/vendors/client/requests/CreateVendorRequest.ts index 64c531673..4a8af4e0e 100644 --- a/src/serialization/resources/vendors/client/requests/CreateVendorRequest.ts +++ b/src/serialization/resources/vendors/client/requests/CreateVendorRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { Vendor } from "../../../../types/Vendor"; export const CreateVendorRequest: core.serialization.Schema< diff --git a/src/serialization/resources/vendors/client/requests/SearchVendorsRequest.ts b/src/serialization/resources/vendors/client/requests/SearchVendorsRequest.ts index 1a22317b8..95b41323d 100644 --- a/src/serialization/resources/vendors/client/requests/SearchVendorsRequest.ts +++ b/src/serialization/resources/vendors/client/requests/SearchVendorsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../index"; -import * as Square from "../../../../../api/index"; +import type * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; import { SearchVendorsRequestFilter } from "../../../../types/SearchVendorsRequestFilter"; import { SearchVendorsRequestSort } from "../../../../types/SearchVendorsRequestSort"; diff --git a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts index 67ed058de..45008fa6d 100644 --- a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts +++ b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { WebhookSubscription } from "../../../../../../types/WebhookSubscription"; export const CreateWebhookSubscriptionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts index 97000bd74..fb56575b8 100644 --- a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts +++ b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; export const TestWebhookSubscriptionRequest: core.serialization.Schema< serializers.webhooks.TestWebhookSubscriptionRequest.Raw, @@ -15,6 +13,6 @@ export const TestWebhookSubscriptionRequest: core.serialization.Schema< export declare namespace TestWebhookSubscriptionRequest { export interface Raw { - event_type?: (string | null) | null; + event_type?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts index 495a62319..dc254a731 100644 --- a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts +++ b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; import { WebhookSubscription } from "../../../../../../types/WebhookSubscription"; export const UpdateWebhookSubscriptionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts index b03a6f88b..a4016b2ef 100644 --- a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts +++ b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../../../../../../index"; -import * as Square from "../../../../../../../api/index"; +import type * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; +import type * as serializers from "../../../../../../index"; export const UpdateWebhookSubscriptionSignatureKeyRequest: core.serialization.Schema< serializers.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest.Raw, @@ -15,6 +13,6 @@ export const UpdateWebhookSubscriptionSignatureKeyRequest: core.serialization.Sc export declare namespace UpdateWebhookSubscriptionSignatureKeyRequest { export interface Raw { - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/index.ts b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/index.ts index 849f59f16..f1543199e 100644 --- a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/index.ts +++ b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/index.ts @@ -1,4 +1,4 @@ export { CreateWebhookSubscriptionRequest } from "./CreateWebhookSubscriptionRequest"; +export { TestWebhookSubscriptionRequest } from "./TestWebhookSubscriptionRequest"; export { UpdateWebhookSubscriptionRequest } from "./UpdateWebhookSubscriptionRequest"; export { UpdateWebhookSubscriptionSignatureKeyRequest } from "./UpdateWebhookSubscriptionSignatureKeyRequest"; -export { TestWebhookSubscriptionRequest } from "./TestWebhookSubscriptionRequest"; diff --git a/src/serialization/types/AcceptDisputeResponse.ts b/src/serialization/types/AcceptDisputeResponse.ts index 2806b9f11..dbc7ff686 100644 --- a/src/serialization/types/AcceptDisputeResponse.ts +++ b/src/serialization/types/AcceptDisputeResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Dispute } from "./Dispute"; +import { Error_ } from "./Error_"; export const AcceptDisputeResponse: core.serialization.ObjectSchema< serializers.AcceptDisputeResponse.Raw, diff --git a/src/serialization/types/AcceptedPaymentMethods.ts b/src/serialization/types/AcceptedPaymentMethods.ts index 1281bce45..f253f9b9f 100644 --- a/src/serialization/types/AcceptedPaymentMethods.ts +++ b/src/serialization/types/AcceptedPaymentMethods.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const AcceptedPaymentMethods: core.serialization.ObjectSchema< serializers.AcceptedPaymentMethods.Raw, @@ -18,9 +16,9 @@ export const AcceptedPaymentMethods: core.serialization.ObjectSchema< export declare namespace AcceptedPaymentMethods { export interface Raw { - apple_pay?: (boolean | null) | null; - google_pay?: (boolean | null) | null; - cash_app_pay?: (boolean | null) | null; - afterpay_clearpay?: (boolean | null) | null; + apple_pay?: (boolean | null | undefined) | null; + google_pay?: (boolean | null | undefined) | null; + cash_app_pay?: (boolean | null | undefined) | null; + afterpay_clearpay?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/AccumulateLoyaltyPointsResponse.ts b/src/serialization/types/AccumulateLoyaltyPointsResponse.ts index a0b7b9f5d..59ea9c74c 100644 --- a/src/serialization/types/AccumulateLoyaltyPointsResponse.ts +++ b/src/serialization/types/AccumulateLoyaltyPointsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyEvent } from "./LoyaltyEvent"; diff --git a/src/serialization/types/AchDetails.ts b/src/serialization/types/AchDetails.ts index b69297e11..24587fe73 100644 --- a/src/serialization/types/AchDetails.ts +++ b/src/serialization/types/AchDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const AchDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -18,8 +16,8 @@ export const AchDetails: core.serialization.ObjectSchema = core.serialization.enum_([ diff --git a/src/serialization/types/AddGroupToCustomerResponse.ts b/src/serialization/types/AddGroupToCustomerResponse.ts index 1d8d5e99c..5cdd4390b 100644 --- a/src/serialization/types/AddGroupToCustomerResponse.ts +++ b/src/serialization/types/AddGroupToCustomerResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const AddGroupToCustomerResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/AdditionalRecipient.ts b/src/serialization/types/AdditionalRecipient.ts index 672bb2df2..513255eb1 100644 --- a/src/serialization/types/AdditionalRecipient.ts +++ b/src/serialization/types/AdditionalRecipient.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const AdditionalRecipient: core.serialization.ObjectSchema< @@ -20,8 +18,8 @@ export const AdditionalRecipient: core.serialization.ObjectSchema< export declare namespace AdditionalRecipient { export interface Raw { location_id: string; - description?: (string | null) | null; + description?: (string | null | undefined) | null; amount_money: Money.Raw; - receivable_id?: (string | null) | null; + receivable_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/Address.ts b/src/serialization/types/Address.ts index 33ed78cdc..e3dcf2b39 100644 --- a/src/serialization/types/Address.ts +++ b/src/serialization/types/Address.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Country } from "./Country"; export const Address: core.serialization.ObjectSchema = @@ -36,19 +34,19 @@ export const Address: core.serialization.ObjectSchema = core.serialization.object({ @@ -13,6 +11,6 @@ export const AfterpayDetails: core.serialization.ObjectSchema = core.serialization.stringLiteral("TERMINAL_API"); diff --git a/src/serialization/types/AppointmentSegment.ts b/src/serialization/types/AppointmentSegment.ts index a159933b8..90bcdc946 100644 --- a/src/serialization/types/AppointmentSegment.ts +++ b/src/serialization/types/AppointmentSegment.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const AppointmentSegment: core.serialization.ObjectSchema< serializers.AppointmentSegment.Raw, @@ -30,10 +28,10 @@ export const AppointmentSegment: core.serialization.ObjectSchema< export declare namespace AppointmentSegment { export interface Raw { - duration_minutes?: (number | null) | null; - service_variation_id?: (string | null) | null; + duration_minutes?: (number | null | undefined) | null; + service_variation_id?: (string | null | undefined) | null; team_member_id: string; - service_variation_version?: ((bigint | number) | null) | null; + service_variation_version?: ((bigint | number) | null | undefined) | null; intermission_minutes?: number | null; any_team_member?: boolean | null; resource_ids?: string[] | null; diff --git a/src/serialization/types/ArchivedState.ts b/src/serialization/types/ArchivedState.ts index 691716411..9b3868b0c 100644 --- a/src/serialization/types/ArchivedState.ts +++ b/src/serialization/types/ArchivedState.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ArchivedState: core.serialization.Schema = core.serialization.enum_(["ARCHIVED_STATE_NOT_ARCHIVED", "ARCHIVED_STATE_ARCHIVED", "ARCHIVED_STATE_ALL"]); diff --git a/src/serialization/types/Availability.ts b/src/serialization/types/Availability.ts index 367bb8fc3..027925ddf 100644 --- a/src/serialization/types/Availability.ts +++ b/src/serialization/types/Availability.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { AppointmentSegment } from "./AppointmentSegment"; export const Availability: core.serialization.ObjectSchema = @@ -19,8 +17,8 @@ export const Availability: core.serialization.ObjectSchema = core.serialization.object({ @@ -49,15 +47,15 @@ export declare namespace BankAccount { account_type: BankAccountType.Raw; holder_name: string; primary_bank_identification_number: string; - secondary_bank_identification_number?: (string | null) | null; - debit_mandate_reference_id?: (string | null) | null; - reference_id?: (string | null) | null; - location_id?: (string | null) | null; + secondary_bank_identification_number?: (string | null | undefined) | null; + debit_mandate_reference_id?: (string | null | undefined) | null; + reference_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; status: BankAccountStatus.Raw; creditable: boolean; debitable: boolean; - fingerprint?: (string | null) | null; + fingerprint?: (string | null | undefined) | null; version?: number | null; - bank_name?: (string | null) | null; + bank_name?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/BankAccountCreatedEvent.ts b/src/serialization/types/BankAccountCreatedEvent.ts index f7b60414b..e6e8f0eab 100644 --- a/src/serialization/types/BankAccountCreatedEvent.ts +++ b/src/serialization/types/BankAccountCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BankAccountCreatedEventData } from "./BankAccountCreatedEventData"; export const BankAccountCreatedEvent: core.serialization.ObjectSchema< @@ -21,10 +19,10 @@ export const BankAccountCreatedEvent: core.serialization.ObjectSchema< export declare namespace BankAccountCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - location_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: BankAccountCreatedEventData.Raw | null; } diff --git a/src/serialization/types/BankAccountCreatedEventData.ts b/src/serialization/types/BankAccountCreatedEventData.ts index 4039ba596..bd371a101 100644 --- a/src/serialization/types/BankAccountCreatedEventData.ts +++ b/src/serialization/types/BankAccountCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BankAccountCreatedEventObject } from "./BankAccountCreatedEventObject"; export const BankAccountCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const BankAccountCreatedEventData: core.serialization.ObjectSchema< export declare namespace BankAccountCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: BankAccountCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/BankAccountCreatedEventObject.ts b/src/serialization/types/BankAccountCreatedEventObject.ts index f37db6a8a..f1d43933f 100644 --- a/src/serialization/types/BankAccountCreatedEventObject.ts +++ b/src/serialization/types/BankAccountCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BankAccount } from "./BankAccount"; export const BankAccountCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BankAccountDisabledEvent.ts b/src/serialization/types/BankAccountDisabledEvent.ts index 816ccc1b4..2c28a315e 100644 --- a/src/serialization/types/BankAccountDisabledEvent.ts +++ b/src/serialization/types/BankAccountDisabledEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BankAccountDisabledEventData } from "./BankAccountDisabledEventData"; export const BankAccountDisabledEvent: core.serialization.ObjectSchema< @@ -21,10 +19,10 @@ export const BankAccountDisabledEvent: core.serialization.ObjectSchema< export declare namespace BankAccountDisabledEvent { export interface Raw { - merchant_id?: (string | null) | null; - location_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: BankAccountDisabledEventData.Raw | null; } diff --git a/src/serialization/types/BankAccountDisabledEventData.ts b/src/serialization/types/BankAccountDisabledEventData.ts index 713331f7c..9f661ccd0 100644 --- a/src/serialization/types/BankAccountDisabledEventData.ts +++ b/src/serialization/types/BankAccountDisabledEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BankAccountDisabledEventObject } from "./BankAccountDisabledEventObject"; export const BankAccountDisabledEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const BankAccountDisabledEventData: core.serialization.ObjectSchema< export declare namespace BankAccountDisabledEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: BankAccountDisabledEventObject.Raw | null; } diff --git a/src/serialization/types/BankAccountDisabledEventObject.ts b/src/serialization/types/BankAccountDisabledEventObject.ts index 4ae222e30..4d84ad9c0 100644 --- a/src/serialization/types/BankAccountDisabledEventObject.ts +++ b/src/serialization/types/BankAccountDisabledEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BankAccount } from "./BankAccount"; export const BankAccountDisabledEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BankAccountPaymentDetails.ts b/src/serialization/types/BankAccountPaymentDetails.ts index 7a5bfea80..8231b312c 100644 --- a/src/serialization/types/BankAccountPaymentDetails.ts +++ b/src/serialization/types/BankAccountPaymentDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { AchDetails } from "./AchDetails"; import { Error_ } from "./Error_"; @@ -30,13 +28,13 @@ export const BankAccountPaymentDetails: core.serialization.ObjectSchema< export declare namespace BankAccountPaymentDetails { export interface Raw { - bank_name?: (string | null) | null; - transfer_type?: (string | null) | null; - account_ownership_type?: (string | null) | null; - fingerprint?: (string | null) | null; - country?: (string | null) | null; - statement_description?: (string | null) | null; + bank_name?: (string | null | undefined) | null; + transfer_type?: (string | null | undefined) | null; + account_ownership_type?: (string | null | undefined) | null; + fingerprint?: (string | null | undefined) | null; + country?: (string | null | undefined) | null; + statement_description?: (string | null | undefined) | null; ach_details?: AchDetails.Raw | null; - errors?: (Error_.Raw[] | null) | null; + errors?: (Error_.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/BankAccountStatus.ts b/src/serialization/types/BankAccountStatus.ts index df4c18d94..9cbc93a3a 100644 --- a/src/serialization/types/BankAccountStatus.ts +++ b/src/serialization/types/BankAccountStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BankAccountStatus: core.serialization.Schema = core.serialization.enum_(["VERIFICATION_IN_PROGRESS", "VERIFIED", "DISABLED"]); diff --git a/src/serialization/types/BankAccountType.ts b/src/serialization/types/BankAccountType.ts index 7d7183052..bff470ca0 100644 --- a/src/serialization/types/BankAccountType.ts +++ b/src/serialization/types/BankAccountType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BankAccountType: core.serialization.Schema = core.serialization.enum_(["CHECKING", "SAVINGS", "INVESTMENT", "OTHER", "BUSINESS_CHECKING"]); diff --git a/src/serialization/types/BankAccountVerifiedEvent.ts b/src/serialization/types/BankAccountVerifiedEvent.ts index 59d4dd820..956e77574 100644 --- a/src/serialization/types/BankAccountVerifiedEvent.ts +++ b/src/serialization/types/BankAccountVerifiedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BankAccountVerifiedEventData } from "./BankAccountVerifiedEventData"; export const BankAccountVerifiedEvent: core.serialization.ObjectSchema< @@ -21,10 +19,10 @@ export const BankAccountVerifiedEvent: core.serialization.ObjectSchema< export declare namespace BankAccountVerifiedEvent { export interface Raw { - merchant_id?: (string | null) | null; - location_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: BankAccountVerifiedEventData.Raw | null; } diff --git a/src/serialization/types/BankAccountVerifiedEventData.ts b/src/serialization/types/BankAccountVerifiedEventData.ts index 5da93bb5e..117aded6f 100644 --- a/src/serialization/types/BankAccountVerifiedEventData.ts +++ b/src/serialization/types/BankAccountVerifiedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BankAccountVerifiedEventObject } from "./BankAccountVerifiedEventObject"; export const BankAccountVerifiedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const BankAccountVerifiedEventData: core.serialization.ObjectSchema< export declare namespace BankAccountVerifiedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: BankAccountVerifiedEventObject.Raw | null; } diff --git a/src/serialization/types/BankAccountVerifiedEventObject.ts b/src/serialization/types/BankAccountVerifiedEventObject.ts index f9a9214d7..bdefc643b 100644 --- a/src/serialization/types/BankAccountVerifiedEventObject.ts +++ b/src/serialization/types/BankAccountVerifiedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BankAccount } from "./BankAccount"; export const BankAccountVerifiedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BatchChangeInventoryRequest.ts b/src/serialization/types/BatchChangeInventoryRequest.ts index e32418d37..207bd2487 100644 --- a/src/serialization/types/BatchChangeInventoryRequest.ts +++ b/src/serialization/types/BatchChangeInventoryRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InventoryChange } from "./InventoryChange"; export const BatchChangeInventoryRequest: core.serialization.ObjectSchema< @@ -22,7 +20,7 @@ export const BatchChangeInventoryRequest: core.serialization.ObjectSchema< export declare namespace BatchChangeInventoryRequest { export interface Raw { idempotency_key: string; - changes?: (InventoryChange.Raw[] | null) | null; - ignore_unchanged_counts?: (boolean | null) | null; + changes?: (InventoryChange.Raw[] | null | undefined) | null; + ignore_unchanged_counts?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/BatchChangeInventoryResponse.ts b/src/serialization/types/BatchChangeInventoryResponse.ts index 277e85771..3cdbd9efb 100644 --- a/src/serialization/types/BatchChangeInventoryResponse.ts +++ b/src/serialization/types/BatchChangeInventoryResponse.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; -import { InventoryCount } from "./InventoryCount"; import { InventoryChange } from "./InventoryChange"; +import { InventoryCount } from "./InventoryCount"; export const BatchChangeInventoryResponse: core.serialization.ObjectSchema< serializers.BatchChangeInventoryResponse.Raw, diff --git a/src/serialization/types/BatchCreateTeamMembersResponse.ts b/src/serialization/types/BatchCreateTeamMembersResponse.ts index 9edb71dac..1d50e5879 100644 --- a/src/serialization/types/BatchCreateTeamMembersResponse.ts +++ b/src/serialization/types/BatchCreateTeamMembersResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CreateTeamMemberResponse } from "./CreateTeamMemberResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BatchCreateVendorsResponse.ts b/src/serialization/types/BatchCreateVendorsResponse.ts index b23bfbbb0..181f990bf 100644 --- a/src/serialization/types/BatchCreateVendorsResponse.ts +++ b/src/serialization/types/BatchCreateVendorsResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { CreateVendorResponse } from "./CreateVendorResponse"; +import { Error_ } from "./Error_"; export const BatchCreateVendorsResponse: core.serialization.ObjectSchema< serializers.BatchCreateVendorsResponse.Raw, diff --git a/src/serialization/types/BatchDeleteCatalogObjectsResponse.ts b/src/serialization/types/BatchDeleteCatalogObjectsResponse.ts index 53c0cdcdd..9ef8f924c 100644 --- a/src/serialization/types/BatchDeleteCatalogObjectsResponse.ts +++ b/src/serialization/types/BatchDeleteCatalogObjectsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const BatchDeleteCatalogObjectsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BatchGetCatalogObjectsResponse.ts b/src/serialization/types/BatchGetCatalogObjectsResponse.ts index de6f66a25..319bc9e58 100644 --- a/src/serialization/types/BatchGetCatalogObjectsResponse.ts +++ b/src/serialization/types/BatchGetCatalogObjectsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { Error_ } from "./Error_"; export const BatchGetCatalogObjectsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BatchGetInventoryChangesResponse.ts b/src/serialization/types/BatchGetInventoryChangesResponse.ts index 1a100da5a..f4d476d59 100644 --- a/src/serialization/types/BatchGetInventoryChangesResponse.ts +++ b/src/serialization/types/BatchGetInventoryChangesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryChange } from "./InventoryChange"; diff --git a/src/serialization/types/BatchGetInventoryCountsRequest.ts b/src/serialization/types/BatchGetInventoryCountsRequest.ts index eb8312bf6..e8ee5a47f 100644 --- a/src/serialization/types/BatchGetInventoryCountsRequest.ts +++ b/src/serialization/types/BatchGetInventoryCountsRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InventoryState } from "./InventoryState"; export const BatchGetInventoryCountsRequest: core.serialization.ObjectSchema< @@ -27,11 +25,11 @@ export const BatchGetInventoryCountsRequest: core.serialization.ObjectSchema< export declare namespace BatchGetInventoryCountsRequest { export interface Raw { - catalog_object_ids?: (string[] | null) | null; - location_ids?: (string[] | null) | null; - updated_after?: (string | null) | null; - cursor?: (string | null) | null; - states?: (InventoryState.Raw[] | null) | null; - limit?: (number | null) | null; + catalog_object_ids?: (string[] | null | undefined) | null; + location_ids?: (string[] | null | undefined) | null; + updated_after?: (string | null | undefined) | null; + cursor?: (string | null | undefined) | null; + states?: (InventoryState.Raw[] | null | undefined) | null; + limit?: (number | null | undefined) | null; } } diff --git a/src/serialization/types/BatchGetInventoryCountsResponse.ts b/src/serialization/types/BatchGetInventoryCountsResponse.ts index 030eab0a5..c17b38359 100644 --- a/src/serialization/types/BatchGetInventoryCountsResponse.ts +++ b/src/serialization/types/BatchGetInventoryCountsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryCount } from "./InventoryCount"; diff --git a/src/serialization/types/BatchGetOrdersResponse.ts b/src/serialization/types/BatchGetOrdersResponse.ts index 3eb249da1..9ce2af0fe 100644 --- a/src/serialization/types/BatchGetOrdersResponse.ts +++ b/src/serialization/types/BatchGetOrdersResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Order } from "./Order"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Order } from "./Order"; export const BatchGetOrdersResponse: core.serialization.ObjectSchema< serializers.BatchGetOrdersResponse.Raw, diff --git a/src/serialization/types/BatchGetVendorsResponse.ts b/src/serialization/types/BatchGetVendorsResponse.ts index 9ece6ca65..1c2575d44 100644 --- a/src/serialization/types/BatchGetVendorsResponse.ts +++ b/src/serialization/types/BatchGetVendorsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GetVendorResponse } from "./GetVendorResponse"; diff --git a/src/serialization/types/BatchRetrieveInventoryChangesRequest.ts b/src/serialization/types/BatchRetrieveInventoryChangesRequest.ts index 9183e6d0d..703244b39 100644 --- a/src/serialization/types/BatchRetrieveInventoryChangesRequest.ts +++ b/src/serialization/types/BatchRetrieveInventoryChangesRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InventoryChangeType } from "./InventoryChangeType"; import { InventoryState } from "./InventoryState"; @@ -30,13 +28,13 @@ export const BatchRetrieveInventoryChangesRequest: core.serialization.ObjectSche export declare namespace BatchRetrieveInventoryChangesRequest { export interface Raw { - catalog_object_ids?: (string[] | null) | null; - location_ids?: (string[] | null) | null; - types?: (InventoryChangeType.Raw[] | null) | null; - states?: (InventoryState.Raw[] | null) | null; - updated_after?: (string | null) | null; - updated_before?: (string | null) | null; - cursor?: (string | null) | null; - limit?: (number | null) | null; + catalog_object_ids?: (string[] | null | undefined) | null; + location_ids?: (string[] | null | undefined) | null; + types?: (InventoryChangeType.Raw[] | null | undefined) | null; + states?: (InventoryState.Raw[] | null | undefined) | null; + updated_after?: (string | null | undefined) | null; + updated_before?: (string | null | undefined) | null; + cursor?: (string | null | undefined) | null; + limit?: (number | null | undefined) | null; } } diff --git a/src/serialization/types/BatchUpdateTeamMembersResponse.ts b/src/serialization/types/BatchUpdateTeamMembersResponse.ts index faa2d592f..ef2ac6194 100644 --- a/src/serialization/types/BatchUpdateTeamMembersResponse.ts +++ b/src/serialization/types/BatchUpdateTeamMembersResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { UpdateTeamMemberResponse } from "./UpdateTeamMemberResponse"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { UpdateTeamMemberResponse } from "./UpdateTeamMemberResponse"; export const BatchUpdateTeamMembersResponse: core.serialization.ObjectSchema< serializers.BatchUpdateTeamMembersResponse.Raw, diff --git a/src/serialization/types/BatchUpdateVendorsResponse.ts b/src/serialization/types/BatchUpdateVendorsResponse.ts index 88d932f61..10c2f6435 100644 --- a/src/serialization/types/BatchUpdateVendorsResponse.ts +++ b/src/serialization/types/BatchUpdateVendorsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { UpdateVendorResponse } from "./UpdateVendorResponse"; diff --git a/src/serialization/types/BatchUpsertCatalogObjectsResponse.ts b/src/serialization/types/BatchUpsertCatalogObjectsResponse.ts index 685418862..772749985 100644 --- a/src/serialization/types/BatchUpsertCatalogObjectsResponse.ts +++ b/src/serialization/types/BatchUpsertCatalogObjectsResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import * as serializers from "../index"; import { CatalogIdMapping } from "./CatalogIdMapping"; +import { Error_ } from "./Error_"; export const BatchUpsertCatalogObjectsResponse: core.serialization.ObjectSchema< serializers.BatchUpsertCatalogObjectsResponse.Raw, diff --git a/src/serialization/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts b/src/serialization/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts index 888ed197a..448f1f817 100644 --- a/src/serialization/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts +++ b/src/serialization/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest: core.serialization.ObjectSchema< @@ -20,6 +18,6 @@ export declare namespace BatchUpsertCustomerCustomAttributesRequestCustomerCusto export interface Raw { customer_id: string; custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/BatchUpsertCustomerCustomAttributesResponse.ts b/src/serialization/types/BatchUpsertCustomerCustomAttributesResponse.ts index 62941923e..54d22605e 100644 --- a/src/serialization/types/BatchUpsertCustomerCustomAttributesResponse.ts +++ b/src/serialization/types/BatchUpsertCustomerCustomAttributesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse } from "./BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts b/src/serialization/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts index 5f3a3fb24..4222ce056 100644 --- a/src/serialization/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts +++ b/src/serialization/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/Booking.ts b/src/serialization/types/Booking.ts index 91ef5f029..a4950a34a 100644 --- a/src/serialization/types/Booking.ts +++ b/src/serialization/types/Booking.ts @@ -1,16 +1,14 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { BookingStatus } from "./BookingStatus"; +import type * as serializers from "../index"; +import { Address } from "./Address"; import { AppointmentSegment } from "./AppointmentSegment"; -import { BusinessAppointmentSettingsBookingLocationType } from "./BusinessAppointmentSettingsBookingLocationType"; -import { BookingCreatorDetails } from "./BookingCreatorDetails"; import { BookingBookingSource } from "./BookingBookingSource"; -import { Address } from "./Address"; +import { BookingCreatorDetails } from "./BookingCreatorDetails"; +import { BookingStatus } from "./BookingStatus"; +import { BusinessAppointmentSettingsBookingLocationType } from "./BusinessAppointmentSettingsBookingLocationType"; export const Booking: core.serialization.ObjectSchema = core.serialization.object({ @@ -49,12 +47,12 @@ export declare namespace Booking { status?: BookingStatus.Raw | null; created_at?: string | null; updated_at?: string | null; - start_at?: (string | null) | null; - location_id?: (string | null) | null; - customer_id?: (string | null) | null; - customer_note?: (string | null) | null; - seller_note?: (string | null) | null; - appointment_segments?: (AppointmentSegment.Raw[] | null) | null; + start_at?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; + customer_id?: (string | null | undefined) | null; + customer_note?: (string | null | undefined) | null; + seller_note?: (string | null | undefined) | null; + appointment_segments?: (AppointmentSegment.Raw[] | null | undefined) | null; transition_time_minutes?: number | null; all_day?: boolean | null; location_type?: BusinessAppointmentSettingsBookingLocationType.Raw | null; diff --git a/src/serialization/types/BookingBookingSource.ts b/src/serialization/types/BookingBookingSource.ts index b056aab33..f8a39552e 100644 --- a/src/serialization/types/BookingBookingSource.ts +++ b/src/serialization/types/BookingBookingSource.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BookingBookingSource: core.serialization.Schema< serializers.BookingBookingSource.Raw, diff --git a/src/serialization/types/BookingCreatedEvent.ts b/src/serialization/types/BookingCreatedEvent.ts index 0b4853f56..4a65f044c 100644 --- a/src/serialization/types/BookingCreatedEvent.ts +++ b/src/serialization/types/BookingCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BookingCreatedEventData } from "./BookingCreatedEventData"; export const BookingCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCreatedEvent: core.serialization.ObjectSchema< export declare namespace BookingCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: BookingCreatedEventData.Raw | null; } diff --git a/src/serialization/types/BookingCreatedEventData.ts b/src/serialization/types/BookingCreatedEventData.ts index 2634c25da..f909238f2 100644 --- a/src/serialization/types/BookingCreatedEventData.ts +++ b/src/serialization/types/BookingCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BookingCreatedEventObject } from "./BookingCreatedEventObject"; export const BookingCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const BookingCreatedEventData: core.serialization.ObjectSchema< export declare namespace BookingCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: BookingCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/BookingCreatedEventObject.ts b/src/serialization/types/BookingCreatedEventObject.ts index 24f223757..8321d0b49 100644 --- a/src/serialization/types/BookingCreatedEventObject.ts +++ b/src/serialization/types/BookingCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Booking } from "./Booking"; export const BookingCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BookingCreatorDetails.ts b/src/serialization/types/BookingCreatorDetails.ts index cd64d6781..b502e58c5 100644 --- a/src/serialization/types/BookingCreatorDetails.ts +++ b/src/serialization/types/BookingCreatorDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BookingCreatorDetailsCreatorType } from "./BookingCreatorDetailsCreatorType"; export const BookingCreatorDetails: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BookingCreatorDetailsCreatorType.ts b/src/serialization/types/BookingCreatorDetailsCreatorType.ts index a7b1a513a..764071806 100644 --- a/src/serialization/types/BookingCreatorDetailsCreatorType.ts +++ b/src/serialization/types/BookingCreatorDetailsCreatorType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BookingCreatorDetailsCreatorType: core.serialization.Schema< serializers.BookingCreatorDetailsCreatorType.Raw, diff --git a/src/serialization/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts index 32240578b..12f80db93 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionOwnedCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCustomAttributeDefinitionOwnedCreatedEvent: core.serializati export declare namespace BookingCustomAttributeDefinitionOwnedCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts index 33b42ada4..2989f4c8f 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionOwnedDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCustomAttributeDefinitionOwnedDeletedEvent: core.serializati export declare namespace BookingCustomAttributeDefinitionOwnedDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts index 42143c6fb..a14e20cbb 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionOwnedUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCustomAttributeDefinitionOwnedUpdatedEvent: core.serializati export declare namespace BookingCustomAttributeDefinitionOwnedUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts index 92130d330..385d15acb 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionVisibleCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCustomAttributeDefinitionVisibleCreatedEvent: core.serializa export declare namespace BookingCustomAttributeDefinitionVisibleCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts index 97f7b7586..c31b36a3c 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionVisibleDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCustomAttributeDefinitionVisibleDeletedEvent: core.serializa export declare namespace BookingCustomAttributeDefinitionVisibleDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts index dcdef9d35..7b16577a5 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionVisibleUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCustomAttributeDefinitionVisibleUpdatedEvent: core.serializa export declare namespace BookingCustomAttributeDefinitionVisibleUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDeleteRequest.ts b/src/serialization/types/BookingCustomAttributeDeleteRequest.ts index 0700eb5e3..2e1fbaaec 100644 --- a/src/serialization/types/BookingCustomAttributeDeleteRequest.ts +++ b/src/serialization/types/BookingCustomAttributeDeleteRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BookingCustomAttributeDeleteRequest: core.serialization.ObjectSchema< serializers.BookingCustomAttributeDeleteRequest.Raw, diff --git a/src/serialization/types/BookingCustomAttributeDeleteResponse.ts b/src/serialization/types/BookingCustomAttributeDeleteResponse.ts index c0703fe23..6e5f9a309 100644 --- a/src/serialization/types/BookingCustomAttributeDeleteResponse.ts +++ b/src/serialization/types/BookingCustomAttributeDeleteResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const BookingCustomAttributeDeleteResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BookingCustomAttributeOwnedDeletedEvent.ts b/src/serialization/types/BookingCustomAttributeOwnedDeletedEvent.ts index c3aa6d573..b4100fae9 100644 --- a/src/serialization/types/BookingCustomAttributeOwnedDeletedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeOwnedDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const BookingCustomAttributeOwnedDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCustomAttributeOwnedDeletedEvent: core.serialization.ObjectS export declare namespace BookingCustomAttributeOwnedDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeOwnedUpdatedEvent.ts b/src/serialization/types/BookingCustomAttributeOwnedUpdatedEvent.ts index 4d98023a8..4baadde8d 100644 --- a/src/serialization/types/BookingCustomAttributeOwnedUpdatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeOwnedUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const BookingCustomAttributeOwnedUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCustomAttributeOwnedUpdatedEvent: core.serialization.ObjectS export declare namespace BookingCustomAttributeOwnedUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeUpsertRequest.ts b/src/serialization/types/BookingCustomAttributeUpsertRequest.ts index 4a794c637..6dfaea813 100644 --- a/src/serialization/types/BookingCustomAttributeUpsertRequest.ts +++ b/src/serialization/types/BookingCustomAttributeUpsertRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const BookingCustomAttributeUpsertRequest: core.serialization.ObjectSchema< @@ -20,6 +18,6 @@ export declare namespace BookingCustomAttributeUpsertRequest { export interface Raw { booking_id: string; custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/BookingCustomAttributeUpsertResponse.ts b/src/serialization/types/BookingCustomAttributeUpsertResponse.ts index 7d26a7ecd..664d03fba 100644 --- a/src/serialization/types/BookingCustomAttributeUpsertResponse.ts +++ b/src/serialization/types/BookingCustomAttributeUpsertResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BookingCustomAttributeVisibleDeletedEvent.ts b/src/serialization/types/BookingCustomAttributeVisibleDeletedEvent.ts index 586fef885..1a2279a32 100644 --- a/src/serialization/types/BookingCustomAttributeVisibleDeletedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeVisibleDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const BookingCustomAttributeVisibleDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCustomAttributeVisibleDeletedEvent: core.serialization.Objec export declare namespace BookingCustomAttributeVisibleDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeVisibleUpdatedEvent.ts b/src/serialization/types/BookingCustomAttributeVisibleUpdatedEvent.ts index 5cd434ad0..59d8eb420 100644 --- a/src/serialization/types/BookingCustomAttributeVisibleUpdatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeVisibleUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const BookingCustomAttributeVisibleUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingCustomAttributeVisibleUpdatedEvent: core.serialization.Objec export declare namespace BookingCustomAttributeVisibleUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/BookingStatus.ts b/src/serialization/types/BookingStatus.ts index 23f9f5841..e18dd03b5 100644 --- a/src/serialization/types/BookingStatus.ts +++ b/src/serialization/types/BookingStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BookingStatus: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/BookingUpdatedEvent.ts b/src/serialization/types/BookingUpdatedEvent.ts index 5b7414856..e317a7f29 100644 --- a/src/serialization/types/BookingUpdatedEvent.ts +++ b/src/serialization/types/BookingUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BookingUpdatedEventData } from "./BookingUpdatedEventData"; export const BookingUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const BookingUpdatedEvent: core.serialization.ObjectSchema< export declare namespace BookingUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: BookingUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/BookingUpdatedEventData.ts b/src/serialization/types/BookingUpdatedEventData.ts index 1e4adbe2e..bf4b6ca2a 100644 --- a/src/serialization/types/BookingUpdatedEventData.ts +++ b/src/serialization/types/BookingUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BookingUpdatedEventObject } from "./BookingUpdatedEventObject"; export const BookingUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const BookingUpdatedEventData: core.serialization.ObjectSchema< export declare namespace BookingUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: BookingUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/BookingUpdatedEventObject.ts b/src/serialization/types/BookingUpdatedEventObject.ts index 5dcf7f4cc..239221c2d 100644 --- a/src/serialization/types/BookingUpdatedEventObject.ts +++ b/src/serialization/types/BookingUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Booking } from "./Booking"; export const BookingUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Break.ts b/src/serialization/types/Break.ts index 3490d3e2d..cbf5e3bd8 100644 --- a/src/serialization/types/Break.ts +++ b/src/serialization/types/Break.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Break: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -20,7 +18,7 @@ export declare namespace Break { export interface Raw { id?: string | null; start_at: string; - end_at?: (string | null) | null; + end_at?: (string | null | undefined) | null; break_type_id: string; name: string; expected_duration: string; diff --git a/src/serialization/types/BreakType.ts b/src/serialization/types/BreakType.ts index 391ff6e5d..8f9e9079d 100644 --- a/src/serialization/types/BreakType.ts +++ b/src/serialization/types/BreakType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BreakType: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/BulkCreateCustomerData.ts b/src/serialization/types/BulkCreateCustomerData.ts index 8cf11f262..a58153ff6 100644 --- a/src/serialization/types/BulkCreateCustomerData.ts +++ b/src/serialization/types/BulkCreateCustomerData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Address } from "./Address"; import { CustomerTaxIds } from "./CustomerTaxIds"; @@ -27,16 +25,16 @@ export const BulkCreateCustomerData: core.serialization.ObjectSchema< export declare namespace BulkCreateCustomerData { export interface Raw { - given_name?: (string | null) | null; - family_name?: (string | null) | null; - company_name?: (string | null) | null; - nickname?: (string | null) | null; - email_address?: (string | null) | null; + given_name?: (string | null | undefined) | null; + family_name?: (string | null | undefined) | null; + company_name?: (string | null | undefined) | null; + nickname?: (string | null | undefined) | null; + email_address?: (string | null | undefined) | null; address?: Address.Raw | null; - phone_number?: (string | null) | null; - reference_id?: (string | null) | null; - note?: (string | null) | null; - birthday?: (string | null) | null; + phone_number?: (string | null | undefined) | null; + reference_id?: (string | null | undefined) | null; + note?: (string | null | undefined) | null; + birthday?: (string | null | undefined) | null; tax_ids?: CustomerTaxIds.Raw | null; } } diff --git a/src/serialization/types/BulkCreateCustomersResponse.ts b/src/serialization/types/BulkCreateCustomersResponse.ts index 54f9631e5..bd8d3f0f8 100644 --- a/src/serialization/types/BulkCreateCustomersResponse.ts +++ b/src/serialization/types/BulkCreateCustomersResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CreateCustomerResponse } from "./CreateCustomerResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkDeleteBookingCustomAttributesResponse.ts b/src/serialization/types/BulkDeleteBookingCustomAttributesResponse.ts index 194589a54..f121a962b 100644 --- a/src/serialization/types/BulkDeleteBookingCustomAttributesResponse.ts +++ b/src/serialization/types/BulkDeleteBookingCustomAttributesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BookingCustomAttributeDeleteResponse } from "./BookingCustomAttributeDeleteResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkDeleteCustomersResponse.ts b/src/serialization/types/BulkDeleteCustomersResponse.ts index a14b5cdbc..231114ee2 100644 --- a/src/serialization/types/BulkDeleteCustomersResponse.ts +++ b/src/serialization/types/BulkDeleteCustomersResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DeleteCustomerResponse } from "./DeleteCustomerResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts b/src/serialization/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts index 8ec39ae53..99ae91cf1 100644 --- a/src/serialization/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts +++ b/src/serialization/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest: core.serialization.ObjectSchema< serializers.BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.Raw, diff --git a/src/serialization/types/BulkDeleteLocationCustomAttributesResponse.ts b/src/serialization/types/BulkDeleteLocationCustomAttributesResponse.ts index 8e7a81dff..6cb5f853b 100644 --- a/src/serialization/types/BulkDeleteLocationCustomAttributesResponse.ts +++ b/src/serialization/types/BulkDeleteLocationCustomAttributesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse } from "./BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts b/src/serialization/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts index 22d88c11a..bdb602d03 100644 --- a/src/serialization/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts +++ b/src/serialization/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts b/src/serialization/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts index 2ccbd2d85..b5da98daf 100644 --- a/src/serialization/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts +++ b/src/serialization/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest: core.serialization.ObjectSchema< serializers.BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.Raw, diff --git a/src/serialization/types/BulkDeleteMerchantCustomAttributesResponse.ts b/src/serialization/types/BulkDeleteMerchantCustomAttributesResponse.ts index c03b88e57..40f3f2432 100644 --- a/src/serialization/types/BulkDeleteMerchantCustomAttributesResponse.ts +++ b/src/serialization/types/BulkDeleteMerchantCustomAttributesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse } from "./BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts b/src/serialization/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts index f6923054b..1916ccb5e 100644 --- a/src/serialization/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts +++ b/src/serialization/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts b/src/serialization/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts index c7d3eea93..0525fb8f5 100644 --- a/src/serialization/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts +++ b/src/serialization/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute: core.serialization.ObjectSchema< serializers.BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.Raw, diff --git a/src/serialization/types/BulkDeleteOrderCustomAttributesResponse.ts b/src/serialization/types/BulkDeleteOrderCustomAttributesResponse.ts index 09cb65491..9dab74717 100644 --- a/src/serialization/types/BulkDeleteOrderCustomAttributesResponse.ts +++ b/src/serialization/types/BulkDeleteOrderCustomAttributesResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { DeleteOrderCustomAttributeResponse } from "./DeleteOrderCustomAttributeResponse"; +import { Error_ } from "./Error_"; export const BulkDeleteOrderCustomAttributesResponse: core.serialization.ObjectSchema< serializers.BulkDeleteOrderCustomAttributesResponse.Raw, diff --git a/src/serialization/types/BulkPublishScheduledShiftsData.ts b/src/serialization/types/BulkPublishScheduledShiftsData.ts index 4d241bb60..129fe34c2 100644 --- a/src/serialization/types/BulkPublishScheduledShiftsData.ts +++ b/src/serialization/types/BulkPublishScheduledShiftsData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BulkPublishScheduledShiftsData: core.serialization.ObjectSchema< serializers.BulkPublishScheduledShiftsData.Raw, diff --git a/src/serialization/types/BulkPublishScheduledShiftsResponse.ts b/src/serialization/types/BulkPublishScheduledShiftsResponse.ts index 4b47bd202..d67494a6c 100644 --- a/src/serialization/types/BulkPublishScheduledShiftsResponse.ts +++ b/src/serialization/types/BulkPublishScheduledShiftsResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { PublishScheduledShiftResponse } from "./PublishScheduledShiftResponse"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { PublishScheduledShiftResponse } from "./PublishScheduledShiftResponse"; export const BulkPublishScheduledShiftsResponse: core.serialization.ObjectSchema< serializers.BulkPublishScheduledShiftsResponse.Raw, diff --git a/src/serialization/types/BulkRetrieveBookingsResponse.ts b/src/serialization/types/BulkRetrieveBookingsResponse.ts index 002ff6a60..1f2b72f8c 100644 --- a/src/serialization/types/BulkRetrieveBookingsResponse.ts +++ b/src/serialization/types/BulkRetrieveBookingsResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { GetBookingResponse } from "./GetBookingResponse"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { GetBookingResponse } from "./GetBookingResponse"; export const BulkRetrieveBookingsResponse: core.serialization.ObjectSchema< serializers.BulkRetrieveBookingsResponse.Raw, diff --git a/src/serialization/types/BulkRetrieveChannelsRequestConstants.ts b/src/serialization/types/BulkRetrieveChannelsRequestConstants.ts index 1e8ea7bcc..bfdb8150b 100644 --- a/src/serialization/types/BulkRetrieveChannelsRequestConstants.ts +++ b/src/serialization/types/BulkRetrieveChannelsRequestConstants.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BulkRetrieveChannelsRequestConstants: core.serialization.Schema< serializers.BulkRetrieveChannelsRequestConstants.Raw, diff --git a/src/serialization/types/BulkRetrieveChannelsResponse.ts b/src/serialization/types/BulkRetrieveChannelsResponse.ts index a9f30befa..9a075ffad 100644 --- a/src/serialization/types/BulkRetrieveChannelsResponse.ts +++ b/src/serialization/types/BulkRetrieveChannelsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { RetrieveChannelResponse } from "./RetrieveChannelResponse"; diff --git a/src/serialization/types/BulkRetrieveCustomersResponse.ts b/src/serialization/types/BulkRetrieveCustomersResponse.ts index 1a7485668..239bddb68 100644 --- a/src/serialization/types/BulkRetrieveCustomersResponse.ts +++ b/src/serialization/types/BulkRetrieveCustomersResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { GetCustomerResponse } from "./GetCustomerResponse"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { GetCustomerResponse } from "./GetCustomerResponse"; export const BulkRetrieveCustomersResponse: core.serialization.ObjectSchema< serializers.BulkRetrieveCustomersResponse.Raw, diff --git a/src/serialization/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts b/src/serialization/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts index 8853ea123..e1cd56b7b 100644 --- a/src/serialization/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts +++ b/src/serialization/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { GetTeamMemberBookingProfileResponse } from "./GetTeamMemberBookingProfileResponse"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { GetTeamMemberBookingProfileResponse } from "./GetTeamMemberBookingProfileResponse"; export const BulkRetrieveTeamMemberBookingProfilesResponse: core.serialization.ObjectSchema< serializers.BulkRetrieveTeamMemberBookingProfilesResponse.Raw, diff --git a/src/serialization/types/BulkSwapPlanResponse.ts b/src/serialization/types/BulkSwapPlanResponse.ts index 7381468f1..9cf98fd36 100644 --- a/src/serialization/types/BulkSwapPlanResponse.ts +++ b/src/serialization/types/BulkSwapPlanResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const BulkSwapPlanResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BulkUpdateCustomerData.ts b/src/serialization/types/BulkUpdateCustomerData.ts index d496cc57a..66d469882 100644 --- a/src/serialization/types/BulkUpdateCustomerData.ts +++ b/src/serialization/types/BulkUpdateCustomerData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Address } from "./Address"; import { CustomerTaxIds } from "./CustomerTaxIds"; @@ -28,16 +26,16 @@ export const BulkUpdateCustomerData: core.serialization.ObjectSchema< export declare namespace BulkUpdateCustomerData { export interface Raw { - given_name?: (string | null) | null; - family_name?: (string | null) | null; - company_name?: (string | null) | null; - nickname?: (string | null) | null; - email_address?: (string | null) | null; + given_name?: (string | null | undefined) | null; + family_name?: (string | null | undefined) | null; + company_name?: (string | null | undefined) | null; + nickname?: (string | null | undefined) | null; + email_address?: (string | null | undefined) | null; address?: Address.Raw | null; - phone_number?: (string | null) | null; - reference_id?: (string | null) | null; - note?: (string | null) | null; - birthday?: (string | null) | null; + phone_number?: (string | null | undefined) | null; + reference_id?: (string | null | undefined) | null; + note?: (string | null | undefined) | null; + birthday?: (string | null | undefined) | null; tax_ids?: CustomerTaxIds.Raw | null; version?: (bigint | number) | null; } diff --git a/src/serialization/types/BulkUpdateCustomersResponse.ts b/src/serialization/types/BulkUpdateCustomersResponse.ts index 07cb6cb3e..0b7b76652 100644 --- a/src/serialization/types/BulkUpdateCustomersResponse.ts +++ b/src/serialization/types/BulkUpdateCustomersResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { UpdateCustomerResponse } from "./UpdateCustomerResponse"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { UpdateCustomerResponse } from "./UpdateCustomerResponse"; export const BulkUpdateCustomersResponse: core.serialization.ObjectSchema< serializers.BulkUpdateCustomersResponse.Raw, diff --git a/src/serialization/types/BulkUpsertBookingCustomAttributesResponse.ts b/src/serialization/types/BulkUpsertBookingCustomAttributesResponse.ts index d155e7850..1d3b33cb1 100644 --- a/src/serialization/types/BulkUpsertBookingCustomAttributesResponse.ts +++ b/src/serialization/types/BulkUpsertBookingCustomAttributesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BookingCustomAttributeUpsertResponse } from "./BookingCustomAttributeUpsertResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts b/src/serialization/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts index b4c2f7b5c..149ef3ffc 100644 --- a/src/serialization/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts +++ b/src/serialization/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest: core.serialization.ObjectSchema< @@ -20,6 +18,6 @@ export declare namespace BulkUpsertLocationCustomAttributesRequestLocationCustom export interface Raw { location_id: string; custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/BulkUpsertLocationCustomAttributesResponse.ts b/src/serialization/types/BulkUpsertLocationCustomAttributesResponse.ts index 85a6fbbed..119d8b4eb 100644 --- a/src/serialization/types/BulkUpsertLocationCustomAttributesResponse.ts +++ b/src/serialization/types/BulkUpsertLocationCustomAttributesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse } from "./BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts b/src/serialization/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts index 2742b461c..5ae1fe24d 100644 --- a/src/serialization/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts +++ b/src/serialization/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts b/src/serialization/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts index 1a0307bc8..aadf2ec6c 100644 --- a/src/serialization/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts +++ b/src/serialization/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest: core.serialization.ObjectSchema< @@ -20,6 +18,6 @@ export declare namespace BulkUpsertMerchantCustomAttributesRequestMerchantCustom export interface Raw { merchant_id: string; custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/BulkUpsertMerchantCustomAttributesResponse.ts b/src/serialization/types/BulkUpsertMerchantCustomAttributesResponse.ts index 14fdbfe1d..a517a39d4 100644 --- a/src/serialization/types/BulkUpsertMerchantCustomAttributesResponse.ts +++ b/src/serialization/types/BulkUpsertMerchantCustomAttributesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse } from "./BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts b/src/serialization/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts index 479912102..19569bede 100644 --- a/src/serialization/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts +++ b/src/serialization/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts b/src/serialization/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts index 01fb99457..a9d62549b 100644 --- a/src/serialization/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts +++ b/src/serialization/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute: core.serialization.ObjectSchema< @@ -19,7 +17,7 @@ export const BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute: core.s export declare namespace BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null) | null; + idempotency_key?: (string | null | undefined) | null; order_id: string; } } diff --git a/src/serialization/types/BulkUpsertOrderCustomAttributesResponse.ts b/src/serialization/types/BulkUpsertOrderCustomAttributesResponse.ts index 814fb79fa..248ab907c 100644 --- a/src/serialization/types/BulkUpsertOrderCustomAttributesResponse.ts +++ b/src/serialization/types/BulkUpsertOrderCustomAttributesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { UpsertOrderCustomAttributeResponse } from "./UpsertOrderCustomAttributeResponse"; diff --git a/src/serialization/types/BusinessAppointmentSettings.ts b/src/serialization/types/BusinessAppointmentSettings.ts index bcb5b8250..ffbbf4d16 100644 --- a/src/serialization/types/BusinessAppointmentSettings.ts +++ b/src/serialization/types/BusinessAppointmentSettings.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { BusinessAppointmentSettingsBookingLocationType } from "./BusinessAppointmentSettingsBookingLocationType"; +import type * as serializers from "../index"; import { BusinessAppointmentSettingsAlignmentTime } from "./BusinessAppointmentSettingsAlignmentTime"; +import { BusinessAppointmentSettingsBookingLocationType } from "./BusinessAppointmentSettingsBookingLocationType"; +import { BusinessAppointmentSettingsCancellationPolicy } from "./BusinessAppointmentSettingsCancellationPolicy"; import { BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType } from "./BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType"; import { Money } from "./Money"; -import { BusinessAppointmentSettingsCancellationPolicy } from "./BusinessAppointmentSettingsCancellationPolicy"; export const BusinessAppointmentSettings: core.serialization.ObjectSchema< serializers.BusinessAppointmentSettings.Raw, @@ -65,18 +63,18 @@ export const BusinessAppointmentSettings: core.serialization.ObjectSchema< export declare namespace BusinessAppointmentSettings { export interface Raw { - location_types?: (BusinessAppointmentSettingsBookingLocationType.Raw[] | null) | null; + location_types?: (BusinessAppointmentSettingsBookingLocationType.Raw[] | null | undefined) | null; alignment_time?: BusinessAppointmentSettingsAlignmentTime.Raw | null; - min_booking_lead_time_seconds?: (number | null) | null; - max_booking_lead_time_seconds?: (number | null) | null; - any_team_member_booking_enabled?: (boolean | null) | null; - multiple_service_booking_enabled?: (boolean | null) | null; + min_booking_lead_time_seconds?: (number | null | undefined) | null; + max_booking_lead_time_seconds?: (number | null | undefined) | null; + any_team_member_booking_enabled?: (boolean | null | undefined) | null; + multiple_service_booking_enabled?: (boolean | null | undefined) | null; max_appointments_per_day_limit_type?: BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.Raw | null; - max_appointments_per_day_limit?: (number | null) | null; - cancellation_window_seconds?: (number | null) | null; + max_appointments_per_day_limit?: (number | null | undefined) | null; + cancellation_window_seconds?: (number | null | undefined) | null; cancellation_fee_money?: Money.Raw | null; cancellation_policy?: BusinessAppointmentSettingsCancellationPolicy.Raw | null; - cancellation_policy_text?: (string | null) | null; - skip_booking_flow_staff_selection?: (boolean | null) | null; + cancellation_policy_text?: (string | null | undefined) | null; + skip_booking_flow_staff_selection?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/BusinessAppointmentSettingsAlignmentTime.ts b/src/serialization/types/BusinessAppointmentSettingsAlignmentTime.ts index b0eaf681a..f0e4a2178 100644 --- a/src/serialization/types/BusinessAppointmentSettingsAlignmentTime.ts +++ b/src/serialization/types/BusinessAppointmentSettingsAlignmentTime.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BusinessAppointmentSettingsAlignmentTime: core.serialization.Schema< serializers.BusinessAppointmentSettingsAlignmentTime.Raw, diff --git a/src/serialization/types/BusinessAppointmentSettingsBookingLocationType.ts b/src/serialization/types/BusinessAppointmentSettingsBookingLocationType.ts index bcb0aa343..1f718339c 100644 --- a/src/serialization/types/BusinessAppointmentSettingsBookingLocationType.ts +++ b/src/serialization/types/BusinessAppointmentSettingsBookingLocationType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BusinessAppointmentSettingsBookingLocationType: core.serialization.Schema< serializers.BusinessAppointmentSettingsBookingLocationType.Raw, diff --git a/src/serialization/types/BusinessAppointmentSettingsCancellationPolicy.ts b/src/serialization/types/BusinessAppointmentSettingsCancellationPolicy.ts index 018750741..2895aa468 100644 --- a/src/serialization/types/BusinessAppointmentSettingsCancellationPolicy.ts +++ b/src/serialization/types/BusinessAppointmentSettingsCancellationPolicy.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BusinessAppointmentSettingsCancellationPolicy: core.serialization.Schema< serializers.BusinessAppointmentSettingsCancellationPolicy.Raw, diff --git a/src/serialization/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts b/src/serialization/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts index 8441815be..33fb69833 100644 --- a/src/serialization/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts +++ b/src/serialization/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType: core.serialization.Schema< serializers.BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.Raw, diff --git a/src/serialization/types/BusinessBookingProfile.ts b/src/serialization/types/BusinessBookingProfile.ts index 4176f585b..57f2c7d7d 100644 --- a/src/serialization/types/BusinessBookingProfile.ts +++ b/src/serialization/types/BusinessBookingProfile.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { BusinessBookingProfileCustomerTimezoneChoice } from "./BusinessBookingProfileCustomerTimezoneChoice"; -import { BusinessBookingProfileBookingPolicy } from "./BusinessBookingProfileBookingPolicy"; +import type * as serializers from "../index"; import { BusinessAppointmentSettings } from "./BusinessAppointmentSettings"; +import { BusinessBookingProfileBookingPolicy } from "./BusinessBookingProfileBookingPolicy"; +import { BusinessBookingProfileCustomerTimezoneChoice } from "./BusinessBookingProfileCustomerTimezoneChoice"; export const BusinessBookingProfile: core.serialization.ObjectSchema< serializers.BusinessBookingProfile.Raw, @@ -34,13 +32,13 @@ export const BusinessBookingProfile: core.serialization.ObjectSchema< export declare namespace BusinessBookingProfile { export interface Raw { - seller_id?: (string | null) | null; + seller_id?: (string | null | undefined) | null; created_at?: string | null; - booking_enabled?: (boolean | null) | null; + booking_enabled?: (boolean | null | undefined) | null; customer_timezone_choice?: BusinessBookingProfileCustomerTimezoneChoice.Raw | null; booking_policy?: BusinessBookingProfileBookingPolicy.Raw | null; - allow_user_cancel?: (boolean | null) | null; + allow_user_cancel?: (boolean | null | undefined) | null; business_appointment_settings?: BusinessAppointmentSettings.Raw | null; - support_seller_level_writes?: (boolean | null) | null; + support_seller_level_writes?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/BusinessBookingProfileBookingPolicy.ts b/src/serialization/types/BusinessBookingProfileBookingPolicy.ts index 26f3122b0..6e89df42d 100644 --- a/src/serialization/types/BusinessBookingProfileBookingPolicy.ts +++ b/src/serialization/types/BusinessBookingProfileBookingPolicy.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BusinessBookingProfileBookingPolicy: core.serialization.Schema< serializers.BusinessBookingProfileBookingPolicy.Raw, diff --git a/src/serialization/types/BusinessBookingProfileCustomerTimezoneChoice.ts b/src/serialization/types/BusinessBookingProfileCustomerTimezoneChoice.ts index e4b5e2f3c..57d11c2bb 100644 --- a/src/serialization/types/BusinessBookingProfileCustomerTimezoneChoice.ts +++ b/src/serialization/types/BusinessBookingProfileCustomerTimezoneChoice.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const BusinessBookingProfileCustomerTimezoneChoice: core.serialization.Schema< serializers.BusinessBookingProfileCustomerTimezoneChoice.Raw, diff --git a/src/serialization/types/BusinessHours.ts b/src/serialization/types/BusinessHours.ts index 56f2933eb..8f3cf57a6 100644 --- a/src/serialization/types/BusinessHours.ts +++ b/src/serialization/types/BusinessHours.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BusinessHoursPeriod } from "./BusinessHoursPeriod"; export const BusinessHours: core.serialization.ObjectSchema = @@ -14,6 +12,6 @@ export const BusinessHours: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -40,14 +38,14 @@ export declare namespace Card { id?: string | null; card_brand?: CardBrand.Raw | null; last_4?: string | null; - exp_month?: ((bigint | number) | null) | null; - exp_year?: ((bigint | number) | null) | null; - cardholder_name?: (string | null) | null; + exp_month?: ((bigint | number) | null | undefined) | null; + exp_year?: ((bigint | number) | null | undefined) | null; + cardholder_name?: (string | null | undefined) | null; billing_address?: Address.Raw | null; fingerprint?: string | null; - customer_id?: (string | null) | null; + customer_id?: (string | null | undefined) | null; merchant_id?: string | null; - reference_id?: (string | null) | null; + reference_id?: (string | null | undefined) | null; enabled?: boolean | null; card_type?: CardType.Raw | null; prepaid_type?: CardPrepaidType.Raw | null; diff --git a/src/serialization/types/CardAutomaticallyUpdatedEvent.ts b/src/serialization/types/CardAutomaticallyUpdatedEvent.ts index c99f5340c..f2c4231e5 100644 --- a/src/serialization/types/CardAutomaticallyUpdatedEvent.ts +++ b/src/serialization/types/CardAutomaticallyUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardAutomaticallyUpdatedEventData } from "./CardAutomaticallyUpdatedEventData"; export const CardAutomaticallyUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CardAutomaticallyUpdatedEvent: core.serialization.ObjectSchema< export declare namespace CardAutomaticallyUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CardAutomaticallyUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/CardAutomaticallyUpdatedEventData.ts b/src/serialization/types/CardAutomaticallyUpdatedEventData.ts index c785306c8..b051eeb60 100644 --- a/src/serialization/types/CardAutomaticallyUpdatedEventData.ts +++ b/src/serialization/types/CardAutomaticallyUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardAutomaticallyUpdatedEventObject } from "./CardAutomaticallyUpdatedEventObject"; export const CardAutomaticallyUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const CardAutomaticallyUpdatedEventData: core.serialization.ObjectSchema< export declare namespace CardAutomaticallyUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: CardAutomaticallyUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/CardAutomaticallyUpdatedEventObject.ts b/src/serialization/types/CardAutomaticallyUpdatedEventObject.ts index c326dd874..02000e1c8 100644 --- a/src/serialization/types/CardAutomaticallyUpdatedEventObject.ts +++ b/src/serialization/types/CardAutomaticallyUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Card } from "./Card"; export const CardAutomaticallyUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CardBrand.ts b/src/serialization/types/CardBrand.ts index c42e88c83..166051ab7 100644 --- a/src/serialization/types/CardBrand.ts +++ b/src/serialization/types/CardBrand.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CardBrand: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/CardCoBrand.ts b/src/serialization/types/CardCoBrand.ts index 61e447c20..fddfd3bf9 100644 --- a/src/serialization/types/CardCoBrand.ts +++ b/src/serialization/types/CardCoBrand.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CardCoBrand: core.serialization.Schema = core.serialization.enum_(["UNKNOWN", "AFTERPAY", "CLEARPAY"]); diff --git a/src/serialization/types/CardCreatedEvent.ts b/src/serialization/types/CardCreatedEvent.ts index b028b724b..3b9a9ee9c 100644 --- a/src/serialization/types/CardCreatedEvent.ts +++ b/src/serialization/types/CardCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardCreatedEventData } from "./CardCreatedEventData"; export const CardCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CardCreatedEvent: core.serialization.ObjectSchema< export declare namespace CardCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CardCreatedEventData.Raw | null; } diff --git a/src/serialization/types/CardCreatedEventData.ts b/src/serialization/types/CardCreatedEventData.ts index 862a2f3be..ea99bf5bb 100644 --- a/src/serialization/types/CardCreatedEventData.ts +++ b/src/serialization/types/CardCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardCreatedEventObject } from "./CardCreatedEventObject"; export const CardCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const CardCreatedEventData: core.serialization.ObjectSchema< export declare namespace CardCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: CardCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/CardCreatedEventObject.ts b/src/serialization/types/CardCreatedEventObject.ts index 3899a5f66..70e7c1468 100644 --- a/src/serialization/types/CardCreatedEventObject.ts +++ b/src/serialization/types/CardCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Card } from "./Card"; export const CardCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CardDisabledEvent.ts b/src/serialization/types/CardDisabledEvent.ts index 5db7cd7b1..d4dc328b4 100644 --- a/src/serialization/types/CardDisabledEvent.ts +++ b/src/serialization/types/CardDisabledEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardDisabledEventData } from "./CardDisabledEventData"; export const CardDisabledEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CardDisabledEvent: core.serialization.ObjectSchema< export declare namespace CardDisabledEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CardDisabledEventData.Raw | null; } diff --git a/src/serialization/types/CardDisabledEventData.ts b/src/serialization/types/CardDisabledEventData.ts index ef3a1e42b..c0d72ad4e 100644 --- a/src/serialization/types/CardDisabledEventData.ts +++ b/src/serialization/types/CardDisabledEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardDisabledEventObject } from "./CardDisabledEventObject"; export const CardDisabledEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const CardDisabledEventData: core.serialization.ObjectSchema< export declare namespace CardDisabledEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: CardDisabledEventObject.Raw | null; } diff --git a/src/serialization/types/CardDisabledEventObject.ts b/src/serialization/types/CardDisabledEventObject.ts index 9e3b79fa9..ac0d46893 100644 --- a/src/serialization/types/CardDisabledEventObject.ts +++ b/src/serialization/types/CardDisabledEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Card } from "./Card"; export const CardDisabledEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CardForgottenEvent.ts b/src/serialization/types/CardForgottenEvent.ts index f13d157f2..042249a1f 100644 --- a/src/serialization/types/CardForgottenEvent.ts +++ b/src/serialization/types/CardForgottenEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardForgottenEventData } from "./CardForgottenEventData"; export const CardForgottenEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CardForgottenEvent: core.serialization.ObjectSchema< export declare namespace CardForgottenEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CardForgottenEventData.Raw | null; } diff --git a/src/serialization/types/CardForgottenEventCard.ts b/src/serialization/types/CardForgottenEventCard.ts index 4e246906e..af873ddde 100644 --- a/src/serialization/types/CardForgottenEventCard.ts +++ b/src/serialization/types/CardForgottenEventCard.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CardForgottenEventCard: core.serialization.ObjectSchema< serializers.CardForgottenEventCard.Raw, @@ -21,10 +19,10 @@ export const CardForgottenEventCard: core.serialization.ObjectSchema< export declare namespace CardForgottenEventCard { export interface Raw { id?: string | null; - customer_id?: (string | null) | null; - enabled?: (boolean | null) | null; - reference_id?: (string | null) | null; + customer_id?: (string | null | undefined) | null; + enabled?: (boolean | null | undefined) | null; + reference_id?: (string | null | undefined) | null; version?: (bigint | number) | null; - merchant_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/CardForgottenEventData.ts b/src/serialization/types/CardForgottenEventData.ts index fd8adc9f8..2b3118d48 100644 --- a/src/serialization/types/CardForgottenEventData.ts +++ b/src/serialization/types/CardForgottenEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardForgottenEventObject } from "./CardForgottenEventObject"; export const CardForgottenEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const CardForgottenEventData: core.serialization.ObjectSchema< export declare namespace CardForgottenEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: CardForgottenEventObject.Raw | null; } diff --git a/src/serialization/types/CardForgottenEventObject.ts b/src/serialization/types/CardForgottenEventObject.ts index fc22e5208..9240f88df 100644 --- a/src/serialization/types/CardForgottenEventObject.ts +++ b/src/serialization/types/CardForgottenEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardForgottenEventCard } from "./CardForgottenEventCard"; export const CardForgottenEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CardIssuerAlert.ts b/src/serialization/types/CardIssuerAlert.ts index 2eb7755cd..04b6ee2fe 100644 --- a/src/serialization/types/CardIssuerAlert.ts +++ b/src/serialization/types/CardIssuerAlert.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CardIssuerAlert: core.serialization.Schema = core.serialization.stringLiteral("ISSUER_ALERT_CARD_CLOSED"); diff --git a/src/serialization/types/CardPaymentDetails.ts b/src/serialization/types/CardPaymentDetails.ts index 92e792768..9187abe1a 100644 --- a/src/serialization/types/CardPaymentDetails.ts +++ b/src/serialization/types/CardPaymentDetails.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Card } from "./Card"; -import { DeviceDetails } from "./DeviceDetails"; import { CardPaymentTimeline } from "./CardPaymentTimeline"; +import { DeviceDetails } from "./DeviceDetails"; import { Error_ } from "./Error_"; export const CardPaymentDetails: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CardPaymentTimeline.ts b/src/serialization/types/CardPaymentTimeline.ts index 8c3915d0c..7e5f1a67e 100644 --- a/src/serialization/types/CardPaymentTimeline.ts +++ b/src/serialization/types/CardPaymentTimeline.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CardPaymentTimeline: core.serialization.ObjectSchema< serializers.CardPaymentTimeline.Raw, @@ -17,8 +15,8 @@ export const CardPaymentTimeline: core.serialization.ObjectSchema< export declare namespace CardPaymentTimeline { export interface Raw { - authorized_at?: (string | null) | null; - captured_at?: (string | null) | null; - voided_at?: (string | null) | null; + authorized_at?: (string | null | undefined) | null; + captured_at?: (string | null | undefined) | null; + voided_at?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/CardPrepaidType.ts b/src/serialization/types/CardPrepaidType.ts index 5a5e94558..eebdb0bac 100644 --- a/src/serialization/types/CardPrepaidType.ts +++ b/src/serialization/types/CardPrepaidType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CardPrepaidType: core.serialization.Schema = core.serialization.enum_(["UNKNOWN_PREPAID_TYPE", "NOT_PREPAID", "PREPAID"]); diff --git a/src/serialization/types/CardType.ts b/src/serialization/types/CardType.ts index c3f72ee5a..ef4eca226 100644 --- a/src/serialization/types/CardType.ts +++ b/src/serialization/types/CardType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CardType: core.serialization.Schema = core.serialization.enum_([ "UNKNOWN_CARD_TYPE", diff --git a/src/serialization/types/CardUpdatedEvent.ts b/src/serialization/types/CardUpdatedEvent.ts index e5cd408bf..5167aae33 100644 --- a/src/serialization/types/CardUpdatedEvent.ts +++ b/src/serialization/types/CardUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardUpdatedEventData } from "./CardUpdatedEventData"; export const CardUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CardUpdatedEvent: core.serialization.ObjectSchema< export declare namespace CardUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CardUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/CardUpdatedEventData.ts b/src/serialization/types/CardUpdatedEventData.ts index 3cd16e1cb..b48693c00 100644 --- a/src/serialization/types/CardUpdatedEventData.ts +++ b/src/serialization/types/CardUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CardUpdatedEventObject } from "./CardUpdatedEventObject"; export const CardUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const CardUpdatedEventData: core.serialization.ObjectSchema< export declare namespace CardUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: CardUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/CardUpdatedEventObject.ts b/src/serialization/types/CardUpdatedEventObject.ts index 4609f9e56..30e2d5b3c 100644 --- a/src/serialization/types/CardUpdatedEventObject.ts +++ b/src/serialization/types/CardUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Card } from "./Card"; export const CardUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CashAppDetails.ts b/src/serialization/types/CashAppDetails.ts index 0697dd1c6..9c7b37738 100644 --- a/src/serialization/types/CashAppDetails.ts +++ b/src/serialization/types/CashAppDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CashAppDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -18,8 +16,8 @@ export const CashAppDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -50,10 +48,10 @@ export declare namespace CashDrawerShift { export interface Raw { id?: string | null; state?: CashDrawerShiftState.Raw | null; - opened_at?: (string | null) | null; - ended_at?: (string | null) | null; - closed_at?: (string | null) | null; - description?: (string | null) | null; + opened_at?: (string | null | undefined) | null; + ended_at?: (string | null | undefined) | null; + closed_at?: (string | null | undefined) | null; + description?: (string | null | undefined) | null; opened_cash_money?: Money.Raw | null; cash_payment_money?: Money.Raw | null; cash_refunds_money?: Money.Raw | null; diff --git a/src/serialization/types/CashDrawerShiftEvent.ts b/src/serialization/types/CashDrawerShiftEvent.ts index 985d7ba91..7bcaad054 100644 --- a/src/serialization/types/CashDrawerShiftEvent.ts +++ b/src/serialization/types/CashDrawerShiftEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CashDrawerEventType } from "./CashDrawerEventType"; import { Money } from "./Money"; @@ -26,7 +24,7 @@ export declare namespace CashDrawerShiftEvent { event_type?: CashDrawerEventType.Raw | null; event_money?: Money.Raw | null; created_at?: string | null; - description?: (string | null) | null; + description?: (string | null | undefined) | null; team_member_id?: string | null; } } diff --git a/src/serialization/types/CashDrawerShiftState.ts b/src/serialization/types/CashDrawerShiftState.ts index b12dcc804..46c7e776d 100644 --- a/src/serialization/types/CashDrawerShiftState.ts +++ b/src/serialization/types/CashDrawerShiftState.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CashDrawerShiftState: core.serialization.Schema< serializers.CashDrawerShiftState.Raw, diff --git a/src/serialization/types/CashDrawerShiftSummary.ts b/src/serialization/types/CashDrawerShiftSummary.ts index e9d476cac..0415c2b65 100644 --- a/src/serialization/types/CashDrawerShiftSummary.ts +++ b/src/serialization/types/CashDrawerShiftSummary.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CashDrawerShiftState } from "./CashDrawerShiftState"; import { Money } from "./Money"; @@ -30,10 +28,10 @@ export declare namespace CashDrawerShiftSummary { export interface Raw { id?: string | null; state?: CashDrawerShiftState.Raw | null; - opened_at?: (string | null) | null; - ended_at?: (string | null) | null; - closed_at?: (string | null) | null; - description?: (string | null) | null; + opened_at?: (string | null | undefined) | null; + ended_at?: (string | null | undefined) | null; + closed_at?: (string | null | undefined) | null; + description?: (string | null | undefined) | null; opened_cash_money?: Money.Raw | null; expected_cash_money?: Money.Raw | null; closed_cash_money?: Money.Raw | null; diff --git a/src/serialization/types/CashPaymentDetails.ts b/src/serialization/types/CashPaymentDetails.ts index 022fc849c..0a1e4bc3b 100644 --- a/src/serialization/types/CashPaymentDetails.ts +++ b/src/serialization/types/CashPaymentDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const CashPaymentDetails: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CatalogAvailabilityPeriod.ts b/src/serialization/types/CatalogAvailabilityPeriod.ts index c775afe16..5ca70bb86 100644 --- a/src/serialization/types/CatalogAvailabilityPeriod.ts +++ b/src/serialization/types/CatalogAvailabilityPeriod.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DayOfWeek } from "./DayOfWeek"; export const CatalogAvailabilityPeriod: core.serialization.ObjectSchema< @@ -18,8 +16,8 @@ export const CatalogAvailabilityPeriod: core.serialization.ObjectSchema< export declare namespace CatalogAvailabilityPeriod { export interface Raw { - start_local_time?: (string | null) | null; - end_local_time?: (string | null) | null; + start_local_time?: (string | null | undefined) | null; + end_local_time?: (string | null | undefined) | null; day_of_week?: DayOfWeek.Raw | null; } } diff --git a/src/serialization/types/CatalogCategory.ts b/src/serialization/types/CatalogCategory.ts index 98df942d4..e1306d82a 100644 --- a/src/serialization/types/CatalogCategory.ts +++ b/src/serialization/types/CatalogCategory.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { CatalogCategoryType } from "./CatalogCategoryType"; import { CatalogEcomSeoData } from "./CatalogEcomSeoData"; import { CategoryPathToRootNode } from "./CategoryPathToRootNode"; @@ -41,16 +39,16 @@ export const CatalogCategory: core.serialization.ObjectSchema = core.serialization.object({ @@ -23,12 +21,12 @@ export const CatalogDiscount: core.serialization.ObjectSchema = core.serialization.object({ @@ -19,9 +17,9 @@ export const CatalogImage: core.serialization.ObjectSchema = core.serialization.object({ @@ -76,30 +74,30 @@ export const CatalogItem: core.serialization.ObjectSchema = core.serialization.object({ @@ -25,13 +23,13 @@ export const CatalogModifier: core.serialization.ObjectSchema = core.serialization diff --git a/src/serialization/types/CatalogObjectAvailabilityPeriod.ts b/src/serialization/types/CatalogObjectAvailabilityPeriod.ts index cd9824124..a271c8108 100644 --- a/src/serialization/types/CatalogObjectAvailabilityPeriod.ts +++ b/src/serialization/types/CatalogObjectAvailabilityPeriod.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogAvailabilityPeriod } from "./CatalogAvailabilityPeriod"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectBase.ts b/src/serialization/types/CatalogObjectBase.ts index 05fba814b..853250d76 100644 --- a/src/serialization/types/CatalogObjectBase.ts +++ b/src/serialization/types/CatalogObjectBase.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogCustomAttributeValue } from "./CatalogCustomAttributeValue"; import { CatalogV1Id } from "./CatalogV1Id"; diff --git a/src/serialization/types/CatalogObjectBatch.ts b/src/serialization/types/CatalogObjectBatch.ts index 74f6e1640..269ae77d2 100644 --- a/src/serialization/types/CatalogObjectBatch.ts +++ b/src/serialization/types/CatalogObjectBatch.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; export const CatalogObjectBatch: core.serialization.ObjectSchema< serializers.CatalogObjectBatch.Raw, diff --git a/src/serialization/types/CatalogObjectCategory.ts b/src/serialization/types/CatalogObjectCategory.ts index f23ff7cb7..f1658535f 100644 --- a/src/serialization/types/CatalogObjectCategory.ts +++ b/src/serialization/types/CatalogObjectCategory.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { CatalogCustomAttributeValue } from "./CatalogCustomAttributeValue"; import { CatalogV1Id } from "./CatalogV1Id"; @@ -44,7 +42,7 @@ export const CatalogObjectCategory: core.serialization.ObjectSchema< export declare namespace CatalogObjectCategory { export interface Raw { id?: string | null; - ordinal?: ((bigint | number) | null) | null; + ordinal?: ((bigint | number) | null | undefined) | null; category_data?: serializers.CatalogCategory.Raw | null; updated_at?: string | null; version?: (bigint | number) | null; diff --git a/src/serialization/types/CatalogObjectCustomAttributeDefinition.ts b/src/serialization/types/CatalogObjectCustomAttributeDefinition.ts index d2857d7e0..cf4abb9e6 100644 --- a/src/serialization/types/CatalogObjectCustomAttributeDefinition.ts +++ b/src/serialization/types/CatalogObjectCustomAttributeDefinition.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogCustomAttributeDefinition } from "./CatalogCustomAttributeDefinition"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectDiscount.ts b/src/serialization/types/CatalogObjectDiscount.ts index 8fa372b7f..a2832788c 100644 --- a/src/serialization/types/CatalogObjectDiscount.ts +++ b/src/serialization/types/CatalogObjectDiscount.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogDiscount } from "./CatalogDiscount"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectImage.ts b/src/serialization/types/CatalogObjectImage.ts index 8fed46189..7a5773046 100644 --- a/src/serialization/types/CatalogObjectImage.ts +++ b/src/serialization/types/CatalogObjectImage.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogImage } from "./CatalogImage"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectItem.ts b/src/serialization/types/CatalogObjectItem.ts index b7b91e20f..832623eb1 100644 --- a/src/serialization/types/CatalogObjectItem.ts +++ b/src/serialization/types/CatalogObjectItem.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectItem: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CatalogObjectItemOption.ts b/src/serialization/types/CatalogObjectItemOption.ts index fa36313a8..f851abcf8 100644 --- a/src/serialization/types/CatalogObjectItemOption.ts +++ b/src/serialization/types/CatalogObjectItemOption.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectItemOption: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CatalogObjectItemOptionValue.ts b/src/serialization/types/CatalogObjectItemOptionValue.ts index 7326bfd59..8125c0cc4 100644 --- a/src/serialization/types/CatalogObjectItemOptionValue.ts +++ b/src/serialization/types/CatalogObjectItemOptionValue.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogItemOptionValue } from "./CatalogItemOptionValue"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectItemVariation.ts b/src/serialization/types/CatalogObjectItemVariation.ts index 88d8f4c80..1cb98082b 100644 --- a/src/serialization/types/CatalogObjectItemVariation.ts +++ b/src/serialization/types/CatalogObjectItemVariation.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogItemVariation } from "./CatalogItemVariation"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectMeasurementUnit.ts b/src/serialization/types/CatalogObjectMeasurementUnit.ts index 753f727e8..4df149203 100644 --- a/src/serialization/types/CatalogObjectMeasurementUnit.ts +++ b/src/serialization/types/CatalogObjectMeasurementUnit.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogMeasurementUnit } from "./CatalogMeasurementUnit"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectModifier.ts b/src/serialization/types/CatalogObjectModifier.ts index c2e146e43..50f92cc54 100644 --- a/src/serialization/types/CatalogObjectModifier.ts +++ b/src/serialization/types/CatalogObjectModifier.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogModifier } from "./CatalogModifier"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectModifierList.ts b/src/serialization/types/CatalogObjectModifierList.ts index 0e98634e9..eecb3708e 100644 --- a/src/serialization/types/CatalogObjectModifierList.ts +++ b/src/serialization/types/CatalogObjectModifierList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectModifierList: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CatalogObjectPricingRule.ts b/src/serialization/types/CatalogObjectPricingRule.ts index 442c3483c..27a2bf498 100644 --- a/src/serialization/types/CatalogObjectPricingRule.ts +++ b/src/serialization/types/CatalogObjectPricingRule.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { CatalogPricingRule } from "./CatalogPricingRule"; +import type * as serializers from "../index"; import { CatalogObjectBase } from "./CatalogObjectBase"; +import { CatalogPricingRule } from "./CatalogPricingRule"; export const CatalogObjectPricingRule: core.serialization.ObjectSchema< serializers.CatalogObjectPricingRule.Raw, diff --git a/src/serialization/types/CatalogObjectProductSet.ts b/src/serialization/types/CatalogObjectProductSet.ts index 862eda0e1..fb98de849 100644 --- a/src/serialization/types/CatalogObjectProductSet.ts +++ b/src/serialization/types/CatalogObjectProductSet.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { CatalogProductSet } from "./CatalogProductSet"; +import type * as serializers from "../index"; import { CatalogObjectBase } from "./CatalogObjectBase"; +import { CatalogProductSet } from "./CatalogProductSet"; export const CatalogObjectProductSet: core.serialization.ObjectSchema< serializers.CatalogObjectProductSet.Raw, diff --git a/src/serialization/types/CatalogObjectQuickAmountsSettings.ts b/src/serialization/types/CatalogObjectQuickAmountsSettings.ts index 34ca8497d..daba9dbf4 100644 --- a/src/serialization/types/CatalogObjectQuickAmountsSettings.ts +++ b/src/serialization/types/CatalogObjectQuickAmountsSettings.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { CatalogQuickAmountsSettings } from "./CatalogQuickAmountsSettings"; +import type * as serializers from "../index"; import { CatalogObjectBase } from "./CatalogObjectBase"; +import { CatalogQuickAmountsSettings } from "./CatalogQuickAmountsSettings"; export const CatalogObjectQuickAmountsSettings: core.serialization.ObjectSchema< serializers.CatalogObjectQuickAmountsSettings.Raw, diff --git a/src/serialization/types/CatalogObjectReference.ts b/src/serialization/types/CatalogObjectReference.ts index c7e20761c..1f7af7511 100644 --- a/src/serialization/types/CatalogObjectReference.ts +++ b/src/serialization/types/CatalogObjectReference.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogObjectReference: core.serialization.ObjectSchema< serializers.CatalogObjectReference.Raw, @@ -16,7 +14,7 @@ export const CatalogObjectReference: core.serialization.ObjectSchema< export declare namespace CatalogObjectReference { export interface Raw { - object_id?: (string | null) | null; - catalog_version?: ((bigint | number) | null) | null; + object_id?: (string | null | undefined) | null; + catalog_version?: ((bigint | number) | null | undefined) | null; } } diff --git a/src/serialization/types/CatalogObjectSubscriptionPlan.ts b/src/serialization/types/CatalogObjectSubscriptionPlan.ts index ac4fffc44..4003b3bb0 100644 --- a/src/serialization/types/CatalogObjectSubscriptionPlan.ts +++ b/src/serialization/types/CatalogObjectSubscriptionPlan.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectSubscriptionPlan: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CatalogObjectSubscriptionPlanVariation.ts b/src/serialization/types/CatalogObjectSubscriptionPlanVariation.ts index e21dca783..db285970f 100644 --- a/src/serialization/types/CatalogObjectSubscriptionPlanVariation.ts +++ b/src/serialization/types/CatalogObjectSubscriptionPlanVariation.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { CatalogSubscriptionPlanVariation } from "./CatalogSubscriptionPlanVariation"; +import type * as serializers from "../index"; import { CatalogObjectBase } from "./CatalogObjectBase"; +import { CatalogSubscriptionPlanVariation } from "./CatalogSubscriptionPlanVariation"; export const CatalogObjectSubscriptionPlanVariation: core.serialization.ObjectSchema< serializers.CatalogObjectSubscriptionPlanVariation.Raw, diff --git a/src/serialization/types/CatalogObjectTax.ts b/src/serialization/types/CatalogObjectTax.ts index 890d0cb15..9ab57722b 100644 --- a/src/serialization/types/CatalogObjectTax.ts +++ b/src/serialization/types/CatalogObjectTax.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { CatalogTax } from "./CatalogTax"; +import type * as serializers from "../index"; import { CatalogObjectBase } from "./CatalogObjectBase"; +import { CatalogTax } from "./CatalogTax"; export const CatalogObjectTax: core.serialization.ObjectSchema< serializers.CatalogObjectTax.Raw, diff --git a/src/serialization/types/CatalogObjectTimePeriod.ts b/src/serialization/types/CatalogObjectTimePeriod.ts index b199b9374..426ab397c 100644 --- a/src/serialization/types/CatalogObjectTimePeriod.ts +++ b/src/serialization/types/CatalogObjectTimePeriod.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { CatalogTimePeriod } from "./CatalogTimePeriod"; +import type * as serializers from "../index"; import { CatalogObjectBase } from "./CatalogObjectBase"; +import { CatalogTimePeriod } from "./CatalogTimePeriod"; export const CatalogObjectTimePeriod: core.serialization.ObjectSchema< serializers.CatalogObjectTimePeriod.Raw, diff --git a/src/serialization/types/CatalogObjectType.ts b/src/serialization/types/CatalogObjectType.ts index 178202e9d..44c6592f8 100644 --- a/src/serialization/types/CatalogObjectType.ts +++ b/src/serialization/types/CatalogObjectType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogObjectType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/CatalogPricingRule.ts b/src/serialization/types/CatalogPricingRule.ts index 083f32b61..cf835669c 100644 --- a/src/serialization/types/CatalogPricingRule.ts +++ b/src/serialization/types/CatalogPricingRule.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ExcludeStrategy } from "./ExcludeStrategy"; import { Money } from "./Money"; @@ -44,18 +42,18 @@ export const CatalogPricingRule: core.serialization.ObjectSchema< export declare namespace CatalogPricingRule { export interface Raw { - name?: (string | null) | null; - time_period_ids?: (string[] | null) | null; - discount_id?: (string | null) | null; - match_products_id?: (string | null) | null; - apply_products_id?: (string | null) | null; - exclude_products_id?: (string | null) | null; - valid_from_date?: (string | null) | null; - valid_from_local_time?: (string | null) | null; - valid_until_date?: (string | null) | null; - valid_until_local_time?: (string | null) | null; + name?: (string | null | undefined) | null; + time_period_ids?: (string[] | null | undefined) | null; + discount_id?: (string | null | undefined) | null; + match_products_id?: (string | null | undefined) | null; + apply_products_id?: (string | null | undefined) | null; + exclude_products_id?: (string | null | undefined) | null; + valid_from_date?: (string | null | undefined) | null; + valid_from_local_time?: (string | null | undefined) | null; + valid_until_date?: (string | null | undefined) | null; + valid_until_local_time?: (string | null | undefined) | null; exclude_strategy?: ExcludeStrategy.Raw | null; minimum_order_subtotal_money?: Money.Raw | null; - customer_group_ids_any?: (string[] | null) | null; + customer_group_ids_any?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/CatalogPricingType.ts b/src/serialization/types/CatalogPricingType.ts index 3a4a30619..aece42bd0 100644 --- a/src/serialization/types/CatalogPricingType.ts +++ b/src/serialization/types/CatalogPricingType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogPricingType: core.serialization.Schema< serializers.CatalogPricingType.Raw, diff --git a/src/serialization/types/CatalogProductSet.ts b/src/serialization/types/CatalogProductSet.ts index f8c98f1db..24c0cfc15 100644 --- a/src/serialization/types/CatalogProductSet.ts +++ b/src/serialization/types/CatalogProductSet.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogProductSet: core.serialization.ObjectSchema< serializers.CatalogProductSet.Raw, @@ -27,12 +25,12 @@ export const CatalogProductSet: core.serialization.ObjectSchema< export declare namespace CatalogProductSet { export interface Raw { - name?: (string | null) | null; - product_ids_any?: (string[] | null) | null; - product_ids_all?: (string[] | null) | null; - quantity_exact?: ((bigint | number) | null) | null; - quantity_min?: ((bigint | number) | null) | null; - quantity_max?: ((bigint | number) | null) | null; - all_products?: (boolean | null) | null; + name?: (string | null | undefined) | null; + product_ids_any?: (string[] | null | undefined) | null; + product_ids_all?: (string[] | null | undefined) | null; + quantity_exact?: ((bigint | number) | null | undefined) | null; + quantity_min?: ((bigint | number) | null | undefined) | null; + quantity_max?: ((bigint | number) | null | undefined) | null; + all_products?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/CatalogQuery.ts b/src/serialization/types/CatalogQuery.ts index 120ca5426..1680f801a 100644 --- a/src/serialization/types/CatalogQuery.ts +++ b/src/serialization/types/CatalogQuery.ts @@ -1,20 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { CatalogQuerySortedAttribute } from "./CatalogQuerySortedAttribute"; +import type * as serializers from "../index"; import { CatalogQueryExact } from "./CatalogQueryExact"; -import { CatalogQuerySet } from "./CatalogQuerySet"; +import { CatalogQueryItemsForItemOptions } from "./CatalogQueryItemsForItemOptions"; +import { CatalogQueryItemsForModifierList } from "./CatalogQueryItemsForModifierList"; +import { CatalogQueryItemsForTax } from "./CatalogQueryItemsForTax"; +import { CatalogQueryItemVariationsForItemOptionValues } from "./CatalogQueryItemVariationsForItemOptionValues"; import { CatalogQueryPrefix } from "./CatalogQueryPrefix"; import { CatalogQueryRange } from "./CatalogQueryRange"; +import { CatalogQuerySet } from "./CatalogQuerySet"; +import { CatalogQuerySortedAttribute } from "./CatalogQuerySortedAttribute"; import { CatalogQueryText } from "./CatalogQueryText"; -import { CatalogQueryItemsForTax } from "./CatalogQueryItemsForTax"; -import { CatalogQueryItemsForModifierList } from "./CatalogQueryItemsForModifierList"; -import { CatalogQueryItemsForItemOptions } from "./CatalogQueryItemsForItemOptions"; -import { CatalogQueryItemVariationsForItemOptionValues } from "./CatalogQueryItemVariationsForItemOptionValues"; export const CatalogQuery: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CatalogQueryExact.ts b/src/serialization/types/CatalogQueryExact.ts index 6e990610c..febdb6f60 100644 --- a/src/serialization/types/CatalogQueryExact.ts +++ b/src/serialization/types/CatalogQueryExact.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQueryExact: core.serialization.ObjectSchema< serializers.CatalogQueryExact.Raw, diff --git a/src/serialization/types/CatalogQueryItemVariationsForItemOptionValues.ts b/src/serialization/types/CatalogQueryItemVariationsForItemOptionValues.ts index 9c2698c6d..b73f1a714 100644 --- a/src/serialization/types/CatalogQueryItemVariationsForItemOptionValues.ts +++ b/src/serialization/types/CatalogQueryItemVariationsForItemOptionValues.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQueryItemVariationsForItemOptionValues: core.serialization.ObjectSchema< serializers.CatalogQueryItemVariationsForItemOptionValues.Raw, @@ -18,6 +16,6 @@ export const CatalogQueryItemVariationsForItemOptionValues: core.serialization.O export declare namespace CatalogQueryItemVariationsForItemOptionValues { export interface Raw { - item_option_value_ids?: (string[] | null) | null; + item_option_value_ids?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/CatalogQueryItemsForItemOptions.ts b/src/serialization/types/CatalogQueryItemsForItemOptions.ts index 820bc6bcd..b3339029a 100644 --- a/src/serialization/types/CatalogQueryItemsForItemOptions.ts +++ b/src/serialization/types/CatalogQueryItemsForItemOptions.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQueryItemsForItemOptions: core.serialization.ObjectSchema< serializers.CatalogQueryItemsForItemOptions.Raw, @@ -18,6 +16,6 @@ export const CatalogQueryItemsForItemOptions: core.serialization.ObjectSchema< export declare namespace CatalogQueryItemsForItemOptions { export interface Raw { - item_option_ids?: (string[] | null) | null; + item_option_ids?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/CatalogQueryItemsForModifierList.ts b/src/serialization/types/CatalogQueryItemsForModifierList.ts index bdf2752f9..a9521751d 100644 --- a/src/serialization/types/CatalogQueryItemsForModifierList.ts +++ b/src/serialization/types/CatalogQueryItemsForModifierList.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQueryItemsForModifierList: core.serialization.ObjectSchema< serializers.CatalogQueryItemsForModifierList.Raw, diff --git a/src/serialization/types/CatalogQueryItemsForTax.ts b/src/serialization/types/CatalogQueryItemsForTax.ts index de63f3cd6..d73362f4d 100644 --- a/src/serialization/types/CatalogQueryItemsForTax.ts +++ b/src/serialization/types/CatalogQueryItemsForTax.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQueryItemsForTax: core.serialization.ObjectSchema< serializers.CatalogQueryItemsForTax.Raw, diff --git a/src/serialization/types/CatalogQueryPrefix.ts b/src/serialization/types/CatalogQueryPrefix.ts index d3bb0198f..58691b750 100644 --- a/src/serialization/types/CatalogQueryPrefix.ts +++ b/src/serialization/types/CatalogQueryPrefix.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQueryPrefix: core.serialization.ObjectSchema< serializers.CatalogQueryPrefix.Raw, diff --git a/src/serialization/types/CatalogQueryRange.ts b/src/serialization/types/CatalogQueryRange.ts index 0a62d5286..94555a389 100644 --- a/src/serialization/types/CatalogQueryRange.ts +++ b/src/serialization/types/CatalogQueryRange.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQueryRange: core.serialization.ObjectSchema< serializers.CatalogQueryRange.Raw, @@ -24,7 +22,7 @@ export const CatalogQueryRange: core.serialization.ObjectSchema< export declare namespace CatalogQueryRange { export interface Raw { attribute_name: string; - attribute_min_value?: ((bigint | number) | null) | null; - attribute_max_value?: ((bigint | number) | null) | null; + attribute_min_value?: ((bigint | number) | null | undefined) | null; + attribute_max_value?: ((bigint | number) | null | undefined) | null; } } diff --git a/src/serialization/types/CatalogQuerySet.ts b/src/serialization/types/CatalogQuerySet.ts index 0c42e01f7..7e204e97e 100644 --- a/src/serialization/types/CatalogQuerySet.ts +++ b/src/serialization/types/CatalogQuerySet.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQuerySet: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CatalogQuerySortedAttribute.ts b/src/serialization/types/CatalogQuerySortedAttribute.ts index 5ff24ef07..fa27821f6 100644 --- a/src/serialization/types/CatalogQuerySortedAttribute.ts +++ b/src/serialization/types/CatalogQuerySortedAttribute.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SortOrder } from "./SortOrder"; export const CatalogQuerySortedAttribute: core.serialization.ObjectSchema< @@ -22,7 +20,7 @@ export const CatalogQuerySortedAttribute: core.serialization.ObjectSchema< export declare namespace CatalogQuerySortedAttribute { export interface Raw { attribute_name: string; - initial_attribute_value?: (string | null) | null; + initial_attribute_value?: (string | null | undefined) | null; sort_order?: SortOrder.Raw | null; } } diff --git a/src/serialization/types/CatalogQueryText.ts b/src/serialization/types/CatalogQueryText.ts index b94fc9a29..c1df4fece 100644 --- a/src/serialization/types/CatalogQueryText.ts +++ b/src/serialization/types/CatalogQueryText.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQueryText: core.serialization.ObjectSchema< serializers.CatalogQueryText.Raw, diff --git a/src/serialization/types/CatalogQuickAmount.ts b/src/serialization/types/CatalogQuickAmount.ts index 3ff6828ca..1e6fb21d8 100644 --- a/src/serialization/types/CatalogQuickAmount.ts +++ b/src/serialization/types/CatalogQuickAmount.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogQuickAmountType } from "./CatalogQuickAmountType"; import { Money } from "./Money"; @@ -22,7 +20,7 @@ export declare namespace CatalogQuickAmount { export interface Raw { type: CatalogQuickAmountType.Raw; amount: Money.Raw; - score?: ((bigint | number) | null) | null; - ordinal?: ((bigint | number) | null) | null; + score?: ((bigint | number) | null | undefined) | null; + ordinal?: ((bigint | number) | null | undefined) | null; } } diff --git a/src/serialization/types/CatalogQuickAmountType.ts b/src/serialization/types/CatalogQuickAmountType.ts index 10cbf99ae..4ae4644c3 100644 --- a/src/serialization/types/CatalogQuickAmountType.ts +++ b/src/serialization/types/CatalogQuickAmountType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQuickAmountType: core.serialization.Schema< serializers.CatalogQuickAmountType.Raw, diff --git a/src/serialization/types/CatalogQuickAmountsSettings.ts b/src/serialization/types/CatalogQuickAmountsSettings.ts index efe43eff6..3f8652de6 100644 --- a/src/serialization/types/CatalogQuickAmountsSettings.ts +++ b/src/serialization/types/CatalogQuickAmountsSettings.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { CatalogQuickAmountsSettingsOption } from "./CatalogQuickAmountsSettingsOption"; +import type * as serializers from "../index"; import { CatalogQuickAmount } from "./CatalogQuickAmount"; +import { CatalogQuickAmountsSettingsOption } from "./CatalogQuickAmountsSettingsOption"; export const CatalogQuickAmountsSettings: core.serialization.ObjectSchema< serializers.CatalogQuickAmountsSettings.Raw, @@ -23,7 +21,7 @@ export const CatalogQuickAmountsSettings: core.serialization.ObjectSchema< export declare namespace CatalogQuickAmountsSettings { export interface Raw { option: CatalogQuickAmountsSettingsOption.Raw; - eligible_for_auto_amounts?: (boolean | null) | null; - amounts?: (CatalogQuickAmount.Raw[] | null) | null; + eligible_for_auto_amounts?: (boolean | null | undefined) | null; + amounts?: (CatalogQuickAmount.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/CatalogQuickAmountsSettingsOption.ts b/src/serialization/types/CatalogQuickAmountsSettingsOption.ts index dc5cd9051..d07a1ec2b 100644 --- a/src/serialization/types/CatalogQuickAmountsSettingsOption.ts +++ b/src/serialization/types/CatalogQuickAmountsSettingsOption.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogQuickAmountsSettingsOption: core.serialization.Schema< serializers.CatalogQuickAmountsSettingsOption.Raw, diff --git a/src/serialization/types/CatalogStockConversion.ts b/src/serialization/types/CatalogStockConversion.ts index 365449418..7a3f0ddf1 100644 --- a/src/serialization/types/CatalogStockConversion.ts +++ b/src/serialization/types/CatalogStockConversion.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CatalogStockConversion: core.serialization.ObjectSchema< serializers.CatalogStockConversion.Raw, diff --git a/src/serialization/types/CatalogSubscriptionPlan.ts b/src/serialization/types/CatalogSubscriptionPlan.ts index 189e4b302..ce76273c3 100644 --- a/src/serialization/types/CatalogSubscriptionPlan.ts +++ b/src/serialization/types/CatalogSubscriptionPlan.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { SubscriptionPhase } from "./SubscriptionPhase"; export const CatalogSubscriptionPlan: core.serialization.ObjectSchema< @@ -31,10 +29,10 @@ export const CatalogSubscriptionPlan: core.serialization.ObjectSchema< export declare namespace CatalogSubscriptionPlan { export interface Raw { name: string; - phases?: (SubscriptionPhase.Raw[] | null) | null; - subscription_plan_variations?: (serializers.CatalogObject.Raw[] | null) | null; - eligible_item_ids?: (string[] | null) | null; - eligible_category_ids?: (string[] | null) | null; - all_items?: (boolean | null) | null; + phases?: (SubscriptionPhase.Raw[] | null | undefined) | null; + subscription_plan_variations?: (serializers.CatalogObject.Raw[] | null | undefined) | null; + eligible_item_ids?: (string[] | null | undefined) | null; + eligible_category_ids?: (string[] | null | undefined) | null; + all_items?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/CatalogSubscriptionPlanVariation.ts b/src/serialization/types/CatalogSubscriptionPlanVariation.ts index 0a5fb2298..2a080f2bb 100644 --- a/src/serialization/types/CatalogSubscriptionPlanVariation.ts +++ b/src/serialization/types/CatalogSubscriptionPlanVariation.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SubscriptionPhase } from "./SubscriptionPhase"; export const CatalogSubscriptionPlanVariation: core.serialization.ObjectSchema< @@ -32,9 +30,9 @@ export declare namespace CatalogSubscriptionPlanVariation { export interface Raw { name: string; phases: SubscriptionPhase.Raw[]; - subscription_plan_id?: (string | null) | null; - monthly_billing_anchor_date?: ((bigint | number) | null) | null; - can_prorate?: (boolean | null) | null; - successor_plan_variation_id?: (string | null) | null; + subscription_plan_id?: (string | null | undefined) | null; + monthly_billing_anchor_date?: ((bigint | number) | null | undefined) | null; + can_prorate?: (boolean | null | undefined) | null; + successor_plan_variation_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/CatalogTax.ts b/src/serialization/types/CatalogTax.ts index be8da258b..9e27bccd9 100644 --- a/src/serialization/types/CatalogTax.ts +++ b/src/serialization/types/CatalogTax.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TaxCalculationPhase } from "./TaxCalculationPhase"; import { TaxInclusionType } from "./TaxInclusionType"; @@ -27,12 +25,12 @@ export const CatalogTax: core.serialization.ObjectSchema = core.serialization.object({ @@ -14,7 +12,7 @@ export const CatalogV1Id: core.serialization.ObjectSchema = core.serialization.enum_(["IMMEDIATE", "END_OF_BILLING_CYCLE"]); diff --git a/src/serialization/types/Channel.ts b/src/serialization/types/Channel.ts index d4d8dd500..569e21a3d 100644 --- a/src/serialization/types/Channel.ts +++ b/src/serialization/types/Channel.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Reference } from "./Reference"; +import type * as serializers from "../index"; import { ChannelStatus } from "./ChannelStatus"; +import { Reference } from "./Reference"; export const Channel: core.serialization.ObjectSchema = core.serialization.object({ @@ -24,7 +22,7 @@ export declare namespace Channel { export interface Raw { id?: string | null; merchant_id?: string | null; - name?: (string | null) | null; + name?: (string | null | undefined) | null; version?: number | null; reference?: Reference.Raw | null; status?: ChannelStatus.Raw | null; diff --git a/src/serialization/types/ChannelStatus.ts b/src/serialization/types/ChannelStatus.ts index 18bb0c931..48c3ab100 100644 --- a/src/serialization/types/ChannelStatus.ts +++ b/src/serialization/types/ChannelStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ChannelStatus: core.serialization.Schema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/ChargeRequestAdditionalRecipient.ts b/src/serialization/types/ChargeRequestAdditionalRecipient.ts index 7da0d9bbe..eba44d6a4 100644 --- a/src/serialization/types/ChargeRequestAdditionalRecipient.ts +++ b/src/serialization/types/ChargeRequestAdditionalRecipient.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const ChargeRequestAdditionalRecipient: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Checkout.ts b/src/serialization/types/Checkout.ts index af318ff29..123e60b30 100644 --- a/src/serialization/types/Checkout.ts +++ b/src/serialization/types/Checkout.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; +import { AdditionalRecipient } from "./AdditionalRecipient"; import { Address } from "./Address"; import { Order } from "./Order"; -import { AdditionalRecipient } from "./AdditionalRecipient"; export const Checkout: core.serialization.ObjectSchema = core.serialization.object({ @@ -41,14 +39,14 @@ export const Checkout: core.serialization.ObjectSchema = core.serialization.object({ @@ -13,6 +11,6 @@ export const ClearpayDetails: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CompletePaymentResponse.ts b/src/serialization/types/CompletePaymentResponse.ts index ad790d62a..5119395a1 100644 --- a/src/serialization/types/CompletePaymentResponse.ts +++ b/src/serialization/types/CompletePaymentResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Payment } from "./Payment"; diff --git a/src/serialization/types/Component.ts b/src/serialization/types/Component.ts index 18d3c09e9..0d7da3cf9 100644 --- a/src/serialization/types/Component.ts +++ b/src/serialization/types/Component.ts @@ -1,16 +1,14 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ComponentComponentType } from "./ComponentComponentType"; import { DeviceComponentDetailsApplicationDetails } from "./DeviceComponentDetailsApplicationDetails"; -import { DeviceComponentDetailsCardReaderDetails } from "./DeviceComponentDetailsCardReaderDetails"; import { DeviceComponentDetailsBatteryDetails } from "./DeviceComponentDetailsBatteryDetails"; -import { DeviceComponentDetailsWiFiDetails } from "./DeviceComponentDetailsWiFiDetails"; +import { DeviceComponentDetailsCardReaderDetails } from "./DeviceComponentDetailsCardReaderDetails"; import { DeviceComponentDetailsEthernetDetails } from "./DeviceComponentDetailsEthernetDetails"; +import { DeviceComponentDetailsWiFiDetails } from "./DeviceComponentDetailsWiFiDetails"; export const Component: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/ComponentComponentType.ts b/src/serialization/types/ComponentComponentType.ts index fab0e16b3..b5ea5779b 100644 --- a/src/serialization/types/ComponentComponentType.ts +++ b/src/serialization/types/ComponentComponentType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ComponentComponentType: core.serialization.Schema< serializers.ComponentComponentType.Raw, diff --git a/src/serialization/types/ConfirmationDecision.ts b/src/serialization/types/ConfirmationDecision.ts index d857306bd..79f0b898e 100644 --- a/src/serialization/types/ConfirmationDecision.ts +++ b/src/serialization/types/ConfirmationDecision.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ConfirmationDecision: core.serialization.ObjectSchema< serializers.ConfirmationDecision.Raw, diff --git a/src/serialization/types/ConfirmationOptions.ts b/src/serialization/types/ConfirmationOptions.ts index 285a1f77f..a7c2e989c 100644 --- a/src/serialization/types/ConfirmationOptions.ts +++ b/src/serialization/types/ConfirmationOptions.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ConfirmationDecision } from "./ConfirmationDecision"; export const ConfirmationOptions: core.serialization.ObjectSchema< @@ -26,7 +24,7 @@ export declare namespace ConfirmationOptions { title: string; body: string; agree_button_text: string; - disagree_button_text?: (string | null) | null; + disagree_button_text?: (string | null | undefined) | null; decision?: ConfirmationDecision.Raw | null; } } diff --git a/src/serialization/types/Coordinates.ts b/src/serialization/types/Coordinates.ts index aeb171690..35acb4fa7 100644 --- a/src/serialization/types/Coordinates.ts +++ b/src/serialization/types/Coordinates.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Coordinates: core.serialization.ObjectSchema = core.serialization.object({ @@ -14,7 +12,7 @@ export const Coordinates: core.serialization.ObjectSchema = core.serialization.enum_([ "ZZ", diff --git a/src/serialization/types/CreateBookingCustomAttributeDefinitionResponse.ts b/src/serialization/types/CreateBookingCustomAttributeDefinitionResponse.ts index 39c595962..f736c596f 100644 --- a/src/serialization/types/CreateBookingCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/CreateBookingCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateBookingResponse.ts b/src/serialization/types/CreateBookingResponse.ts index 6bf71e49a..0b1cf8a0a 100644 --- a/src/serialization/types/CreateBookingResponse.ts +++ b/src/serialization/types/CreateBookingResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Booking } from "./Booking"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateBreakTypeResponse.ts b/src/serialization/types/CreateBreakTypeResponse.ts index 8abe550a8..9a3ad9201 100644 --- a/src/serialization/types/CreateBreakTypeResponse.ts +++ b/src/serialization/types/CreateBreakTypeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BreakType } from "./BreakType"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateCardResponse.ts b/src/serialization/types/CreateCardResponse.ts index 374cd9d34..a00625cdf 100644 --- a/src/serialization/types/CreateCardResponse.ts +++ b/src/serialization/types/CreateCardResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Card } from "./Card"; +import { Error_ } from "./Error_"; export const CreateCardResponse: core.serialization.ObjectSchema< serializers.CreateCardResponse.Raw, diff --git a/src/serialization/types/CreateCatalogImageRequest.ts b/src/serialization/types/CreateCatalogImageRequest.ts index 861ed5f4a..0ce50617c 100644 --- a/src/serialization/types/CreateCatalogImageRequest.ts +++ b/src/serialization/types/CreateCatalogImageRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; export const CreateCatalogImageRequest: core.serialization.ObjectSchema< serializers.CreateCatalogImageRequest.Raw, diff --git a/src/serialization/types/CreateCatalogImageResponse.ts b/src/serialization/types/CreateCatalogImageResponse.ts index 9dd799d61..e58a072d4 100644 --- a/src/serialization/types/CreateCatalogImageResponse.ts +++ b/src/serialization/types/CreateCatalogImageResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { Error_ } from "./Error_"; export const CreateCatalogImageResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CreateCheckoutResponse.ts b/src/serialization/types/CreateCheckoutResponse.ts index 9eb703880..0781dc5b9 100644 --- a/src/serialization/types/CreateCheckoutResponse.ts +++ b/src/serialization/types/CreateCheckoutResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Checkout } from "./Checkout"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateCustomerCardResponse.ts b/src/serialization/types/CreateCustomerCardResponse.ts index 8449b3850..96e3358d7 100644 --- a/src/serialization/types/CreateCustomerCardResponse.ts +++ b/src/serialization/types/CreateCustomerCardResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Card } from "./Card"; +import { Error_ } from "./Error_"; export const CreateCustomerCardResponse: core.serialization.ObjectSchema< serializers.CreateCustomerCardResponse.Raw, diff --git a/src/serialization/types/CreateCustomerCustomAttributeDefinitionResponse.ts b/src/serialization/types/CreateCustomerCustomAttributeDefinitionResponse.ts index 2b97ef4b6..9a8f7a1a8 100644 --- a/src/serialization/types/CreateCustomerCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/CreateCustomerCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateCustomerGroupResponse.ts b/src/serialization/types/CreateCustomerGroupResponse.ts index 40cf55199..26b0ddca5 100644 --- a/src/serialization/types/CreateCustomerGroupResponse.ts +++ b/src/serialization/types/CreateCustomerGroupResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { CustomerGroup } from "./CustomerGroup"; +import { Error_ } from "./Error_"; export const CreateCustomerGroupResponse: core.serialization.ObjectSchema< serializers.CreateCustomerGroupResponse.Raw, diff --git a/src/serialization/types/CreateCustomerResponse.ts b/src/serialization/types/CreateCustomerResponse.ts index 6d01d42c7..007731dbf 100644 --- a/src/serialization/types/CreateCustomerResponse.ts +++ b/src/serialization/types/CreateCustomerResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Customer } from "./Customer"; +import { Error_ } from "./Error_"; export const CreateCustomerResponse: core.serialization.ObjectSchema< serializers.CreateCustomerResponse.Raw, diff --git a/src/serialization/types/CreateDeviceCodeResponse.ts b/src/serialization/types/CreateDeviceCodeResponse.ts index ce85dd674..841008250 100644 --- a/src/serialization/types/CreateDeviceCodeResponse.ts +++ b/src/serialization/types/CreateDeviceCodeResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { DeviceCode } from "./DeviceCode"; +import { Error_ } from "./Error_"; export const CreateDeviceCodeResponse: core.serialization.ObjectSchema< serializers.CreateDeviceCodeResponse.Raw, diff --git a/src/serialization/types/CreateDisputeEvidenceFileRequest.ts b/src/serialization/types/CreateDisputeEvidenceFileRequest.ts index 1d3fca2bf..b50f73445 100644 --- a/src/serialization/types/CreateDisputeEvidenceFileRequest.ts +++ b/src/serialization/types/CreateDisputeEvidenceFileRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DisputeEvidenceType } from "./DisputeEvidenceType"; export const CreateDisputeEvidenceFileRequest: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CreateDisputeEvidenceFileResponse.ts b/src/serialization/types/CreateDisputeEvidenceFileResponse.ts index 38f77d069..c23f6806a 100644 --- a/src/serialization/types/CreateDisputeEvidenceFileResponse.ts +++ b/src/serialization/types/CreateDisputeEvidenceFileResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { DisputeEvidence } from "./DisputeEvidence"; +import { Error_ } from "./Error_"; export const CreateDisputeEvidenceFileResponse: core.serialization.ObjectSchema< serializers.CreateDisputeEvidenceFileResponse.Raw, diff --git a/src/serialization/types/CreateDisputeEvidenceTextResponse.ts b/src/serialization/types/CreateDisputeEvidenceTextResponse.ts index 9e278727c..655b4a400 100644 --- a/src/serialization/types/CreateDisputeEvidenceTextResponse.ts +++ b/src/serialization/types/CreateDisputeEvidenceTextResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { DisputeEvidence } from "./DisputeEvidence"; +import { Error_ } from "./Error_"; export const CreateDisputeEvidenceTextResponse: core.serialization.ObjectSchema< serializers.CreateDisputeEvidenceTextResponse.Raw, diff --git a/src/serialization/types/CreateGiftCardActivityResponse.ts b/src/serialization/types/CreateGiftCardActivityResponse.ts index dd25beb58..d98a93f35 100644 --- a/src/serialization/types/CreateGiftCardActivityResponse.ts +++ b/src/serialization/types/CreateGiftCardActivityResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCardActivity } from "./GiftCardActivity"; diff --git a/src/serialization/types/CreateGiftCardResponse.ts b/src/serialization/types/CreateGiftCardResponse.ts index 441867d59..dcc4ec22d 100644 --- a/src/serialization/types/CreateGiftCardResponse.ts +++ b/src/serialization/types/CreateGiftCardResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCard } from "./GiftCard"; diff --git a/src/serialization/types/CreateInvoiceAttachmentRequestData.ts b/src/serialization/types/CreateInvoiceAttachmentRequestData.ts index 56bd40f1e..0a8a1d03c 100644 --- a/src/serialization/types/CreateInvoiceAttachmentRequestData.ts +++ b/src/serialization/types/CreateInvoiceAttachmentRequestData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CreateInvoiceAttachmentRequestData: core.serialization.ObjectSchema< serializers.CreateInvoiceAttachmentRequestData.Raw, diff --git a/src/serialization/types/CreateInvoiceAttachmentResponse.ts b/src/serialization/types/CreateInvoiceAttachmentResponse.ts index b5f7e474d..b7c85d500 100644 --- a/src/serialization/types/CreateInvoiceAttachmentResponse.ts +++ b/src/serialization/types/CreateInvoiceAttachmentResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { InvoiceAttachment } from "./InvoiceAttachment"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { InvoiceAttachment } from "./InvoiceAttachment"; export const CreateInvoiceAttachmentResponse: core.serialization.ObjectSchema< serializers.CreateInvoiceAttachmentResponse.Raw, diff --git a/src/serialization/types/CreateInvoiceResponse.ts b/src/serialization/types/CreateInvoiceResponse.ts index 30246acab..260b07be1 100644 --- a/src/serialization/types/CreateInvoiceResponse.ts +++ b/src/serialization/types/CreateInvoiceResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Invoice } from "./Invoice"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Invoice } from "./Invoice"; export const CreateInvoiceResponse: core.serialization.ObjectSchema< serializers.CreateInvoiceResponse.Raw, diff --git a/src/serialization/types/CreateJobResponse.ts b/src/serialization/types/CreateJobResponse.ts index 8d8376f63..a322653c8 100644 --- a/src/serialization/types/CreateJobResponse.ts +++ b/src/serialization/types/CreateJobResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Job } from "./Job"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Job } from "./Job"; export const CreateJobResponse: core.serialization.ObjectSchema< serializers.CreateJobResponse.Raw, diff --git a/src/serialization/types/CreateLocationCustomAttributeDefinitionResponse.ts b/src/serialization/types/CreateLocationCustomAttributeDefinitionResponse.ts index ff829065c..b178be0be 100644 --- a/src/serialization/types/CreateLocationCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/CreateLocationCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateLocationResponse.ts b/src/serialization/types/CreateLocationResponse.ts index d4a35dbc3..f1c2a7908 100644 --- a/src/serialization/types/CreateLocationResponse.ts +++ b/src/serialization/types/CreateLocationResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Location } from "./Location"; diff --git a/src/serialization/types/CreateLoyaltyAccountResponse.ts b/src/serialization/types/CreateLoyaltyAccountResponse.ts index 719616e98..cca5d2218 100644 --- a/src/serialization/types/CreateLoyaltyAccountResponse.ts +++ b/src/serialization/types/CreateLoyaltyAccountResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyAccount } from "./LoyaltyAccount"; diff --git a/src/serialization/types/CreateLoyaltyPromotionResponse.ts b/src/serialization/types/CreateLoyaltyPromotionResponse.ts index 3bb2dea21..d0d562080 100644 --- a/src/serialization/types/CreateLoyaltyPromotionResponse.ts +++ b/src/serialization/types/CreateLoyaltyPromotionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyPromotion } from "./LoyaltyPromotion"; diff --git a/src/serialization/types/CreateLoyaltyRewardResponse.ts b/src/serialization/types/CreateLoyaltyRewardResponse.ts index fd4404dbd..7c0bda76d 100644 --- a/src/serialization/types/CreateLoyaltyRewardResponse.ts +++ b/src/serialization/types/CreateLoyaltyRewardResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyReward } from "./LoyaltyReward"; diff --git a/src/serialization/types/CreateMerchantCustomAttributeDefinitionResponse.ts b/src/serialization/types/CreateMerchantCustomAttributeDefinitionResponse.ts index 6fa86f3f4..3196ce6f0 100644 --- a/src/serialization/types/CreateMerchantCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/CreateMerchantCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateMobileAuthorizationCodeResponse.ts b/src/serialization/types/CreateMobileAuthorizationCodeResponse.ts index 9e00f3fab..e61b7baf9 100644 --- a/src/serialization/types/CreateMobileAuthorizationCodeResponse.ts +++ b/src/serialization/types/CreateMobileAuthorizationCodeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const CreateMobileAuthorizationCodeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CreateOrderCustomAttributeDefinitionResponse.ts b/src/serialization/types/CreateOrderCustomAttributeDefinitionResponse.ts index 0c269b0d2..d8eecf673 100644 --- a/src/serialization/types/CreateOrderCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/CreateOrderCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateOrderRequest.ts b/src/serialization/types/CreateOrderRequest.ts index 97b072a82..cb813a188 100644 --- a/src/serialization/types/CreateOrderRequest.ts +++ b/src/serialization/types/CreateOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Order } from "./Order"; export const CreateOrderRequest: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CreateOrderResponse.ts b/src/serialization/types/CreateOrderResponse.ts index 3cdc089b7..5685b52d1 100644 --- a/src/serialization/types/CreateOrderResponse.ts +++ b/src/serialization/types/CreateOrderResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Order } from "./Order"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Order } from "./Order"; export const CreateOrderResponse: core.serialization.ObjectSchema< serializers.CreateOrderResponse.Raw, diff --git a/src/serialization/types/CreatePaymentLinkResponse.ts b/src/serialization/types/CreatePaymentLinkResponse.ts index e56b6d267..a4d54090e 100644 --- a/src/serialization/types/CreatePaymentLinkResponse.ts +++ b/src/serialization/types/CreatePaymentLinkResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentLink } from "./PaymentLink"; import { PaymentLinkRelatedResources } from "./PaymentLinkRelatedResources"; diff --git a/src/serialization/types/CreatePaymentResponse.ts b/src/serialization/types/CreatePaymentResponse.ts index 5ab32549a..b5bd438f1 100644 --- a/src/serialization/types/CreatePaymentResponse.ts +++ b/src/serialization/types/CreatePaymentResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Payment } from "./Payment"; diff --git a/src/serialization/types/CreateScheduledShiftResponse.ts b/src/serialization/types/CreateScheduledShiftResponse.ts index 6fa3bebf9..2e921021a 100644 --- a/src/serialization/types/CreateScheduledShiftResponse.ts +++ b/src/serialization/types/CreateScheduledShiftResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { ScheduledShift } from "./ScheduledShift"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { ScheduledShift } from "./ScheduledShift"; export const CreateScheduledShiftResponse: core.serialization.ObjectSchema< serializers.CreateScheduledShiftResponse.Raw, diff --git a/src/serialization/types/CreateShiftResponse.ts b/src/serialization/types/CreateShiftResponse.ts index 367047732..354767de3 100644 --- a/src/serialization/types/CreateShiftResponse.ts +++ b/src/serialization/types/CreateShiftResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Shift } from "./Shift"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Shift } from "./Shift"; export const CreateShiftResponse: core.serialization.ObjectSchema< serializers.CreateShiftResponse.Raw, diff --git a/src/serialization/types/CreateSubscriptionResponse.ts b/src/serialization/types/CreateSubscriptionResponse.ts index 925fff48a..6e876b2cc 100644 --- a/src/serialization/types/CreateSubscriptionResponse.ts +++ b/src/serialization/types/CreateSubscriptionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; diff --git a/src/serialization/types/CreateTeamMemberRequest.ts b/src/serialization/types/CreateTeamMemberRequest.ts index 2dfc3ea28..7967b9171 100644 --- a/src/serialization/types/CreateTeamMemberRequest.ts +++ b/src/serialization/types/CreateTeamMemberRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TeamMember } from "./TeamMember"; export const CreateTeamMemberRequest: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CreateTeamMemberResponse.ts b/src/serialization/types/CreateTeamMemberResponse.ts index 817631b00..9516b41a3 100644 --- a/src/serialization/types/CreateTeamMemberResponse.ts +++ b/src/serialization/types/CreateTeamMemberResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TeamMember } from "./TeamMember"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { TeamMember } from "./TeamMember"; export const CreateTeamMemberResponse: core.serialization.ObjectSchema< serializers.CreateTeamMemberResponse.Raw, diff --git a/src/serialization/types/CreateTerminalActionResponse.ts b/src/serialization/types/CreateTerminalActionResponse.ts index 10002c68c..5aa87eae1 100644 --- a/src/serialization/types/CreateTerminalActionResponse.ts +++ b/src/serialization/types/CreateTerminalActionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalAction } from "./TerminalAction"; diff --git a/src/serialization/types/CreateTerminalCheckoutResponse.ts b/src/serialization/types/CreateTerminalCheckoutResponse.ts index 7c30fb814..1c1790627 100644 --- a/src/serialization/types/CreateTerminalCheckoutResponse.ts +++ b/src/serialization/types/CreateTerminalCheckoutResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalCheckout } from "./TerminalCheckout"; diff --git a/src/serialization/types/CreateTerminalRefundResponse.ts b/src/serialization/types/CreateTerminalRefundResponse.ts index 028548ff9..b6b564231 100644 --- a/src/serialization/types/CreateTerminalRefundResponse.ts +++ b/src/serialization/types/CreateTerminalRefundResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalRefund } from "./TerminalRefund"; diff --git a/src/serialization/types/CreateTimecardResponse.ts b/src/serialization/types/CreateTimecardResponse.ts index 6b9d87ec4..e80f43f83 100644 --- a/src/serialization/types/CreateTimecardResponse.ts +++ b/src/serialization/types/CreateTimecardResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Timecard } from "./Timecard"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Timecard } from "./Timecard"; export const CreateTimecardResponse: core.serialization.ObjectSchema< serializers.CreateTimecardResponse.Raw, diff --git a/src/serialization/types/CreateTransferOrderData.ts b/src/serialization/types/CreateTransferOrderData.ts index d87af9b3d..0acd46cc4 100644 --- a/src/serialization/types/CreateTransferOrderData.ts +++ b/src/serialization/types/CreateTransferOrderData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CreateTransferOrderLineData } from "./CreateTransferOrderLineData"; export const CreateTransferOrderData: core.serialization.ObjectSchema< @@ -30,10 +28,10 @@ export declare namespace CreateTransferOrderData { export interface Raw { source_location_id: string; destination_location_id: string; - expected_at?: (string | null) | null; - notes?: (string | null) | null; - tracking_number?: (string | null) | null; - created_by_team_member_id?: (string | null) | null; - line_items?: (CreateTransferOrderLineData.Raw[] | null) | null; + expected_at?: (string | null | undefined) | null; + notes?: (string | null | undefined) | null; + tracking_number?: (string | null | undefined) | null; + created_by_team_member_id?: (string | null | undefined) | null; + line_items?: (CreateTransferOrderLineData.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/CreateTransferOrderLineData.ts b/src/serialization/types/CreateTransferOrderLineData.ts index 5819787be..f3334035e 100644 --- a/src/serialization/types/CreateTransferOrderLineData.ts +++ b/src/serialization/types/CreateTransferOrderLineData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CreateTransferOrderLineData: core.serialization.ObjectSchema< serializers.CreateTransferOrderLineData.Raw, diff --git a/src/serialization/types/CreateTransferOrderResponse.ts b/src/serialization/types/CreateTransferOrderResponse.ts index f6e02796d..a23c988e7 100644 --- a/src/serialization/types/CreateTransferOrderResponse.ts +++ b/src/serialization/types/CreateTransferOrderResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TransferOrder } from "./TransferOrder"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { TransferOrder } from "./TransferOrder"; export const CreateTransferOrderResponse: core.serialization.ObjectSchema< serializers.CreateTransferOrderResponse.Raw, diff --git a/src/serialization/types/CreateVendorResponse.ts b/src/serialization/types/CreateVendorResponse.ts index eb5ee83a0..5ba661c51 100644 --- a/src/serialization/types/CreateVendorResponse.ts +++ b/src/serialization/types/CreateVendorResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Vendor } from "./Vendor"; diff --git a/src/serialization/types/CreateWebhookSubscriptionResponse.ts b/src/serialization/types/CreateWebhookSubscriptionResponse.ts index 3d7ae7166..ac3b2e724 100644 --- a/src/serialization/types/CreateWebhookSubscriptionResponse.ts +++ b/src/serialization/types/CreateWebhookSubscriptionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { WebhookSubscription } from "./WebhookSubscription"; diff --git a/src/serialization/types/Currency.ts b/src/serialization/types/Currency.ts index 4842418f9..1c159ecb7 100644 --- a/src/serialization/types/Currency.ts +++ b/src/serialization/types/Currency.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Currency: core.serialization.Schema = core.serialization.enum_([ "UNKNOWN_CURRENCY", diff --git a/src/serialization/types/CustomAttribute.ts b/src/serialization/types/CustomAttribute.ts index 2f671981f..fc02580fc 100644 --- a/src/serialization/types/CustomAttribute.ts +++ b/src/serialization/types/CustomAttribute.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { CustomAttributeDefinitionVisibility } from "./CustomAttributeDefinitionVisibility"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; +import { CustomAttributeDefinitionVisibility } from "./CustomAttributeDefinitionVisibility"; export const CustomAttribute: core.serialization.ObjectSchema = core.serialization.object({ @@ -21,8 +19,8 @@ export const CustomAttribute: core.serialization.ObjectSchema | null) | null; - name?: (string | null) | null; - description?: (string | null) | null; + key?: (string | null | undefined) | null; + schema?: (Record | null | undefined) | null; + name?: (string | null | undefined) | null; + description?: (string | null | undefined) | null; visibility?: CustomAttributeDefinitionVisibility.Raw | null; version?: number | null; updated_at?: string | null; diff --git a/src/serialization/types/CustomAttributeDefinitionEventData.ts b/src/serialization/types/CustomAttributeDefinitionEventData.ts index c18b9bfa7..ffec2b90b 100644 --- a/src/serialization/types/CustomAttributeDefinitionEventData.ts +++ b/src/serialization/types/CustomAttributeDefinitionEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventDataObject } from "./CustomAttributeDefinitionEventDataObject"; export const CustomAttributeDefinitionEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const CustomAttributeDefinitionEventData: core.serialization.ObjectSchema export declare namespace CustomAttributeDefinitionEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: CustomAttributeDefinitionEventDataObject.Raw | null; } diff --git a/src/serialization/types/CustomAttributeDefinitionEventDataObject.ts b/src/serialization/types/CustomAttributeDefinitionEventDataObject.ts index 29edfb185..d521bf1b6 100644 --- a/src/serialization/types/CustomAttributeDefinitionEventDataObject.ts +++ b/src/serialization/types/CustomAttributeDefinitionEventDataObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; export const CustomAttributeDefinitionEventDataObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CustomAttributeDefinitionVisibility.ts b/src/serialization/types/CustomAttributeDefinitionVisibility.ts index 09e71c424..32f251a78 100644 --- a/src/serialization/types/CustomAttributeDefinitionVisibility.ts +++ b/src/serialization/types/CustomAttributeDefinitionVisibility.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomAttributeDefinitionVisibility: core.serialization.Schema< serializers.CustomAttributeDefinitionVisibility.Raw, diff --git a/src/serialization/types/CustomAttributeEventData.ts b/src/serialization/types/CustomAttributeEventData.ts index 7b5a892d1..ee77b9e2f 100644 --- a/src/serialization/types/CustomAttributeEventData.ts +++ b/src/serialization/types/CustomAttributeEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventDataObject } from "./CustomAttributeEventDataObject"; export const CustomAttributeEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const CustomAttributeEventData: core.serialization.ObjectSchema< export declare namespace CustomAttributeEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: CustomAttributeEventDataObject.Raw | null; } diff --git a/src/serialization/types/CustomAttributeEventDataObject.ts b/src/serialization/types/CustomAttributeEventDataObject.ts index f67e51e7f..3eab1b327 100644 --- a/src/serialization/types/CustomAttributeEventDataObject.ts +++ b/src/serialization/types/CustomAttributeEventDataObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const CustomAttributeEventDataObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CustomAttributeFilter.ts b/src/serialization/types/CustomAttributeFilter.ts index 9e6d947af..bf54888a6 100644 --- a/src/serialization/types/CustomAttributeFilter.ts +++ b/src/serialization/types/CustomAttributeFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Range } from "./Range"; export const CustomAttributeFilter: core.serialization.ObjectSchema< @@ -27,11 +25,11 @@ export const CustomAttributeFilter: core.serialization.ObjectSchema< export declare namespace CustomAttributeFilter { export interface Raw { - custom_attribute_definition_id?: (string | null) | null; - key?: (string | null) | null; - string_filter?: (string | null) | null; + custom_attribute_definition_id?: (string | null | undefined) | null; + key?: (string | null | undefined) | null; + string_filter?: (string | null | undefined) | null; number_filter?: Range.Raw | null; - selection_uids_filter?: (string[] | null) | null; - bool_filter?: (boolean | null) | null; + selection_uids_filter?: (string[] | null | undefined) | null; + bool_filter?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/CustomField.ts b/src/serialization/types/CustomField.ts index 112388b70..9abc54570 100644 --- a/src/serialization/types/CustomField.ts +++ b/src/serialization/types/CustomField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomField: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Customer.ts b/src/serialization/types/Customer.ts index ec7ddfd7f..8cb9ed8e5 100644 --- a/src/serialization/types/Customer.ts +++ b/src/serialization/types/Customer.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Address } from "./Address"; -import { CustomerPreferences } from "./CustomerPreferences"; import { CustomerCreationSource } from "./CustomerCreationSource"; +import { CustomerPreferences } from "./CustomerPreferences"; import { CustomerTaxIds } from "./CustomerTaxIds"; export const Customer: core.serialization.ObjectSchema = @@ -44,20 +42,20 @@ export declare namespace Customer { id?: string | null; created_at?: string | null; updated_at?: string | null; - given_name?: (string | null) | null; - family_name?: (string | null) | null; - nickname?: (string | null) | null; - company_name?: (string | null) | null; - email_address?: (string | null) | null; + given_name?: (string | null | undefined) | null; + family_name?: (string | null | undefined) | null; + nickname?: (string | null | undefined) | null; + company_name?: (string | null | undefined) | null; + email_address?: (string | null | undefined) | null; address?: Address.Raw | null; - phone_number?: (string | null) | null; - birthday?: (string | null) | null; - reference_id?: (string | null) | null; - note?: (string | null) | null; + phone_number?: (string | null | undefined) | null; + birthday?: (string | null | undefined) | null; + reference_id?: (string | null | undefined) | null; + note?: (string | null | undefined) | null; preferences?: CustomerPreferences.Raw | null; creation_source?: CustomerCreationSource.Raw | null; - group_ids?: (string[] | null) | null; - segment_ids?: (string[] | null) | null; + group_ids?: (string[] | null | undefined) | null; + segment_ids?: (string[] | null | undefined) | null; version?: (bigint | number) | null; tax_ids?: CustomerTaxIds.Raw | null; } diff --git a/src/serialization/types/CustomerAddressFilter.ts b/src/serialization/types/CustomerAddressFilter.ts index 536e3fec7..50478cf62 100644 --- a/src/serialization/types/CustomerAddressFilter.ts +++ b/src/serialization/types/CustomerAddressFilter.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { CustomerTextFilter } from "./CustomerTextFilter"; +import type * as serializers from "../index"; import { Country } from "./Country"; +import { CustomerTextFilter } from "./CustomerTextFilter"; export const CustomerAddressFilter: core.serialization.ObjectSchema< serializers.CustomerAddressFilter.Raw, diff --git a/src/serialization/types/CustomerCreatedEvent.ts b/src/serialization/types/CustomerCreatedEvent.ts index db327a752..6dd540ee5 100644 --- a/src/serialization/types/CustomerCreatedEvent.ts +++ b/src/serialization/types/CustomerCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerCreatedEventData } from "./CustomerCreatedEventData"; export const CustomerCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCreatedEvent: core.serialization.ObjectSchema< export declare namespace CustomerCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomerCreatedEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCreatedEventData.ts b/src/serialization/types/CustomerCreatedEventData.ts index e6d13d800..32d5293f7 100644 --- a/src/serialization/types/CustomerCreatedEventData.ts +++ b/src/serialization/types/CustomerCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerCreatedEventObject } from "./CustomerCreatedEventObject"; export const CustomerCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const CustomerCreatedEventData: core.serialization.ObjectSchema< export declare namespace CustomerCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: CustomerCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/CustomerCreatedEventEventContext.ts b/src/serialization/types/CustomerCreatedEventEventContext.ts index 560bad1d8..cad3283de 100644 --- a/src/serialization/types/CustomerCreatedEventEventContext.ts +++ b/src/serialization/types/CustomerCreatedEventEventContext.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerCreatedEventEventContextMerge } from "./CustomerCreatedEventEventContextMerge"; export const CustomerCreatedEventEventContext: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CustomerCreatedEventEventContextMerge.ts b/src/serialization/types/CustomerCreatedEventEventContextMerge.ts index ddf65c816..20e9901d5 100644 --- a/src/serialization/types/CustomerCreatedEventEventContextMerge.ts +++ b/src/serialization/types/CustomerCreatedEventEventContextMerge.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomerCreatedEventEventContextMerge: core.serialization.ObjectSchema< serializers.CustomerCreatedEventEventContextMerge.Raw, @@ -19,7 +17,7 @@ export const CustomerCreatedEventEventContextMerge: core.serialization.ObjectSch export declare namespace CustomerCreatedEventEventContextMerge { export interface Raw { - from_customer_ids?: (string[] | null) | null; - to_customer_id?: (string | null) | null; + from_customer_ids?: (string[] | null | undefined) | null; + to_customer_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/CustomerCreatedEventObject.ts b/src/serialization/types/CustomerCreatedEventObject.ts index 8becea722..d8a1b0392 100644 --- a/src/serialization/types/CustomerCreatedEventObject.ts +++ b/src/serialization/types/CustomerCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Customer } from "./Customer"; import { CustomerCreatedEventEventContext } from "./CustomerCreatedEventEventContext"; diff --git a/src/serialization/types/CustomerCreationSource.ts b/src/serialization/types/CustomerCreationSource.ts index aa8551b3f..92db3021a 100644 --- a/src/serialization/types/CustomerCreationSource.ts +++ b/src/serialization/types/CustomerCreationSource.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomerCreationSource: core.serialization.Schema< serializers.CustomerCreationSource.Raw, diff --git a/src/serialization/types/CustomerCreationSourceFilter.ts b/src/serialization/types/CustomerCreationSourceFilter.ts index 514cd7c2b..9e34d96b2 100644 --- a/src/serialization/types/CustomerCreationSourceFilter.ts +++ b/src/serialization/types/CustomerCreationSourceFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerCreationSource } from "./CustomerCreationSource"; import { CustomerInclusionExclusion } from "./CustomerInclusionExclusion"; @@ -18,7 +16,7 @@ export const CustomerCreationSourceFilter: core.serialization.ObjectSchema< export declare namespace CustomerCreationSourceFilter { export interface Raw { - values?: (CustomerCreationSource.Raw[] | null) | null; + values?: (CustomerCreationSource.Raw[] | null | undefined) | null; rule?: CustomerInclusionExclusion.Raw | null; } } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionCreatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionCreatedEvent.ts index 32262ad64..78e4542e7 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionCreatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionCreatedEvent: core.serialization.O export declare namespace CustomerCustomAttributeDefinitionCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts index 721e2b517..6e8a40e5c 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionCreatedPublicEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionCreatedPublicEvent: core.serializa export declare namespace CustomerCustomAttributeDefinitionCreatedPublicEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionDeletedEvent.ts index 3d67c4401..4c3e4519b 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionDeletedEvent: core.serialization.O export declare namespace CustomerCustomAttributeDefinitionDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts index 137b4d34e..99d066042 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionDeletedPublicEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionDeletedPublicEvent: core.serializa export declare namespace CustomerCustomAttributeDefinitionDeletedPublicEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts index b601b0b63..74630b92e 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionOwnedCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionOwnedCreatedEvent: core.serializat export declare namespace CustomerCustomAttributeDefinitionOwnedCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts index fff983f58..96904c020 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionOwnedDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionOwnedDeletedEvent: core.serializat export declare namespace CustomerCustomAttributeDefinitionOwnedDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts index ebdf5a959..3aa0ee8bb 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionOwnedUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionOwnedUpdatedEvent: core.serializat export declare namespace CustomerCustomAttributeDefinitionOwnedUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts index cab3773a0..ea30929de 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionUpdatedEvent: core.serialization.O export declare namespace CustomerCustomAttributeDefinitionUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts index 12b4a1c93..d1c80fdc0 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionUpdatedPublicEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionUpdatedPublicEvent: core.serializa export declare namespace CustomerCustomAttributeDefinitionUpdatedPublicEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts index 00dfa6b54..c4f572985 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionVisibleCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionVisibleCreatedEvent: core.serializ export declare namespace CustomerCustomAttributeDefinitionVisibleCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts index 0a5fbbce2..72a45e24f 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionVisibleDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionVisibleDeletedEvent: core.serializ export declare namespace CustomerCustomAttributeDefinitionVisibleDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts index d22362803..b60771f68 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionVisibleUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDefinitionVisibleUpdatedEvent: core.serializ export declare namespace CustomerCustomAttributeDefinitionVisibleUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeDeletedEvent.ts index c0202a40b..38da6f0c7 100644 --- a/src/serialization/types/CustomerCustomAttributeDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDeletedEvent: core.serialization.ObjectSchem export declare namespace CustomerCustomAttributeDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDeletedPublicEvent.ts b/src/serialization/types/CustomerCustomAttributeDeletedPublicEvent.ts index cd997be55..14e509c61 100644 --- a/src/serialization/types/CustomerCustomAttributeDeletedPublicEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDeletedPublicEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeDeletedPublicEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeDeletedPublicEvent: core.serialization.Objec export declare namespace CustomerCustomAttributeDeletedPublicEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeFilter.ts b/src/serialization/types/CustomerCustomAttributeFilter.ts index 4f4fd1320..d43602a21 100644 --- a/src/serialization/types/CustomerCustomAttributeFilter.ts +++ b/src/serialization/types/CustomerCustomAttributeFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerCustomAttributeFilterValue } from "./CustomerCustomAttributeFilterValue"; import { TimeRange } from "./TimeRange"; diff --git a/src/serialization/types/CustomerCustomAttributeFilterValue.ts b/src/serialization/types/CustomerCustomAttributeFilterValue.ts index 855a127f2..3653d5d91 100644 --- a/src/serialization/types/CustomerCustomAttributeFilterValue.ts +++ b/src/serialization/types/CustomerCustomAttributeFilterValue.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; +import { CustomerAddressFilter } from "./CustomerAddressFilter"; import { CustomerTextFilter } from "./CustomerTextFilter"; import { FilterValue } from "./FilterValue"; -import { TimeRange } from "./TimeRange"; import { FloatNumberRange } from "./FloatNumberRange"; -import { CustomerAddressFilter } from "./CustomerAddressFilter"; +import { TimeRange } from "./TimeRange"; export const CustomerCustomAttributeFilterValue: core.serialization.ObjectSchema< serializers.CustomerCustomAttributeFilterValue.Raw, @@ -33,7 +31,7 @@ export declare namespace CustomerCustomAttributeFilterValue { selection?: FilterValue.Raw | null; date?: TimeRange.Raw | null; number?: FloatNumberRange.Raw | null; - boolean?: (boolean | null) | null; + boolean?: (boolean | null | undefined) | null; address?: CustomerAddressFilter.Raw | null; } } diff --git a/src/serialization/types/CustomerCustomAttributeFilters.ts b/src/serialization/types/CustomerCustomAttributeFilters.ts index b7fa2ed18..ec6fe13a4 100644 --- a/src/serialization/types/CustomerCustomAttributeFilters.ts +++ b/src/serialization/types/CustomerCustomAttributeFilters.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerCustomAttributeFilter } from "./CustomerCustomAttributeFilter"; export const CustomerCustomAttributeFilters: core.serialization.ObjectSchema< @@ -16,6 +14,6 @@ export const CustomerCustomAttributeFilters: core.serialization.ObjectSchema< export declare namespace CustomerCustomAttributeFilters { export interface Raw { - filters?: (CustomerCustomAttributeFilter.Raw[] | null) | null; + filters?: (CustomerCustomAttributeFilter.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/CustomerCustomAttributeOwnedDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeOwnedDeletedEvent.ts index da3885373..a986ae47f 100644 --- a/src/serialization/types/CustomerCustomAttributeOwnedDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeOwnedDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeOwnedDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeOwnedDeletedEvent: core.serialization.Object export declare namespace CustomerCustomAttributeOwnedDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeOwnedUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeOwnedUpdatedEvent.ts index bd97c5a50..8d57c1797 100644 --- a/src/serialization/types/CustomerCustomAttributeOwnedUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeOwnedUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeOwnedUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeOwnedUpdatedEvent: core.serialization.Object export declare namespace CustomerCustomAttributeOwnedUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeUpdatedEvent.ts index f16aa1bc0..240476e0a 100644 --- a/src/serialization/types/CustomerCustomAttributeUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeUpdatedEvent: core.serialization.ObjectSchem export declare namespace CustomerCustomAttributeUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeUpdatedPublicEvent.ts b/src/serialization/types/CustomerCustomAttributeUpdatedPublicEvent.ts index 3a99d562c..223445576 100644 --- a/src/serialization/types/CustomerCustomAttributeUpdatedPublicEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeUpdatedPublicEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeUpdatedPublicEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeUpdatedPublicEvent: core.serialization.Objec export declare namespace CustomerCustomAttributeUpdatedPublicEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeVisibleDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeVisibleDeletedEvent.ts index 0e34c5245..a419c3d2b 100644 --- a/src/serialization/types/CustomerCustomAttributeVisibleDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeVisibleDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeVisibleDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeVisibleDeletedEvent: core.serialization.Obje export declare namespace CustomerCustomAttributeVisibleDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeVisibleUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeVisibleUpdatedEvent.ts index 1e10fbf45..86d2570de 100644 --- a/src/serialization/types/CustomerCustomAttributeVisibleUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeVisibleUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeVisibleUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerCustomAttributeVisibleUpdatedEvent: core.serialization.Obje export declare namespace CustomerCustomAttributeVisibleUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerDeletedEvent.ts b/src/serialization/types/CustomerDeletedEvent.ts index 1c2c5317a..68104d19d 100644 --- a/src/serialization/types/CustomerDeletedEvent.ts +++ b/src/serialization/types/CustomerDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerDeletedEventData } from "./CustomerDeletedEventData"; export const CustomerDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const CustomerDeletedEvent: core.serialization.ObjectSchema< export declare namespace CustomerDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: CustomerDeletedEventData.Raw | null; } diff --git a/src/serialization/types/CustomerDeletedEventData.ts b/src/serialization/types/CustomerDeletedEventData.ts index 6f46eb424..9553c4f1b 100644 --- a/src/serialization/types/CustomerDeletedEventData.ts +++ b/src/serialization/types/CustomerDeletedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerDeletedEventObject } from "./CustomerDeletedEventObject"; export const CustomerDeletedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const CustomerDeletedEventData: core.serialization.ObjectSchema< export declare namespace CustomerDeletedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: CustomerDeletedEventObject.Raw | null; } diff --git a/src/serialization/types/CustomerDeletedEventEventContext.ts b/src/serialization/types/CustomerDeletedEventEventContext.ts index 4c0617f8c..928c5cd36 100644 --- a/src/serialization/types/CustomerDeletedEventEventContext.ts +++ b/src/serialization/types/CustomerDeletedEventEventContext.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerDeletedEventEventContextMerge } from "./CustomerDeletedEventEventContextMerge"; export const CustomerDeletedEventEventContext: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CustomerDeletedEventEventContextMerge.ts b/src/serialization/types/CustomerDeletedEventEventContextMerge.ts index 0c39c236c..b5b3a8181 100644 --- a/src/serialization/types/CustomerDeletedEventEventContextMerge.ts +++ b/src/serialization/types/CustomerDeletedEventEventContextMerge.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomerDeletedEventEventContextMerge: core.serialization.ObjectSchema< serializers.CustomerDeletedEventEventContextMerge.Raw, @@ -19,7 +17,7 @@ export const CustomerDeletedEventEventContextMerge: core.serialization.ObjectSch export declare namespace CustomerDeletedEventEventContextMerge { export interface Raw { - from_customer_ids?: (string[] | null) | null; - to_customer_id?: (string | null) | null; + from_customer_ids?: (string[] | null | undefined) | null; + to_customer_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/CustomerDeletedEventObject.ts b/src/serialization/types/CustomerDeletedEventObject.ts index 51db7af38..57a957659 100644 --- a/src/serialization/types/CustomerDeletedEventObject.ts +++ b/src/serialization/types/CustomerDeletedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Customer } from "./Customer"; import { CustomerDeletedEventEventContext } from "./CustomerDeletedEventEventContext"; diff --git a/src/serialization/types/CustomerDetails.ts b/src/serialization/types/CustomerDetails.ts index 04afde920..efb59aa24 100644 --- a/src/serialization/types/CustomerDetails.ts +++ b/src/serialization/types/CustomerDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomerDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -17,7 +15,7 @@ export const CustomerDetails: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CustomerGroup.ts b/src/serialization/types/CustomerGroup.ts index 7375e075e..e54f12bd4 100644 --- a/src/serialization/types/CustomerGroup.ts +++ b/src/serialization/types/CustomerGroup.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomerGroup: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CustomerInclusionExclusion.ts b/src/serialization/types/CustomerInclusionExclusion.ts index 70cbbbb21..e6302f636 100644 --- a/src/serialization/types/CustomerInclusionExclusion.ts +++ b/src/serialization/types/CustomerInclusionExclusion.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomerInclusionExclusion: core.serialization.Schema< serializers.CustomerInclusionExclusion.Raw, diff --git a/src/serialization/types/CustomerPreferences.ts b/src/serialization/types/CustomerPreferences.ts index c9f3a7d35..a42352232 100644 --- a/src/serialization/types/CustomerPreferences.ts +++ b/src/serialization/types/CustomerPreferences.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomerPreferences: core.serialization.ObjectSchema< serializers.CustomerPreferences.Raw, @@ -18,6 +16,6 @@ export const CustomerPreferences: core.serialization.ObjectSchema< export declare namespace CustomerPreferences { export interface Raw { - email_unsubscribed?: (boolean | null) | null; + email_unsubscribed?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/CustomerQuery.ts b/src/serialization/types/CustomerQuery.ts index 74c50bc41..85fb0c6f2 100644 --- a/src/serialization/types/CustomerQuery.ts +++ b/src/serialization/types/CustomerQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerFilter } from "./CustomerFilter"; import { CustomerSort } from "./CustomerSort"; diff --git a/src/serialization/types/CustomerSegment.ts b/src/serialization/types/CustomerSegment.ts index 7303e6880..4d60767af 100644 --- a/src/serialization/types/CustomerSegment.ts +++ b/src/serialization/types/CustomerSegment.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomerSegment: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CustomerSort.ts b/src/serialization/types/CustomerSort.ts index 2b9ef32f7..fd1eb15ff 100644 --- a/src/serialization/types/CustomerSort.ts +++ b/src/serialization/types/CustomerSort.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomerSortField } from "./CustomerSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/CustomerSortField.ts b/src/serialization/types/CustomerSortField.ts index 21e2203c2..e33da6e4f 100644 --- a/src/serialization/types/CustomerSortField.ts +++ b/src/serialization/types/CustomerSortField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomerSortField: core.serialization.Schema = core.serialization.enum_(["DEFAULT", "CREATED_AT"]); diff --git a/src/serialization/types/CustomerTaxIds.ts b/src/serialization/types/CustomerTaxIds.ts index cef8a8edb..a1952186c 100644 --- a/src/serialization/types/CustomerTaxIds.ts +++ b/src/serialization/types/CustomerTaxIds.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const CustomerTaxIds: core.serialization.ObjectSchema = core.serialization.object({ @@ -13,6 +11,6 @@ export const CustomerTaxIds: core.serialization.ObjectSchema = core.serialization.object({ @@ -14,7 +12,7 @@ export const DateRange: core.serialization.ObjectSchema = core.serialization.enum_(["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]); diff --git a/src/serialization/types/DeleteBookingCustomAttributeDefinitionResponse.ts b/src/serialization/types/DeleteBookingCustomAttributeDefinitionResponse.ts index 0a4b638fc..386abe6e8 100644 --- a/src/serialization/types/DeleteBookingCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/DeleteBookingCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteBookingCustomAttributeDefinitionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteBookingCustomAttributeResponse.ts b/src/serialization/types/DeleteBookingCustomAttributeResponse.ts index ef33e73a4..606dd0b49 100644 --- a/src/serialization/types/DeleteBookingCustomAttributeResponse.ts +++ b/src/serialization/types/DeleteBookingCustomAttributeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteBookingCustomAttributeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteBreakTypeResponse.ts b/src/serialization/types/DeleteBreakTypeResponse.ts index 32a9fd7b4..73eb6c842 100644 --- a/src/serialization/types/DeleteBreakTypeResponse.ts +++ b/src/serialization/types/DeleteBreakTypeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteBreakTypeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCatalogObjectResponse.ts b/src/serialization/types/DeleteCatalogObjectResponse.ts index 8cd03bde4..e32233924 100644 --- a/src/serialization/types/DeleteCatalogObjectResponse.ts +++ b/src/serialization/types/DeleteCatalogObjectResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCatalogObjectResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCustomerCardResponse.ts b/src/serialization/types/DeleteCustomerCardResponse.ts index de93fa722..030a82d89 100644 --- a/src/serialization/types/DeleteCustomerCardResponse.ts +++ b/src/serialization/types/DeleteCustomerCardResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCustomerCardResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCustomerCustomAttributeDefinitionResponse.ts b/src/serialization/types/DeleteCustomerCustomAttributeDefinitionResponse.ts index b74465071..1cb56b60a 100644 --- a/src/serialization/types/DeleteCustomerCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/DeleteCustomerCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCustomerCustomAttributeDefinitionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCustomerCustomAttributeResponse.ts b/src/serialization/types/DeleteCustomerCustomAttributeResponse.ts index 0a64db0d8..cfc2b57aa 100644 --- a/src/serialization/types/DeleteCustomerCustomAttributeResponse.ts +++ b/src/serialization/types/DeleteCustomerCustomAttributeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCustomerCustomAttributeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCustomerGroupResponse.ts b/src/serialization/types/DeleteCustomerGroupResponse.ts index ceefcf781..d6089f5c9 100644 --- a/src/serialization/types/DeleteCustomerGroupResponse.ts +++ b/src/serialization/types/DeleteCustomerGroupResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCustomerGroupResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCustomerResponse.ts b/src/serialization/types/DeleteCustomerResponse.ts index b6b31e040..34a213f22 100644 --- a/src/serialization/types/DeleteCustomerResponse.ts +++ b/src/serialization/types/DeleteCustomerResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCustomerResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteDisputeEvidenceResponse.ts b/src/serialization/types/DeleteDisputeEvidenceResponse.ts index 5462a5275..e2586e5b5 100644 --- a/src/serialization/types/DeleteDisputeEvidenceResponse.ts +++ b/src/serialization/types/DeleteDisputeEvidenceResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteDisputeEvidenceResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteInvoiceAttachmentResponse.ts b/src/serialization/types/DeleteInvoiceAttachmentResponse.ts index 6385db0c8..66cfc201b 100644 --- a/src/serialization/types/DeleteInvoiceAttachmentResponse.ts +++ b/src/serialization/types/DeleteInvoiceAttachmentResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteInvoiceAttachmentResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteInvoiceResponse.ts b/src/serialization/types/DeleteInvoiceResponse.ts index 3475aa54b..6b495a0fc 100644 --- a/src/serialization/types/DeleteInvoiceResponse.ts +++ b/src/serialization/types/DeleteInvoiceResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteInvoiceResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteLocationCustomAttributeDefinitionResponse.ts b/src/serialization/types/DeleteLocationCustomAttributeDefinitionResponse.ts index acf03bfd2..f7c7e9219 100644 --- a/src/serialization/types/DeleteLocationCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/DeleteLocationCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteLocationCustomAttributeDefinitionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteLocationCustomAttributeResponse.ts b/src/serialization/types/DeleteLocationCustomAttributeResponse.ts index fa3d0ed2b..3d4a4b238 100644 --- a/src/serialization/types/DeleteLocationCustomAttributeResponse.ts +++ b/src/serialization/types/DeleteLocationCustomAttributeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteLocationCustomAttributeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteLoyaltyRewardResponse.ts b/src/serialization/types/DeleteLoyaltyRewardResponse.ts index 5d3fbc7bc..4601c9615 100644 --- a/src/serialization/types/DeleteLoyaltyRewardResponse.ts +++ b/src/serialization/types/DeleteLoyaltyRewardResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteLoyaltyRewardResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteMerchantCustomAttributeDefinitionResponse.ts b/src/serialization/types/DeleteMerchantCustomAttributeDefinitionResponse.ts index 4bb4141e6..896bada8a 100644 --- a/src/serialization/types/DeleteMerchantCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/DeleteMerchantCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteMerchantCustomAttributeDefinitionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteMerchantCustomAttributeResponse.ts b/src/serialization/types/DeleteMerchantCustomAttributeResponse.ts index 5c68b8813..f454716b4 100644 --- a/src/serialization/types/DeleteMerchantCustomAttributeResponse.ts +++ b/src/serialization/types/DeleteMerchantCustomAttributeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteMerchantCustomAttributeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteOrderCustomAttributeDefinitionResponse.ts b/src/serialization/types/DeleteOrderCustomAttributeDefinitionResponse.ts index 3b3ff726a..d99b0f8dd 100644 --- a/src/serialization/types/DeleteOrderCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/DeleteOrderCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteOrderCustomAttributeDefinitionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteOrderCustomAttributeResponse.ts b/src/serialization/types/DeleteOrderCustomAttributeResponse.ts index b9edcc24a..44617c32c 100644 --- a/src/serialization/types/DeleteOrderCustomAttributeResponse.ts +++ b/src/serialization/types/DeleteOrderCustomAttributeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteOrderCustomAttributeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeletePaymentLinkResponse.ts b/src/serialization/types/DeletePaymentLinkResponse.ts index a78fac4ba..a223f903e 100644 --- a/src/serialization/types/DeletePaymentLinkResponse.ts +++ b/src/serialization/types/DeletePaymentLinkResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeletePaymentLinkResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteShiftResponse.ts b/src/serialization/types/DeleteShiftResponse.ts index 46c572ab5..eee1e85ee 100644 --- a/src/serialization/types/DeleteShiftResponse.ts +++ b/src/serialization/types/DeleteShiftResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteShiftResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteSnippetResponse.ts b/src/serialization/types/DeleteSnippetResponse.ts index 1c7670975..2d611ef0c 100644 --- a/src/serialization/types/DeleteSnippetResponse.ts +++ b/src/serialization/types/DeleteSnippetResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteSnippetResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteSubscriptionActionResponse.ts b/src/serialization/types/DeleteSubscriptionActionResponse.ts index 1f25108ee..53d3ed995 100644 --- a/src/serialization/types/DeleteSubscriptionActionResponse.ts +++ b/src/serialization/types/DeleteSubscriptionActionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; diff --git a/src/serialization/types/DeleteTimecardResponse.ts b/src/serialization/types/DeleteTimecardResponse.ts index 4b02939b8..c65df7f4f 100644 --- a/src/serialization/types/DeleteTimecardResponse.ts +++ b/src/serialization/types/DeleteTimecardResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteTimecardResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteTransferOrderResponse.ts b/src/serialization/types/DeleteTransferOrderResponse.ts index ae6b0fc4b..d32ee233f 100644 --- a/src/serialization/types/DeleteTransferOrderResponse.ts +++ b/src/serialization/types/DeleteTransferOrderResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteTransferOrderResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteWebhookSubscriptionResponse.ts b/src/serialization/types/DeleteWebhookSubscriptionResponse.ts index b56bfc771..ed5971d76 100644 --- a/src/serialization/types/DeleteWebhookSubscriptionResponse.ts +++ b/src/serialization/types/DeleteWebhookSubscriptionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteWebhookSubscriptionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Destination.ts b/src/serialization/types/Destination.ts index 366eff6d8..5c282c657 100644 --- a/src/serialization/types/Destination.ts +++ b/src/serialization/types/Destination.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DestinationType } from "./DestinationType"; export const Destination: core.serialization.ObjectSchema = diff --git a/src/serialization/types/DestinationDetails.ts b/src/serialization/types/DestinationDetails.ts index a75499ab1..8ae5bb9dc 100644 --- a/src/serialization/types/DestinationDetails.ts +++ b/src/serialization/types/DestinationDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DestinationDetailsCardRefundDetails } from "./DestinationDetailsCardRefundDetails"; import { DestinationDetailsCashRefundDetails } from "./DestinationDetailsCashRefundDetails"; import { DestinationDetailsExternalRefundDetails } from "./DestinationDetailsExternalRefundDetails"; diff --git a/src/serialization/types/DestinationDetailsCardRefundDetails.ts b/src/serialization/types/DestinationDetailsCardRefundDetails.ts index e7aeb6e32..9eee46dd3 100644 --- a/src/serialization/types/DestinationDetailsCardRefundDetails.ts +++ b/src/serialization/types/DestinationDetailsCardRefundDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Card } from "./Card"; export const DestinationDetailsCardRefundDetails: core.serialization.ObjectSchema< @@ -19,7 +17,7 @@ export const DestinationDetailsCardRefundDetails: core.serialization.ObjectSchem export declare namespace DestinationDetailsCardRefundDetails { export interface Raw { card?: Card.Raw | null; - entry_method?: (string | null) | null; - auth_result_code?: (string | null) | null; + entry_method?: (string | null | undefined) | null; + auth_result_code?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DestinationDetailsCashRefundDetails.ts b/src/serialization/types/DestinationDetailsCashRefundDetails.ts index a34890e16..0271bab5d 100644 --- a/src/serialization/types/DestinationDetailsCashRefundDetails.ts +++ b/src/serialization/types/DestinationDetailsCashRefundDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const DestinationDetailsCashRefundDetails: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DestinationDetailsExternalRefundDetails.ts b/src/serialization/types/DestinationDetailsExternalRefundDetails.ts index d6cc57509..3661023e0 100644 --- a/src/serialization/types/DestinationDetailsExternalRefundDetails.ts +++ b/src/serialization/types/DestinationDetailsExternalRefundDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DestinationDetailsExternalRefundDetails: core.serialization.ObjectSchema< serializers.DestinationDetailsExternalRefundDetails.Raw, @@ -19,6 +17,6 @@ export declare namespace DestinationDetailsExternalRefundDetails { export interface Raw { type: string; source: string; - source_id?: (string | null) | null; + source_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DestinationType.ts b/src/serialization/types/DestinationType.ts index 8d5966cf5..88ce291d6 100644 --- a/src/serialization/types/DestinationType.ts +++ b/src/serialization/types/DestinationType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DestinationType: core.serialization.Schema = core.serialization.enum_(["BANK_ACCOUNT", "CARD", "SQUARE_BALANCE", "SQUARE_STORED_BALANCE"]); diff --git a/src/serialization/types/Device.ts b/src/serialization/types/Device.ts index bdfa1bd46..599ba2e7b 100644 --- a/src/serialization/types/Device.ts +++ b/src/serialization/types/Device.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { DeviceAttributes } from "./DeviceAttributes"; +import type * as serializers from "../index"; import { Component } from "./Component"; +import { DeviceAttributes } from "./DeviceAttributes"; import { DeviceStatus } from "./DeviceStatus"; export const Device: core.serialization.ObjectSchema = core.serialization.object( @@ -22,7 +20,7 @@ export declare namespace Device { export interface Raw { id?: string | null; attributes: DeviceAttributes.Raw; - components?: (Component.Raw[] | null) | null; + components?: (Component.Raw[] | null | undefined) | null; status?: DeviceStatus.Raw | null; } } diff --git a/src/serialization/types/DeviceAttributes.ts b/src/serialization/types/DeviceAttributes.ts index 364f6f982..64a0c0954 100644 --- a/src/serialization/types/DeviceAttributes.ts +++ b/src/serialization/types/DeviceAttributes.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DeviceAttributesDeviceType } from "./DeviceAttributesDeviceType"; export const DeviceAttributes: core.serialization.ObjectSchema< @@ -25,11 +23,11 @@ export declare namespace DeviceAttributes { export interface Raw { type: DeviceAttributesDeviceType.Raw; manufacturer: string; - model?: (string | null) | null; - name?: (string | null) | null; - manufacturers_id?: (string | null) | null; + model?: (string | null | undefined) | null; + name?: (string | null | undefined) | null; + manufacturers_id?: (string | null | undefined) | null; updated_at?: string | null; version?: string | null; - merchant_token?: (string | null) | null; + merchant_token?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DeviceAttributesDeviceType.ts b/src/serialization/types/DeviceAttributesDeviceType.ts index fb76868a5..6e5fea54d 100644 --- a/src/serialization/types/DeviceAttributesDeviceType.ts +++ b/src/serialization/types/DeviceAttributesDeviceType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DeviceAttributesDeviceType: core.serialization.Schema< serializers.DeviceAttributesDeviceType.Raw, diff --git a/src/serialization/types/DeviceCheckoutOptions.ts b/src/serialization/types/DeviceCheckoutOptions.ts index b9498253e..0905829fd 100644 --- a/src/serialization/types/DeviceCheckoutOptions.ts +++ b/src/serialization/types/DeviceCheckoutOptions.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TipSettings } from "./TipSettings"; export const DeviceCheckoutOptions: core.serialization.ObjectSchema< @@ -27,9 +25,9 @@ export const DeviceCheckoutOptions: core.serialization.ObjectSchema< export declare namespace DeviceCheckoutOptions { export interface Raw { device_id: string; - skip_receipt_screen?: (boolean | null) | null; - collect_signature?: (boolean | null) | null; + skip_receipt_screen?: (boolean | null | undefined) | null; + collect_signature?: (boolean | null | undefined) | null; tip_settings?: TipSettings.Raw | null; - show_itemized_cart?: (boolean | null) | null; + show_itemized_cart?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/DeviceCode.ts b/src/serialization/types/DeviceCode.ts index d21f97aa2..6dabba6c6 100644 --- a/src/serialization/types/DeviceCode.ts +++ b/src/serialization/types/DeviceCode.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { ProductType } from "./ProductType"; +import type * as serializers from "../index"; import { DeviceCodeStatus } from "./DeviceCodeStatus"; +import { ProductType } from "./ProductType"; export const DeviceCode: core.serialization.ObjectSchema = core.serialization.object({ @@ -26,11 +24,11 @@ export const DeviceCode: core.serialization.ObjectSchema = core.serialization.enum_(["UNKNOWN", "UNPAIRED", "PAIRED", "EXPIRED"]); diff --git a/src/serialization/types/DeviceComponentDetailsApplicationDetails.ts b/src/serialization/types/DeviceComponentDetailsApplicationDetails.ts index b0c35e557..101991653 100644 --- a/src/serialization/types/DeviceComponentDetailsApplicationDetails.ts +++ b/src/serialization/types/DeviceComponentDetailsApplicationDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ApplicationType } from "./ApplicationType"; export const DeviceComponentDetailsApplicationDetails: core.serialization.ObjectSchema< @@ -21,7 +19,7 @@ export declare namespace DeviceComponentDetailsApplicationDetails { export interface Raw { application_type?: ApplicationType.Raw | null; version?: string | null; - session_location?: (string | null) | null; - device_code_id?: (string | null) | null; + session_location?: (string | null | undefined) | null; + device_code_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DeviceComponentDetailsBatteryDetails.ts b/src/serialization/types/DeviceComponentDetailsBatteryDetails.ts index 12e3b61d6..a84eec9f4 100644 --- a/src/serialization/types/DeviceComponentDetailsBatteryDetails.ts +++ b/src/serialization/types/DeviceComponentDetailsBatteryDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DeviceComponentDetailsExternalPower } from "./DeviceComponentDetailsExternalPower"; export const DeviceComponentDetailsBatteryDetails: core.serialization.ObjectSchema< @@ -17,7 +15,7 @@ export const DeviceComponentDetailsBatteryDetails: core.serialization.ObjectSche export declare namespace DeviceComponentDetailsBatteryDetails { export interface Raw { - visible_percent?: (number | null) | null; + visible_percent?: (number | null | undefined) | null; external_power?: DeviceComponentDetailsExternalPower.Raw | null; } } diff --git a/src/serialization/types/DeviceComponentDetailsCardReaderDetails.ts b/src/serialization/types/DeviceComponentDetailsCardReaderDetails.ts index 5904dbe18..c572c46ae 100644 --- a/src/serialization/types/DeviceComponentDetailsCardReaderDetails.ts +++ b/src/serialization/types/DeviceComponentDetailsCardReaderDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DeviceComponentDetailsCardReaderDetails: core.serialization.ObjectSchema< serializers.DeviceComponentDetailsCardReaderDetails.Raw, diff --git a/src/serialization/types/DeviceComponentDetailsEthernetDetails.ts b/src/serialization/types/DeviceComponentDetailsEthernetDetails.ts index dec00107b..84493e399 100644 --- a/src/serialization/types/DeviceComponentDetailsEthernetDetails.ts +++ b/src/serialization/types/DeviceComponentDetailsEthernetDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DeviceComponentDetailsEthernetDetails: core.serialization.ObjectSchema< serializers.DeviceComponentDetailsEthernetDetails.Raw, @@ -17,8 +15,8 @@ export const DeviceComponentDetailsEthernetDetails: core.serialization.ObjectSch export declare namespace DeviceComponentDetailsEthernetDetails { export interface Raw { - active?: (boolean | null) | null; - ip_address_v4?: (string | null) | null; - mac_address?: (string | null) | null; + active?: (boolean | null | undefined) | null; + ip_address_v4?: (string | null | undefined) | null; + mac_address?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DeviceComponentDetailsExternalPower.ts b/src/serialization/types/DeviceComponentDetailsExternalPower.ts index 0f81b7fee..611faef29 100644 --- a/src/serialization/types/DeviceComponentDetailsExternalPower.ts +++ b/src/serialization/types/DeviceComponentDetailsExternalPower.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DeviceComponentDetailsExternalPower: core.serialization.Schema< serializers.DeviceComponentDetailsExternalPower.Raw, diff --git a/src/serialization/types/DeviceComponentDetailsMeasurement.ts b/src/serialization/types/DeviceComponentDetailsMeasurement.ts index 6a6bfea0b..d745fde92 100644 --- a/src/serialization/types/DeviceComponentDetailsMeasurement.ts +++ b/src/serialization/types/DeviceComponentDetailsMeasurement.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DeviceComponentDetailsMeasurement: core.serialization.ObjectSchema< serializers.DeviceComponentDetailsMeasurement.Raw, @@ -15,6 +13,6 @@ export const DeviceComponentDetailsMeasurement: core.serialization.ObjectSchema< export declare namespace DeviceComponentDetailsMeasurement { export interface Raw { - value?: (number | null) | null; + value?: (number | null | undefined) | null; } } diff --git a/src/serialization/types/DeviceComponentDetailsWiFiDetails.ts b/src/serialization/types/DeviceComponentDetailsWiFiDetails.ts index 60cb28a76..863daea09 100644 --- a/src/serialization/types/DeviceComponentDetailsWiFiDetails.ts +++ b/src/serialization/types/DeviceComponentDetailsWiFiDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DeviceComponentDetailsMeasurement } from "./DeviceComponentDetailsMeasurement"; export const DeviceComponentDetailsWiFiDetails: core.serialization.ObjectSchema< @@ -21,11 +19,11 @@ export const DeviceComponentDetailsWiFiDetails: core.serialization.ObjectSchema< export declare namespace DeviceComponentDetailsWiFiDetails { export interface Raw { - active?: (boolean | null) | null; - ssid?: (string | null) | null; - ip_address_v4?: (string | null) | null; - secure_connection?: (string | null) | null; + active?: (boolean | null | undefined) | null; + ssid?: (string | null | undefined) | null; + ip_address_v4?: (string | null | undefined) | null; + secure_connection?: (string | null | undefined) | null; signal_strength?: DeviceComponentDetailsMeasurement.Raw | null; - mac_address?: (string | null) | null; + mac_address?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DeviceCreatedEvent.ts b/src/serialization/types/DeviceCreatedEvent.ts index 2f888c6be..7af6c6699 100644 --- a/src/serialization/types/DeviceCreatedEvent.ts +++ b/src/serialization/types/DeviceCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DeviceCreatedEventData } from "./DeviceCreatedEventData"; export const DeviceCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const DeviceCreatedEvent: core.serialization.ObjectSchema< export declare namespace DeviceCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: DeviceCreatedEventData.Raw | null; } diff --git a/src/serialization/types/DeviceCreatedEventData.ts b/src/serialization/types/DeviceCreatedEventData.ts index 1e03bb561..744f7810b 100644 --- a/src/serialization/types/DeviceCreatedEventData.ts +++ b/src/serialization/types/DeviceCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DeviceCreatedEventObject } from "./DeviceCreatedEventObject"; export const DeviceCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const DeviceCreatedEventData: core.serialization.ObjectSchema< export declare namespace DeviceCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: DeviceCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/DeviceCreatedEventObject.ts b/src/serialization/types/DeviceCreatedEventObject.ts index f4a3bde8f..c8318c441 100644 --- a/src/serialization/types/DeviceCreatedEventObject.ts +++ b/src/serialization/types/DeviceCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Device } from "./Device"; export const DeviceCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeviceDetails.ts b/src/serialization/types/DeviceDetails.ts index 569bd6b08..818bc0e95 100644 --- a/src/serialization/types/DeviceDetails.ts +++ b/src/serialization/types/DeviceDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DeviceDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -18,8 +16,8 @@ export const DeviceDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -36,17 +34,17 @@ export const DeviceMetadata: core.serialization.ObjectSchema = diff --git a/src/serialization/types/DeviceStatusCategory.ts b/src/serialization/types/DeviceStatusCategory.ts index 35f539b5b..220e882b5 100644 --- a/src/serialization/types/DeviceStatusCategory.ts +++ b/src/serialization/types/DeviceStatusCategory.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DeviceStatusCategory: core.serialization.Schema< serializers.DeviceStatusCategory.Raw, diff --git a/src/serialization/types/DigitalWalletDetails.ts b/src/serialization/types/DigitalWalletDetails.ts index 22a338e6f..cb2f18027 100644 --- a/src/serialization/types/DigitalWalletDetails.ts +++ b/src/serialization/types/DigitalWalletDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CashAppDetails } from "./CashAppDetails"; export const DigitalWalletDetails: core.serialization.ObjectSchema< @@ -18,8 +16,8 @@ export const DigitalWalletDetails: core.serialization.ObjectSchema< export declare namespace DigitalWalletDetails { export interface Raw { - status?: (string | null) | null; - brand?: (string | null) | null; + status?: (string | null | undefined) | null; + brand?: (string | null | undefined) | null; cash_app_details?: CashAppDetails.Raw | null; } } diff --git a/src/serialization/types/DisableCardResponse.ts b/src/serialization/types/DisableCardResponse.ts index 9b0895fff..272d8726a 100644 --- a/src/serialization/types/DisableCardResponse.ts +++ b/src/serialization/types/DisableCardResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Card } from "./Card"; +import { Error_ } from "./Error_"; export const DisableCardResponse: core.serialization.ObjectSchema< serializers.DisableCardResponse.Raw, diff --git a/src/serialization/types/DisableEventsResponse.ts b/src/serialization/types/DisableEventsResponse.ts index c00d6bce6..e5d7bb3c2 100644 --- a/src/serialization/types/DisableEventsResponse.ts +++ b/src/serialization/types/DisableEventsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DisableEventsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DismissTerminalActionResponse.ts b/src/serialization/types/DismissTerminalActionResponse.ts index 31c15cb00..7af9353a4 100644 --- a/src/serialization/types/DismissTerminalActionResponse.ts +++ b/src/serialization/types/DismissTerminalActionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalAction } from "./TerminalAction"; diff --git a/src/serialization/types/DismissTerminalCheckoutResponse.ts b/src/serialization/types/DismissTerminalCheckoutResponse.ts index 355ace5b7..23d87fa94 100644 --- a/src/serialization/types/DismissTerminalCheckoutResponse.ts +++ b/src/serialization/types/DismissTerminalCheckoutResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalCheckout } from "./TerminalCheckout"; diff --git a/src/serialization/types/DismissTerminalRefundResponse.ts b/src/serialization/types/DismissTerminalRefundResponse.ts index 533b62e3a..d28bd33b7 100644 --- a/src/serialization/types/DismissTerminalRefundResponse.ts +++ b/src/serialization/types/DismissTerminalRefundResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalRefund } from "./TerminalRefund"; diff --git a/src/serialization/types/Dispute.ts b/src/serialization/types/Dispute.ts index bff1b3f70..379b04da4 100644 --- a/src/serialization/types/Dispute.ts +++ b/src/serialization/types/Dispute.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Money } from "./Money"; +import type * as serializers from "../index"; +import { CardBrand } from "./CardBrand"; +import { DisputedPayment } from "./DisputedPayment"; import { DisputeReason } from "./DisputeReason"; import { DisputeState } from "./DisputeState"; -import { DisputedPayment } from "./DisputedPayment"; -import { CardBrand } from "./CardBrand"; +import { Money } from "./Money"; export const Dispute: core.serialization.ObjectSchema = core.serialization.object({ @@ -36,21 +34,21 @@ export const Dispute: core.serialization.ObjectSchema = core.serialization.enum_([ diff --git a/src/serialization/types/DisputeState.ts b/src/serialization/types/DisputeState.ts index 815e152bd..fd46f43eb 100644 --- a/src/serialization/types/DisputeState.ts +++ b/src/serialization/types/DisputeState.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DisputeState: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/DisputeStateChangedEvent.ts b/src/serialization/types/DisputeStateChangedEvent.ts index 39ef9cf13..9ce0a10e9 100644 --- a/src/serialization/types/DisputeStateChangedEvent.ts +++ b/src/serialization/types/DisputeStateChangedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DisputeStateChangedEventData } from "./DisputeStateChangedEventData"; export const DisputeStateChangedEvent: core.serialization.ObjectSchema< @@ -21,10 +19,10 @@ export const DisputeStateChangedEvent: core.serialization.ObjectSchema< export declare namespace DisputeStateChangedEvent { export interface Raw { - merchant_id?: (string | null) | null; - location_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: DisputeStateChangedEventData.Raw | null; } diff --git a/src/serialization/types/DisputeStateChangedEventData.ts b/src/serialization/types/DisputeStateChangedEventData.ts index 48c566bae..3276c853c 100644 --- a/src/serialization/types/DisputeStateChangedEventData.ts +++ b/src/serialization/types/DisputeStateChangedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DisputeStateChangedEventObject } from "./DisputeStateChangedEventObject"; export const DisputeStateChangedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const DisputeStateChangedEventData: core.serialization.ObjectSchema< export declare namespace DisputeStateChangedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: DisputeStateChangedEventObject.Raw | null; } diff --git a/src/serialization/types/DisputeStateChangedEventObject.ts b/src/serialization/types/DisputeStateChangedEventObject.ts index 9384df171..e2a52d0c7 100644 --- a/src/serialization/types/DisputeStateChangedEventObject.ts +++ b/src/serialization/types/DisputeStateChangedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Dispute } from "./Dispute"; export const DisputeStateChangedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DisputeStateUpdatedEvent.ts b/src/serialization/types/DisputeStateUpdatedEvent.ts index 7c05a6f04..88189017c 100644 --- a/src/serialization/types/DisputeStateUpdatedEvent.ts +++ b/src/serialization/types/DisputeStateUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DisputeStateUpdatedEventData } from "./DisputeStateUpdatedEventData"; export const DisputeStateUpdatedEvent: core.serialization.ObjectSchema< @@ -21,10 +19,10 @@ export const DisputeStateUpdatedEvent: core.serialization.ObjectSchema< export declare namespace DisputeStateUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - location_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: DisputeStateUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/DisputeStateUpdatedEventData.ts b/src/serialization/types/DisputeStateUpdatedEventData.ts index ff28f07a8..754d1f7a8 100644 --- a/src/serialization/types/DisputeStateUpdatedEventData.ts +++ b/src/serialization/types/DisputeStateUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DisputeStateUpdatedEventObject } from "./DisputeStateUpdatedEventObject"; export const DisputeStateUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const DisputeStateUpdatedEventData: core.serialization.ObjectSchema< export declare namespace DisputeStateUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: DisputeStateUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/DisputeStateUpdatedEventObject.ts b/src/serialization/types/DisputeStateUpdatedEventObject.ts index 4bd6d4d02..cc2901cda 100644 --- a/src/serialization/types/DisputeStateUpdatedEventObject.ts +++ b/src/serialization/types/DisputeStateUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Dispute } from "./Dispute"; export const DisputeStateUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DisputedPayment.ts b/src/serialization/types/DisputedPayment.ts index 5c0798547..4088af7ab 100644 --- a/src/serialization/types/DisputedPayment.ts +++ b/src/serialization/types/DisputedPayment.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const DisputedPayment: core.serialization.ObjectSchema = core.serialization.object({ @@ -13,6 +11,6 @@ export const DisputedPayment: core.serialization.ObjectSchema = core.serialization.enum_(["UNINDEXED", "UNAVAILABLE", "HIDDEN", "VISIBLE"]); diff --git a/src/serialization/types/Employee.ts b/src/serialization/types/Employee.ts index 860e08f00..7dbe7f0a7 100644 --- a/src/serialization/types/Employee.ts +++ b/src/serialization/types/Employee.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { EmployeeStatus } from "./EmployeeStatus"; export const Employee: core.serialization.ObjectSchema = @@ -27,13 +25,13 @@ export const Employee: core.serialization.ObjectSchema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/EmployeeWage.ts b/src/serialization/types/EmployeeWage.ts index 14437ed3b..0c1c8be2d 100644 --- a/src/serialization/types/EmployeeWage.ts +++ b/src/serialization/types/EmployeeWage.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const EmployeeWage: core.serialization.ObjectSchema = @@ -18,8 +16,8 @@ export const EmployeeWage: core.serialization.ObjectSchema = core.serialization.enum_([ diff --git a/src/serialization/types/ErrorCode.ts b/src/serialization/types/ErrorCode.ts index ffbff6731..7f3267bff 100644 --- a/src/serialization/types/ErrorCode.ts +++ b/src/serialization/types/ErrorCode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ErrorCode: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/Error_.ts b/src/serialization/types/Error_.ts index 00b51db34..e8c1212e8 100644 --- a/src/serialization/types/Error_.ts +++ b/src/serialization/types/Error_.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ErrorCategory } from "./ErrorCategory"; import { ErrorCode } from "./ErrorCode"; diff --git a/src/serialization/types/Event.ts b/src/serialization/types/Event.ts index 4c24c847c..c00dec3af 100644 --- a/src/serialization/types/Event.ts +++ b/src/serialization/types/Event.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { EventData } from "./EventData"; export const Event: core.serialization.ObjectSchema = core.serialization.object({ @@ -18,10 +16,10 @@ export const Event: core.serialization.ObjectSchema = core.serialization.object({ @@ -16,9 +14,9 @@ export const EventData: core.serialization.ObjectSchema | null) | null; + deleted?: (boolean | null | undefined) | null; + object?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/EventMetadata.ts b/src/serialization/types/EventMetadata.ts index 6e97d0967..f7374a432 100644 --- a/src/serialization/types/EventMetadata.ts +++ b/src/serialization/types/EventMetadata.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const EventMetadata: core.serialization.ObjectSchema = core.serialization.object({ @@ -14,7 +12,7 @@ export const EventMetadata: core.serialization.ObjectSchema = core.serialization.enum_(["LEAST_EXPENSIVE", "MOST_EXPENSIVE"]); diff --git a/src/serialization/types/ExternalPaymentDetails.ts b/src/serialization/types/ExternalPaymentDetails.ts index 957fe6370..8e8281bc7 100644 --- a/src/serialization/types/ExternalPaymentDetails.ts +++ b/src/serialization/types/ExternalPaymentDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const ExternalPaymentDetails: core.serialization.ObjectSchema< @@ -21,7 +19,7 @@ export declare namespace ExternalPaymentDetails { export interface Raw { type: string; source: string; - source_id?: (string | null) | null; + source_id?: (string | null | undefined) | null; source_fee_money?: Money.Raw | null; } } diff --git a/src/serialization/types/FilterValue.ts b/src/serialization/types/FilterValue.ts index b16ce73bd..17934a5a4 100644 --- a/src/serialization/types/FilterValue.ts +++ b/src/serialization/types/FilterValue.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FilterValue: core.serialization.ObjectSchema = core.serialization.object({ @@ -15,8 +13,8 @@ export const FilterValue: core.serialization.ObjectSchema = core.serialization.object({ @@ -33,12 +31,12 @@ export const Fulfillment: core.serialization.ObjectSchema | null) | null; + metadata?: (Record | null | undefined) | null; pickup_details?: FulfillmentPickupDetails.Raw | null; shipment_details?: FulfillmentShipmentDetails.Raw | null; delivery_details?: FulfillmentDeliveryDetails.Raw | null; diff --git a/src/serialization/types/FulfillmentDeliveryDetails.ts b/src/serialization/types/FulfillmentDeliveryDetails.ts index fc6a290f3..3980933f8 100644 --- a/src/serialization/types/FulfillmentDeliveryDetails.ts +++ b/src/serialization/types/FulfillmentDeliveryDetails.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { FulfillmentRecipient } from "./FulfillmentRecipient"; +import type * as serializers from "../index"; import { FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType } from "./FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType"; +import { FulfillmentRecipient } from "./FulfillmentRecipient"; export const FulfillmentDeliveryDetails: core.serialization.ObjectSchema< serializers.FulfillmentDeliveryDetails.Raw, @@ -63,25 +61,25 @@ export declare namespace FulfillmentDeliveryDetails { recipient?: FulfillmentRecipient.Raw | null; schedule_type?: FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.Raw | null; placed_at?: string | null; - deliver_at?: (string | null) | null; - prep_time_duration?: (string | null) | null; - delivery_window_duration?: (string | null) | null; - note?: (string | null) | null; - completed_at?: (string | null) | null; + deliver_at?: (string | null | undefined) | null; + prep_time_duration?: (string | null | undefined) | null; + delivery_window_duration?: (string | null | undefined) | null; + note?: (string | null | undefined) | null; + completed_at?: (string | null | undefined) | null; in_progress_at?: string | null; rejected_at?: string | null; ready_at?: string | null; delivered_at?: string | null; canceled_at?: string | null; - cancel_reason?: (string | null) | null; - courier_pickup_at?: (string | null) | null; - courier_pickup_window_duration?: (string | null) | null; - is_no_contact_delivery?: (boolean | null) | null; - dropoff_notes?: (string | null) | null; - courier_provider_name?: (string | null) | null; - courier_support_phone_number?: (string | null) | null; - square_delivery_id?: (string | null) | null; - external_delivery_id?: (string | null) | null; - managed_delivery?: (boolean | null) | null; + cancel_reason?: (string | null | undefined) | null; + courier_pickup_at?: (string | null | undefined) | null; + courier_pickup_window_duration?: (string | null | undefined) | null; + is_no_contact_delivery?: (boolean | null | undefined) | null; + dropoff_notes?: (string | null | undefined) | null; + courier_provider_name?: (string | null | undefined) | null; + courier_support_phone_number?: (string | null | undefined) | null; + square_delivery_id?: (string | null | undefined) | null; + external_delivery_id?: (string | null | undefined) | null; + managed_delivery?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts b/src/serialization/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts index dd1d97b1e..3d276df83 100644 --- a/src/serialization/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts +++ b/src/serialization/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType: core.serialization.Schema< serializers.FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.Raw, diff --git a/src/serialization/types/FulfillmentFulfillmentEntry.ts b/src/serialization/types/FulfillmentFulfillmentEntry.ts index da586b64f..bcefb9b10 100644 --- a/src/serialization/types/FulfillmentFulfillmentEntry.ts +++ b/src/serialization/types/FulfillmentFulfillmentEntry.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FulfillmentFulfillmentEntry: core.serialization.ObjectSchema< serializers.FulfillmentFulfillmentEntry.Raw, @@ -20,9 +18,9 @@ export const FulfillmentFulfillmentEntry: core.serialization.ObjectSchema< export declare namespace FulfillmentFulfillmentEntry { export interface Raw { - uid?: (string | null) | null; + uid?: (string | null | undefined) | null; line_item_uid: string; quantity: string; - metadata?: (Record | null) | null; + metadata?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/FulfillmentFulfillmentLineItemApplication.ts b/src/serialization/types/FulfillmentFulfillmentLineItemApplication.ts index 0a3c8ab9e..70b06c255 100644 --- a/src/serialization/types/FulfillmentFulfillmentLineItemApplication.ts +++ b/src/serialization/types/FulfillmentFulfillmentLineItemApplication.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FulfillmentFulfillmentLineItemApplication: core.serialization.Schema< serializers.FulfillmentFulfillmentLineItemApplication.Raw, diff --git a/src/serialization/types/FulfillmentPickupDetails.ts b/src/serialization/types/FulfillmentPickupDetails.ts index f88d88241..51a6310cd 100644 --- a/src/serialization/types/FulfillmentPickupDetails.ts +++ b/src/serialization/types/FulfillmentPickupDetails.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { FulfillmentRecipient } from "./FulfillmentRecipient"; -import { FulfillmentPickupDetailsScheduleType } from "./FulfillmentPickupDetailsScheduleType"; +import type * as serializers from "../index"; import { FulfillmentPickupDetailsCurbsidePickupDetails } from "./FulfillmentPickupDetailsCurbsidePickupDetails"; +import { FulfillmentPickupDetailsScheduleType } from "./FulfillmentPickupDetailsScheduleType"; +import { FulfillmentRecipient } from "./FulfillmentRecipient"; export const FulfillmentPickupDetails: core.serialization.ObjectSchema< serializers.FulfillmentPickupDetails.Raw, @@ -48,13 +46,13 @@ export const FulfillmentPickupDetails: core.serialization.ObjectSchema< export declare namespace FulfillmentPickupDetails { export interface Raw { recipient?: FulfillmentRecipient.Raw | null; - expires_at?: (string | null) | null; - auto_complete_duration?: (string | null) | null; + expires_at?: (string | null | undefined) | null; + auto_complete_duration?: (string | null | undefined) | null; schedule_type?: FulfillmentPickupDetailsScheduleType.Raw | null; - pickup_at?: (string | null) | null; - pickup_window_duration?: (string | null) | null; - prep_time_duration?: (string | null) | null; - note?: (string | null) | null; + pickup_at?: (string | null | undefined) | null; + pickup_window_duration?: (string | null | undefined) | null; + prep_time_duration?: (string | null | undefined) | null; + note?: (string | null | undefined) | null; placed_at?: string | null; accepted_at?: string | null; rejected_at?: string | null; @@ -62,8 +60,8 @@ export declare namespace FulfillmentPickupDetails { expired_at?: string | null; picked_up_at?: string | null; canceled_at?: string | null; - cancel_reason?: (string | null) | null; - is_curbside_pickup?: (boolean | null) | null; + cancel_reason?: (string | null | undefined) | null; + is_curbside_pickup?: (boolean | null | undefined) | null; curbside_pickup_details?: FulfillmentPickupDetailsCurbsidePickupDetails.Raw | null; } } diff --git a/src/serialization/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts b/src/serialization/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts index ce8f1eb19..ed06beb55 100644 --- a/src/serialization/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts +++ b/src/serialization/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FulfillmentPickupDetailsCurbsidePickupDetails: core.serialization.ObjectSchema< serializers.FulfillmentPickupDetailsCurbsidePickupDetails.Raw, @@ -16,7 +14,7 @@ export const FulfillmentPickupDetailsCurbsidePickupDetails: core.serialization.O export declare namespace FulfillmentPickupDetailsCurbsidePickupDetails { export interface Raw { - curbside_details?: (string | null) | null; - buyer_arrived_at?: (string | null) | null; + curbside_details?: (string | null | undefined) | null; + buyer_arrived_at?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/FulfillmentPickupDetailsScheduleType.ts b/src/serialization/types/FulfillmentPickupDetailsScheduleType.ts index 1d5ad7e9b..65a9528e9 100644 --- a/src/serialization/types/FulfillmentPickupDetailsScheduleType.ts +++ b/src/serialization/types/FulfillmentPickupDetailsScheduleType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FulfillmentPickupDetailsScheduleType: core.serialization.Schema< serializers.FulfillmentPickupDetailsScheduleType.Raw, diff --git a/src/serialization/types/FulfillmentRecipient.ts b/src/serialization/types/FulfillmentRecipient.ts index 43148eacb..32b327644 100644 --- a/src/serialization/types/FulfillmentRecipient.ts +++ b/src/serialization/types/FulfillmentRecipient.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Address } from "./Address"; export const FulfillmentRecipient: core.serialization.ObjectSchema< @@ -20,10 +18,10 @@ export const FulfillmentRecipient: core.serialization.ObjectSchema< export declare namespace FulfillmentRecipient { export interface Raw { - customer_id?: (string | null) | null; - display_name?: (string | null) | null; - email_address?: (string | null) | null; - phone_number?: (string | null) | null; + customer_id?: (string | null | undefined) | null; + display_name?: (string | null | undefined) | null; + email_address?: (string | null | undefined) | null; + phone_number?: (string | null | undefined) | null; address?: Address.Raw | null; } } diff --git a/src/serialization/types/FulfillmentShipmentDetails.ts b/src/serialization/types/FulfillmentShipmentDetails.ts index b79f6229d..a67791df3 100644 --- a/src/serialization/types/FulfillmentShipmentDetails.ts +++ b/src/serialization/types/FulfillmentShipmentDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FulfillmentRecipient } from "./FulfillmentRecipient"; export const FulfillmentShipmentDetails: core.serialization.ObjectSchema< @@ -34,19 +32,19 @@ export const FulfillmentShipmentDetails: core.serialization.ObjectSchema< export declare namespace FulfillmentShipmentDetails { export interface Raw { recipient?: FulfillmentRecipient.Raw | null; - carrier?: (string | null) | null; - shipping_note?: (string | null) | null; - shipping_type?: (string | null) | null; - tracking_number?: (string | null) | null; - tracking_url?: (string | null) | null; + carrier?: (string | null | undefined) | null; + shipping_note?: (string | null | undefined) | null; + shipping_type?: (string | null | undefined) | null; + tracking_number?: (string | null | undefined) | null; + tracking_url?: (string | null | undefined) | null; placed_at?: string | null; in_progress_at?: string | null; packaged_at?: string | null; - expected_shipped_at?: (string | null) | null; + expected_shipped_at?: (string | null | undefined) | null; shipped_at?: string | null; - canceled_at?: (string | null) | null; - cancel_reason?: (string | null) | null; + canceled_at?: (string | null | undefined) | null; + cancel_reason?: (string | null | undefined) | null; failed_at?: string | null; - failure_reason?: (string | null) | null; + failure_reason?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/FulfillmentState.ts b/src/serialization/types/FulfillmentState.ts index d624ac9e3..5b40133bd 100644 --- a/src/serialization/types/FulfillmentState.ts +++ b/src/serialization/types/FulfillmentState.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FulfillmentState: core.serialization.Schema = core.serialization.enum_(["PROPOSED", "RESERVED", "PREPARED", "COMPLETED", "CANCELED", "FAILED"]); diff --git a/src/serialization/types/FulfillmentType.ts b/src/serialization/types/FulfillmentType.ts index 88783a472..049042b57 100644 --- a/src/serialization/types/FulfillmentType.ts +++ b/src/serialization/types/FulfillmentType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const FulfillmentType: core.serialization.Schema = core.serialization.enum_(["PICKUP", "SHIPMENT", "DELIVERY"]); diff --git a/src/serialization/types/GetBankAccountByV1IdResponse.ts b/src/serialization/types/GetBankAccountByV1IdResponse.ts index f4c5e2568..207f7cffe 100644 --- a/src/serialization/types/GetBankAccountByV1IdResponse.ts +++ b/src/serialization/types/GetBankAccountByV1IdResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { BankAccount } from "./BankAccount"; +import { Error_ } from "./Error_"; export const GetBankAccountByV1IdResponse: core.serialization.ObjectSchema< serializers.GetBankAccountByV1IdResponse.Raw, diff --git a/src/serialization/types/GetBankAccountResponse.ts b/src/serialization/types/GetBankAccountResponse.ts index cb4e4e99d..2d2bc324e 100644 --- a/src/serialization/types/GetBankAccountResponse.ts +++ b/src/serialization/types/GetBankAccountResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { BankAccount } from "./BankAccount"; +import { Error_ } from "./Error_"; export const GetBankAccountResponse: core.serialization.ObjectSchema< serializers.GetBankAccountResponse.Raw, diff --git a/src/serialization/types/GetBookingRequest.ts b/src/serialization/types/GetBookingRequest.ts index d408951cc..aa5f5c8d5 100644 --- a/src/serialization/types/GetBookingRequest.ts +++ b/src/serialization/types/GetBookingRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetBookingRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetBookingResponse.ts b/src/serialization/types/GetBookingResponse.ts index 2a90fa6d8..d950d35a3 100644 --- a/src/serialization/types/GetBookingResponse.ts +++ b/src/serialization/types/GetBookingResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Booking } from "./Booking"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetBreakTypeResponse.ts b/src/serialization/types/GetBreakTypeResponse.ts index 026c809cc..5381c3001 100644 --- a/src/serialization/types/GetBreakTypeResponse.ts +++ b/src/serialization/types/GetBreakTypeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BreakType } from "./BreakType"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetBusinessBookingProfileRequest.ts b/src/serialization/types/GetBusinessBookingProfileRequest.ts index 26bfcf738..02ab5cf13 100644 --- a/src/serialization/types/GetBusinessBookingProfileRequest.ts +++ b/src/serialization/types/GetBusinessBookingProfileRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetBusinessBookingProfileRequest: core.serialization.Schema< serializers.GetBusinessBookingProfileRequest.Raw, diff --git a/src/serialization/types/GetBusinessBookingProfileResponse.ts b/src/serialization/types/GetBusinessBookingProfileResponse.ts index 9c7bd48c6..aa8b35013 100644 --- a/src/serialization/types/GetBusinessBookingProfileResponse.ts +++ b/src/serialization/types/GetBusinessBookingProfileResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { BusinessBookingProfile } from "./BusinessBookingProfile"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetCardRequest.ts b/src/serialization/types/GetCardRequest.ts index 12ae29f20..fe2460dd5 100644 --- a/src/serialization/types/GetCardRequest.ts +++ b/src/serialization/types/GetCardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetCardRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetCardResponse.ts b/src/serialization/types/GetCardResponse.ts index 4f32f7c94..688735618 100644 --- a/src/serialization/types/GetCardResponse.ts +++ b/src/serialization/types/GetCardResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Card } from "./Card"; +import { Error_ } from "./Error_"; export const GetCardResponse: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/GetCashDrawerShiftResponse.ts b/src/serialization/types/GetCashDrawerShiftResponse.ts index 7dbb57527..2163cd7ff 100644 --- a/src/serialization/types/GetCashDrawerShiftResponse.ts +++ b/src/serialization/types/GetCashDrawerShiftResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CashDrawerShift } from "./CashDrawerShift"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetCatalogObjectResponse.ts b/src/serialization/types/GetCatalogObjectResponse.ts index bfaac4ff3..b6a7cfecc 100644 --- a/src/serialization/types/GetCatalogObjectResponse.ts +++ b/src/serialization/types/GetCatalogObjectResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { Error_ } from "./Error_"; export const GetCatalogObjectResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GetCustomerCustomAttributeDefinitionResponse.ts b/src/serialization/types/GetCustomerCustomAttributeDefinitionResponse.ts index 1472950ac..6059a67a1 100644 --- a/src/serialization/types/GetCustomerCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/GetCustomerCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetCustomerCustomAttributeResponse.ts b/src/serialization/types/GetCustomerCustomAttributeResponse.ts index b927cf0fa..ce2f98b7f 100644 --- a/src/serialization/types/GetCustomerCustomAttributeResponse.ts +++ b/src/serialization/types/GetCustomerCustomAttributeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetCustomerGroupRequest.ts b/src/serialization/types/GetCustomerGroupRequest.ts index f4dfa52b9..7cf623abb 100644 --- a/src/serialization/types/GetCustomerGroupRequest.ts +++ b/src/serialization/types/GetCustomerGroupRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetCustomerGroupRequest: core.serialization.Schema< serializers.GetCustomerGroupRequest.Raw, diff --git a/src/serialization/types/GetCustomerGroupResponse.ts b/src/serialization/types/GetCustomerGroupResponse.ts index a7006053f..1bd8a0d56 100644 --- a/src/serialization/types/GetCustomerGroupResponse.ts +++ b/src/serialization/types/GetCustomerGroupResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { CustomerGroup } from "./CustomerGroup"; +import { Error_ } from "./Error_"; export const GetCustomerGroupResponse: core.serialization.ObjectSchema< serializers.GetCustomerGroupResponse.Raw, diff --git a/src/serialization/types/GetCustomerRequest.ts b/src/serialization/types/GetCustomerRequest.ts index 8526416bd..bc9d98057 100644 --- a/src/serialization/types/GetCustomerRequest.ts +++ b/src/serialization/types/GetCustomerRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetCustomerRequest: core.serialization.Schema< serializers.GetCustomerRequest.Raw, diff --git a/src/serialization/types/GetCustomerResponse.ts b/src/serialization/types/GetCustomerResponse.ts index f590308e1..37db6b63a 100644 --- a/src/serialization/types/GetCustomerResponse.ts +++ b/src/serialization/types/GetCustomerResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Customer } from "./Customer"; +import { Error_ } from "./Error_"; export const GetCustomerResponse: core.serialization.ObjectSchema< serializers.GetCustomerResponse.Raw, diff --git a/src/serialization/types/GetCustomerSegmentRequest.ts b/src/serialization/types/GetCustomerSegmentRequest.ts index c247de446..fc9d6ed21 100644 --- a/src/serialization/types/GetCustomerSegmentRequest.ts +++ b/src/serialization/types/GetCustomerSegmentRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetCustomerSegmentRequest: core.serialization.Schema< serializers.GetCustomerSegmentRequest.Raw, diff --git a/src/serialization/types/GetCustomerSegmentResponse.ts b/src/serialization/types/GetCustomerSegmentResponse.ts index 40aa558b5..f08dfb59d 100644 --- a/src/serialization/types/GetCustomerSegmentResponse.ts +++ b/src/serialization/types/GetCustomerSegmentResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { CustomerSegment } from "./CustomerSegment"; +import { Error_ } from "./Error_"; export const GetCustomerSegmentResponse: core.serialization.ObjectSchema< serializers.GetCustomerSegmentResponse.Raw, diff --git a/src/serialization/types/GetDeviceCodeResponse.ts b/src/serialization/types/GetDeviceCodeResponse.ts index ce9400994..89a5ecc15 100644 --- a/src/serialization/types/GetDeviceCodeResponse.ts +++ b/src/serialization/types/GetDeviceCodeResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { DeviceCode } from "./DeviceCode"; +import { Error_ } from "./Error_"; export const GetDeviceCodeResponse: core.serialization.ObjectSchema< serializers.GetDeviceCodeResponse.Raw, diff --git a/src/serialization/types/GetDeviceResponse.ts b/src/serialization/types/GetDeviceResponse.ts index 0de28714a..0dd6da898 100644 --- a/src/serialization/types/GetDeviceResponse.ts +++ b/src/serialization/types/GetDeviceResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Device } from "./Device"; +import { Error_ } from "./Error_"; export const GetDeviceResponse: core.serialization.ObjectSchema< serializers.GetDeviceResponse.Raw, diff --git a/src/serialization/types/GetDisputeEvidenceRequest.ts b/src/serialization/types/GetDisputeEvidenceRequest.ts index 63effcd24..313fb8ace 100644 --- a/src/serialization/types/GetDisputeEvidenceRequest.ts +++ b/src/serialization/types/GetDisputeEvidenceRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetDisputeEvidenceRequest: core.serialization.Schema< serializers.GetDisputeEvidenceRequest.Raw, diff --git a/src/serialization/types/GetDisputeEvidenceResponse.ts b/src/serialization/types/GetDisputeEvidenceResponse.ts index df9d25569..b029ce773 100644 --- a/src/serialization/types/GetDisputeEvidenceResponse.ts +++ b/src/serialization/types/GetDisputeEvidenceResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { DisputeEvidence } from "./DisputeEvidence"; +import { Error_ } from "./Error_"; export const GetDisputeEvidenceResponse: core.serialization.ObjectSchema< serializers.GetDisputeEvidenceResponse.Raw, diff --git a/src/serialization/types/GetDisputeRequest.ts b/src/serialization/types/GetDisputeRequest.ts index e8d3f5ce1..7633de060 100644 --- a/src/serialization/types/GetDisputeRequest.ts +++ b/src/serialization/types/GetDisputeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetDisputeRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetDisputeResponse.ts b/src/serialization/types/GetDisputeResponse.ts index 182b44846..44660732c 100644 --- a/src/serialization/types/GetDisputeResponse.ts +++ b/src/serialization/types/GetDisputeResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Dispute } from "./Dispute"; +import { Error_ } from "./Error_"; export const GetDisputeResponse: core.serialization.ObjectSchema< serializers.GetDisputeResponse.Raw, diff --git a/src/serialization/types/GetEmployeeRequest.ts b/src/serialization/types/GetEmployeeRequest.ts index 136c96bbe..9f662a9be 100644 --- a/src/serialization/types/GetEmployeeRequest.ts +++ b/src/serialization/types/GetEmployeeRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetEmployeeRequest: core.serialization.Schema< serializers.GetEmployeeRequest.Raw, diff --git a/src/serialization/types/GetEmployeeResponse.ts b/src/serialization/types/GetEmployeeResponse.ts index 268f84fc5..fea595974 100644 --- a/src/serialization/types/GetEmployeeResponse.ts +++ b/src/serialization/types/GetEmployeeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Employee } from "./Employee"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetEmployeeWageResponse.ts b/src/serialization/types/GetEmployeeWageResponse.ts index 5181efdb6..ae9dc566c 100644 --- a/src/serialization/types/GetEmployeeWageResponse.ts +++ b/src/serialization/types/GetEmployeeWageResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { EmployeeWage } from "./EmployeeWage"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetGiftCardFromGanResponse.ts b/src/serialization/types/GetGiftCardFromGanResponse.ts index cf88fa9ad..4925b3682 100644 --- a/src/serialization/types/GetGiftCardFromGanResponse.ts +++ b/src/serialization/types/GetGiftCardFromGanResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCard } from "./GiftCard"; diff --git a/src/serialization/types/GetGiftCardFromNonceResponse.ts b/src/serialization/types/GetGiftCardFromNonceResponse.ts index 242d8b966..3e3213606 100644 --- a/src/serialization/types/GetGiftCardFromNonceResponse.ts +++ b/src/serialization/types/GetGiftCardFromNonceResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCard } from "./GiftCard"; diff --git a/src/serialization/types/GetGiftCardRequest.ts b/src/serialization/types/GetGiftCardRequest.ts index 3c705f1c6..4730ba070 100644 --- a/src/serialization/types/GetGiftCardRequest.ts +++ b/src/serialization/types/GetGiftCardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetGiftCardRequest: core.serialization.Schema< serializers.GetGiftCardRequest.Raw, diff --git a/src/serialization/types/GetGiftCardResponse.ts b/src/serialization/types/GetGiftCardResponse.ts index 467a46cc0..8c4eaf1df 100644 --- a/src/serialization/types/GetGiftCardResponse.ts +++ b/src/serialization/types/GetGiftCardResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCard } from "./GiftCard"; diff --git a/src/serialization/types/GetInventoryAdjustmentRequest.ts b/src/serialization/types/GetInventoryAdjustmentRequest.ts index 4902f518c..78061be14 100644 --- a/src/serialization/types/GetInventoryAdjustmentRequest.ts +++ b/src/serialization/types/GetInventoryAdjustmentRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetInventoryAdjustmentRequest: core.serialization.Schema< serializers.GetInventoryAdjustmentRequest.Raw, diff --git a/src/serialization/types/GetInventoryAdjustmentResponse.ts b/src/serialization/types/GetInventoryAdjustmentResponse.ts index 74163baa7..8d797b655 100644 --- a/src/serialization/types/GetInventoryAdjustmentResponse.ts +++ b/src/serialization/types/GetInventoryAdjustmentResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryAdjustment } from "./InventoryAdjustment"; diff --git a/src/serialization/types/GetInventoryChangesResponse.ts b/src/serialization/types/GetInventoryChangesResponse.ts index 1c75db603..22249f5fa 100644 --- a/src/serialization/types/GetInventoryChangesResponse.ts +++ b/src/serialization/types/GetInventoryChangesResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryChange } from "./InventoryChange"; diff --git a/src/serialization/types/GetInventoryCountResponse.ts b/src/serialization/types/GetInventoryCountResponse.ts index f9f487d37..e2eaa127f 100644 --- a/src/serialization/types/GetInventoryCountResponse.ts +++ b/src/serialization/types/GetInventoryCountResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryCount } from "./InventoryCount"; diff --git a/src/serialization/types/GetInventoryPhysicalCountRequest.ts b/src/serialization/types/GetInventoryPhysicalCountRequest.ts index 0df7bf141..642d5ce9c 100644 --- a/src/serialization/types/GetInventoryPhysicalCountRequest.ts +++ b/src/serialization/types/GetInventoryPhysicalCountRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetInventoryPhysicalCountRequest: core.serialization.Schema< serializers.GetInventoryPhysicalCountRequest.Raw, diff --git a/src/serialization/types/GetInventoryPhysicalCountResponse.ts b/src/serialization/types/GetInventoryPhysicalCountResponse.ts index 74e4f9b41..59fec0f1a 100644 --- a/src/serialization/types/GetInventoryPhysicalCountResponse.ts +++ b/src/serialization/types/GetInventoryPhysicalCountResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryPhysicalCount } from "./InventoryPhysicalCount"; diff --git a/src/serialization/types/GetInventoryTransferRequest.ts b/src/serialization/types/GetInventoryTransferRequest.ts index 7d7383fce..8b0dc78bf 100644 --- a/src/serialization/types/GetInventoryTransferRequest.ts +++ b/src/serialization/types/GetInventoryTransferRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetInventoryTransferRequest: core.serialization.Schema< serializers.GetInventoryTransferRequest.Raw, diff --git a/src/serialization/types/GetInventoryTransferResponse.ts b/src/serialization/types/GetInventoryTransferResponse.ts index 2094d9103..e0dfe3168 100644 --- a/src/serialization/types/GetInventoryTransferResponse.ts +++ b/src/serialization/types/GetInventoryTransferResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryTransfer } from "./InventoryTransfer"; diff --git a/src/serialization/types/GetInvoiceResponse.ts b/src/serialization/types/GetInvoiceResponse.ts index 038461e76..d96701e49 100644 --- a/src/serialization/types/GetInvoiceResponse.ts +++ b/src/serialization/types/GetInvoiceResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Invoice } from "./Invoice"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Invoice } from "./Invoice"; export const GetInvoiceResponse: core.serialization.ObjectSchema< serializers.GetInvoiceResponse.Raw, diff --git a/src/serialization/types/GetLocationRequest.ts b/src/serialization/types/GetLocationRequest.ts index 461c0c8cc..8e0c39a11 100644 --- a/src/serialization/types/GetLocationRequest.ts +++ b/src/serialization/types/GetLocationRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetLocationRequest: core.serialization.Schema< serializers.GetLocationRequest.Raw, diff --git a/src/serialization/types/GetLocationResponse.ts b/src/serialization/types/GetLocationResponse.ts index 7d4112fd7..67af211fc 100644 --- a/src/serialization/types/GetLocationResponse.ts +++ b/src/serialization/types/GetLocationResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Location } from "./Location"; diff --git a/src/serialization/types/GetLoyaltyAccountRequest.ts b/src/serialization/types/GetLoyaltyAccountRequest.ts index 689c3491a..396130002 100644 --- a/src/serialization/types/GetLoyaltyAccountRequest.ts +++ b/src/serialization/types/GetLoyaltyAccountRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetLoyaltyAccountRequest: core.serialization.Schema< serializers.GetLoyaltyAccountRequest.Raw, diff --git a/src/serialization/types/GetLoyaltyAccountResponse.ts b/src/serialization/types/GetLoyaltyAccountResponse.ts index 15b8eeb30..0c151c9c2 100644 --- a/src/serialization/types/GetLoyaltyAccountResponse.ts +++ b/src/serialization/types/GetLoyaltyAccountResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyAccount } from "./LoyaltyAccount"; diff --git a/src/serialization/types/GetLoyaltyProgramRequest.ts b/src/serialization/types/GetLoyaltyProgramRequest.ts index c7ab0be0a..183c04ce3 100644 --- a/src/serialization/types/GetLoyaltyProgramRequest.ts +++ b/src/serialization/types/GetLoyaltyProgramRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetLoyaltyProgramRequest: core.serialization.Schema< serializers.GetLoyaltyProgramRequest.Raw, diff --git a/src/serialization/types/GetLoyaltyProgramResponse.ts b/src/serialization/types/GetLoyaltyProgramResponse.ts index c054699c1..0a81208d0 100644 --- a/src/serialization/types/GetLoyaltyProgramResponse.ts +++ b/src/serialization/types/GetLoyaltyProgramResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyProgram } from "./LoyaltyProgram"; diff --git a/src/serialization/types/GetLoyaltyPromotionRequest.ts b/src/serialization/types/GetLoyaltyPromotionRequest.ts index 36531ed2e..f673a2d7f 100644 --- a/src/serialization/types/GetLoyaltyPromotionRequest.ts +++ b/src/serialization/types/GetLoyaltyPromotionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetLoyaltyPromotionRequest: core.serialization.Schema< serializers.GetLoyaltyPromotionRequest.Raw, diff --git a/src/serialization/types/GetLoyaltyPromotionResponse.ts b/src/serialization/types/GetLoyaltyPromotionResponse.ts index d300d9cbd..cb686c182 100644 --- a/src/serialization/types/GetLoyaltyPromotionResponse.ts +++ b/src/serialization/types/GetLoyaltyPromotionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyPromotion } from "./LoyaltyPromotion"; diff --git a/src/serialization/types/GetLoyaltyRewardRequest.ts b/src/serialization/types/GetLoyaltyRewardRequest.ts index d8ecd561b..d54285fb8 100644 --- a/src/serialization/types/GetLoyaltyRewardRequest.ts +++ b/src/serialization/types/GetLoyaltyRewardRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetLoyaltyRewardRequest: core.serialization.Schema< serializers.GetLoyaltyRewardRequest.Raw, diff --git a/src/serialization/types/GetLoyaltyRewardResponse.ts b/src/serialization/types/GetLoyaltyRewardResponse.ts index d936de9af..0ae8a962b 100644 --- a/src/serialization/types/GetLoyaltyRewardResponse.ts +++ b/src/serialization/types/GetLoyaltyRewardResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyReward } from "./LoyaltyReward"; diff --git a/src/serialization/types/GetMerchantRequest.ts b/src/serialization/types/GetMerchantRequest.ts index 23b622a5b..87f099df4 100644 --- a/src/serialization/types/GetMerchantRequest.ts +++ b/src/serialization/types/GetMerchantRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetMerchantRequest: core.serialization.Schema< serializers.GetMerchantRequest.Raw, diff --git a/src/serialization/types/GetMerchantResponse.ts b/src/serialization/types/GetMerchantResponse.ts index 4f6ed35c3..207a42c13 100644 --- a/src/serialization/types/GetMerchantResponse.ts +++ b/src/serialization/types/GetMerchantResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Merchant } from "./Merchant"; diff --git a/src/serialization/types/GetOrderRequest.ts b/src/serialization/types/GetOrderRequest.ts index 90f21d792..c5ab643b9 100644 --- a/src/serialization/types/GetOrderRequest.ts +++ b/src/serialization/types/GetOrderRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetOrderRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetOrderResponse.ts b/src/serialization/types/GetOrderResponse.ts index 903ce0f8c..25d97fec6 100644 --- a/src/serialization/types/GetOrderResponse.ts +++ b/src/serialization/types/GetOrderResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Order } from "./Order"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Order } from "./Order"; export const GetOrderResponse: core.serialization.ObjectSchema< serializers.GetOrderResponse.Raw, diff --git a/src/serialization/types/GetPaymentLinkRequest.ts b/src/serialization/types/GetPaymentLinkRequest.ts index 96dd5d8a5..2a8a3092a 100644 --- a/src/serialization/types/GetPaymentLinkRequest.ts +++ b/src/serialization/types/GetPaymentLinkRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetPaymentLinkRequest: core.serialization.Schema< serializers.GetPaymentLinkRequest.Raw, diff --git a/src/serialization/types/GetPaymentLinkResponse.ts b/src/serialization/types/GetPaymentLinkResponse.ts index bcdcca186..378b03cd2 100644 --- a/src/serialization/types/GetPaymentLinkResponse.ts +++ b/src/serialization/types/GetPaymentLinkResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentLink } from "./PaymentLink"; diff --git a/src/serialization/types/GetPaymentRefundResponse.ts b/src/serialization/types/GetPaymentRefundResponse.ts index 9711d4d39..132afd024 100644 --- a/src/serialization/types/GetPaymentRefundResponse.ts +++ b/src/serialization/types/GetPaymentRefundResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentRefund } from "./PaymentRefund"; diff --git a/src/serialization/types/GetPaymentResponse.ts b/src/serialization/types/GetPaymentResponse.ts index 0f380cf2f..3293401ff 100644 --- a/src/serialization/types/GetPaymentResponse.ts +++ b/src/serialization/types/GetPaymentResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Payment } from "./Payment"; diff --git a/src/serialization/types/GetPayoutResponse.ts b/src/serialization/types/GetPayoutResponse.ts index cebd3beca..86765db6f 100644 --- a/src/serialization/types/GetPayoutResponse.ts +++ b/src/serialization/types/GetPayoutResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Payout } from "./Payout"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Payout } from "./Payout"; export const GetPayoutResponse: core.serialization.ObjectSchema< serializers.GetPayoutResponse.Raw, diff --git a/src/serialization/types/GetShiftResponse.ts b/src/serialization/types/GetShiftResponse.ts index 9c02f8677..bbc0f950e 100644 --- a/src/serialization/types/GetShiftResponse.ts +++ b/src/serialization/types/GetShiftResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Shift } from "./Shift"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Shift } from "./Shift"; export const GetShiftResponse: core.serialization.ObjectSchema< serializers.GetShiftResponse.Raw, diff --git a/src/serialization/types/GetSnippetRequest.ts b/src/serialization/types/GetSnippetRequest.ts index 8bcf10913..115afa0c9 100644 --- a/src/serialization/types/GetSnippetRequest.ts +++ b/src/serialization/types/GetSnippetRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetSnippetRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetSnippetResponse.ts b/src/serialization/types/GetSnippetResponse.ts index a0a418678..e2722065a 100644 --- a/src/serialization/types/GetSnippetResponse.ts +++ b/src/serialization/types/GetSnippetResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Snippet } from "./Snippet"; diff --git a/src/serialization/types/GetSubscriptionResponse.ts b/src/serialization/types/GetSubscriptionResponse.ts index 76695322b..c42a12c76 100644 --- a/src/serialization/types/GetSubscriptionResponse.ts +++ b/src/serialization/types/GetSubscriptionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; diff --git a/src/serialization/types/GetTeamMemberBookingProfileRequest.ts b/src/serialization/types/GetTeamMemberBookingProfileRequest.ts index ff7ab4a1e..36ca6e118 100644 --- a/src/serialization/types/GetTeamMemberBookingProfileRequest.ts +++ b/src/serialization/types/GetTeamMemberBookingProfileRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetTeamMemberBookingProfileRequest: core.serialization.Schema< serializers.GetTeamMemberBookingProfileRequest.Raw, diff --git a/src/serialization/types/GetTeamMemberBookingProfileResponse.ts b/src/serialization/types/GetTeamMemberBookingProfileResponse.ts index 5069af0aa..887529bd7 100644 --- a/src/serialization/types/GetTeamMemberBookingProfileResponse.ts +++ b/src/serialization/types/GetTeamMemberBookingProfileResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TeamMemberBookingProfile } from "./TeamMemberBookingProfile"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { TeamMemberBookingProfile } from "./TeamMemberBookingProfile"; export const GetTeamMemberBookingProfileResponse: core.serialization.ObjectSchema< serializers.GetTeamMemberBookingProfileResponse.Raw, diff --git a/src/serialization/types/GetTeamMemberRequest.ts b/src/serialization/types/GetTeamMemberRequest.ts index b65d724ff..852bfd32a 100644 --- a/src/serialization/types/GetTeamMemberRequest.ts +++ b/src/serialization/types/GetTeamMemberRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetTeamMemberRequest: core.serialization.Schema< serializers.GetTeamMemberRequest.Raw, diff --git a/src/serialization/types/GetTeamMemberResponse.ts b/src/serialization/types/GetTeamMemberResponse.ts index 4023d83fe..1312aa31f 100644 --- a/src/serialization/types/GetTeamMemberResponse.ts +++ b/src/serialization/types/GetTeamMemberResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TeamMember } from "./TeamMember"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { TeamMember } from "./TeamMember"; export const GetTeamMemberResponse: core.serialization.ObjectSchema< serializers.GetTeamMemberResponse.Raw, diff --git a/src/serialization/types/GetTeamMemberWageResponse.ts b/src/serialization/types/GetTeamMemberWageResponse.ts index d226f40f6..ffc241079 100644 --- a/src/serialization/types/GetTeamMemberWageResponse.ts +++ b/src/serialization/types/GetTeamMemberWageResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TeamMemberWage } from "./TeamMemberWage"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { TeamMemberWage } from "./TeamMemberWage"; export const GetTeamMemberWageResponse: core.serialization.ObjectSchema< serializers.GetTeamMemberWageResponse.Raw, diff --git a/src/serialization/types/GetTerminalActionResponse.ts b/src/serialization/types/GetTerminalActionResponse.ts index 701202b83..94450c190 100644 --- a/src/serialization/types/GetTerminalActionResponse.ts +++ b/src/serialization/types/GetTerminalActionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalAction } from "./TerminalAction"; diff --git a/src/serialization/types/GetTerminalCheckoutResponse.ts b/src/serialization/types/GetTerminalCheckoutResponse.ts index 2a89d63a4..c2ed4a7be 100644 --- a/src/serialization/types/GetTerminalCheckoutResponse.ts +++ b/src/serialization/types/GetTerminalCheckoutResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalCheckout } from "./TerminalCheckout"; diff --git a/src/serialization/types/GetTerminalRefundResponse.ts b/src/serialization/types/GetTerminalRefundResponse.ts index 87febea02..66cf6e5fa 100644 --- a/src/serialization/types/GetTerminalRefundResponse.ts +++ b/src/serialization/types/GetTerminalRefundResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalRefund } from "./TerminalRefund"; diff --git a/src/serialization/types/GetTransactionRequest.ts b/src/serialization/types/GetTransactionRequest.ts index f3adb132a..2c65b93ce 100644 --- a/src/serialization/types/GetTransactionRequest.ts +++ b/src/serialization/types/GetTransactionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetTransactionRequest: core.serialization.Schema< serializers.GetTransactionRequest.Raw, diff --git a/src/serialization/types/GetTransactionResponse.ts b/src/serialization/types/GetTransactionResponse.ts index c91a94d24..a7ccd9cdb 100644 --- a/src/serialization/types/GetTransactionResponse.ts +++ b/src/serialization/types/GetTransactionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Transaction } from "./Transaction"; diff --git a/src/serialization/types/GetVendorRequest.ts b/src/serialization/types/GetVendorRequest.ts index 4c6a3fd38..805d24a40 100644 --- a/src/serialization/types/GetVendorRequest.ts +++ b/src/serialization/types/GetVendorRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetVendorRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetVendorResponse.ts b/src/serialization/types/GetVendorResponse.ts index e2c170739..178a37ce4 100644 --- a/src/serialization/types/GetVendorResponse.ts +++ b/src/serialization/types/GetVendorResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Vendor } from "./Vendor"; diff --git a/src/serialization/types/GetWageSettingRequest.ts b/src/serialization/types/GetWageSettingRequest.ts index 52ba32b82..d8238a568 100644 --- a/src/serialization/types/GetWageSettingRequest.ts +++ b/src/serialization/types/GetWageSettingRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetWageSettingRequest: core.serialization.Schema< serializers.GetWageSettingRequest.Raw, diff --git a/src/serialization/types/GetWageSettingResponse.ts b/src/serialization/types/GetWageSettingResponse.ts index cb181e5e7..a5504c3e4 100644 --- a/src/serialization/types/GetWageSettingResponse.ts +++ b/src/serialization/types/GetWageSettingResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { WageSetting } from "./WageSetting"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { WageSetting } from "./WageSetting"; export const GetWageSettingResponse: core.serialization.ObjectSchema< serializers.GetWageSettingResponse.Raw, diff --git a/src/serialization/types/GetWebhookSubscriptionRequest.ts b/src/serialization/types/GetWebhookSubscriptionRequest.ts index 2e6771793..19b89a6bf 100644 --- a/src/serialization/types/GetWebhookSubscriptionRequest.ts +++ b/src/serialization/types/GetWebhookSubscriptionRequest.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GetWebhookSubscriptionRequest: core.serialization.Schema< serializers.GetWebhookSubscriptionRequest.Raw, diff --git a/src/serialization/types/GetWebhookSubscriptionResponse.ts b/src/serialization/types/GetWebhookSubscriptionResponse.ts index 3e02e9e12..5c83563bb 100644 --- a/src/serialization/types/GetWebhookSubscriptionResponse.ts +++ b/src/serialization/types/GetWebhookSubscriptionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { WebhookSubscription } from "./WebhookSubscription"; diff --git a/src/serialization/types/GiftCard.ts b/src/serialization/types/GiftCard.ts index 87199f596..1f0a0dd6c 100644 --- a/src/serialization/types/GiftCard.ts +++ b/src/serialization/types/GiftCard.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { GiftCardType } from "./GiftCardType"; +import type * as serializers from "../index"; import { GiftCardGanSource } from "./GiftCardGanSource"; import { GiftCardStatus } from "./GiftCardStatus"; +import { GiftCardType } from "./GiftCardType"; import { Money } from "./Money"; export const GiftCard: core.serialization.ObjectSchema = @@ -32,7 +30,7 @@ export declare namespace GiftCard { gan_source?: GiftCardGanSource.Raw | null; state?: GiftCardStatus.Raw | null; balance_money?: Money.Raw | null; - gan?: (string | null) | null; + gan?: (string | null | undefined) | null; created_at?: string | null; customer_ids?: string[] | null; } diff --git a/src/serialization/types/GiftCardActivity.ts b/src/serialization/types/GiftCardActivity.ts index 5f2f95243..dc9da478a 100644 --- a/src/serialization/types/GiftCardActivity.ts +++ b/src/serialization/types/GiftCardActivity.ts @@ -1,27 +1,25 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { GiftCardActivityType } from "./GiftCardActivityType"; -import { Money } from "./Money"; -import { GiftCardActivityLoad } from "./GiftCardActivityLoad"; +import type * as serializers from "../index"; import { GiftCardActivityActivate } from "./GiftCardActivityActivate"; -import { GiftCardActivityRedeem } from "./GiftCardActivityRedeem"; +import { GiftCardActivityAdjustDecrement } from "./GiftCardActivityAdjustDecrement"; +import { GiftCardActivityAdjustIncrement } from "./GiftCardActivityAdjustIncrement"; +import { GiftCardActivityBlock } from "./GiftCardActivityBlock"; import { GiftCardActivityClearBalance } from "./GiftCardActivityClearBalance"; import { GiftCardActivityDeactivate } from "./GiftCardActivityDeactivate"; -import { GiftCardActivityAdjustIncrement } from "./GiftCardActivityAdjustIncrement"; -import { GiftCardActivityAdjustDecrement } from "./GiftCardActivityAdjustDecrement"; -import { GiftCardActivityRefund } from "./GiftCardActivityRefund"; -import { GiftCardActivityUnlinkedActivityRefund } from "./GiftCardActivityUnlinkedActivityRefund"; import { GiftCardActivityImport } from "./GiftCardActivityImport"; -import { GiftCardActivityBlock } from "./GiftCardActivityBlock"; -import { GiftCardActivityUnblock } from "./GiftCardActivityUnblock"; import { GiftCardActivityImportReversal } from "./GiftCardActivityImportReversal"; -import { GiftCardActivityTransferBalanceTo } from "./GiftCardActivityTransferBalanceTo"; +import { GiftCardActivityLoad } from "./GiftCardActivityLoad"; +import { GiftCardActivityRedeem } from "./GiftCardActivityRedeem"; +import { GiftCardActivityRefund } from "./GiftCardActivityRefund"; import { GiftCardActivityTransferBalanceFrom } from "./GiftCardActivityTransferBalanceFrom"; +import { GiftCardActivityTransferBalanceTo } from "./GiftCardActivityTransferBalanceTo"; +import { GiftCardActivityType } from "./GiftCardActivityType"; +import { GiftCardActivityUnblock } from "./GiftCardActivityUnblock"; +import { GiftCardActivityUnlinkedActivityRefund } from "./GiftCardActivityUnlinkedActivityRefund"; +import { Money } from "./Money"; export const GiftCardActivity: core.serialization.ObjectSchema< serializers.GiftCardActivity.Raw, @@ -84,8 +82,8 @@ export declare namespace GiftCardActivity { type: GiftCardActivityType.Raw; location_id: string; created_at?: string | null; - gift_card_id?: (string | null) | null; - gift_card_gan?: (string | null) | null; + gift_card_id?: (string | null | undefined) | null; + gift_card_gan?: (string | null | undefined) | null; gift_card_balance_money?: Money.Raw | null; load_activity_details?: GiftCardActivityLoad.Raw | null; activate_activity_details?: GiftCardActivityActivate.Raw | null; diff --git a/src/serialization/types/GiftCardActivityActivate.ts b/src/serialization/types/GiftCardActivityActivate.ts index f4643ba31..99ac6dea6 100644 --- a/src/serialization/types/GiftCardActivityActivate.ts +++ b/src/serialization/types/GiftCardActivityActivate.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityActivate: core.serialization.ObjectSchema< @@ -24,9 +22,9 @@ export const GiftCardActivityActivate: core.serialization.ObjectSchema< export declare namespace GiftCardActivityActivate { export interface Raw { amount_money?: Money.Raw | null; - order_id?: (string | null) | null; - line_item_uid?: (string | null) | null; - reference_id?: (string | null) | null; - buyer_payment_instrument_ids?: (string[] | null) | null; + order_id?: (string | null | undefined) | null; + line_item_uid?: (string | null | undefined) | null; + reference_id?: (string | null | undefined) | null; + buyer_payment_instrument_ids?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/GiftCardActivityAdjustDecrement.ts b/src/serialization/types/GiftCardActivityAdjustDecrement.ts index 2f77e39a1..7573f4985 100644 --- a/src/serialization/types/GiftCardActivityAdjustDecrement.ts +++ b/src/serialization/types/GiftCardActivityAdjustDecrement.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Money } from "./Money"; +import type * as serializers from "../index"; import { GiftCardActivityAdjustDecrementReason } from "./GiftCardActivityAdjustDecrementReason"; +import { Money } from "./Money"; export const GiftCardActivityAdjustDecrement: core.serialization.ObjectSchema< serializers.GiftCardActivityAdjustDecrement.Raw, diff --git a/src/serialization/types/GiftCardActivityAdjustDecrementReason.ts b/src/serialization/types/GiftCardActivityAdjustDecrementReason.ts index 9d2d0fbd3..d3d3cfe52 100644 --- a/src/serialization/types/GiftCardActivityAdjustDecrementReason.ts +++ b/src/serialization/types/GiftCardActivityAdjustDecrementReason.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardActivityAdjustDecrementReason: core.serialization.Schema< serializers.GiftCardActivityAdjustDecrementReason.Raw, diff --git a/src/serialization/types/GiftCardActivityAdjustIncrement.ts b/src/serialization/types/GiftCardActivityAdjustIncrement.ts index 49f48b1e2..bc0cbdcb5 100644 --- a/src/serialization/types/GiftCardActivityAdjustIncrement.ts +++ b/src/serialization/types/GiftCardActivityAdjustIncrement.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Money } from "./Money"; +import type * as serializers from "../index"; import { GiftCardActivityAdjustIncrementReason } from "./GiftCardActivityAdjustIncrementReason"; +import { Money } from "./Money"; export const GiftCardActivityAdjustIncrement: core.serialization.ObjectSchema< serializers.GiftCardActivityAdjustIncrement.Raw, diff --git a/src/serialization/types/GiftCardActivityAdjustIncrementReason.ts b/src/serialization/types/GiftCardActivityAdjustIncrementReason.ts index cadc8cc9a..1378aae91 100644 --- a/src/serialization/types/GiftCardActivityAdjustIncrementReason.ts +++ b/src/serialization/types/GiftCardActivityAdjustIncrementReason.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardActivityAdjustIncrementReason: core.serialization.Schema< serializers.GiftCardActivityAdjustIncrementReason.Raw, diff --git a/src/serialization/types/GiftCardActivityBlock.ts b/src/serialization/types/GiftCardActivityBlock.ts index e1d40a989..5a47b1560 100644 --- a/src/serialization/types/GiftCardActivityBlock.ts +++ b/src/serialization/types/GiftCardActivityBlock.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardActivityBlockReason } from "./GiftCardActivityBlockReason"; export const GiftCardActivityBlock: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityBlockReason.ts b/src/serialization/types/GiftCardActivityBlockReason.ts index d24d63096..6a4e9b3e2 100644 --- a/src/serialization/types/GiftCardActivityBlockReason.ts +++ b/src/serialization/types/GiftCardActivityBlockReason.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardActivityBlockReason: core.serialization.Schema< serializers.GiftCardActivityBlockReason.Raw, diff --git a/src/serialization/types/GiftCardActivityClearBalance.ts b/src/serialization/types/GiftCardActivityClearBalance.ts index 14f5d1d26..98af55446 100644 --- a/src/serialization/types/GiftCardActivityClearBalance.ts +++ b/src/serialization/types/GiftCardActivityClearBalance.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardActivityClearBalanceReason } from "./GiftCardActivityClearBalanceReason"; export const GiftCardActivityClearBalance: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityClearBalanceReason.ts b/src/serialization/types/GiftCardActivityClearBalanceReason.ts index 5fe86e635..9a726ed35 100644 --- a/src/serialization/types/GiftCardActivityClearBalanceReason.ts +++ b/src/serialization/types/GiftCardActivityClearBalanceReason.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardActivityClearBalanceReason: core.serialization.Schema< serializers.GiftCardActivityClearBalanceReason.Raw, diff --git a/src/serialization/types/GiftCardActivityCreatedEvent.ts b/src/serialization/types/GiftCardActivityCreatedEvent.ts index 82935bdd9..0012d64ac 100644 --- a/src/serialization/types/GiftCardActivityCreatedEvent.ts +++ b/src/serialization/types/GiftCardActivityCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardActivityCreatedEventData } from "./GiftCardActivityCreatedEventData"; export const GiftCardActivityCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const GiftCardActivityCreatedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardActivityCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: GiftCardActivityCreatedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardActivityCreatedEventData.ts b/src/serialization/types/GiftCardActivityCreatedEventData.ts index 1d274aa2b..33656f69a 100644 --- a/src/serialization/types/GiftCardActivityCreatedEventData.ts +++ b/src/serialization/types/GiftCardActivityCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardActivityCreatedEventObject } from "./GiftCardActivityCreatedEventObject"; export const GiftCardActivityCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const GiftCardActivityCreatedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardActivityCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: GiftCardActivityCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardActivityCreatedEventObject.ts b/src/serialization/types/GiftCardActivityCreatedEventObject.ts index 736486217..2f33232e9 100644 --- a/src/serialization/types/GiftCardActivityCreatedEventObject.ts +++ b/src/serialization/types/GiftCardActivityCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardActivity } from "./GiftCardActivity"; export const GiftCardActivityCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityDeactivate.ts b/src/serialization/types/GiftCardActivityDeactivate.ts index 490a74c9e..c456a8d3f 100644 --- a/src/serialization/types/GiftCardActivityDeactivate.ts +++ b/src/serialization/types/GiftCardActivityDeactivate.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardActivityDeactivateReason } from "./GiftCardActivityDeactivateReason"; export const GiftCardActivityDeactivate: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityDeactivateReason.ts b/src/serialization/types/GiftCardActivityDeactivateReason.ts index 47ecedbf1..7708d558f 100644 --- a/src/serialization/types/GiftCardActivityDeactivateReason.ts +++ b/src/serialization/types/GiftCardActivityDeactivateReason.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardActivityDeactivateReason: core.serialization.Schema< serializers.GiftCardActivityDeactivateReason.Raw, diff --git a/src/serialization/types/GiftCardActivityImport.ts b/src/serialization/types/GiftCardActivityImport.ts index 3a84bf94b..d38b2b95d 100644 --- a/src/serialization/types/GiftCardActivityImport.ts +++ b/src/serialization/types/GiftCardActivityImport.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityImport: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityImportReversal.ts b/src/serialization/types/GiftCardActivityImportReversal.ts index f7627916d..f5a3e2f94 100644 --- a/src/serialization/types/GiftCardActivityImportReversal.ts +++ b/src/serialization/types/GiftCardActivityImportReversal.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityImportReversal: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityLoad.ts b/src/serialization/types/GiftCardActivityLoad.ts index 610635f63..a2bc16590 100644 --- a/src/serialization/types/GiftCardActivityLoad.ts +++ b/src/serialization/types/GiftCardActivityLoad.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityLoad: core.serialization.ObjectSchema< @@ -24,9 +22,9 @@ export const GiftCardActivityLoad: core.serialization.ObjectSchema< export declare namespace GiftCardActivityLoad { export interface Raw { amount_money?: Money.Raw | null; - order_id?: (string | null) | null; - line_item_uid?: (string | null) | null; - reference_id?: (string | null) | null; - buyer_payment_instrument_ids?: (string[] | null) | null; + order_id?: (string | null | undefined) | null; + line_item_uid?: (string | null | undefined) | null; + reference_id?: (string | null | undefined) | null; + buyer_payment_instrument_ids?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/GiftCardActivityRedeem.ts b/src/serialization/types/GiftCardActivityRedeem.ts index 0e43c3bc3..00883b159 100644 --- a/src/serialization/types/GiftCardActivityRedeem.ts +++ b/src/serialization/types/GiftCardActivityRedeem.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Money } from "./Money"; +import type * as serializers from "../index"; import { GiftCardActivityRedeemStatus } from "./GiftCardActivityRedeemStatus"; +import { Money } from "./Money"; export const GiftCardActivityRedeem: core.serialization.ObjectSchema< serializers.GiftCardActivityRedeem.Raw, @@ -22,7 +20,7 @@ export declare namespace GiftCardActivityRedeem { export interface Raw { amount_money: Money.Raw; payment_id?: string | null; - reference_id?: (string | null) | null; + reference_id?: (string | null | undefined) | null; status?: GiftCardActivityRedeemStatus.Raw | null; } } diff --git a/src/serialization/types/GiftCardActivityRedeemStatus.ts b/src/serialization/types/GiftCardActivityRedeemStatus.ts index ea0717145..b5a89bd79 100644 --- a/src/serialization/types/GiftCardActivityRedeemStatus.ts +++ b/src/serialization/types/GiftCardActivityRedeemStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardActivityRedeemStatus: core.serialization.Schema< serializers.GiftCardActivityRedeemStatus.Raw, diff --git a/src/serialization/types/GiftCardActivityRefund.ts b/src/serialization/types/GiftCardActivityRefund.ts index b2983e9be..38d60c91b 100644 --- a/src/serialization/types/GiftCardActivityRefund.ts +++ b/src/serialization/types/GiftCardActivityRefund.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityRefund: core.serialization.ObjectSchema< @@ -19,9 +17,9 @@ export const GiftCardActivityRefund: core.serialization.ObjectSchema< export declare namespace GiftCardActivityRefund { export interface Raw { - redeem_activity_id?: (string | null) | null; + redeem_activity_id?: (string | null | undefined) | null; amount_money?: Money.Raw | null; - reference_id?: (string | null) | null; + reference_id?: (string | null | undefined) | null; payment_id?: string | null; } } diff --git a/src/serialization/types/GiftCardActivityTransferBalanceFrom.ts b/src/serialization/types/GiftCardActivityTransferBalanceFrom.ts index 852fb7857..ecd579db6 100644 --- a/src/serialization/types/GiftCardActivityTransferBalanceFrom.ts +++ b/src/serialization/types/GiftCardActivityTransferBalanceFrom.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityTransferBalanceFrom: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityTransferBalanceTo.ts b/src/serialization/types/GiftCardActivityTransferBalanceTo.ts index 147277398..bbf8b92b5 100644 --- a/src/serialization/types/GiftCardActivityTransferBalanceTo.ts +++ b/src/serialization/types/GiftCardActivityTransferBalanceTo.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityTransferBalanceTo: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityType.ts b/src/serialization/types/GiftCardActivityType.ts index 2c628dac9..04b1734ce 100644 --- a/src/serialization/types/GiftCardActivityType.ts +++ b/src/serialization/types/GiftCardActivityType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardActivityType: core.serialization.Schema< serializers.GiftCardActivityType.Raw, diff --git a/src/serialization/types/GiftCardActivityUnblock.ts b/src/serialization/types/GiftCardActivityUnblock.ts index 6cf9f515b..4dc7199ef 100644 --- a/src/serialization/types/GiftCardActivityUnblock.ts +++ b/src/serialization/types/GiftCardActivityUnblock.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardActivityUnblockReason } from "./GiftCardActivityUnblockReason"; export const GiftCardActivityUnblock: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityUnblockReason.ts b/src/serialization/types/GiftCardActivityUnblockReason.ts index 1ffb7a9bb..b5e5ae0b3 100644 --- a/src/serialization/types/GiftCardActivityUnblockReason.ts +++ b/src/serialization/types/GiftCardActivityUnblockReason.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardActivityUnblockReason: core.serialization.Schema< serializers.GiftCardActivityUnblockReason.Raw, diff --git a/src/serialization/types/GiftCardActivityUnlinkedActivityRefund.ts b/src/serialization/types/GiftCardActivityUnlinkedActivityRefund.ts index 5e5cd0347..a2b4c0a4e 100644 --- a/src/serialization/types/GiftCardActivityUnlinkedActivityRefund.ts +++ b/src/serialization/types/GiftCardActivityUnlinkedActivityRefund.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityUnlinkedActivityRefund: core.serialization.ObjectSchema< @@ -19,7 +17,7 @@ export const GiftCardActivityUnlinkedActivityRefund: core.serialization.ObjectSc export declare namespace GiftCardActivityUnlinkedActivityRefund { export interface Raw { amount_money: Money.Raw; - reference_id?: (string | null) | null; + reference_id?: (string | null | undefined) | null; payment_id?: string | null; } } diff --git a/src/serialization/types/GiftCardActivityUpdatedEvent.ts b/src/serialization/types/GiftCardActivityUpdatedEvent.ts index 31442efd6..465c24ca4 100644 --- a/src/serialization/types/GiftCardActivityUpdatedEvent.ts +++ b/src/serialization/types/GiftCardActivityUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardActivityUpdatedEventData } from "./GiftCardActivityUpdatedEventData"; export const GiftCardActivityUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const GiftCardActivityUpdatedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardActivityUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: GiftCardActivityUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardActivityUpdatedEventData.ts b/src/serialization/types/GiftCardActivityUpdatedEventData.ts index b7be9ff4d..0a6b6b94e 100644 --- a/src/serialization/types/GiftCardActivityUpdatedEventData.ts +++ b/src/serialization/types/GiftCardActivityUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardActivityUpdatedEventObject } from "./GiftCardActivityUpdatedEventObject"; export const GiftCardActivityUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const GiftCardActivityUpdatedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardActivityUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: GiftCardActivityUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardActivityUpdatedEventObject.ts b/src/serialization/types/GiftCardActivityUpdatedEventObject.ts index 0a0f6804f..a9ae773db 100644 --- a/src/serialization/types/GiftCardActivityUpdatedEventObject.ts +++ b/src/serialization/types/GiftCardActivityUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardActivity } from "./GiftCardActivity"; export const GiftCardActivityUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardCreatedEvent.ts b/src/serialization/types/GiftCardCreatedEvent.ts index 5a8b97b7a..e2cccbfed 100644 --- a/src/serialization/types/GiftCardCreatedEvent.ts +++ b/src/serialization/types/GiftCardCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardCreatedEventData } from "./GiftCardCreatedEventData"; export const GiftCardCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const GiftCardCreatedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: GiftCardCreatedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardCreatedEventData.ts b/src/serialization/types/GiftCardCreatedEventData.ts index 1339cb783..4665cc402 100644 --- a/src/serialization/types/GiftCardCreatedEventData.ts +++ b/src/serialization/types/GiftCardCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardCreatedEventObject } from "./GiftCardCreatedEventObject"; export const GiftCardCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const GiftCardCreatedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: GiftCardCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardCreatedEventObject.ts b/src/serialization/types/GiftCardCreatedEventObject.ts index 34de654f4..166af4075 100644 --- a/src/serialization/types/GiftCardCreatedEventObject.ts +++ b/src/serialization/types/GiftCardCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCard } from "./GiftCard"; export const GiftCardCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardCustomerLinkedEvent.ts b/src/serialization/types/GiftCardCustomerLinkedEvent.ts index 3bda42ea3..369f6fa59 100644 --- a/src/serialization/types/GiftCardCustomerLinkedEvent.ts +++ b/src/serialization/types/GiftCardCustomerLinkedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardCustomerLinkedEventData } from "./GiftCardCustomerLinkedEventData"; export const GiftCardCustomerLinkedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const GiftCardCustomerLinkedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardCustomerLinkedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: GiftCardCustomerLinkedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardCustomerLinkedEventData.ts b/src/serialization/types/GiftCardCustomerLinkedEventData.ts index 08fd44bc4..4700111a1 100644 --- a/src/serialization/types/GiftCardCustomerLinkedEventData.ts +++ b/src/serialization/types/GiftCardCustomerLinkedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardCustomerLinkedEventObject } from "./GiftCardCustomerLinkedEventObject"; export const GiftCardCustomerLinkedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const GiftCardCustomerLinkedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardCustomerLinkedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: GiftCardCustomerLinkedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardCustomerLinkedEventObject.ts b/src/serialization/types/GiftCardCustomerLinkedEventObject.ts index 78d7baf47..c8b1e7557 100644 --- a/src/serialization/types/GiftCardCustomerLinkedEventObject.ts +++ b/src/serialization/types/GiftCardCustomerLinkedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCard } from "./GiftCard"; export const GiftCardCustomerLinkedEventObject: core.serialization.ObjectSchema< @@ -18,6 +16,6 @@ export const GiftCardCustomerLinkedEventObject: core.serialization.ObjectSchema< export declare namespace GiftCardCustomerLinkedEventObject { export interface Raw { gift_card?: GiftCard.Raw | null; - linked_customer_id?: (string | null) | null; + linked_customer_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/GiftCardCustomerUnlinkedEvent.ts b/src/serialization/types/GiftCardCustomerUnlinkedEvent.ts index fc128d347..3dcb5f1f6 100644 --- a/src/serialization/types/GiftCardCustomerUnlinkedEvent.ts +++ b/src/serialization/types/GiftCardCustomerUnlinkedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardCustomerUnlinkedEventData } from "./GiftCardCustomerUnlinkedEventData"; export const GiftCardCustomerUnlinkedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const GiftCardCustomerUnlinkedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardCustomerUnlinkedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: GiftCardCustomerUnlinkedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardCustomerUnlinkedEventData.ts b/src/serialization/types/GiftCardCustomerUnlinkedEventData.ts index 3208e670e..e398c3062 100644 --- a/src/serialization/types/GiftCardCustomerUnlinkedEventData.ts +++ b/src/serialization/types/GiftCardCustomerUnlinkedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardCustomerUnlinkedEventObject } from "./GiftCardCustomerUnlinkedEventObject"; export const GiftCardCustomerUnlinkedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const GiftCardCustomerUnlinkedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardCustomerUnlinkedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: GiftCardCustomerUnlinkedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardCustomerUnlinkedEventObject.ts b/src/serialization/types/GiftCardCustomerUnlinkedEventObject.ts index 2c74d9e6d..7de0d8242 100644 --- a/src/serialization/types/GiftCardCustomerUnlinkedEventObject.ts +++ b/src/serialization/types/GiftCardCustomerUnlinkedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCard } from "./GiftCard"; export const GiftCardCustomerUnlinkedEventObject: core.serialization.ObjectSchema< @@ -21,6 +19,6 @@ export const GiftCardCustomerUnlinkedEventObject: core.serialization.ObjectSchem export declare namespace GiftCardCustomerUnlinkedEventObject { export interface Raw { gift_card?: GiftCard.Raw | null; - unlinked_customer_id?: (string | null) | null; + unlinked_customer_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/GiftCardGanSource.ts b/src/serialization/types/GiftCardGanSource.ts index 759e10061..d56c42f44 100644 --- a/src/serialization/types/GiftCardGanSource.ts +++ b/src/serialization/types/GiftCardGanSource.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardGanSource: core.serialization.Schema = core.serialization.enum_(["SQUARE", "OTHER"]); diff --git a/src/serialization/types/GiftCardStatus.ts b/src/serialization/types/GiftCardStatus.ts index eeb183e8f..30d3cd5fe 100644 --- a/src/serialization/types/GiftCardStatus.ts +++ b/src/serialization/types/GiftCardStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardStatus: core.serialization.Schema = core.serialization.enum_(["ACTIVE", "DEACTIVATED", "BLOCKED", "PENDING"]); diff --git a/src/serialization/types/GiftCardType.ts b/src/serialization/types/GiftCardType.ts index 42a52afa9..3f2def67d 100644 --- a/src/serialization/types/GiftCardType.ts +++ b/src/serialization/types/GiftCardType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const GiftCardType: core.serialization.Schema = core.serialization.enum_(["PHYSICAL", "DIGITAL"]); diff --git a/src/serialization/types/GiftCardUpdatedEvent.ts b/src/serialization/types/GiftCardUpdatedEvent.ts index e947e260c..f3cb27c61 100644 --- a/src/serialization/types/GiftCardUpdatedEvent.ts +++ b/src/serialization/types/GiftCardUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardUpdatedEventData } from "./GiftCardUpdatedEventData"; export const GiftCardUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const GiftCardUpdatedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: GiftCardUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardUpdatedEventData.ts b/src/serialization/types/GiftCardUpdatedEventData.ts index d5dd91b53..75d0b589d 100644 --- a/src/serialization/types/GiftCardUpdatedEventData.ts +++ b/src/serialization/types/GiftCardUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCardUpdatedEventObject } from "./GiftCardUpdatedEventObject"; export const GiftCardUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const GiftCardUpdatedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: GiftCardUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardUpdatedEventObject.ts b/src/serialization/types/GiftCardUpdatedEventObject.ts index d550374cc..ea933f07a 100644 --- a/src/serialization/types/GiftCardUpdatedEventObject.ts +++ b/src/serialization/types/GiftCardUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { GiftCard } from "./GiftCard"; export const GiftCardUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/InventoryAdjustment.ts b/src/serialization/types/InventoryAdjustment.ts index c0f813c6f..0a0201f12 100644 --- a/src/serialization/types/InventoryAdjustment.ts +++ b/src/serialization/types/InventoryAdjustment.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; +import { InventoryAdjustmentGroup } from "./InventoryAdjustmentGroup"; import { InventoryState } from "./InventoryState"; import { Money } from "./Money"; import { SourceApplication } from "./SourceApplication"; -import { InventoryAdjustmentGroup } from "./InventoryAdjustmentGroup"; export const InventoryAdjustment: core.serialization.ObjectSchema< serializers.InventoryAdjustment.Raw, @@ -41,19 +39,19 @@ export const InventoryAdjustment: core.serialization.ObjectSchema< export declare namespace InventoryAdjustment { export interface Raw { id?: string | null; - reference_id?: (string | null) | null; + reference_id?: (string | null | undefined) | null; from_state?: InventoryState.Raw | null; to_state?: InventoryState.Raw | null; - location_id?: (string | null) | null; - catalog_object_id?: (string | null) | null; - catalog_object_type?: (string | null) | null; - quantity?: (string | null) | null; + location_id?: (string | null | undefined) | null; + catalog_object_id?: (string | null | undefined) | null; + catalog_object_type?: (string | null | undefined) | null; + quantity?: (string | null | undefined) | null; total_price_money?: Money.Raw | null; - occurred_at?: (string | null) | null; + occurred_at?: (string | null | undefined) | null; created_at?: string | null; source?: SourceApplication.Raw | null; - employee_id?: (string | null) | null; - team_member_id?: (string | null) | null; + employee_id?: (string | null | undefined) | null; + team_member_id?: (string | null | undefined) | null; transaction_id?: string | null; refund_id?: string | null; purchase_order_id?: string | null; diff --git a/src/serialization/types/InventoryAdjustmentGroup.ts b/src/serialization/types/InventoryAdjustmentGroup.ts index d32aa7ef2..5adc519cd 100644 --- a/src/serialization/types/InventoryAdjustmentGroup.ts +++ b/src/serialization/types/InventoryAdjustmentGroup.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InventoryState } from "./InventoryState"; export const InventoryAdjustmentGroup: core.serialization.ObjectSchema< diff --git a/src/serialization/types/InventoryAlertType.ts b/src/serialization/types/InventoryAlertType.ts index d89842f58..a68e59c2e 100644 --- a/src/serialization/types/InventoryAlertType.ts +++ b/src/serialization/types/InventoryAlertType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InventoryAlertType: core.serialization.Schema< serializers.InventoryAlertType.Raw, diff --git a/src/serialization/types/InventoryChange.ts b/src/serialization/types/InventoryChange.ts index ef50a81b7..da96b6a37 100644 --- a/src/serialization/types/InventoryChange.ts +++ b/src/serialization/types/InventoryChange.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; +import { CatalogMeasurementUnit } from "./CatalogMeasurementUnit"; +import { InventoryAdjustment } from "./InventoryAdjustment"; import { InventoryChangeType } from "./InventoryChangeType"; import { InventoryPhysicalCount } from "./InventoryPhysicalCount"; -import { InventoryAdjustment } from "./InventoryAdjustment"; import { InventoryTransfer } from "./InventoryTransfer"; -import { CatalogMeasurementUnit } from "./CatalogMeasurementUnit"; export const InventoryChange: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/InventoryChangeType.ts b/src/serialization/types/InventoryChangeType.ts index 6598bec3a..384938781 100644 --- a/src/serialization/types/InventoryChangeType.ts +++ b/src/serialization/types/InventoryChangeType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InventoryChangeType: core.serialization.Schema< serializers.InventoryChangeType.Raw, diff --git a/src/serialization/types/InventoryCount.ts b/src/serialization/types/InventoryCount.ts index 5bc02050e..44f8582c7 100644 --- a/src/serialization/types/InventoryCount.ts +++ b/src/serialization/types/InventoryCount.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InventoryState } from "./InventoryState"; export const InventoryCount: core.serialization.ObjectSchema = @@ -26,11 +24,11 @@ export const InventoryCount: core.serialization.ObjectSchema = core.serialization.enum_([ diff --git a/src/serialization/types/InventoryTransfer.ts b/src/serialization/types/InventoryTransfer.ts index 27a01f6ad..57ba1005c 100644 --- a/src/serialization/types/InventoryTransfer.ts +++ b/src/serialization/types/InventoryTransfer.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InventoryState } from "./InventoryState"; import { SourceApplication } from "./SourceApplication"; @@ -33,17 +31,17 @@ export const InventoryTransfer: core.serialization.ObjectSchema< export declare namespace InventoryTransfer { export interface Raw { id?: string | null; - reference_id?: (string | null) | null; + reference_id?: (string | null | undefined) | null; state?: InventoryState.Raw | null; - from_location_id?: (string | null) | null; - to_location_id?: (string | null) | null; - catalog_object_id?: (string | null) | null; - catalog_object_type?: (string | null) | null; - quantity?: (string | null) | null; - occurred_at?: (string | null) | null; + from_location_id?: (string | null | undefined) | null; + to_location_id?: (string | null | undefined) | null; + catalog_object_id?: (string | null | undefined) | null; + catalog_object_type?: (string | null | undefined) | null; + quantity?: (string | null | undefined) | null; + occurred_at?: (string | null | undefined) | null; created_at?: string | null; source?: SourceApplication.Raw | null; - employee_id?: (string | null) | null; - team_member_id?: (string | null) | null; + employee_id?: (string | null | undefined) | null; + team_member_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/Invoice.ts b/src/serialization/types/Invoice.ts index cefcdd375..ce7542211 100644 --- a/src/serialization/types/Invoice.ts +++ b/src/serialization/types/Invoice.ts @@ -1,18 +1,16 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { InvoiceRecipient } from "./InvoiceRecipient"; -import { InvoicePaymentRequest } from "./InvoicePaymentRequest"; -import { InvoiceDeliveryMethod } from "./InvoiceDeliveryMethod"; -import { Money } from "./Money"; -import { InvoiceStatus } from "./InvoiceStatus"; +import type * as serializers from "../index"; import { InvoiceAcceptedPaymentMethods } from "./InvoiceAcceptedPaymentMethods"; -import { InvoiceCustomField } from "./InvoiceCustomField"; import { InvoiceAttachment } from "./InvoiceAttachment"; +import { InvoiceCustomField } from "./InvoiceCustomField"; +import { InvoiceDeliveryMethod } from "./InvoiceDeliveryMethod"; +import { InvoicePaymentRequest } from "./InvoicePaymentRequest"; +import { InvoiceRecipient } from "./InvoiceRecipient"; +import { InvoiceStatus } from "./InvoiceStatus"; +import { Money } from "./Money"; export const Invoice: core.serialization.ObjectSchema = core.serialization.object({ @@ -68,15 +66,15 @@ export declare namespace Invoice { export interface Raw { id?: string | null; version?: number | null; - location_id?: (string | null) | null; - order_id?: (string | null) | null; + location_id?: (string | null | undefined) | null; + order_id?: (string | null | undefined) | null; primary_recipient?: InvoiceRecipient.Raw | null; - payment_requests?: (InvoicePaymentRequest.Raw[] | null) | null; + payment_requests?: (InvoicePaymentRequest.Raw[] | null | undefined) | null; delivery_method?: InvoiceDeliveryMethod.Raw | null; - invoice_number?: (string | null) | null; - title?: (string | null) | null; - description?: (string | null) | null; - scheduled_at?: (string | null) | null; + invoice_number?: (string | null | undefined) | null; + title?: (string | null | undefined) | null; + description?: (string | null | undefined) | null; + scheduled_at?: (string | null | undefined) | null; public_url?: string | null; next_payment_amount_money?: Money.Raw | null; status?: InvoiceStatus.Raw | null; @@ -84,11 +82,11 @@ export declare namespace Invoice { created_at?: string | null; updated_at?: string | null; accepted_payment_methods?: InvoiceAcceptedPaymentMethods.Raw | null; - custom_fields?: (InvoiceCustomField.Raw[] | null) | null; + custom_fields?: (InvoiceCustomField.Raw[] | null | undefined) | null; subscription_id?: string | null; - sale_or_service_date?: (string | null) | null; - payment_conditions?: (string | null) | null; - store_payment_method_enabled?: (boolean | null) | null; + sale_or_service_date?: (string | null | undefined) | null; + payment_conditions?: (string | null | undefined) | null; + store_payment_method_enabled?: (boolean | null | undefined) | null; attachments?: InvoiceAttachment.Raw[] | null; creator_team_member_id?: string | null; } diff --git a/src/serialization/types/InvoiceAcceptedPaymentMethods.ts b/src/serialization/types/InvoiceAcceptedPaymentMethods.ts index 17a0fc90e..16eb48467 100644 --- a/src/serialization/types/InvoiceAcceptedPaymentMethods.ts +++ b/src/serialization/types/InvoiceAcceptedPaymentMethods.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InvoiceAcceptedPaymentMethods: core.serialization.ObjectSchema< serializers.InvoiceAcceptedPaymentMethods.Raw, @@ -19,10 +17,10 @@ export const InvoiceAcceptedPaymentMethods: core.serialization.ObjectSchema< export declare namespace InvoiceAcceptedPaymentMethods { export interface Raw { - card?: (boolean | null) | null; - square_gift_card?: (boolean | null) | null; - bank_account?: (boolean | null) | null; - buy_now_pay_later?: (boolean | null) | null; - cash_app_pay?: (boolean | null) | null; + card?: (boolean | null | undefined) | null; + square_gift_card?: (boolean | null | undefined) | null; + bank_account?: (boolean | null | undefined) | null; + buy_now_pay_later?: (boolean | null | undefined) | null; + cash_app_pay?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/InvoiceAttachment.ts b/src/serialization/types/InvoiceAttachment.ts index 8479a3ba1..1ceae0954 100644 --- a/src/serialization/types/InvoiceAttachment.ts +++ b/src/serialization/types/InvoiceAttachment.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InvoiceAttachment: core.serialization.ObjectSchema< serializers.InvoiceAttachment.Raw, diff --git a/src/serialization/types/InvoiceAutomaticPaymentSource.ts b/src/serialization/types/InvoiceAutomaticPaymentSource.ts index f40f3b0cb..c33a48f9b 100644 --- a/src/serialization/types/InvoiceAutomaticPaymentSource.ts +++ b/src/serialization/types/InvoiceAutomaticPaymentSource.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InvoiceAutomaticPaymentSource: core.serialization.Schema< serializers.InvoiceAutomaticPaymentSource.Raw, diff --git a/src/serialization/types/InvoiceCanceledEvent.ts b/src/serialization/types/InvoiceCanceledEvent.ts index dde974a8a..286a89ae2 100644 --- a/src/serialization/types/InvoiceCanceledEvent.ts +++ b/src/serialization/types/InvoiceCanceledEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InvoiceCanceledEventData } from "./InvoiceCanceledEventData"; export const InvoiceCanceledEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const InvoiceCanceledEvent: core.serialization.ObjectSchema< export declare namespace InvoiceCanceledEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: InvoiceCanceledEventData.Raw | null; } diff --git a/src/serialization/types/InvoiceCanceledEventData.ts b/src/serialization/types/InvoiceCanceledEventData.ts index 8de734272..5bdb9cfe3 100644 --- a/src/serialization/types/InvoiceCanceledEventData.ts +++ b/src/serialization/types/InvoiceCanceledEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InvoiceCanceledEventObject } from "./InvoiceCanceledEventObject"; export const InvoiceCanceledEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const InvoiceCanceledEventData: core.serialization.ObjectSchema< export declare namespace InvoiceCanceledEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: InvoiceCanceledEventObject.Raw | null; } diff --git a/src/serialization/types/InvoiceCanceledEventObject.ts b/src/serialization/types/InvoiceCanceledEventObject.ts index 65ee37ad2..0b3819d84 100644 --- a/src/serialization/types/InvoiceCanceledEventObject.ts +++ b/src/serialization/types/InvoiceCanceledEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Invoice } from "./Invoice"; export const InvoiceCanceledEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/InvoiceCreatedEvent.ts b/src/serialization/types/InvoiceCreatedEvent.ts index d9e40bc13..1b7c18e27 100644 --- a/src/serialization/types/InvoiceCreatedEvent.ts +++ b/src/serialization/types/InvoiceCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InvoiceCreatedEventData } from "./InvoiceCreatedEventData"; export const InvoiceCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const InvoiceCreatedEvent: core.serialization.ObjectSchema< export declare namespace InvoiceCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: InvoiceCreatedEventData.Raw | null; } diff --git a/src/serialization/types/InvoiceCreatedEventData.ts b/src/serialization/types/InvoiceCreatedEventData.ts index 264b2d10c..a5df90058 100644 --- a/src/serialization/types/InvoiceCreatedEventData.ts +++ b/src/serialization/types/InvoiceCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InvoiceCreatedEventObject } from "./InvoiceCreatedEventObject"; export const InvoiceCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const InvoiceCreatedEventData: core.serialization.ObjectSchema< export declare namespace InvoiceCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: InvoiceCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/InvoiceCreatedEventObject.ts b/src/serialization/types/InvoiceCreatedEventObject.ts index e2599d833..fa97990b3 100644 --- a/src/serialization/types/InvoiceCreatedEventObject.ts +++ b/src/serialization/types/InvoiceCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Invoice } from "./Invoice"; export const InvoiceCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/InvoiceCustomField.ts b/src/serialization/types/InvoiceCustomField.ts index b68fb4a50..4a653892c 100644 --- a/src/serialization/types/InvoiceCustomField.ts +++ b/src/serialization/types/InvoiceCustomField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InvoiceCustomFieldPlacement } from "./InvoiceCustomFieldPlacement"; export const InvoiceCustomField: core.serialization.ObjectSchema< @@ -18,8 +16,8 @@ export const InvoiceCustomField: core.serialization.ObjectSchema< export declare namespace InvoiceCustomField { export interface Raw { - label?: (string | null) | null; - value?: (string | null) | null; + label?: (string | null | undefined) | null; + value?: (string | null | undefined) | null; placement?: InvoiceCustomFieldPlacement.Raw | null; } } diff --git a/src/serialization/types/InvoiceCustomFieldPlacement.ts b/src/serialization/types/InvoiceCustomFieldPlacement.ts index 65e63c445..5a1085a94 100644 --- a/src/serialization/types/InvoiceCustomFieldPlacement.ts +++ b/src/serialization/types/InvoiceCustomFieldPlacement.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InvoiceCustomFieldPlacement: core.serialization.Schema< serializers.InvoiceCustomFieldPlacement.Raw, diff --git a/src/serialization/types/InvoiceDeletedEvent.ts b/src/serialization/types/InvoiceDeletedEvent.ts index ce27bea56..c27491bab 100644 --- a/src/serialization/types/InvoiceDeletedEvent.ts +++ b/src/serialization/types/InvoiceDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InvoiceDeletedEventData } from "./InvoiceDeletedEventData"; export const InvoiceDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const InvoiceDeletedEvent: core.serialization.ObjectSchema< export declare namespace InvoiceDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: InvoiceDeletedEventData.Raw | null; } diff --git a/src/serialization/types/InvoiceDeletedEventData.ts b/src/serialization/types/InvoiceDeletedEventData.ts index 13530b55b..fd835acb8 100644 --- a/src/serialization/types/InvoiceDeletedEventData.ts +++ b/src/serialization/types/InvoiceDeletedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InvoiceDeletedEventData: core.serialization.ObjectSchema< serializers.InvoiceDeletedEventData.Raw, @@ -17,8 +15,8 @@ export const InvoiceDeletedEventData: core.serialization.ObjectSchema< export declare namespace InvoiceDeletedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; - deleted?: (boolean | null) | null; + deleted?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/InvoiceDeliveryMethod.ts b/src/serialization/types/InvoiceDeliveryMethod.ts index 42ecaeb2d..38f5a2249 100644 --- a/src/serialization/types/InvoiceDeliveryMethod.ts +++ b/src/serialization/types/InvoiceDeliveryMethod.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InvoiceDeliveryMethod: core.serialization.Schema< serializers.InvoiceDeliveryMethod.Raw, diff --git a/src/serialization/types/InvoiceFilter.ts b/src/serialization/types/InvoiceFilter.ts index 2660f6970..f7ffb3734 100644 --- a/src/serialization/types/InvoiceFilter.ts +++ b/src/serialization/types/InvoiceFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InvoiceFilter: core.serialization.ObjectSchema = core.serialization.object({ @@ -18,6 +16,6 @@ export const InvoiceFilter: core.serialization.ObjectSchema = core.serialization.stringLiteral("INVOICE_SORT_DATE"); diff --git a/src/serialization/types/InvoiceStatus.ts b/src/serialization/types/InvoiceStatus.ts index 0d5019adb..da8962573 100644 --- a/src/serialization/types/InvoiceStatus.ts +++ b/src/serialization/types/InvoiceStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const InvoiceStatus: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/InvoiceUpdatedEvent.ts b/src/serialization/types/InvoiceUpdatedEvent.ts index 11a6e1e61..ef61ece76 100644 --- a/src/serialization/types/InvoiceUpdatedEvent.ts +++ b/src/serialization/types/InvoiceUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InvoiceUpdatedEventData } from "./InvoiceUpdatedEventData"; export const InvoiceUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const InvoiceUpdatedEvent: core.serialization.ObjectSchema< export declare namespace InvoiceUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: InvoiceUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/InvoiceUpdatedEventData.ts b/src/serialization/types/InvoiceUpdatedEventData.ts index ce58d91bb..766cf7138 100644 --- a/src/serialization/types/InvoiceUpdatedEventData.ts +++ b/src/serialization/types/InvoiceUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { InvoiceUpdatedEventObject } from "./InvoiceUpdatedEventObject"; export const InvoiceUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const InvoiceUpdatedEventData: core.serialization.ObjectSchema< export declare namespace InvoiceUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: InvoiceUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/InvoiceUpdatedEventObject.ts b/src/serialization/types/InvoiceUpdatedEventObject.ts index 00246a6d1..1638fe927 100644 --- a/src/serialization/types/InvoiceUpdatedEventObject.ts +++ b/src/serialization/types/InvoiceUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Invoice } from "./Invoice"; export const InvoiceUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/ItemVariationLocationOverrides.ts b/src/serialization/types/ItemVariationLocationOverrides.ts index f960fa211..7ae89dcb6 100644 --- a/src/serialization/types/ItemVariationLocationOverrides.ts +++ b/src/serialization/types/ItemVariationLocationOverrides.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Money } from "./Money"; +import type * as serializers from "../index"; import { CatalogPricingType } from "./CatalogPricingType"; import { InventoryAlertType } from "./InventoryAlertType"; +import { Money } from "./Money"; export const ItemVariationLocationOverrides: core.serialization.ObjectSchema< serializers.ItemVariationLocationOverrides.Raw, @@ -28,12 +26,12 @@ export const ItemVariationLocationOverrides: core.serialization.ObjectSchema< export declare namespace ItemVariationLocationOverrides { export interface Raw { - location_id?: (string | null) | null; + location_id?: (string | null | undefined) | null; price_money?: Money.Raw | null; pricing_type?: CatalogPricingType.Raw | null; - track_inventory?: (boolean | null) | null; + track_inventory?: (boolean | null | undefined) | null; inventory_alert_type?: InventoryAlertType.Raw | null; - inventory_alert_threshold?: ((bigint | number) | null) | null; + inventory_alert_threshold?: ((bigint | number) | null | undefined) | null; sold_out?: boolean | null; sold_out_valid_until?: string | null; } diff --git a/src/serialization/types/Job.ts b/src/serialization/types/Job.ts index 8e0104ca1..35a046b9b 100644 --- a/src/serialization/types/Job.ts +++ b/src/serialization/types/Job.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Job: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -18,8 +16,8 @@ export const Job: core.serialization.ObjectSchema = @@ -18,9 +16,9 @@ export const JobCreatedEvent: core.serialization.ObjectSchema = @@ -18,9 +16,9 @@ export const JobUpdatedEvent: core.serialization.ObjectSchema = @@ -55,30 +53,30 @@ export const Location: core.serialization.ObjectSchema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/LocationType.ts b/src/serialization/types/LocationType.ts index d2003c9d2..62380a5aa 100644 --- a/src/serialization/types/LocationType.ts +++ b/src/serialization/types/LocationType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LocationType: core.serialization.Schema = core.serialization.enum_(["PHYSICAL", "MOBILE"]); diff --git a/src/serialization/types/LocationUpdatedEvent.ts b/src/serialization/types/LocationUpdatedEvent.ts index 7604abbb9..b062c2e74 100644 --- a/src/serialization/types/LocationUpdatedEvent.ts +++ b/src/serialization/types/LocationUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LocationUpdatedEventData } from "./LocationUpdatedEventData"; export const LocationUpdatedEvent: core.serialization.ObjectSchema< @@ -21,10 +19,10 @@ export const LocationUpdatedEvent: core.serialization.ObjectSchema< export declare namespace LocationUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - location_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: LocationUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/LocationUpdatedEventData.ts b/src/serialization/types/LocationUpdatedEventData.ts index c46891648..c319cfcc2 100644 --- a/src/serialization/types/LocationUpdatedEventData.ts +++ b/src/serialization/types/LocationUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LocationUpdatedEventData: core.serialization.ObjectSchema< serializers.LocationUpdatedEventData.Raw, @@ -16,7 +14,7 @@ export const LocationUpdatedEventData: core.serialization.ObjectSchema< export declare namespace LocationUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; } } diff --git a/src/serialization/types/LoyaltyAccount.ts b/src/serialization/types/LoyaltyAccount.ts index 78a50fcf0..f9d565fce 100644 --- a/src/serialization/types/LoyaltyAccount.ts +++ b/src/serialization/types/LoyaltyAccount.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { LoyaltyAccountMapping } from "./LoyaltyAccountMapping"; +import type * as serializers from "../index"; import { LoyaltyAccountExpiringPointDeadline } from "./LoyaltyAccountExpiringPointDeadline"; +import { LoyaltyAccountMapping } from "./LoyaltyAccountMapping"; export const LoyaltyAccount: core.serialization.ObjectSchema = core.serialization.object({ @@ -31,11 +29,11 @@ export declare namespace LoyaltyAccount { program_id: string; balance?: number | null; lifetime_points?: number | null; - customer_id?: (string | null) | null; - enrolled_at?: (string | null) | null; + customer_id?: (string | null | undefined) | null; + enrolled_at?: (string | null | undefined) | null; created_at?: string | null; updated_at?: string | null; mapping?: LoyaltyAccountMapping.Raw | null; - expiring_point_deadlines?: (LoyaltyAccountExpiringPointDeadline.Raw[] | null) | null; + expiring_point_deadlines?: (LoyaltyAccountExpiringPointDeadline.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/LoyaltyAccountCreatedEvent.ts b/src/serialization/types/LoyaltyAccountCreatedEvent.ts index a2493dc53..7bbd1fa23 100644 --- a/src/serialization/types/LoyaltyAccountCreatedEvent.ts +++ b/src/serialization/types/LoyaltyAccountCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyAccountCreatedEventData } from "./LoyaltyAccountCreatedEventData"; export const LoyaltyAccountCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const LoyaltyAccountCreatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: LoyaltyAccountCreatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountCreatedEventData.ts b/src/serialization/types/LoyaltyAccountCreatedEventData.ts index 2845ba72c..f2cd45407 100644 --- a/src/serialization/types/LoyaltyAccountCreatedEventData.ts +++ b/src/serialization/types/LoyaltyAccountCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyAccountCreatedEventObject } from "./LoyaltyAccountCreatedEventObject"; export const LoyaltyAccountCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const LoyaltyAccountCreatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: LoyaltyAccountCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountCreatedEventObject.ts b/src/serialization/types/LoyaltyAccountCreatedEventObject.ts index ceb16bfca..03c628394 100644 --- a/src/serialization/types/LoyaltyAccountCreatedEventObject.ts +++ b/src/serialization/types/LoyaltyAccountCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyAccount } from "./LoyaltyAccount"; export const LoyaltyAccountCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyAccountDeletedEvent.ts b/src/serialization/types/LoyaltyAccountDeletedEvent.ts index 877fa1328..b37b53334 100644 --- a/src/serialization/types/LoyaltyAccountDeletedEvent.ts +++ b/src/serialization/types/LoyaltyAccountDeletedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyAccountDeletedEventData } from "./LoyaltyAccountDeletedEventData"; export const LoyaltyAccountDeletedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const LoyaltyAccountDeletedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountDeletedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: LoyaltyAccountDeletedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountDeletedEventData.ts b/src/serialization/types/LoyaltyAccountDeletedEventData.ts index 3cfa1878d..b8801da40 100644 --- a/src/serialization/types/LoyaltyAccountDeletedEventData.ts +++ b/src/serialization/types/LoyaltyAccountDeletedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyAccountDeletedEventObject } from "./LoyaltyAccountDeletedEventObject"; export const LoyaltyAccountDeletedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const LoyaltyAccountDeletedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountDeletedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: LoyaltyAccountDeletedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountDeletedEventObject.ts b/src/serialization/types/LoyaltyAccountDeletedEventObject.ts index ad10cb8a4..82d8f527f 100644 --- a/src/serialization/types/LoyaltyAccountDeletedEventObject.ts +++ b/src/serialization/types/LoyaltyAccountDeletedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyAccount } from "./LoyaltyAccount"; export const LoyaltyAccountDeletedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyAccountExpiringPointDeadline.ts b/src/serialization/types/LoyaltyAccountExpiringPointDeadline.ts index 8da4115ca..7c69ff6ac 100644 --- a/src/serialization/types/LoyaltyAccountExpiringPointDeadline.ts +++ b/src/serialization/types/LoyaltyAccountExpiringPointDeadline.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyAccountExpiringPointDeadline: core.serialization.ObjectSchema< serializers.LoyaltyAccountExpiringPointDeadline.Raw, diff --git a/src/serialization/types/LoyaltyAccountMapping.ts b/src/serialization/types/LoyaltyAccountMapping.ts index 6c3ac7656..011c71cec 100644 --- a/src/serialization/types/LoyaltyAccountMapping.ts +++ b/src/serialization/types/LoyaltyAccountMapping.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyAccountMapping: core.serialization.ObjectSchema< serializers.LoyaltyAccountMapping.Raw, @@ -19,6 +17,6 @@ export declare namespace LoyaltyAccountMapping { export interface Raw { id?: string | null; created_at?: string | null; - phone_number?: (string | null) | null; + phone_number?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/LoyaltyAccountMappingType.ts b/src/serialization/types/LoyaltyAccountMappingType.ts index c7d2af17e..80f690ec9 100644 --- a/src/serialization/types/LoyaltyAccountMappingType.ts +++ b/src/serialization/types/LoyaltyAccountMappingType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyAccountMappingType: core.serialization.Schema< serializers.LoyaltyAccountMappingType.Raw, diff --git a/src/serialization/types/LoyaltyAccountUpdatedEvent.ts b/src/serialization/types/LoyaltyAccountUpdatedEvent.ts index ffe6e38af..1047e9d33 100644 --- a/src/serialization/types/LoyaltyAccountUpdatedEvent.ts +++ b/src/serialization/types/LoyaltyAccountUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyAccountUpdatedEventData } from "./LoyaltyAccountUpdatedEventData"; export const LoyaltyAccountUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const LoyaltyAccountUpdatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: LoyaltyAccountUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountUpdatedEventData.ts b/src/serialization/types/LoyaltyAccountUpdatedEventData.ts index f3171bd9c..05c425030 100644 --- a/src/serialization/types/LoyaltyAccountUpdatedEventData.ts +++ b/src/serialization/types/LoyaltyAccountUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyAccountUpdatedEventObject } from "./LoyaltyAccountUpdatedEventObject"; export const LoyaltyAccountUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const LoyaltyAccountUpdatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: LoyaltyAccountUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountUpdatedEventObject.ts b/src/serialization/types/LoyaltyAccountUpdatedEventObject.ts index 9ab327ced..588229da0 100644 --- a/src/serialization/types/LoyaltyAccountUpdatedEventObject.ts +++ b/src/serialization/types/LoyaltyAccountUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyAccount } from "./LoyaltyAccount"; export const LoyaltyAccountUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyEvent.ts b/src/serialization/types/LoyaltyEvent.ts index 4503c375b..d62607706 100644 --- a/src/serialization/types/LoyaltyEvent.ts +++ b/src/serialization/types/LoyaltyEvent.ts @@ -1,20 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { LoyaltyEventType } from "./LoyaltyEventType"; +import type * as serializers from "../index"; import { LoyaltyEventAccumulatePoints } from "./LoyaltyEventAccumulatePoints"; +import { LoyaltyEventAccumulatePromotionPoints } from "./LoyaltyEventAccumulatePromotionPoints"; +import { LoyaltyEventAdjustPoints } from "./LoyaltyEventAdjustPoints"; import { LoyaltyEventCreateReward } from "./LoyaltyEventCreateReward"; -import { LoyaltyEventRedeemReward } from "./LoyaltyEventRedeemReward"; import { LoyaltyEventDeleteReward } from "./LoyaltyEventDeleteReward"; -import { LoyaltyEventAdjustPoints } from "./LoyaltyEventAdjustPoints"; -import { LoyaltyEventSource } from "./LoyaltyEventSource"; import { LoyaltyEventExpirePoints } from "./LoyaltyEventExpirePoints"; import { LoyaltyEventOther } from "./LoyaltyEventOther"; -import { LoyaltyEventAccumulatePromotionPoints } from "./LoyaltyEventAccumulatePromotionPoints"; +import { LoyaltyEventRedeemReward } from "./LoyaltyEventRedeemReward"; +import { LoyaltyEventSource } from "./LoyaltyEventSource"; +import { LoyaltyEventType } from "./LoyaltyEventType"; export const LoyaltyEvent: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/LoyaltyEventAccumulatePoints.ts b/src/serialization/types/LoyaltyEventAccumulatePoints.ts index d04eda5e4..1b30eb735 100644 --- a/src/serialization/types/LoyaltyEventAccumulatePoints.ts +++ b/src/serialization/types/LoyaltyEventAccumulatePoints.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventAccumulatePoints: core.serialization.ObjectSchema< serializers.LoyaltyEventAccumulatePoints.Raw, @@ -18,7 +16,7 @@ export const LoyaltyEventAccumulatePoints: core.serialization.ObjectSchema< export declare namespace LoyaltyEventAccumulatePoints { export interface Raw { loyalty_program_id?: string | null; - points?: (number | null) | null; - order_id?: (string | null) | null; + points?: (number | null | undefined) | null; + order_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/LoyaltyEventAccumulatePromotionPoints.ts b/src/serialization/types/LoyaltyEventAccumulatePromotionPoints.ts index bae7b7806..a98987d6b 100644 --- a/src/serialization/types/LoyaltyEventAccumulatePromotionPoints.ts +++ b/src/serialization/types/LoyaltyEventAccumulatePromotionPoints.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventAccumulatePromotionPoints: core.serialization.ObjectSchema< serializers.LoyaltyEventAccumulatePromotionPoints.Raw, diff --git a/src/serialization/types/LoyaltyEventAdjustPoints.ts b/src/serialization/types/LoyaltyEventAdjustPoints.ts index f1be0699c..fb71e8fd1 100644 --- a/src/serialization/types/LoyaltyEventAdjustPoints.ts +++ b/src/serialization/types/LoyaltyEventAdjustPoints.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventAdjustPoints: core.serialization.ObjectSchema< serializers.LoyaltyEventAdjustPoints.Raw, @@ -19,6 +17,6 @@ export declare namespace LoyaltyEventAdjustPoints { export interface Raw { loyalty_program_id?: string | null; points: number; - reason?: (string | null) | null; + reason?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/LoyaltyEventCreateReward.ts b/src/serialization/types/LoyaltyEventCreateReward.ts index c677f1508..5ef82473d 100644 --- a/src/serialization/types/LoyaltyEventCreateReward.ts +++ b/src/serialization/types/LoyaltyEventCreateReward.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventCreateReward: core.serialization.ObjectSchema< serializers.LoyaltyEventCreateReward.Raw, diff --git a/src/serialization/types/LoyaltyEventCreatedEvent.ts b/src/serialization/types/LoyaltyEventCreatedEvent.ts index 21655eb60..ddedcefc4 100644 --- a/src/serialization/types/LoyaltyEventCreatedEvent.ts +++ b/src/serialization/types/LoyaltyEventCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyEventCreatedEventData } from "./LoyaltyEventCreatedEventData"; export const LoyaltyEventCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const LoyaltyEventCreatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyEventCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: LoyaltyEventCreatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyEventCreatedEventData.ts b/src/serialization/types/LoyaltyEventCreatedEventData.ts index 65f9620c7..b807724bc 100644 --- a/src/serialization/types/LoyaltyEventCreatedEventData.ts +++ b/src/serialization/types/LoyaltyEventCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyEventCreatedEventObject } from "./LoyaltyEventCreatedEventObject"; export const LoyaltyEventCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const LoyaltyEventCreatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyEventCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: LoyaltyEventCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyEventCreatedEventObject.ts b/src/serialization/types/LoyaltyEventCreatedEventObject.ts index 994636b16..04d87aefa 100644 --- a/src/serialization/types/LoyaltyEventCreatedEventObject.ts +++ b/src/serialization/types/LoyaltyEventCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyEvent } from "./LoyaltyEvent"; export const LoyaltyEventCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyEventDateTimeFilter.ts b/src/serialization/types/LoyaltyEventDateTimeFilter.ts index c8675f7a3..5ffd775d5 100644 --- a/src/serialization/types/LoyaltyEventDateTimeFilter.ts +++ b/src/serialization/types/LoyaltyEventDateTimeFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TimeRange } from "./TimeRange"; export const LoyaltyEventDateTimeFilter: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyEventDeleteReward.ts b/src/serialization/types/LoyaltyEventDeleteReward.ts index b0e883563..6b89885ef 100644 --- a/src/serialization/types/LoyaltyEventDeleteReward.ts +++ b/src/serialization/types/LoyaltyEventDeleteReward.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventDeleteReward: core.serialization.ObjectSchema< serializers.LoyaltyEventDeleteReward.Raw, diff --git a/src/serialization/types/LoyaltyEventExpirePoints.ts b/src/serialization/types/LoyaltyEventExpirePoints.ts index f8ab6e654..83009f31f 100644 --- a/src/serialization/types/LoyaltyEventExpirePoints.ts +++ b/src/serialization/types/LoyaltyEventExpirePoints.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventExpirePoints: core.serialization.ObjectSchema< serializers.LoyaltyEventExpirePoints.Raw, diff --git a/src/serialization/types/LoyaltyEventFilter.ts b/src/serialization/types/LoyaltyEventFilter.ts index 145b2ddc6..1f1cf8be4 100644 --- a/src/serialization/types/LoyaltyEventFilter.ts +++ b/src/serialization/types/LoyaltyEventFilter.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { LoyaltyEventLoyaltyAccountFilter } from "./LoyaltyEventLoyaltyAccountFilter"; -import { LoyaltyEventTypeFilter } from "./LoyaltyEventTypeFilter"; +import type * as serializers from "../index"; import { LoyaltyEventDateTimeFilter } from "./LoyaltyEventDateTimeFilter"; import { LoyaltyEventLocationFilter } from "./LoyaltyEventLocationFilter"; +import { LoyaltyEventLoyaltyAccountFilter } from "./LoyaltyEventLoyaltyAccountFilter"; import { LoyaltyEventOrderFilter } from "./LoyaltyEventOrderFilter"; +import { LoyaltyEventTypeFilter } from "./LoyaltyEventTypeFilter"; export const LoyaltyEventFilter: core.serialization.ObjectSchema< serializers.LoyaltyEventFilter.Raw, diff --git a/src/serialization/types/LoyaltyEventLocationFilter.ts b/src/serialization/types/LoyaltyEventLocationFilter.ts index 06ae6117b..e86cc1054 100644 --- a/src/serialization/types/LoyaltyEventLocationFilter.ts +++ b/src/serialization/types/LoyaltyEventLocationFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventLocationFilter: core.serialization.ObjectSchema< serializers.LoyaltyEventLocationFilter.Raw, diff --git a/src/serialization/types/LoyaltyEventLoyaltyAccountFilter.ts b/src/serialization/types/LoyaltyEventLoyaltyAccountFilter.ts index ea4be1b22..f7f08703b 100644 --- a/src/serialization/types/LoyaltyEventLoyaltyAccountFilter.ts +++ b/src/serialization/types/LoyaltyEventLoyaltyAccountFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventLoyaltyAccountFilter: core.serialization.ObjectSchema< serializers.LoyaltyEventLoyaltyAccountFilter.Raw, diff --git a/src/serialization/types/LoyaltyEventOrderFilter.ts b/src/serialization/types/LoyaltyEventOrderFilter.ts index 60aceb6ee..4f715f923 100644 --- a/src/serialization/types/LoyaltyEventOrderFilter.ts +++ b/src/serialization/types/LoyaltyEventOrderFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventOrderFilter: core.serialization.ObjectSchema< serializers.LoyaltyEventOrderFilter.Raw, diff --git a/src/serialization/types/LoyaltyEventOther.ts b/src/serialization/types/LoyaltyEventOther.ts index 4cbbdd044..9677f234b 100644 --- a/src/serialization/types/LoyaltyEventOther.ts +++ b/src/serialization/types/LoyaltyEventOther.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventOther: core.serialization.ObjectSchema< serializers.LoyaltyEventOther.Raw, diff --git a/src/serialization/types/LoyaltyEventQuery.ts b/src/serialization/types/LoyaltyEventQuery.ts index f85d5e9c4..37ac5259e 100644 --- a/src/serialization/types/LoyaltyEventQuery.ts +++ b/src/serialization/types/LoyaltyEventQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyEventFilter } from "./LoyaltyEventFilter"; export const LoyaltyEventQuery: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyEventRedeemReward.ts b/src/serialization/types/LoyaltyEventRedeemReward.ts index 3f2bdfa6b..6e7b4e6d8 100644 --- a/src/serialization/types/LoyaltyEventRedeemReward.ts +++ b/src/serialization/types/LoyaltyEventRedeemReward.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventRedeemReward: core.serialization.ObjectSchema< serializers.LoyaltyEventRedeemReward.Raw, diff --git a/src/serialization/types/LoyaltyEventSource.ts b/src/serialization/types/LoyaltyEventSource.ts index db9ffcaed..728fbff96 100644 --- a/src/serialization/types/LoyaltyEventSource.ts +++ b/src/serialization/types/LoyaltyEventSource.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventSource: core.serialization.Schema< serializers.LoyaltyEventSource.Raw, diff --git a/src/serialization/types/LoyaltyEventType.ts b/src/serialization/types/LoyaltyEventType.ts index 7dca763aa..a7c2f5ddb 100644 --- a/src/serialization/types/LoyaltyEventType.ts +++ b/src/serialization/types/LoyaltyEventType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyEventType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/LoyaltyEventTypeFilter.ts b/src/serialization/types/LoyaltyEventTypeFilter.ts index 405b69228..bd29686e8 100644 --- a/src/serialization/types/LoyaltyEventTypeFilter.ts +++ b/src/serialization/types/LoyaltyEventTypeFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyEventType } from "./LoyaltyEventType"; export const LoyaltyEventTypeFilter: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyProgram.ts b/src/serialization/types/LoyaltyProgram.ts index d020c5377..d484de8d7 100644 --- a/src/serialization/types/LoyaltyProgram.ts +++ b/src/serialization/types/LoyaltyProgram.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { LoyaltyProgramStatus } from "./LoyaltyProgramStatus"; -import { LoyaltyProgramRewardTier } from "./LoyaltyProgramRewardTier"; +import type * as serializers from "../index"; +import { LoyaltyProgramAccrualRule } from "./LoyaltyProgramAccrualRule"; import { LoyaltyProgramExpirationPolicy } from "./LoyaltyProgramExpirationPolicy"; +import { LoyaltyProgramRewardTier } from "./LoyaltyProgramRewardTier"; +import { LoyaltyProgramStatus } from "./LoyaltyProgramStatus"; import { LoyaltyProgramTerminology } from "./LoyaltyProgramTerminology"; -import { LoyaltyProgramAccrualRule } from "./LoyaltyProgramAccrualRule"; export const LoyaltyProgram: core.serialization.ObjectSchema = core.serialization.object({ @@ -37,12 +35,12 @@ export declare namespace LoyaltyProgram { export interface Raw { id?: string | null; status?: LoyaltyProgramStatus.Raw | null; - reward_tiers?: (LoyaltyProgramRewardTier.Raw[] | null) | null; + reward_tiers?: (LoyaltyProgramRewardTier.Raw[] | null | undefined) | null; expiration_policy?: LoyaltyProgramExpirationPolicy.Raw | null; terminology?: LoyaltyProgramTerminology.Raw | null; - location_ids?: (string[] | null) | null; + location_ids?: (string[] | null | undefined) | null; created_at?: string | null; updated_at?: string | null; - accrual_rules?: (LoyaltyProgramAccrualRule.Raw[] | null) | null; + accrual_rules?: (LoyaltyProgramAccrualRule.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/LoyaltyProgramAccrualRule.ts b/src/serialization/types/LoyaltyProgramAccrualRule.ts index d24f34354..7b0533814 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRule.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRule.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; +import { LoyaltyProgramAccrualRuleCategoryData } from "./LoyaltyProgramAccrualRuleCategoryData"; +import { LoyaltyProgramAccrualRuleItemVariationData } from "./LoyaltyProgramAccrualRuleItemVariationData"; +import { LoyaltyProgramAccrualRuleSpendData } from "./LoyaltyProgramAccrualRuleSpendData"; import { LoyaltyProgramAccrualRuleType } from "./LoyaltyProgramAccrualRuleType"; import { LoyaltyProgramAccrualRuleVisitData } from "./LoyaltyProgramAccrualRuleVisitData"; -import { LoyaltyProgramAccrualRuleSpendData } from "./LoyaltyProgramAccrualRuleSpendData"; -import { LoyaltyProgramAccrualRuleItemVariationData } from "./LoyaltyProgramAccrualRuleItemVariationData"; -import { LoyaltyProgramAccrualRuleCategoryData } from "./LoyaltyProgramAccrualRuleCategoryData"; export const LoyaltyProgramAccrualRule: core.serialization.ObjectSchema< serializers.LoyaltyProgramAccrualRule.Raw, @@ -29,7 +27,7 @@ export const LoyaltyProgramAccrualRule: core.serialization.ObjectSchema< export declare namespace LoyaltyProgramAccrualRule { export interface Raw { accrual_type: LoyaltyProgramAccrualRuleType.Raw; - points?: (number | null) | null; + points?: (number | null | undefined) | null; visit_data?: LoyaltyProgramAccrualRuleVisitData.Raw | null; spend_data?: LoyaltyProgramAccrualRuleSpendData.Raw | null; item_variation_data?: LoyaltyProgramAccrualRuleItemVariationData.Raw | null; diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleCategoryData.ts b/src/serialization/types/LoyaltyProgramAccrualRuleCategoryData.ts index f528cfad6..32128827e 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleCategoryData.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleCategoryData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyProgramAccrualRuleCategoryData: core.serialization.ObjectSchema< serializers.LoyaltyProgramAccrualRuleCategoryData.Raw, diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleItemVariationData.ts b/src/serialization/types/LoyaltyProgramAccrualRuleItemVariationData.ts index afd62c584..335739332 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleItemVariationData.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleItemVariationData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyProgramAccrualRuleItemVariationData: core.serialization.ObjectSchema< serializers.LoyaltyProgramAccrualRuleItemVariationData.Raw, diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleSpendData.ts b/src/serialization/types/LoyaltyProgramAccrualRuleSpendData.ts index 392662f9c..e99f9ac62 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleSpendData.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleSpendData.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Money } from "./Money"; +import type * as serializers from "../index"; import { LoyaltyProgramAccrualRuleTaxMode } from "./LoyaltyProgramAccrualRuleTaxMode"; +import { Money } from "./Money"; export const LoyaltyProgramAccrualRuleSpendData: core.serialization.ObjectSchema< serializers.LoyaltyProgramAccrualRuleSpendData.Raw, @@ -27,8 +25,8 @@ export const LoyaltyProgramAccrualRuleSpendData: core.serialization.ObjectSchema export declare namespace LoyaltyProgramAccrualRuleSpendData { export interface Raw { amount_money: Money.Raw; - excluded_category_ids?: (string[] | null) | null; - excluded_item_variation_ids?: (string[] | null) | null; + excluded_category_ids?: (string[] | null | undefined) | null; + excluded_item_variation_ids?: (string[] | null | undefined) | null; tax_mode: LoyaltyProgramAccrualRuleTaxMode.Raw; } } diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleTaxMode.ts b/src/serialization/types/LoyaltyProgramAccrualRuleTaxMode.ts index cda917057..fa7bfda54 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleTaxMode.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleTaxMode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyProgramAccrualRuleTaxMode: core.serialization.Schema< serializers.LoyaltyProgramAccrualRuleTaxMode.Raw, diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleType.ts b/src/serialization/types/LoyaltyProgramAccrualRuleType.ts index 76c2c16a0..60067fb91 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleType.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyProgramAccrualRuleType: core.serialization.Schema< serializers.LoyaltyProgramAccrualRuleType.Raw, diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleVisitData.ts b/src/serialization/types/LoyaltyProgramAccrualRuleVisitData.ts index 55869b831..79536ce02 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleVisitData.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleVisitData.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Money } from "./Money"; +import type * as serializers from "../index"; import { LoyaltyProgramAccrualRuleTaxMode } from "./LoyaltyProgramAccrualRuleTaxMode"; +import { Money } from "./Money"; export const LoyaltyProgramAccrualRuleVisitData: core.serialization.ObjectSchema< serializers.LoyaltyProgramAccrualRuleVisitData.Raw, diff --git a/src/serialization/types/LoyaltyProgramCreatedEvent.ts b/src/serialization/types/LoyaltyProgramCreatedEvent.ts index c32e88ec8..05503521f 100644 --- a/src/serialization/types/LoyaltyProgramCreatedEvent.ts +++ b/src/serialization/types/LoyaltyProgramCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyProgramCreatedEventData } from "./LoyaltyProgramCreatedEventData"; export const LoyaltyProgramCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const LoyaltyProgramCreatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyProgramCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: LoyaltyProgramCreatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyProgramCreatedEventData.ts b/src/serialization/types/LoyaltyProgramCreatedEventData.ts index e124e6a97..5609e0a54 100644 --- a/src/serialization/types/LoyaltyProgramCreatedEventData.ts +++ b/src/serialization/types/LoyaltyProgramCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyProgramCreatedEventObject } from "./LoyaltyProgramCreatedEventObject"; export const LoyaltyProgramCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const LoyaltyProgramCreatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyProgramCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: LoyaltyProgramCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyProgramCreatedEventObject.ts b/src/serialization/types/LoyaltyProgramCreatedEventObject.ts index a8e3a404b..7e059dcfa 100644 --- a/src/serialization/types/LoyaltyProgramCreatedEventObject.ts +++ b/src/serialization/types/LoyaltyProgramCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyProgram } from "./LoyaltyProgram"; export const LoyaltyProgramCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyProgramExpirationPolicy.ts b/src/serialization/types/LoyaltyProgramExpirationPolicy.ts index 46559ff5e..18f2cfc49 100644 --- a/src/serialization/types/LoyaltyProgramExpirationPolicy.ts +++ b/src/serialization/types/LoyaltyProgramExpirationPolicy.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyProgramExpirationPolicy: core.serialization.ObjectSchema< serializers.LoyaltyProgramExpirationPolicy.Raw, diff --git a/src/serialization/types/LoyaltyProgramRewardTier.ts b/src/serialization/types/LoyaltyProgramRewardTier.ts index e728ad13c..cdde10623 100644 --- a/src/serialization/types/LoyaltyProgramRewardTier.ts +++ b/src/serialization/types/LoyaltyProgramRewardTier.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CatalogObjectReference } from "./CatalogObjectReference"; export const LoyaltyProgramRewardTier: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyProgramStatus.ts b/src/serialization/types/LoyaltyProgramStatus.ts index 437b0cc79..345d9f8de 100644 --- a/src/serialization/types/LoyaltyProgramStatus.ts +++ b/src/serialization/types/LoyaltyProgramStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyProgramStatus: core.serialization.Schema< serializers.LoyaltyProgramStatus.Raw, diff --git a/src/serialization/types/LoyaltyProgramTerminology.ts b/src/serialization/types/LoyaltyProgramTerminology.ts index 5f9aa7b54..7d293aabd 100644 --- a/src/serialization/types/LoyaltyProgramTerminology.ts +++ b/src/serialization/types/LoyaltyProgramTerminology.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyProgramTerminology: core.serialization.ObjectSchema< serializers.LoyaltyProgramTerminology.Raw, diff --git a/src/serialization/types/LoyaltyProgramUpdatedEvent.ts b/src/serialization/types/LoyaltyProgramUpdatedEvent.ts index 3d80c96fb..3ca9e19fd 100644 --- a/src/serialization/types/LoyaltyProgramUpdatedEvent.ts +++ b/src/serialization/types/LoyaltyProgramUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyProgramUpdatedEventData } from "./LoyaltyProgramUpdatedEventData"; export const LoyaltyProgramUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const LoyaltyProgramUpdatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyProgramUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: LoyaltyProgramUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyProgramUpdatedEventData.ts b/src/serialization/types/LoyaltyProgramUpdatedEventData.ts index 9f6562630..a0c50b3da 100644 --- a/src/serialization/types/LoyaltyProgramUpdatedEventData.ts +++ b/src/serialization/types/LoyaltyProgramUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyProgramUpdatedEventObject } from "./LoyaltyProgramUpdatedEventObject"; export const LoyaltyProgramUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const LoyaltyProgramUpdatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyProgramUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: LoyaltyProgramUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyProgramUpdatedEventObject.ts b/src/serialization/types/LoyaltyProgramUpdatedEventObject.ts index d5069372e..516b282e2 100644 --- a/src/serialization/types/LoyaltyProgramUpdatedEventObject.ts +++ b/src/serialization/types/LoyaltyProgramUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyProgram } from "./LoyaltyProgram"; export const LoyaltyProgramUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyPromotion.ts b/src/serialization/types/LoyaltyPromotion.ts index aaf228eb2..2cac9508b 100644 --- a/src/serialization/types/LoyaltyPromotion.ts +++ b/src/serialization/types/LoyaltyPromotion.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { LoyaltyPromotionIncentive } from "./LoyaltyPromotionIncentive"; +import type * as serializers from "../index"; import { LoyaltyPromotionAvailableTimeData } from "./LoyaltyPromotionAvailableTimeData"; -import { LoyaltyPromotionTriggerLimit } from "./LoyaltyPromotionTriggerLimit"; +import { LoyaltyPromotionIncentive } from "./LoyaltyPromotionIncentive"; import { LoyaltyPromotionStatus } from "./LoyaltyPromotionStatus"; +import { LoyaltyPromotionTriggerLimit } from "./LoyaltyPromotionTriggerLimit"; import { Money } from "./Money"; export const LoyaltyPromotion: core.serialization.ObjectSchema< @@ -49,7 +47,7 @@ export declare namespace LoyaltyPromotion { updated_at?: string | null; loyalty_program_id?: string | null; minimum_spend_amount_money?: Money.Raw | null; - qualifying_item_variation_ids?: (string[] | null) | null; - qualifying_category_ids?: (string[] | null) | null; + qualifying_item_variation_ids?: (string[] | null | undefined) | null; + qualifying_category_ids?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/LoyaltyPromotionAvailableTimeData.ts b/src/serialization/types/LoyaltyPromotionAvailableTimeData.ts index f7b34ac92..876c9359c 100644 --- a/src/serialization/types/LoyaltyPromotionAvailableTimeData.ts +++ b/src/serialization/types/LoyaltyPromotionAvailableTimeData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyPromotionAvailableTimeData: core.serialization.ObjectSchema< serializers.LoyaltyPromotionAvailableTimeData.Raw, diff --git a/src/serialization/types/LoyaltyPromotionCreatedEvent.ts b/src/serialization/types/LoyaltyPromotionCreatedEvent.ts index f7068ab9d..8794d3d40 100644 --- a/src/serialization/types/LoyaltyPromotionCreatedEvent.ts +++ b/src/serialization/types/LoyaltyPromotionCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyPromotionCreatedEventData } from "./LoyaltyPromotionCreatedEventData"; export const LoyaltyPromotionCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const LoyaltyPromotionCreatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyPromotionCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: LoyaltyPromotionCreatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyPromotionCreatedEventData.ts b/src/serialization/types/LoyaltyPromotionCreatedEventData.ts index 456b03b56..54571084d 100644 --- a/src/serialization/types/LoyaltyPromotionCreatedEventData.ts +++ b/src/serialization/types/LoyaltyPromotionCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyPromotionCreatedEventObject } from "./LoyaltyPromotionCreatedEventObject"; export const LoyaltyPromotionCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const LoyaltyPromotionCreatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyPromotionCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: LoyaltyPromotionCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyPromotionCreatedEventObject.ts b/src/serialization/types/LoyaltyPromotionCreatedEventObject.ts index a4023966d..4e21d8d2d 100644 --- a/src/serialization/types/LoyaltyPromotionCreatedEventObject.ts +++ b/src/serialization/types/LoyaltyPromotionCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyPromotion } from "./LoyaltyPromotion"; export const LoyaltyPromotionCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyPromotionIncentive.ts b/src/serialization/types/LoyaltyPromotionIncentive.ts index 0301b9d63..a4e256e69 100644 --- a/src/serialization/types/LoyaltyPromotionIncentive.ts +++ b/src/serialization/types/LoyaltyPromotionIncentive.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { LoyaltyPromotionIncentiveType } from "./LoyaltyPromotionIncentiveType"; -import { LoyaltyPromotionIncentivePointsMultiplierData } from "./LoyaltyPromotionIncentivePointsMultiplierData"; +import type * as serializers from "../index"; import { LoyaltyPromotionIncentivePointsAdditionData } from "./LoyaltyPromotionIncentivePointsAdditionData"; +import { LoyaltyPromotionIncentivePointsMultiplierData } from "./LoyaltyPromotionIncentivePointsMultiplierData"; +import { LoyaltyPromotionIncentiveType } from "./LoyaltyPromotionIncentiveType"; export const LoyaltyPromotionIncentive: core.serialization.ObjectSchema< serializers.LoyaltyPromotionIncentive.Raw, diff --git a/src/serialization/types/LoyaltyPromotionIncentivePointsAdditionData.ts b/src/serialization/types/LoyaltyPromotionIncentivePointsAdditionData.ts index 8b0ed9225..f9e7f7068 100644 --- a/src/serialization/types/LoyaltyPromotionIncentivePointsAdditionData.ts +++ b/src/serialization/types/LoyaltyPromotionIncentivePointsAdditionData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyPromotionIncentivePointsAdditionData: core.serialization.ObjectSchema< serializers.LoyaltyPromotionIncentivePointsAdditionData.Raw, diff --git a/src/serialization/types/LoyaltyPromotionIncentivePointsMultiplierData.ts b/src/serialization/types/LoyaltyPromotionIncentivePointsMultiplierData.ts index 97309104c..e2a19018e 100644 --- a/src/serialization/types/LoyaltyPromotionIncentivePointsMultiplierData.ts +++ b/src/serialization/types/LoyaltyPromotionIncentivePointsMultiplierData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyPromotionIncentivePointsMultiplierData: core.serialization.ObjectSchema< serializers.LoyaltyPromotionIncentivePointsMultiplierData.Raw, @@ -16,7 +14,7 @@ export const LoyaltyPromotionIncentivePointsMultiplierData: core.serialization.O export declare namespace LoyaltyPromotionIncentivePointsMultiplierData { export interface Raw { - points_multiplier?: (number | null) | null; - multiplier?: (string | null) | null; + points_multiplier?: (number | null | undefined) | null; + multiplier?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/LoyaltyPromotionIncentiveType.ts b/src/serialization/types/LoyaltyPromotionIncentiveType.ts index 11ce60a53..bc85138ba 100644 --- a/src/serialization/types/LoyaltyPromotionIncentiveType.ts +++ b/src/serialization/types/LoyaltyPromotionIncentiveType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyPromotionIncentiveType: core.serialization.Schema< serializers.LoyaltyPromotionIncentiveType.Raw, diff --git a/src/serialization/types/LoyaltyPromotionStatus.ts b/src/serialization/types/LoyaltyPromotionStatus.ts index 248bc733e..c5c13ac37 100644 --- a/src/serialization/types/LoyaltyPromotionStatus.ts +++ b/src/serialization/types/LoyaltyPromotionStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyPromotionStatus: core.serialization.Schema< serializers.LoyaltyPromotionStatus.Raw, diff --git a/src/serialization/types/LoyaltyPromotionTriggerLimit.ts b/src/serialization/types/LoyaltyPromotionTriggerLimit.ts index 98aef06d2..9ee8a9d84 100644 --- a/src/serialization/types/LoyaltyPromotionTriggerLimit.ts +++ b/src/serialization/types/LoyaltyPromotionTriggerLimit.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyPromotionTriggerLimitInterval } from "./LoyaltyPromotionTriggerLimitInterval"; export const LoyaltyPromotionTriggerLimit: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyPromotionTriggerLimitInterval.ts b/src/serialization/types/LoyaltyPromotionTriggerLimitInterval.ts index ee4f88df7..0bdc79e24 100644 --- a/src/serialization/types/LoyaltyPromotionTriggerLimitInterval.ts +++ b/src/serialization/types/LoyaltyPromotionTriggerLimitInterval.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyPromotionTriggerLimitInterval: core.serialization.Schema< serializers.LoyaltyPromotionTriggerLimitInterval.Raw, diff --git a/src/serialization/types/LoyaltyPromotionUpdatedEvent.ts b/src/serialization/types/LoyaltyPromotionUpdatedEvent.ts index 7c961c4e4..aa38f74a6 100644 --- a/src/serialization/types/LoyaltyPromotionUpdatedEvent.ts +++ b/src/serialization/types/LoyaltyPromotionUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyPromotionUpdatedEventData } from "./LoyaltyPromotionUpdatedEventData"; export const LoyaltyPromotionUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const LoyaltyPromotionUpdatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyPromotionUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: LoyaltyPromotionUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyPromotionUpdatedEventData.ts b/src/serialization/types/LoyaltyPromotionUpdatedEventData.ts index f19cbac42..655b21223 100644 --- a/src/serialization/types/LoyaltyPromotionUpdatedEventData.ts +++ b/src/serialization/types/LoyaltyPromotionUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyPromotionUpdatedEventObject } from "./LoyaltyPromotionUpdatedEventObject"; export const LoyaltyPromotionUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const LoyaltyPromotionUpdatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyPromotionUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: LoyaltyPromotionUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyPromotionUpdatedEventObject.ts b/src/serialization/types/LoyaltyPromotionUpdatedEventObject.ts index 57c1a6849..4b740ea71 100644 --- a/src/serialization/types/LoyaltyPromotionUpdatedEventObject.ts +++ b/src/serialization/types/LoyaltyPromotionUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyPromotion } from "./LoyaltyPromotion"; export const LoyaltyPromotionUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyReward.ts b/src/serialization/types/LoyaltyReward.ts index 5eaeb90bc..f4450b337 100644 --- a/src/serialization/types/LoyaltyReward.ts +++ b/src/serialization/types/LoyaltyReward.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyRewardStatus } from "./LoyaltyRewardStatus"; export const LoyaltyReward: core.serialization.ObjectSchema = @@ -27,7 +25,7 @@ export declare namespace LoyaltyReward { loyalty_account_id: string; reward_tier_id: string; points?: number | null; - order_id?: (string | null) | null; + order_id?: (string | null | undefined) | null; created_at?: string | null; updated_at?: string | null; redeemed_at?: string | null; diff --git a/src/serialization/types/LoyaltyRewardStatus.ts b/src/serialization/types/LoyaltyRewardStatus.ts index 73204b87a..4653016a6 100644 --- a/src/serialization/types/LoyaltyRewardStatus.ts +++ b/src/serialization/types/LoyaltyRewardStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const LoyaltyRewardStatus: core.serialization.Schema< serializers.LoyaltyRewardStatus.Raw, diff --git a/src/serialization/types/MeasurementUnit.ts b/src/serialization/types/MeasurementUnit.ts index b567cfbe7..20128864a 100644 --- a/src/serialization/types/MeasurementUnit.ts +++ b/src/serialization/types/MeasurementUnit.ts @@ -1,18 +1,16 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { MeasurementUnitCustom } from "./MeasurementUnitCustom"; +import type * as serializers from "../index"; import { MeasurementUnitArea } from "./MeasurementUnitArea"; -import { MeasurementUnitLength } from "./MeasurementUnitLength"; -import { MeasurementUnitVolume } from "./MeasurementUnitVolume"; -import { MeasurementUnitWeight } from "./MeasurementUnitWeight"; +import { MeasurementUnitCustom } from "./MeasurementUnitCustom"; import { MeasurementUnitGeneric } from "./MeasurementUnitGeneric"; +import { MeasurementUnitLength } from "./MeasurementUnitLength"; import { MeasurementUnitTime } from "./MeasurementUnitTime"; import { MeasurementUnitUnitType } from "./MeasurementUnitUnitType"; +import { MeasurementUnitVolume } from "./MeasurementUnitVolume"; +import { MeasurementUnitWeight } from "./MeasurementUnitWeight"; export const MeasurementUnit: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/MeasurementUnitArea.ts b/src/serialization/types/MeasurementUnitArea.ts index b6e8bb363..c3c77fb5f 100644 --- a/src/serialization/types/MeasurementUnitArea.ts +++ b/src/serialization/types/MeasurementUnitArea.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const MeasurementUnitArea: core.serialization.Schema< serializers.MeasurementUnitArea.Raw, diff --git a/src/serialization/types/MeasurementUnitCustom.ts b/src/serialization/types/MeasurementUnitCustom.ts index c1a9688ac..b395b04a5 100644 --- a/src/serialization/types/MeasurementUnitCustom.ts +++ b/src/serialization/types/MeasurementUnitCustom.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const MeasurementUnitCustom: core.serialization.ObjectSchema< serializers.MeasurementUnitCustom.Raw, diff --git a/src/serialization/types/MeasurementUnitGeneric.ts b/src/serialization/types/MeasurementUnitGeneric.ts index c2a5a8fa6..0d2ca85b9 100644 --- a/src/serialization/types/MeasurementUnitGeneric.ts +++ b/src/serialization/types/MeasurementUnitGeneric.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const MeasurementUnitGeneric: core.serialization.Schema< serializers.MeasurementUnitGeneric.Raw, diff --git a/src/serialization/types/MeasurementUnitLength.ts b/src/serialization/types/MeasurementUnitLength.ts index f2bbedab8..2d98c3ba8 100644 --- a/src/serialization/types/MeasurementUnitLength.ts +++ b/src/serialization/types/MeasurementUnitLength.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const MeasurementUnitLength: core.serialization.Schema< serializers.MeasurementUnitLength.Raw, diff --git a/src/serialization/types/MeasurementUnitTime.ts b/src/serialization/types/MeasurementUnitTime.ts index 2470332b0..9d599c7a5 100644 --- a/src/serialization/types/MeasurementUnitTime.ts +++ b/src/serialization/types/MeasurementUnitTime.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const MeasurementUnitTime: core.serialization.Schema< serializers.MeasurementUnitTime.Raw, diff --git a/src/serialization/types/MeasurementUnitUnitType.ts b/src/serialization/types/MeasurementUnitUnitType.ts index b1466384a..423f83d52 100644 --- a/src/serialization/types/MeasurementUnitUnitType.ts +++ b/src/serialization/types/MeasurementUnitUnitType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const MeasurementUnitUnitType: core.serialization.Schema< serializers.MeasurementUnitUnitType.Raw, diff --git a/src/serialization/types/MeasurementUnitVolume.ts b/src/serialization/types/MeasurementUnitVolume.ts index 0d8db1ee4..fd081d550 100644 --- a/src/serialization/types/MeasurementUnitVolume.ts +++ b/src/serialization/types/MeasurementUnitVolume.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const MeasurementUnitVolume: core.serialization.Schema< serializers.MeasurementUnitVolume.Raw, diff --git a/src/serialization/types/MeasurementUnitWeight.ts b/src/serialization/types/MeasurementUnitWeight.ts index 14a458dd5..fcfb45aa8 100644 --- a/src/serialization/types/MeasurementUnitWeight.ts +++ b/src/serialization/types/MeasurementUnitWeight.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const MeasurementUnitWeight: core.serialization.Schema< serializers.MeasurementUnitWeight.Raw, diff --git a/src/serialization/types/Merchant.ts b/src/serialization/types/Merchant.ts index 72cc5e821..1888c6f08 100644 --- a/src/serialization/types/Merchant.ts +++ b/src/serialization/types/Merchant.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Country } from "./Country"; import { Currency } from "./Currency"; import { MerchantStatus } from "./MerchantStatus"; @@ -24,12 +22,12 @@ export const Merchant: core.serialization.ObjectSchema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/ModifierLocationOverrides.ts b/src/serialization/types/ModifierLocationOverrides.ts index ca69ef371..e1912dc1c 100644 --- a/src/serialization/types/ModifierLocationOverrides.ts +++ b/src/serialization/types/ModifierLocationOverrides.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const ModifierLocationOverrides: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const ModifierLocationOverrides: core.serialization.ObjectSchema< export declare namespace ModifierLocationOverrides { export interface Raw { - location_id?: (string | null) | null; + location_id?: (string | null | undefined) | null; price_money?: Money.Raw | null; sold_out?: boolean | null; } diff --git a/src/serialization/types/Money.ts b/src/serialization/types/Money.ts index 2ae0cc3be..5fd287c5d 100644 --- a/src/serialization/types/Money.ts +++ b/src/serialization/types/Money.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Currency } from "./Currency"; export const Money: core.serialization.ObjectSchema = core.serialization.object({ @@ -14,7 +12,7 @@ export const Money: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -64,21 +62,21 @@ export declare namespace Order { export interface Raw { id?: string | null; location_id: string; - reference_id?: (string | null) | null; + reference_id?: (string | null | undefined) | null; source?: OrderSource.Raw | null; - customer_id?: (string | null) | null; - line_items?: (OrderLineItem.Raw[] | null) | null; - taxes?: (OrderLineItemTax.Raw[] | null) | null; - discounts?: (OrderLineItemDiscount.Raw[] | null) | null; - service_charges?: (OrderServiceCharge.Raw[] | null) | null; - fulfillments?: (Fulfillment.Raw[] | null) | null; + customer_id?: (string | null | undefined) | null; + line_items?: (OrderLineItem.Raw[] | null | undefined) | null; + taxes?: (OrderLineItemTax.Raw[] | null | undefined) | null; + discounts?: (OrderLineItemDiscount.Raw[] | null | undefined) | null; + service_charges?: (OrderServiceCharge.Raw[] | null | undefined) | null; + fulfillments?: (Fulfillment.Raw[] | null | undefined) | null; returns?: OrderReturn.Raw[] | null; return_amounts?: OrderMoneyAmounts.Raw | null; net_amounts?: OrderMoneyAmounts.Raw | null; rounding_adjustment?: OrderRoundingAdjustment.Raw | null; tenders?: Tender.Raw[] | null; refunds?: Refund.Raw[] | null; - metadata?: (Record | null) | null; + metadata?: (Record | null | undefined) | null; created_at?: string | null; updated_at?: string | null; closed_at?: string | null; @@ -89,7 +87,7 @@ export declare namespace Order { total_discount_money?: Money.Raw | null; total_tip_money?: Money.Raw | null; total_service_charge_money?: Money.Raw | null; - ticket_name?: (string | null) | null; + ticket_name?: (string | null | undefined) | null; pricing_options?: OrderPricingOptions.Raw | null; rewards?: OrderReward.Raw[] | null; net_amount_due_money?: Money.Raw | null; diff --git a/src/serialization/types/OrderCreated.ts b/src/serialization/types/OrderCreated.ts index 8123ff537..76d34766c 100644 --- a/src/serialization/types/OrderCreated.ts +++ b/src/serialization/types/OrderCreated.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { OrderState } from "./OrderState"; export const OrderCreated: core.serialization.ObjectSchema = @@ -18,9 +16,9 @@ export const OrderCreated: core.serialization.ObjectSchema = core.serialization.object({ @@ -15,8 +13,8 @@ export const OrderEntry: core.serialization.ObjectSchema = core.serialization.object({ @@ -56,20 +54,20 @@ export const OrderLineItem: core.serialization.ObjectSchema | null) | null; - modifiers?: (OrderLineItemModifier.Raw[] | null) | null; - applied_taxes?: (OrderLineItemAppliedTax.Raw[] | null) | null; - applied_discounts?: (OrderLineItemAppliedDiscount.Raw[] | null) | null; - applied_service_charges?: (OrderLineItemAppliedServiceCharge.Raw[] | null) | null; + metadata?: (Record | null | undefined) | null; + modifiers?: (OrderLineItemModifier.Raw[] | null | undefined) | null; + applied_taxes?: (OrderLineItemAppliedTax.Raw[] | null | undefined) | null; + applied_discounts?: (OrderLineItemAppliedDiscount.Raw[] | null | undefined) | null; + applied_service_charges?: (OrderLineItemAppliedServiceCharge.Raw[] | null | undefined) | null; base_price_money?: Money.Raw | null; variation_total_price_money?: Money.Raw | null; gross_sales_money?: Money.Raw | null; diff --git a/src/serialization/types/OrderLineItemAppliedDiscount.ts b/src/serialization/types/OrderLineItemAppliedDiscount.ts index 2e1d5875e..a08443d69 100644 --- a/src/serialization/types/OrderLineItemAppliedDiscount.ts +++ b/src/serialization/types/OrderLineItemAppliedDiscount.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderLineItemAppliedDiscount: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const OrderLineItemAppliedDiscount: core.serialization.ObjectSchema< export declare namespace OrderLineItemAppliedDiscount { export interface Raw { - uid?: (string | null) | null; + uid?: (string | null | undefined) | null; discount_uid: string; applied_money?: Money.Raw | null; } diff --git a/src/serialization/types/OrderLineItemAppliedServiceCharge.ts b/src/serialization/types/OrderLineItemAppliedServiceCharge.ts index 36612b700..1edb66e45 100644 --- a/src/serialization/types/OrderLineItemAppliedServiceCharge.ts +++ b/src/serialization/types/OrderLineItemAppliedServiceCharge.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderLineItemAppliedServiceCharge: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const OrderLineItemAppliedServiceCharge: core.serialization.ObjectSchema< export declare namespace OrderLineItemAppliedServiceCharge { export interface Raw { - uid?: (string | null) | null; + uid?: (string | null | undefined) | null; service_charge_uid: string; applied_money?: Money.Raw | null; } diff --git a/src/serialization/types/OrderLineItemAppliedTax.ts b/src/serialization/types/OrderLineItemAppliedTax.ts index d04a39c78..8fbd659aa 100644 --- a/src/serialization/types/OrderLineItemAppliedTax.ts +++ b/src/serialization/types/OrderLineItemAppliedTax.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderLineItemAppliedTax: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const OrderLineItemAppliedTax: core.serialization.ObjectSchema< export declare namespace OrderLineItemAppliedTax { export interface Raw { - uid?: (string | null) | null; + uid?: (string | null | undefined) | null; tax_uid: string; applied_money?: Money.Raw | null; } diff --git a/src/serialization/types/OrderLineItemDiscount.ts b/src/serialization/types/OrderLineItemDiscount.ts index d4044eb07..4574eddc8 100644 --- a/src/serialization/types/OrderLineItemDiscount.ts +++ b/src/serialization/types/OrderLineItemDiscount.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { OrderLineItemDiscountType } from "./OrderLineItemDiscountType"; +import type * as serializers from "../index"; import { Money } from "./Money"; import { OrderLineItemDiscountScope } from "./OrderLineItemDiscountScope"; +import { OrderLineItemDiscountType } from "./OrderLineItemDiscountType"; export const OrderLineItemDiscount: core.serialization.ObjectSchema< serializers.OrderLineItemDiscount.Raw, @@ -34,15 +32,15 @@ export const OrderLineItemDiscount: core.serialization.ObjectSchema< export declare namespace OrderLineItemDiscount { export interface Raw { - uid?: (string | null) | null; - catalog_object_id?: (string | null) | null; - catalog_version?: ((bigint | number) | null) | null; - name?: (string | null) | null; + uid?: (string | null | undefined) | null; + catalog_object_id?: (string | null | undefined) | null; + catalog_version?: ((bigint | number) | null | undefined) | null; + name?: (string | null | undefined) | null; type?: OrderLineItemDiscountType.Raw | null; - percentage?: (string | null) | null; + percentage?: (string | null | undefined) | null; amount_money?: Money.Raw | null; applied_money?: Money.Raw | null; - metadata?: (Record | null) | null; + metadata?: (Record | null | undefined) | null; scope?: OrderLineItemDiscountScope.Raw | null; reward_ids?: string[] | null; pricing_rule_id?: string | null; diff --git a/src/serialization/types/OrderLineItemDiscountScope.ts b/src/serialization/types/OrderLineItemDiscountScope.ts index bce436185..e056d232f 100644 --- a/src/serialization/types/OrderLineItemDiscountScope.ts +++ b/src/serialization/types/OrderLineItemDiscountScope.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderLineItemDiscountScope: core.serialization.Schema< serializers.OrderLineItemDiscountScope.Raw, diff --git a/src/serialization/types/OrderLineItemDiscountType.ts b/src/serialization/types/OrderLineItemDiscountType.ts index dfb201efd..c64a60114 100644 --- a/src/serialization/types/OrderLineItemDiscountType.ts +++ b/src/serialization/types/OrderLineItemDiscountType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderLineItemDiscountType: core.serialization.Schema< serializers.OrderLineItemDiscountType.Raw, diff --git a/src/serialization/types/OrderLineItemItemType.ts b/src/serialization/types/OrderLineItemItemType.ts index 68533023b..78a32b5ea 100644 --- a/src/serialization/types/OrderLineItemItemType.ts +++ b/src/serialization/types/OrderLineItemItemType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderLineItemItemType: core.serialization.Schema< serializers.OrderLineItemItemType.Raw, diff --git a/src/serialization/types/OrderLineItemModifier.ts b/src/serialization/types/OrderLineItemModifier.ts index 8e1eca6ac..e01ddfc95 100644 --- a/src/serialization/types/OrderLineItemModifier.ts +++ b/src/serialization/types/OrderLineItemModifier.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderLineItemModifier: core.serialization.ObjectSchema< @@ -25,13 +23,13 @@ export const OrderLineItemModifier: core.serialization.ObjectSchema< export declare namespace OrderLineItemModifier { export interface Raw { - uid?: (string | null) | null; - catalog_object_id?: (string | null) | null; - catalog_version?: ((bigint | number) | null) | null; - name?: (string | null) | null; - quantity?: (string | null) | null; + uid?: (string | null | undefined) | null; + catalog_object_id?: (string | null | undefined) | null; + catalog_version?: ((bigint | number) | null | undefined) | null; + name?: (string | null | undefined) | null; + quantity?: (string | null | undefined) | null; base_price_money?: Money.Raw | null; total_price_money?: Money.Raw | null; - metadata?: (Record | null) | null; + metadata?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/OrderLineItemPricingBlocklists.ts b/src/serialization/types/OrderLineItemPricingBlocklists.ts index 2042642b5..b63cffcad 100644 --- a/src/serialization/types/OrderLineItemPricingBlocklists.ts +++ b/src/serialization/types/OrderLineItemPricingBlocklists.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { OrderLineItemPricingBlocklistsBlockedDiscount } from "./OrderLineItemPricingBlocklistsBlockedDiscount"; import { OrderLineItemPricingBlocklistsBlockedTax } from "./OrderLineItemPricingBlocklistsBlockedTax"; @@ -24,7 +22,7 @@ export const OrderLineItemPricingBlocklists: core.serialization.ObjectSchema< export declare namespace OrderLineItemPricingBlocklists { export interface Raw { - blocked_discounts?: (OrderLineItemPricingBlocklistsBlockedDiscount.Raw[] | null) | null; - blocked_taxes?: (OrderLineItemPricingBlocklistsBlockedTax.Raw[] | null) | null; + blocked_discounts?: (OrderLineItemPricingBlocklistsBlockedDiscount.Raw[] | null | undefined) | null; + blocked_taxes?: (OrderLineItemPricingBlocklistsBlockedTax.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts b/src/serialization/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts index 2c326bb13..58feb53d8 100644 --- a/src/serialization/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts +++ b/src/serialization/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderLineItemPricingBlocklistsBlockedDiscount: core.serialization.ObjectSchema< serializers.OrderLineItemPricingBlocklistsBlockedDiscount.Raw, @@ -20,8 +18,8 @@ export const OrderLineItemPricingBlocklistsBlockedDiscount: core.serialization.O export declare namespace OrderLineItemPricingBlocklistsBlockedDiscount { export interface Raw { - uid?: (string | null) | null; - discount_uid?: (string | null) | null; - discount_catalog_object_id?: (string | null) | null; + uid?: (string | null | undefined) | null; + discount_uid?: (string | null | undefined) | null; + discount_catalog_object_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/OrderLineItemPricingBlocklistsBlockedTax.ts b/src/serialization/types/OrderLineItemPricingBlocklistsBlockedTax.ts index 0909a8346..13fc312fb 100644 --- a/src/serialization/types/OrderLineItemPricingBlocklistsBlockedTax.ts +++ b/src/serialization/types/OrderLineItemPricingBlocklistsBlockedTax.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderLineItemPricingBlocklistsBlockedTax: core.serialization.ObjectSchema< serializers.OrderLineItemPricingBlocklistsBlockedTax.Raw, @@ -20,8 +18,8 @@ export const OrderLineItemPricingBlocklistsBlockedTax: core.serialization.Object export declare namespace OrderLineItemPricingBlocklistsBlockedTax { export interface Raw { - uid?: (string | null) | null; - tax_uid?: (string | null) | null; - tax_catalog_object_id?: (string | null) | null; + uid?: (string | null | undefined) | null; + tax_uid?: (string | null | undefined) | null; + tax_catalog_object_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/OrderLineItemTax.ts b/src/serialization/types/OrderLineItemTax.ts index 2e61af997..2a16d6efd 100644 --- a/src/serialization/types/OrderLineItemTax.ts +++ b/src/serialization/types/OrderLineItemTax.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { OrderLineItemTaxType } from "./OrderLineItemTaxType"; +import type * as serializers from "../index"; import { Money } from "./Money"; import { OrderLineItemTaxScope } from "./OrderLineItemTaxScope"; +import { OrderLineItemTaxType } from "./OrderLineItemTaxType"; export const OrderLineItemTax: core.serialization.ObjectSchema< serializers.OrderLineItemTax.Raw, @@ -29,13 +27,13 @@ export const OrderLineItemTax: core.serialization.ObjectSchema< export declare namespace OrderLineItemTax { export interface Raw { - uid?: (string | null) | null; - catalog_object_id?: (string | null) | null; - catalog_version?: ((bigint | number) | null) | null; - name?: (string | null) | null; + uid?: (string | null | undefined) | null; + catalog_object_id?: (string | null | undefined) | null; + catalog_version?: ((bigint | number) | null | undefined) | null; + name?: (string | null | undefined) | null; type?: OrderLineItemTaxType.Raw | null; - percentage?: (string | null) | null; - metadata?: (Record | null) | null; + percentage?: (string | null | undefined) | null; + metadata?: (Record | null | undefined) | null; applied_money?: Money.Raw | null; scope?: OrderLineItemTaxScope.Raw | null; auto_applied?: boolean | null; diff --git a/src/serialization/types/OrderLineItemTaxScope.ts b/src/serialization/types/OrderLineItemTaxScope.ts index c819edbed..d3058cb04 100644 --- a/src/serialization/types/OrderLineItemTaxScope.ts +++ b/src/serialization/types/OrderLineItemTaxScope.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderLineItemTaxScope: core.serialization.Schema< serializers.OrderLineItemTaxScope.Raw, diff --git a/src/serialization/types/OrderLineItemTaxType.ts b/src/serialization/types/OrderLineItemTaxType.ts index 37322d402..aed8f6180 100644 --- a/src/serialization/types/OrderLineItemTaxType.ts +++ b/src/serialization/types/OrderLineItemTaxType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderLineItemTaxType: core.serialization.Schema< serializers.OrderLineItemTaxType.Raw, diff --git a/src/serialization/types/OrderMoneyAmounts.ts b/src/serialization/types/OrderMoneyAmounts.ts index 40e754627..d35b8d894 100644 --- a/src/serialization/types/OrderMoneyAmounts.ts +++ b/src/serialization/types/OrderMoneyAmounts.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderMoneyAmounts: core.serialization.ObjectSchema< diff --git a/src/serialization/types/OrderPricingOptions.ts b/src/serialization/types/OrderPricingOptions.ts index cb0dd842b..4f58b7647 100644 --- a/src/serialization/types/OrderPricingOptions.ts +++ b/src/serialization/types/OrderPricingOptions.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderPricingOptions: core.serialization.ObjectSchema< serializers.OrderPricingOptions.Raw, @@ -19,7 +17,7 @@ export const OrderPricingOptions: core.serialization.ObjectSchema< export declare namespace OrderPricingOptions { export interface Raw { - auto_apply_discounts?: (boolean | null) | null; - auto_apply_taxes?: (boolean | null) | null; + auto_apply_discounts?: (boolean | null | undefined) | null; + auto_apply_taxes?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/OrderQuantityUnit.ts b/src/serialization/types/OrderQuantityUnit.ts index 7d67fdc6a..f4ffbf75d 100644 --- a/src/serialization/types/OrderQuantityUnit.ts +++ b/src/serialization/types/OrderQuantityUnit.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { MeasurementUnit } from "./MeasurementUnit"; export const OrderQuantityUnit: core.serialization.ObjectSchema< @@ -20,8 +18,8 @@ export const OrderQuantityUnit: core.serialization.ObjectSchema< export declare namespace OrderQuantityUnit { export interface Raw { measurement_unit?: MeasurementUnit.Raw | null; - precision?: (number | null) | null; - catalog_object_id?: (string | null) | null; - catalog_version?: ((bigint | number) | null) | null; + precision?: (number | null | undefined) | null; + catalog_object_id?: (string | null | undefined) | null; + catalog_version?: ((bigint | number) | null | undefined) | null; } } diff --git a/src/serialization/types/OrderReturn.ts b/src/serialization/types/OrderReturn.ts index 650a90208..72e09722f 100644 --- a/src/serialization/types/OrderReturn.ts +++ b/src/serialization/types/OrderReturn.ts @@ -1,17 +1,15 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; +import { OrderMoneyAmounts } from "./OrderMoneyAmounts"; +import { OrderReturnDiscount } from "./OrderReturnDiscount"; import { OrderReturnLineItem } from "./OrderReturnLineItem"; import { OrderReturnServiceCharge } from "./OrderReturnServiceCharge"; import { OrderReturnTax } from "./OrderReturnTax"; -import { OrderReturnDiscount } from "./OrderReturnDiscount"; import { OrderReturnTip } from "./OrderReturnTip"; import { OrderRoundingAdjustment } from "./OrderRoundingAdjustment"; -import { OrderMoneyAmounts } from "./OrderMoneyAmounts"; export const OrderReturn: core.serialization.ObjectSchema = core.serialization.object({ @@ -40,13 +38,13 @@ export const OrderReturn: core.serialization.ObjectSchema = core.serialization.object({ @@ -27,13 +25,13 @@ export const OrderReturnTax: core.serialization.ObjectSchema = @@ -20,9 +18,9 @@ export const OrderReturnTip: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/OrderRoundingAdjustment.ts b/src/serialization/types/OrderRoundingAdjustment.ts index fcdf03719..47814e563 100644 --- a/src/serialization/types/OrderRoundingAdjustment.ts +++ b/src/serialization/types/OrderRoundingAdjustment.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderRoundingAdjustment: core.serialization.ObjectSchema< @@ -18,8 +16,8 @@ export const OrderRoundingAdjustment: core.serialization.ObjectSchema< export declare namespace OrderRoundingAdjustment { export interface Raw { - uid?: (string | null) | null; - name?: (string | null) | null; + uid?: (string | null | undefined) | null; + name?: (string | null | undefined) | null; amount_money?: Money.Raw | null; } } diff --git a/src/serialization/types/OrderServiceCharge.ts b/src/serialization/types/OrderServiceCharge.ts index 88fbd238a..b2bad2fd2 100644 --- a/src/serialization/types/OrderServiceCharge.ts +++ b/src/serialization/types/OrderServiceCharge.ts @@ -1,16 +1,14 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; -import { OrderServiceChargeCalculationPhase } from "./OrderServiceChargeCalculationPhase"; import { OrderLineItemAppliedTax } from "./OrderLineItemAppliedTax"; -import { OrderServiceChargeType } from "./OrderServiceChargeType"; -import { OrderServiceChargeTreatmentType } from "./OrderServiceChargeTreatmentType"; +import { OrderServiceChargeCalculationPhase } from "./OrderServiceChargeCalculationPhase"; import { OrderServiceChargeScope } from "./OrderServiceChargeScope"; +import { OrderServiceChargeTreatmentType } from "./OrderServiceChargeTreatmentType"; +import { OrderServiceChargeType } from "./OrderServiceChargeType"; export const OrderServiceCharge: core.serialization.ObjectSchema< serializers.OrderServiceCharge.Raw, @@ -41,19 +39,19 @@ export const OrderServiceCharge: core.serialization.ObjectSchema< export declare namespace OrderServiceCharge { export interface Raw { - uid?: (string | null) | null; - name?: (string | null) | null; - catalog_object_id?: (string | null) | null; - catalog_version?: ((bigint | number) | null) | null; - percentage?: (string | null) | null; + uid?: (string | null | undefined) | null; + name?: (string | null | undefined) | null; + catalog_object_id?: (string | null | undefined) | null; + catalog_version?: ((bigint | number) | null | undefined) | null; + percentage?: (string | null | undefined) | null; amount_money?: Money.Raw | null; applied_money?: Money.Raw | null; total_money?: Money.Raw | null; total_tax_money?: Money.Raw | null; calculation_phase?: OrderServiceChargeCalculationPhase.Raw | null; - taxable?: (boolean | null) | null; - applied_taxes?: (OrderLineItemAppliedTax.Raw[] | null) | null; - metadata?: (Record | null) | null; + taxable?: (boolean | null | undefined) | null; + applied_taxes?: (OrderLineItemAppliedTax.Raw[] | null | undefined) | null; + metadata?: (Record | null | undefined) | null; type?: OrderServiceChargeType.Raw | null; treatment_type?: OrderServiceChargeTreatmentType.Raw | null; scope?: OrderServiceChargeScope.Raw | null; diff --git a/src/serialization/types/OrderServiceChargeCalculationPhase.ts b/src/serialization/types/OrderServiceChargeCalculationPhase.ts index ac6544627..7ef68b162 100644 --- a/src/serialization/types/OrderServiceChargeCalculationPhase.ts +++ b/src/serialization/types/OrderServiceChargeCalculationPhase.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderServiceChargeCalculationPhase: core.serialization.Schema< serializers.OrderServiceChargeCalculationPhase.Raw, diff --git a/src/serialization/types/OrderServiceChargeScope.ts b/src/serialization/types/OrderServiceChargeScope.ts index 83faa80ea..f8fcb8d5e 100644 --- a/src/serialization/types/OrderServiceChargeScope.ts +++ b/src/serialization/types/OrderServiceChargeScope.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderServiceChargeScope: core.serialization.Schema< serializers.OrderServiceChargeScope.Raw, diff --git a/src/serialization/types/OrderServiceChargeTreatmentType.ts b/src/serialization/types/OrderServiceChargeTreatmentType.ts index af0aca06c..101cbbf62 100644 --- a/src/serialization/types/OrderServiceChargeTreatmentType.ts +++ b/src/serialization/types/OrderServiceChargeTreatmentType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderServiceChargeTreatmentType: core.serialization.Schema< serializers.OrderServiceChargeTreatmentType.Raw, diff --git a/src/serialization/types/OrderServiceChargeType.ts b/src/serialization/types/OrderServiceChargeType.ts index 4553380e3..e2e195b33 100644 --- a/src/serialization/types/OrderServiceChargeType.ts +++ b/src/serialization/types/OrderServiceChargeType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderServiceChargeType: core.serialization.Schema< serializers.OrderServiceChargeType.Raw, diff --git a/src/serialization/types/OrderSource.ts b/src/serialization/types/OrderSource.ts index f260b8b09..6052d7dee 100644 --- a/src/serialization/types/OrderSource.ts +++ b/src/serialization/types/OrderSource.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const OrderSource: core.serialization.ObjectSchema = core.serialization.object({ @@ -13,6 +11,6 @@ export const OrderSource: core.serialization.ObjectSchema = core.serialization.enum_(["OPEN", "COMPLETED", "CANCELED", "DRAFT"]); diff --git a/src/serialization/types/OrderUpdated.ts b/src/serialization/types/OrderUpdated.ts index 8d3ef5fb1..c3a74a2e9 100644 --- a/src/serialization/types/OrderUpdated.ts +++ b/src/serialization/types/OrderUpdated.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { OrderState } from "./OrderState"; export const OrderUpdated: core.serialization.ObjectSchema = @@ -19,9 +17,9 @@ export const OrderUpdated: core.serialization.ObjectSchema = core.serialization.object({ @@ -91,7 +89,7 @@ export declare namespace Payment { refunded_money?: Money.Raw | null; status?: string | null; delay_duration?: string | null; - delay_action?: (string | null) | null; + delay_action?: (string | null | undefined) | null; delayed_until?: string | null; source_type?: string | null; card_details?: CardPaymentDetails.Raw | null; @@ -106,7 +104,7 @@ export declare namespace Payment { reference_id?: string | null; customer_id?: string | null; employee_id?: string | null; - team_member_id?: (string | null) | null; + team_member_id?: (string | null | undefined) | null; refund_ids?: string[] | null; risk_evaluation?: RiskEvaluation.Raw | null; terminal_checkout_id?: string | null; @@ -122,6 +120,6 @@ export declare namespace Payment { application_details?: ApplicationDetails.Raw | null; is_offline_payment?: boolean | null; offline_payment_details?: OfflinePaymentDetails.Raw | null; - version_token?: (string | null) | null; + version_token?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityAppFeeRefundDetail.ts b/src/serialization/types/PaymentBalanceActivityAppFeeRefundDetail.ts index 93715e586..f8866c242 100644 --- a/src/serialization/types/PaymentBalanceActivityAppFeeRefundDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityAppFeeRefundDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityAppFeeRefundDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityAppFeeRefundDetail.Raw, @@ -17,8 +15,8 @@ export const PaymentBalanceActivityAppFeeRefundDetail: core.serialization.Object export declare namespace PaymentBalanceActivityAppFeeRefundDetail { export interface Raw { - payment_id?: (string | null) | null; - refund_id?: (string | null) | null; - location_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; + refund_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityAppFeeRevenueDetail.ts b/src/serialization/types/PaymentBalanceActivityAppFeeRevenueDetail.ts index e51a7e1d7..f76a9bebd 100644 --- a/src/serialization/types/PaymentBalanceActivityAppFeeRevenueDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityAppFeeRevenueDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityAppFeeRevenueDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityAppFeeRevenueDetail.Raw, @@ -16,7 +14,7 @@ export const PaymentBalanceActivityAppFeeRevenueDetail: core.serialization.Objec export declare namespace PaymentBalanceActivityAppFeeRevenueDetail { export interface Raw { - payment_id?: (string | null) | null; - location_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityAutomaticSavingsDetail.ts b/src/serialization/types/PaymentBalanceActivityAutomaticSavingsDetail.ts index 5a54a9f90..91cd55ccb 100644 --- a/src/serialization/types/PaymentBalanceActivityAutomaticSavingsDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityAutomaticSavingsDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityAutomaticSavingsDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityAutomaticSavingsDetail.Raw, @@ -16,7 +14,7 @@ export const PaymentBalanceActivityAutomaticSavingsDetail: core.serialization.Ob export declare namespace PaymentBalanceActivityAutomaticSavingsDetail { export interface Raw { - payment_id?: (string | null) | null; - payout_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; + payout_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts b/src/serialization/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts index 936413940..feb39fd59 100644 --- a/src/serialization/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityAutomaticSavingsReversedDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityAutomaticSavingsReversedDetail.Raw, @@ -16,7 +14,7 @@ export const PaymentBalanceActivityAutomaticSavingsReversedDetail: core.serializ export declare namespace PaymentBalanceActivityAutomaticSavingsReversedDetail { export interface Raw { - payment_id?: (string | null) | null; - payout_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; + payout_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityChargeDetail.ts b/src/serialization/types/PaymentBalanceActivityChargeDetail.ts index 1106a0204..a4ebc7fe0 100644 --- a/src/serialization/types/PaymentBalanceActivityChargeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityChargeDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityChargeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityChargeDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityChargeDetail: core.serialization.ObjectSchema export declare namespace PaymentBalanceActivityChargeDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityDepositFeeDetail.ts b/src/serialization/types/PaymentBalanceActivityDepositFeeDetail.ts index 8e3f3179e..00f7572fd 100644 --- a/src/serialization/types/PaymentBalanceActivityDepositFeeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityDepositFeeDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityDepositFeeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityDepositFeeDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityDepositFeeDetail: core.serialization.ObjectSc export declare namespace PaymentBalanceActivityDepositFeeDetail { export interface Raw { - payout_id?: (string | null) | null; + payout_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityDepositFeeReversedDetail.ts b/src/serialization/types/PaymentBalanceActivityDepositFeeReversedDetail.ts index 53747895f..fdf9787a5 100644 --- a/src/serialization/types/PaymentBalanceActivityDepositFeeReversedDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityDepositFeeReversedDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityDepositFeeReversedDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityDepositFeeReversedDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityDepositFeeReversedDetail: core.serialization. export declare namespace PaymentBalanceActivityDepositFeeReversedDetail { export interface Raw { - payout_id?: (string | null) | null; + payout_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityDisputeDetail.ts b/src/serialization/types/PaymentBalanceActivityDisputeDetail.ts index a25697664..cb56fba67 100644 --- a/src/serialization/types/PaymentBalanceActivityDisputeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityDisputeDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityDisputeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityDisputeDetail.Raw, @@ -16,7 +14,7 @@ export const PaymentBalanceActivityDisputeDetail: core.serialization.ObjectSchem export declare namespace PaymentBalanceActivityDisputeDetail { export interface Raw { - payment_id?: (string | null) | null; - dispute_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; + dispute_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityFeeDetail.ts b/src/serialization/types/PaymentBalanceActivityFeeDetail.ts index 30db029ff..a4025c771 100644 --- a/src/serialization/types/PaymentBalanceActivityFeeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityFeeDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityFeeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityFeeDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityFeeDetail: core.serialization.ObjectSchema< export declare namespace PaymentBalanceActivityFeeDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityFreeProcessingDetail.ts b/src/serialization/types/PaymentBalanceActivityFreeProcessingDetail.ts index 38e81759b..98a49d9cf 100644 --- a/src/serialization/types/PaymentBalanceActivityFreeProcessingDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityFreeProcessingDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityFreeProcessingDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityFreeProcessingDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityFreeProcessingDetail: core.serialization.Obje export declare namespace PaymentBalanceActivityFreeProcessingDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityHoldAdjustmentDetail.ts b/src/serialization/types/PaymentBalanceActivityHoldAdjustmentDetail.ts index 7add70237..22d759bad 100644 --- a/src/serialization/types/PaymentBalanceActivityHoldAdjustmentDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityHoldAdjustmentDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityHoldAdjustmentDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityHoldAdjustmentDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityHoldAdjustmentDetail: core.serialization.Obje export declare namespace PaymentBalanceActivityHoldAdjustmentDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityOpenDisputeDetail.ts b/src/serialization/types/PaymentBalanceActivityOpenDisputeDetail.ts index ffe15a534..42a1d1510 100644 --- a/src/serialization/types/PaymentBalanceActivityOpenDisputeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityOpenDisputeDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityOpenDisputeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityOpenDisputeDetail.Raw, @@ -16,7 +14,7 @@ export const PaymentBalanceActivityOpenDisputeDetail: core.serialization.ObjectS export declare namespace PaymentBalanceActivityOpenDisputeDetail { export interface Raw { - payment_id?: (string | null) | null; - dispute_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; + dispute_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityOtherAdjustmentDetail.ts b/src/serialization/types/PaymentBalanceActivityOtherAdjustmentDetail.ts index 82a2306a8..41385eecc 100644 --- a/src/serialization/types/PaymentBalanceActivityOtherAdjustmentDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityOtherAdjustmentDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityOtherAdjustmentDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityOtherAdjustmentDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityOtherAdjustmentDetail: core.serialization.Obj export declare namespace PaymentBalanceActivityOtherAdjustmentDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityOtherDetail.ts b/src/serialization/types/PaymentBalanceActivityOtherDetail.ts index b630c73b3..cc36bf3dc 100644 --- a/src/serialization/types/PaymentBalanceActivityOtherDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityOtherDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityOtherDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityOtherDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityOtherDetail: core.serialization.ObjectSchema< export declare namespace PaymentBalanceActivityOtherDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityRefundDetail.ts b/src/serialization/types/PaymentBalanceActivityRefundDetail.ts index 872d98175..e424b9092 100644 --- a/src/serialization/types/PaymentBalanceActivityRefundDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityRefundDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityRefundDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityRefundDetail.Raw, @@ -16,7 +14,7 @@ export const PaymentBalanceActivityRefundDetail: core.serialization.ObjectSchema export declare namespace PaymentBalanceActivityRefundDetail { export interface Raw { - payment_id?: (string | null) | null; - refund_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; + refund_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts b/src/serialization/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts index 9cac322fd..f52fea44a 100644 --- a/src/serialization/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityReleaseAdjustmentDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityReleaseAdjustmentDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityReleaseAdjustmentDetail: core.serialization.O export declare namespace PaymentBalanceActivityReleaseAdjustmentDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityReserveHoldDetail.ts b/src/serialization/types/PaymentBalanceActivityReserveHoldDetail.ts index 9fb979d1b..8ff35faa3 100644 --- a/src/serialization/types/PaymentBalanceActivityReserveHoldDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityReserveHoldDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityReserveHoldDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityReserveHoldDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityReserveHoldDetail: core.serialization.ObjectS export declare namespace PaymentBalanceActivityReserveHoldDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityReserveReleaseDetail.ts b/src/serialization/types/PaymentBalanceActivityReserveReleaseDetail.ts index 3c67aee14..67869e9d0 100644 --- a/src/serialization/types/PaymentBalanceActivityReserveReleaseDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityReserveReleaseDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityReserveReleaseDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityReserveReleaseDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityReserveReleaseDetail: core.serialization.Obje export declare namespace PaymentBalanceActivityReserveReleaseDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts b/src/serialization/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts index 3d6c15fa1..55a415929 100644 --- a/src/serialization/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts +++ b/src/serialization/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivitySquareCapitalPaymentDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivitySquareCapitalPaymentDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivitySquareCapitalPaymentDetail: core.serializatio export declare namespace PaymentBalanceActivitySquareCapitalPaymentDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts b/src/serialization/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts index 055245e5c..194f1a598 100644 --- a/src/serialization/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts +++ b/src/serialization/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivitySquareCapitalReversedPaymentDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivitySquareCapitalReversedPaymentDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivitySquareCapitalReversedPaymentDetail: core.seri export declare namespace PaymentBalanceActivitySquareCapitalReversedPaymentDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts b/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts index 5d4921bbe..edd19d974 100644 --- a/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts +++ b/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivitySquarePayrollTransferDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivitySquarePayrollTransferDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivitySquarePayrollTransferDetail: core.serializati export declare namespace PaymentBalanceActivitySquarePayrollTransferDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts b/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts index c1788834d..30324466d 100644 --- a/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts +++ b/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivitySquarePayrollTransferReversedDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivitySquarePayrollTransferReversedDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivitySquarePayrollTransferReversedDetail: core.ser export declare namespace PaymentBalanceActivitySquarePayrollTransferReversedDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityTaxOnFeeDetail.ts b/src/serialization/types/PaymentBalanceActivityTaxOnFeeDetail.ts index e7b9c9ded..e0f706bc5 100644 --- a/src/serialization/types/PaymentBalanceActivityTaxOnFeeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityTaxOnFeeDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityTaxOnFeeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityTaxOnFeeDetail.Raw, @@ -19,7 +17,7 @@ export const PaymentBalanceActivityTaxOnFeeDetail: core.serialization.ObjectSche export declare namespace PaymentBalanceActivityTaxOnFeeDetail { export interface Raw { - payment_id?: (string | null) | null; - tax_rate_description?: (string | null) | null; + payment_id?: (string | null | undefined) | null; + tax_rate_description?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityThirdPartyFeeDetail.ts b/src/serialization/types/PaymentBalanceActivityThirdPartyFeeDetail.ts index 5cd6f8826..20a35a162 100644 --- a/src/serialization/types/PaymentBalanceActivityThirdPartyFeeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityThirdPartyFeeDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityThirdPartyFeeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityThirdPartyFeeDetail.Raw, @@ -15,6 +13,6 @@ export const PaymentBalanceActivityThirdPartyFeeDetail: core.serialization.Objec export declare namespace PaymentBalanceActivityThirdPartyFeeDetail { export interface Raw { - payment_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts b/src/serialization/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts index 177199e56..64e7f2af6 100644 --- a/src/serialization/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PaymentBalanceActivityThirdPartyFeeRefundDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityThirdPartyFeeRefundDetail.Raw, @@ -16,7 +14,7 @@ export const PaymentBalanceActivityThirdPartyFeeRefundDetail: core.serialization export declare namespace PaymentBalanceActivityThirdPartyFeeRefundDetail { export interface Raw { - payment_id?: (string | null) | null; - refund_id?: (string | null) | null; + payment_id?: (string | null | undefined) | null; + refund_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentCreatedEvent.ts b/src/serialization/types/PaymentCreatedEvent.ts index b34bdd905..047c2cc59 100644 --- a/src/serialization/types/PaymentCreatedEvent.ts +++ b/src/serialization/types/PaymentCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PaymentCreatedEventData } from "./PaymentCreatedEventData"; export const PaymentCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const PaymentCreatedEvent: core.serialization.ObjectSchema< export declare namespace PaymentCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: PaymentCreatedEventData.Raw | null; } diff --git a/src/serialization/types/PaymentCreatedEventData.ts b/src/serialization/types/PaymentCreatedEventData.ts index a09a44f6e..fa80d9f63 100644 --- a/src/serialization/types/PaymentCreatedEventData.ts +++ b/src/serialization/types/PaymentCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PaymentCreatedEventObject } from "./PaymentCreatedEventObject"; export const PaymentCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const PaymentCreatedEventData: core.serialization.ObjectSchema< export declare namespace PaymentCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: PaymentCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/PaymentCreatedEventObject.ts b/src/serialization/types/PaymentCreatedEventObject.ts index 9dbe956b7..a13abf467 100644 --- a/src/serialization/types/PaymentCreatedEventObject.ts +++ b/src/serialization/types/PaymentCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Payment } from "./Payment"; export const PaymentCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/PaymentLink.ts b/src/serialization/types/PaymentLink.ts index 4bef5bb04..eb053e7d9 100644 --- a/src/serialization/types/PaymentLink.ts +++ b/src/serialization/types/PaymentLink.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CheckoutOptions } from "./CheckoutOptions"; import { PrePopulatedData } from "./PrePopulatedData"; @@ -27,7 +25,7 @@ export declare namespace PaymentLink { export interface Raw { id?: string | null; version: number; - description?: (string | null) | null; + description?: (string | null | undefined) | null; order_id?: string | null; checkout_options?: CheckoutOptions.Raw | null; pre_populated_data?: PrePopulatedData.Raw | null; @@ -35,6 +33,6 @@ export declare namespace PaymentLink { long_url?: string | null; created_at?: string | null; updated_at?: string | null; - payment_note?: (string | null) | null; + payment_note?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentLinkRelatedResources.ts b/src/serialization/types/PaymentLinkRelatedResources.ts index b2b074e85..27fd151c2 100644 --- a/src/serialization/types/PaymentLinkRelatedResources.ts +++ b/src/serialization/types/PaymentLinkRelatedResources.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { Order } from "./Order"; export const PaymentLinkRelatedResources: core.serialization.ObjectSchema< @@ -20,7 +18,7 @@ export const PaymentLinkRelatedResources: core.serialization.ObjectSchema< export declare namespace PaymentLinkRelatedResources { export interface Raw { - orders?: (Order.Raw[] | null) | null; - subscription_plans?: (serializers.CatalogObject.Raw[] | null) | null; + orders?: (Order.Raw[] | null | undefined) | null; + subscription_plans?: (serializers.CatalogObject.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/PaymentOptions.ts b/src/serialization/types/PaymentOptions.ts index 35c20723c..fd9b858bd 100644 --- a/src/serialization/types/PaymentOptions.ts +++ b/src/serialization/types/PaymentOptions.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PaymentOptionsDelayAction } from "./PaymentOptionsDelayAction"; export const PaymentOptions: core.serialization.ObjectSchema = @@ -20,9 +18,9 @@ export const PaymentOptions: core.serialization.ObjectSchema = core.serialization.object( { @@ -39,8 +37,8 @@ export declare namespace Payout { destination?: Destination.Raw | null; version?: number | null; type?: PayoutType.Raw | null; - payout_fee?: (PayoutFee.Raw[] | null) | null; - arrival_date?: (string | null) | null; - end_to_end_id?: (string | null) | null; + payout_fee?: (PayoutFee.Raw[] | null | undefined) | null; + arrival_date?: (string | null | undefined) | null; + end_to_end_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/PayoutEntry.ts b/src/serialization/types/PayoutEntry.ts index be6a53eed..231d29f0e 100644 --- a/src/serialization/types/PayoutEntry.ts +++ b/src/serialization/types/PayoutEntry.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ActivityType } from "./ActivityType"; import { Money } from "./Money"; -import { PaymentBalanceActivityAppFeeRevenueDetail } from "./PaymentBalanceActivityAppFeeRevenueDetail"; import { PaymentBalanceActivityAppFeeRefundDetail } from "./PaymentBalanceActivityAppFeeRefundDetail"; +import { PaymentBalanceActivityAppFeeRevenueDetail } from "./PaymentBalanceActivityAppFeeRevenueDetail"; import { PaymentBalanceActivityAutomaticSavingsDetail } from "./PaymentBalanceActivityAutomaticSavingsDetail"; import { PaymentBalanceActivityAutomaticSavingsReversedDetail } from "./PaymentBalanceActivityAutomaticSavingsReversedDetail"; import { PaymentBalanceActivityChargeDetail } from "./PaymentBalanceActivityChargeDetail"; @@ -19,19 +17,19 @@ import { PaymentBalanceActivityFeeDetail } from "./PaymentBalanceActivityFeeDeta import { PaymentBalanceActivityFreeProcessingDetail } from "./PaymentBalanceActivityFreeProcessingDetail"; import { PaymentBalanceActivityHoldAdjustmentDetail } from "./PaymentBalanceActivityHoldAdjustmentDetail"; import { PaymentBalanceActivityOpenDisputeDetail } from "./PaymentBalanceActivityOpenDisputeDetail"; -import { PaymentBalanceActivityOtherDetail } from "./PaymentBalanceActivityOtherDetail"; import { PaymentBalanceActivityOtherAdjustmentDetail } from "./PaymentBalanceActivityOtherAdjustmentDetail"; +import { PaymentBalanceActivityOtherDetail } from "./PaymentBalanceActivityOtherDetail"; import { PaymentBalanceActivityRefundDetail } from "./PaymentBalanceActivityRefundDetail"; import { PaymentBalanceActivityReleaseAdjustmentDetail } from "./PaymentBalanceActivityReleaseAdjustmentDetail"; import { PaymentBalanceActivityReserveHoldDetail } from "./PaymentBalanceActivityReserveHoldDetail"; import { PaymentBalanceActivityReserveReleaseDetail } from "./PaymentBalanceActivityReserveReleaseDetail"; import { PaymentBalanceActivitySquareCapitalPaymentDetail } from "./PaymentBalanceActivitySquareCapitalPaymentDetail"; import { PaymentBalanceActivitySquareCapitalReversedPaymentDetail } from "./PaymentBalanceActivitySquareCapitalReversedPaymentDetail"; +import { PaymentBalanceActivitySquarePayrollTransferDetail } from "./PaymentBalanceActivitySquarePayrollTransferDetail"; +import { PaymentBalanceActivitySquarePayrollTransferReversedDetail } from "./PaymentBalanceActivitySquarePayrollTransferReversedDetail"; import { PaymentBalanceActivityTaxOnFeeDetail } from "./PaymentBalanceActivityTaxOnFeeDetail"; import { PaymentBalanceActivityThirdPartyFeeDetail } from "./PaymentBalanceActivityThirdPartyFeeDetail"; import { PaymentBalanceActivityThirdPartyFeeRefundDetail } from "./PaymentBalanceActivityThirdPartyFeeRefundDetail"; -import { PaymentBalanceActivitySquarePayrollTransferDetail } from "./PaymentBalanceActivitySquarePayrollTransferDetail"; -import { PaymentBalanceActivitySquarePayrollTransferReversedDetail } from "./PaymentBalanceActivitySquarePayrollTransferReversedDetail"; export const PayoutEntry: core.serialization.ObjectSchema = core.serialization.object({ @@ -145,7 +143,7 @@ export declare namespace PayoutEntry { export interface Raw { id: string; payout_id: string; - effective_at?: (string | null) | null; + effective_at?: (string | null | undefined) | null; type?: ActivityType.Raw | null; gross_amount_money?: Money.Raw | null; fee_amount_money?: Money.Raw | null; diff --git a/src/serialization/types/PayoutFailedEvent.ts b/src/serialization/types/PayoutFailedEvent.ts index 52458cb33..8410e3387 100644 --- a/src/serialization/types/PayoutFailedEvent.ts +++ b/src/serialization/types/PayoutFailedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PayoutFailedEventData } from "./PayoutFailedEventData"; export const PayoutFailedEvent: core.serialization.ObjectSchema< @@ -21,10 +19,10 @@ export const PayoutFailedEvent: core.serialization.ObjectSchema< export declare namespace PayoutFailedEvent { export interface Raw { - merchant_id?: (string | null) | null; - location_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: PayoutFailedEventData.Raw | null; } diff --git a/src/serialization/types/PayoutFailedEventData.ts b/src/serialization/types/PayoutFailedEventData.ts index d756875b8..04a806f2a 100644 --- a/src/serialization/types/PayoutFailedEventData.ts +++ b/src/serialization/types/PayoutFailedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PayoutFailedEventObject } from "./PayoutFailedEventObject"; export const PayoutFailedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const PayoutFailedEventData: core.serialization.ObjectSchema< export declare namespace PayoutFailedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: PayoutFailedEventObject.Raw | null; } diff --git a/src/serialization/types/PayoutFailedEventObject.ts b/src/serialization/types/PayoutFailedEventObject.ts index f6793cbca..4681788b0 100644 --- a/src/serialization/types/PayoutFailedEventObject.ts +++ b/src/serialization/types/PayoutFailedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Payout } from "./Payout"; export const PayoutFailedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/PayoutFee.ts b/src/serialization/types/PayoutFee.ts index 336dee4cb..dca34e5ba 100644 --- a/src/serialization/types/PayoutFee.ts +++ b/src/serialization/types/PayoutFee.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; import { PayoutFeeType } from "./PayoutFeeType"; @@ -18,7 +16,7 @@ export const PayoutFee: core.serialization.ObjectSchema = core.serialization.enum_(["TRANSFER_FEE", "TAX_ON_TRANSFER_FEE"]); diff --git a/src/serialization/types/PayoutPaidEvent.ts b/src/serialization/types/PayoutPaidEvent.ts index 77f175062..b26f232bc 100644 --- a/src/serialization/types/PayoutPaidEvent.ts +++ b/src/serialization/types/PayoutPaidEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PayoutPaidEventData } from "./PayoutPaidEventData"; export const PayoutPaidEvent: core.serialization.ObjectSchema = @@ -19,10 +17,10 @@ export const PayoutPaidEvent: core.serialization.ObjectSchema = @@ -19,10 +17,10 @@ export const PayoutSentEvent: core.serialization.ObjectSchema = core.serialization.enum_(["SENT", "FAILED", "PAID"]); diff --git a/src/serialization/types/PayoutType.ts b/src/serialization/types/PayoutType.ts index b098f055b..1a794e06d 100644 --- a/src/serialization/types/PayoutType.ts +++ b/src/serialization/types/PayoutType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const PayoutType: core.serialization.Schema = core.serialization.enum_(["BATCH", "SIMPLE"]); diff --git a/src/serialization/types/Phase.ts b/src/serialization/types/Phase.ts index 729c46185..dd81e2675 100644 --- a/src/serialization/types/Phase.ts +++ b/src/serialization/types/Phase.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Phase: core.serialization.ObjectSchema = core.serialization.object({ uid: core.serialization.string().optionalNullable(), @@ -15,9 +13,9 @@ export const Phase: core.serialization.ObjectSchema = core.serialization.object({ @@ -18,6 +16,6 @@ export const PhaseInput: core.serialization.ObjectSchema = @@ -16,8 +14,8 @@ export const ProcessingFee: core.serialization.ObjectSchema = core.serialization.enum_([ "SQUARE_POS", diff --git a/src/serialization/types/ProductType.ts b/src/serialization/types/ProductType.ts index 4c34c70bf..12439ca7a 100644 --- a/src/serialization/types/ProductType.ts +++ b/src/serialization/types/ProductType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ProductType: core.serialization.Schema = core.serialization.stringLiteral("TERMINAL_API"); diff --git a/src/serialization/types/PublishInvoiceResponse.ts b/src/serialization/types/PublishInvoiceResponse.ts index 7158bd895..2434e430e 100644 --- a/src/serialization/types/PublishInvoiceResponse.ts +++ b/src/serialization/types/PublishInvoiceResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Invoice } from "./Invoice"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Invoice } from "./Invoice"; export const PublishInvoiceResponse: core.serialization.ObjectSchema< serializers.PublishInvoiceResponse.Raw, diff --git a/src/serialization/types/PublishScheduledShiftResponse.ts b/src/serialization/types/PublishScheduledShiftResponse.ts index 4c83f8eda..dd36ce418 100644 --- a/src/serialization/types/PublishScheduledShiftResponse.ts +++ b/src/serialization/types/PublishScheduledShiftResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { ScheduledShift } from "./ScheduledShift"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { ScheduledShift } from "./ScheduledShift"; export const PublishScheduledShiftResponse: core.serialization.ObjectSchema< serializers.PublishScheduledShiftResponse.Raw, diff --git a/src/serialization/types/QrCodeOptions.ts b/src/serialization/types/QrCodeOptions.ts index 441b168c5..ece1f9175 100644 --- a/src/serialization/types/QrCodeOptions.ts +++ b/src/serialization/types/QrCodeOptions.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const QrCodeOptions: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/QuickPay.ts b/src/serialization/types/QuickPay.ts index d2b0867ae..656d38911 100644 --- a/src/serialization/types/QuickPay.ts +++ b/src/serialization/types/QuickPay.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const QuickPay: core.serialization.ObjectSchema = diff --git a/src/serialization/types/Range.ts b/src/serialization/types/Range.ts index a77159731..f8c22d864 100644 --- a/src/serialization/types/Range.ts +++ b/src/serialization/types/Range.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Range: core.serialization.ObjectSchema = core.serialization.object({ min: core.serialization.string().optionalNullable(), @@ -13,7 +11,7 @@ export const Range: core.serialization.ObjectSchema = core.serialization.object({ @@ -16,7 +14,7 @@ export const ReceiptOptions: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ReferenceType.ts b/src/serialization/types/ReferenceType.ts index 1de4d0d77..570b0678e 100644 --- a/src/serialization/types/ReferenceType.ts +++ b/src/serialization/types/ReferenceType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ReferenceType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/Refund.ts b/src/serialization/types/Refund.ts index 2a1c441ae..16397e7ba 100644 --- a/src/serialization/types/Refund.ts +++ b/src/serialization/types/Refund.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; +import { AdditionalRecipient } from "./AdditionalRecipient"; import { Money } from "./Money"; import { RefundStatus } from "./RefundStatus"; -import { AdditionalRecipient } from "./AdditionalRecipient"; export const Refund: core.serialization.ObjectSchema = core.serialization.object( { @@ -31,13 +29,13 @@ export declare namespace Refund { export interface Raw { id: string; location_id: string; - transaction_id?: (string | null) | null; - tender_id?: (string | null) | null; + transaction_id?: (string | null | undefined) | null; + tender_id?: (string | null | undefined) | null; created_at?: string | null; reason: string; amount_money: Money.Raw; status: RefundStatus.Raw; processing_fee_money?: Money.Raw | null; - additional_recipients?: (AdditionalRecipient.Raw[] | null) | null; + additional_recipients?: (AdditionalRecipient.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/RefundCreatedEvent.ts b/src/serialization/types/RefundCreatedEvent.ts index 7e67ab7ad..633a8aedc 100644 --- a/src/serialization/types/RefundCreatedEvent.ts +++ b/src/serialization/types/RefundCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { RefundCreatedEventData } from "./RefundCreatedEventData"; export const RefundCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const RefundCreatedEvent: core.serialization.ObjectSchema< export declare namespace RefundCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: RefundCreatedEventData.Raw | null; } diff --git a/src/serialization/types/RefundCreatedEventData.ts b/src/serialization/types/RefundCreatedEventData.ts index 5ee47cede..a11d5f6ef 100644 --- a/src/serialization/types/RefundCreatedEventData.ts +++ b/src/serialization/types/RefundCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { RefundCreatedEventObject } from "./RefundCreatedEventObject"; export const RefundCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const RefundCreatedEventData: core.serialization.ObjectSchema< export declare namespace RefundCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: RefundCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/RefundCreatedEventObject.ts b/src/serialization/types/RefundCreatedEventObject.ts index 1a182a238..cefce9797 100644 --- a/src/serialization/types/RefundCreatedEventObject.ts +++ b/src/serialization/types/RefundCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PaymentRefund } from "./PaymentRefund"; export const RefundCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/RefundPaymentResponse.ts b/src/serialization/types/RefundPaymentResponse.ts index d76298edc..5d876d328 100644 --- a/src/serialization/types/RefundPaymentResponse.ts +++ b/src/serialization/types/RefundPaymentResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentRefund } from "./PaymentRefund"; diff --git a/src/serialization/types/RefundStatus.ts b/src/serialization/types/RefundStatus.ts index 1578265c9..e7bd8677c 100644 --- a/src/serialization/types/RefundStatus.ts +++ b/src/serialization/types/RefundStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const RefundStatus: core.serialization.Schema = core.serialization.enum_(["PENDING", "APPROVED", "REJECTED", "FAILED"]); diff --git a/src/serialization/types/RefundUpdatedEvent.ts b/src/serialization/types/RefundUpdatedEvent.ts index 9d62c27c5..e3f052ba6 100644 --- a/src/serialization/types/RefundUpdatedEvent.ts +++ b/src/serialization/types/RefundUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { RefundUpdatedEventData } from "./RefundUpdatedEventData"; export const RefundUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const RefundUpdatedEvent: core.serialization.ObjectSchema< export declare namespace RefundUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: RefundUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/RefundUpdatedEventData.ts b/src/serialization/types/RefundUpdatedEventData.ts index 3e394667b..fa2ba1a97 100644 --- a/src/serialization/types/RefundUpdatedEventData.ts +++ b/src/serialization/types/RefundUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { RefundUpdatedEventObject } from "./RefundUpdatedEventObject"; export const RefundUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const RefundUpdatedEventData: core.serialization.ObjectSchema< export declare namespace RefundUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: RefundUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/RefundUpdatedEventObject.ts b/src/serialization/types/RefundUpdatedEventObject.ts index 297396ffd..bd568439e 100644 --- a/src/serialization/types/RefundUpdatedEventObject.ts +++ b/src/serialization/types/RefundUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { PaymentRefund } from "./PaymentRefund"; export const RefundUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/RegisterDomainResponse.ts b/src/serialization/types/RegisterDomainResponse.ts index 87699cee4..b00a02a68 100644 --- a/src/serialization/types/RegisterDomainResponse.ts +++ b/src/serialization/types/RegisterDomainResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { RegisterDomainResponseStatus } from "./RegisterDomainResponseStatus"; diff --git a/src/serialization/types/RegisterDomainResponseStatus.ts b/src/serialization/types/RegisterDomainResponseStatus.ts index 77fd34696..1ca4aaa0d 100644 --- a/src/serialization/types/RegisterDomainResponseStatus.ts +++ b/src/serialization/types/RegisterDomainResponseStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const RegisterDomainResponseStatus: core.serialization.Schema< serializers.RegisterDomainResponseStatus.Raw, diff --git a/src/serialization/types/RemoveGroupFromCustomerResponse.ts b/src/serialization/types/RemoveGroupFromCustomerResponse.ts index a401b3884..9b41401ed 100644 --- a/src/serialization/types/RemoveGroupFromCustomerResponse.ts +++ b/src/serialization/types/RemoveGroupFromCustomerResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const RemoveGroupFromCustomerResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/ResumeSubscriptionResponse.ts b/src/serialization/types/ResumeSubscriptionResponse.ts index b4713acf3..d10aa39ab 100644 --- a/src/serialization/types/ResumeSubscriptionResponse.ts +++ b/src/serialization/types/ResumeSubscriptionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; import { SubscriptionAction } from "./SubscriptionAction"; diff --git a/src/serialization/types/RetrieveBookingCustomAttributeDefinitionResponse.ts b/src/serialization/types/RetrieveBookingCustomAttributeDefinitionResponse.ts index 6a4a3f8ed..3d8fd5cbc 100644 --- a/src/serialization/types/RetrieveBookingCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/RetrieveBookingCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveBookingCustomAttributeResponse.ts b/src/serialization/types/RetrieveBookingCustomAttributeResponse.ts index 31e84710a..ac1e55cb5 100644 --- a/src/serialization/types/RetrieveBookingCustomAttributeResponse.ts +++ b/src/serialization/types/RetrieveBookingCustomAttributeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveChannelResponse.ts b/src/serialization/types/RetrieveChannelResponse.ts index 0bb1147f0..7f8d50b9b 100644 --- a/src/serialization/types/RetrieveChannelResponse.ts +++ b/src/serialization/types/RetrieveChannelResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Channel } from "./Channel"; +import { Error_ } from "./Error_"; export const RetrieveChannelResponse: core.serialization.ObjectSchema< serializers.RetrieveChannelResponse.Raw, diff --git a/src/serialization/types/RetrieveJobResponse.ts b/src/serialization/types/RetrieveJobResponse.ts index a4b98803c..6730b25d9 100644 --- a/src/serialization/types/RetrieveJobResponse.ts +++ b/src/serialization/types/RetrieveJobResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Job } from "./Job"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Job } from "./Job"; export const RetrieveJobResponse: core.serialization.ObjectSchema< serializers.RetrieveJobResponse.Raw, diff --git a/src/serialization/types/RetrieveLocationBookingProfileResponse.ts b/src/serialization/types/RetrieveLocationBookingProfileResponse.ts index 2ad615460..c7c9d1a25 100644 --- a/src/serialization/types/RetrieveLocationBookingProfileResponse.ts +++ b/src/serialization/types/RetrieveLocationBookingProfileResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { LocationBookingProfile } from "./LocationBookingProfile"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { LocationBookingProfile } from "./LocationBookingProfile"; export const RetrieveLocationBookingProfileResponse: core.serialization.ObjectSchema< serializers.RetrieveLocationBookingProfileResponse.Raw, diff --git a/src/serialization/types/RetrieveLocationCustomAttributeDefinitionResponse.ts b/src/serialization/types/RetrieveLocationCustomAttributeDefinitionResponse.ts index 01ddfc6db..75dd5840c 100644 --- a/src/serialization/types/RetrieveLocationCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/RetrieveLocationCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveLocationCustomAttributeResponse.ts b/src/serialization/types/RetrieveLocationCustomAttributeResponse.ts index 7bf3b30d3..f6754b680 100644 --- a/src/serialization/types/RetrieveLocationCustomAttributeResponse.ts +++ b/src/serialization/types/RetrieveLocationCustomAttributeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveLocationSettingsResponse.ts b/src/serialization/types/RetrieveLocationSettingsResponse.ts index 49d846137..1956f28b5 100644 --- a/src/serialization/types/RetrieveLocationSettingsResponse.ts +++ b/src/serialization/types/RetrieveLocationSettingsResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { CheckoutLocationSettings } from "./CheckoutLocationSettings"; +import { Error_ } from "./Error_"; export const RetrieveLocationSettingsResponse: core.serialization.ObjectSchema< serializers.RetrieveLocationSettingsResponse.Raw, diff --git a/src/serialization/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts b/src/serialization/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts index 7eaf410a2..7856b3b00 100644 --- a/src/serialization/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveMerchantCustomAttributeResponse.ts b/src/serialization/types/RetrieveMerchantCustomAttributeResponse.ts index 9f8d1d506..eabaf78dd 100644 --- a/src/serialization/types/RetrieveMerchantCustomAttributeResponse.ts +++ b/src/serialization/types/RetrieveMerchantCustomAttributeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveMerchantSettingsResponse.ts b/src/serialization/types/RetrieveMerchantSettingsResponse.ts index c8150ff50..36f58b8bd 100644 --- a/src/serialization/types/RetrieveMerchantSettingsResponse.ts +++ b/src/serialization/types/RetrieveMerchantSettingsResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { CheckoutMerchantSettings } from "./CheckoutMerchantSettings"; +import { Error_ } from "./Error_"; export const RetrieveMerchantSettingsResponse: core.serialization.ObjectSchema< serializers.RetrieveMerchantSettingsResponse.Raw, diff --git a/src/serialization/types/RetrieveOrderCustomAttributeDefinitionResponse.ts b/src/serialization/types/RetrieveOrderCustomAttributeDefinitionResponse.ts index e783fa6b5..35be3373c 100644 --- a/src/serialization/types/RetrieveOrderCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/RetrieveOrderCustomAttributeDefinitionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveOrderCustomAttributeResponse.ts b/src/serialization/types/RetrieveOrderCustomAttributeResponse.ts index 29ece41ae..989943954 100644 --- a/src/serialization/types/RetrieveOrderCustomAttributeResponse.ts +++ b/src/serialization/types/RetrieveOrderCustomAttributeResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveScheduledShiftResponse.ts b/src/serialization/types/RetrieveScheduledShiftResponse.ts index 06799d906..c0184a101 100644 --- a/src/serialization/types/RetrieveScheduledShiftResponse.ts +++ b/src/serialization/types/RetrieveScheduledShiftResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { ScheduledShift } from "./ScheduledShift"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { ScheduledShift } from "./ScheduledShift"; export const RetrieveScheduledShiftResponse: core.serialization.ObjectSchema< serializers.RetrieveScheduledShiftResponse.Raw, diff --git a/src/serialization/types/RetrieveTimecardResponse.ts b/src/serialization/types/RetrieveTimecardResponse.ts index f47bc2661..1037f18d0 100644 --- a/src/serialization/types/RetrieveTimecardResponse.ts +++ b/src/serialization/types/RetrieveTimecardResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Timecard } from "./Timecard"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Timecard } from "./Timecard"; export const RetrieveTimecardResponse: core.serialization.ObjectSchema< serializers.RetrieveTimecardResponse.Raw, diff --git a/src/serialization/types/RetrieveTokenStatusResponse.ts b/src/serialization/types/RetrieveTokenStatusResponse.ts index c5dfd9b72..1e6530bb6 100644 --- a/src/serialization/types/RetrieveTokenStatusResponse.ts +++ b/src/serialization/types/RetrieveTokenStatusResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const RetrieveTokenStatusResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/RetrieveTransferOrderResponse.ts b/src/serialization/types/RetrieveTransferOrderResponse.ts index b0cf1a404..3dfc617f1 100644 --- a/src/serialization/types/RetrieveTransferOrderResponse.ts +++ b/src/serialization/types/RetrieveTransferOrderResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TransferOrder } from "./TransferOrder"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { TransferOrder } from "./TransferOrder"; export const RetrieveTransferOrderResponse: core.serialization.ObjectSchema< serializers.RetrieveTransferOrderResponse.Raw, diff --git a/src/serialization/types/RevokeTokenResponse.ts b/src/serialization/types/RevokeTokenResponse.ts index 28ebe9146..0fb65dd90 100644 --- a/src/serialization/types/RevokeTokenResponse.ts +++ b/src/serialization/types/RevokeTokenResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const RevokeTokenResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/RiskEvaluation.ts b/src/serialization/types/RiskEvaluation.ts index d2c707c06..f38211ba4 100644 --- a/src/serialization/types/RiskEvaluation.ts +++ b/src/serialization/types/RiskEvaluation.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { RiskEvaluationRiskLevel } from "./RiskEvaluationRiskLevel"; export const RiskEvaluation: core.serialization.ObjectSchema = diff --git a/src/serialization/types/RiskEvaluationRiskLevel.ts b/src/serialization/types/RiskEvaluationRiskLevel.ts index 25df8b767..e29c2198f 100644 --- a/src/serialization/types/RiskEvaluationRiskLevel.ts +++ b/src/serialization/types/RiskEvaluationRiskLevel.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const RiskEvaluationRiskLevel: core.serialization.Schema< serializers.RiskEvaluationRiskLevel.Raw, diff --git a/src/serialization/types/SaveCardOptions.ts b/src/serialization/types/SaveCardOptions.ts index 21e0e6b9e..3a1bd50e4 100644 --- a/src/serialization/types/SaveCardOptions.ts +++ b/src/serialization/types/SaveCardOptions.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SaveCardOptions: core.serialization.ObjectSchema = core.serialization.object({ @@ -17,6 +15,6 @@ export declare namespace SaveCardOptions { export interface Raw { customer_id: string; card_id?: string | null; - reference_id?: (string | null) | null; + reference_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/ScheduledShift.ts b/src/serialization/types/ScheduledShift.ts index 0bab018f7..ba816aa4f 100644 --- a/src/serialization/types/ScheduledShift.ts +++ b/src/serialization/types/ScheduledShift.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ScheduledShiftDetails } from "./ScheduledShiftDetails"; export const ScheduledShift: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ScheduledShiftDetails.ts b/src/serialization/types/ScheduledShiftDetails.ts index 9e6e3dca7..9b9f94c33 100644 --- a/src/serialization/types/ScheduledShiftDetails.ts +++ b/src/serialization/types/ScheduledShiftDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ScheduledShiftDetails: core.serialization.ObjectSchema< serializers.ScheduledShiftDetails.Raw, @@ -22,13 +20,13 @@ export const ScheduledShiftDetails: core.serialization.ObjectSchema< export declare namespace ScheduledShiftDetails { export interface Raw { - team_member_id?: (string | null) | null; - location_id?: (string | null) | null; - job_id?: (string | null) | null; - start_at?: (string | null) | null; - end_at?: (string | null) | null; - notes?: (string | null) | null; - is_deleted?: (boolean | null) | null; + team_member_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; + job_id?: (string | null | undefined) | null; + start_at?: (string | null | undefined) | null; + end_at?: (string | null | undefined) | null; + notes?: (string | null | undefined) | null; + is_deleted?: (boolean | null | undefined) | null; timezone?: string | null; } } diff --git a/src/serialization/types/ScheduledShiftFilter.ts b/src/serialization/types/ScheduledShiftFilter.ts index 32cbeb75d..2862fe48a 100644 --- a/src/serialization/types/ScheduledShiftFilter.ts +++ b/src/serialization/types/ScheduledShiftFilter.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TimeRange } from "./TimeRange"; -import { ScheduledShiftWorkday } from "./ScheduledShiftWorkday"; +import type * as serializers from "../index"; import { ScheduledShiftFilterAssignmentStatus } from "./ScheduledShiftFilterAssignmentStatus"; import { ScheduledShiftFilterScheduledShiftStatus } from "./ScheduledShiftFilterScheduledShiftStatus"; +import { ScheduledShiftWorkday } from "./ScheduledShiftWorkday"; +import { TimeRange } from "./TimeRange"; export const ScheduledShiftFilter: core.serialization.ObjectSchema< serializers.ScheduledShiftFilter.Raw, @@ -34,12 +32,12 @@ export const ScheduledShiftFilter: core.serialization.ObjectSchema< export declare namespace ScheduledShiftFilter { export interface Raw { - location_ids?: (string[] | null) | null; + location_ids?: (string[] | null | undefined) | null; start?: TimeRange.Raw | null; end?: TimeRange.Raw | null; workday?: ScheduledShiftWorkday.Raw | null; - team_member_ids?: (string[] | null) | null; + team_member_ids?: (string[] | null | undefined) | null; assignment_status?: ScheduledShiftFilterAssignmentStatus.Raw | null; - scheduled_shift_statuses?: (ScheduledShiftFilterScheduledShiftStatus.Raw[] | null) | null; + scheduled_shift_statuses?: (ScheduledShiftFilterScheduledShiftStatus.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/ScheduledShiftFilterAssignmentStatus.ts b/src/serialization/types/ScheduledShiftFilterAssignmentStatus.ts index 08a43d855..7bdc47b72 100644 --- a/src/serialization/types/ScheduledShiftFilterAssignmentStatus.ts +++ b/src/serialization/types/ScheduledShiftFilterAssignmentStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ScheduledShiftFilterAssignmentStatus: core.serialization.Schema< serializers.ScheduledShiftFilterAssignmentStatus.Raw, diff --git a/src/serialization/types/ScheduledShiftFilterScheduledShiftStatus.ts b/src/serialization/types/ScheduledShiftFilterScheduledShiftStatus.ts index 69c5f442d..1678e6e27 100644 --- a/src/serialization/types/ScheduledShiftFilterScheduledShiftStatus.ts +++ b/src/serialization/types/ScheduledShiftFilterScheduledShiftStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ScheduledShiftFilterScheduledShiftStatus: core.serialization.Schema< serializers.ScheduledShiftFilterScheduledShiftStatus.Raw, diff --git a/src/serialization/types/ScheduledShiftNotificationAudience.ts b/src/serialization/types/ScheduledShiftNotificationAudience.ts index a67c0d674..73d3a9cea 100644 --- a/src/serialization/types/ScheduledShiftNotificationAudience.ts +++ b/src/serialization/types/ScheduledShiftNotificationAudience.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ScheduledShiftNotificationAudience: core.serialization.Schema< serializers.ScheduledShiftNotificationAudience.Raw, diff --git a/src/serialization/types/ScheduledShiftQuery.ts b/src/serialization/types/ScheduledShiftQuery.ts index 90a349994..30fef1764 100644 --- a/src/serialization/types/ScheduledShiftQuery.ts +++ b/src/serialization/types/ScheduledShiftQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ScheduledShiftFilter } from "./ScheduledShiftFilter"; import { ScheduledShiftSort } from "./ScheduledShiftSort"; diff --git a/src/serialization/types/ScheduledShiftSort.ts b/src/serialization/types/ScheduledShiftSort.ts index a3cf63bc2..6f4ef29d1 100644 --- a/src/serialization/types/ScheduledShiftSort.ts +++ b/src/serialization/types/ScheduledShiftSort.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ScheduledShiftSortField } from "./ScheduledShiftSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/ScheduledShiftSortField.ts b/src/serialization/types/ScheduledShiftSortField.ts index 0328dd47d..9feb9f9b9 100644 --- a/src/serialization/types/ScheduledShiftSortField.ts +++ b/src/serialization/types/ScheduledShiftSortField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ScheduledShiftSortField: core.serialization.Schema< serializers.ScheduledShiftSortField.Raw, diff --git a/src/serialization/types/ScheduledShiftWorkday.ts b/src/serialization/types/ScheduledShiftWorkday.ts index 47c89309f..4e0a9c355 100644 --- a/src/serialization/types/ScheduledShiftWorkday.ts +++ b/src/serialization/types/ScheduledShiftWorkday.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { DateRange } from "./DateRange"; import { ScheduledShiftWorkdayMatcher } from "./ScheduledShiftWorkdayMatcher"; @@ -24,6 +22,6 @@ export declare namespace ScheduledShiftWorkday { export interface Raw { date_range?: DateRange.Raw | null; match_scheduled_shifts_by?: ScheduledShiftWorkdayMatcher.Raw | null; - default_timezone?: (string | null) | null; + default_timezone?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/ScheduledShiftWorkdayMatcher.ts b/src/serialization/types/ScheduledShiftWorkdayMatcher.ts index 659056087..18cd3b5d9 100644 --- a/src/serialization/types/ScheduledShiftWorkdayMatcher.ts +++ b/src/serialization/types/ScheduledShiftWorkdayMatcher.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ScheduledShiftWorkdayMatcher: core.serialization.Schema< serializers.ScheduledShiftWorkdayMatcher.Raw, diff --git a/src/serialization/types/SearchAvailabilityFilter.ts b/src/serialization/types/SearchAvailabilityFilter.ts index 14717622e..122d017ef 100644 --- a/src/serialization/types/SearchAvailabilityFilter.ts +++ b/src/serialization/types/SearchAvailabilityFilter.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TimeRange } from "./TimeRange"; +import type * as serializers from "../index"; import { SegmentFilter } from "./SegmentFilter"; +import { TimeRange } from "./TimeRange"; export const SearchAvailabilityFilter: core.serialization.ObjectSchema< serializers.SearchAvailabilityFilter.Raw, @@ -24,8 +22,8 @@ export const SearchAvailabilityFilter: core.serialization.ObjectSchema< export declare namespace SearchAvailabilityFilter { export interface Raw { start_at_range: TimeRange.Raw; - location_id?: (string | null) | null; - segment_filters?: (SegmentFilter.Raw[] | null) | null; - booking_id?: (string | null) | null; + location_id?: (string | null | undefined) | null; + segment_filters?: (SegmentFilter.Raw[] | null | undefined) | null; + booking_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SearchAvailabilityQuery.ts b/src/serialization/types/SearchAvailabilityQuery.ts index a3166bbb3..63ec13179 100644 --- a/src/serialization/types/SearchAvailabilityQuery.ts +++ b/src/serialization/types/SearchAvailabilityQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SearchAvailabilityFilter } from "./SearchAvailabilityFilter"; export const SearchAvailabilityQuery: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchAvailabilityResponse.ts b/src/serialization/types/SearchAvailabilityResponse.ts index e2ccb73f4..fe4628031 100644 --- a/src/serialization/types/SearchAvailabilityResponse.ts +++ b/src/serialization/types/SearchAvailabilityResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Availability } from "./Availability"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/SearchCatalogItemsRequestStockLevel.ts b/src/serialization/types/SearchCatalogItemsRequestStockLevel.ts index 2f39d5598..a42649cc1 100644 --- a/src/serialization/types/SearchCatalogItemsRequestStockLevel.ts +++ b/src/serialization/types/SearchCatalogItemsRequestStockLevel.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SearchCatalogItemsRequestStockLevel: core.serialization.Schema< serializers.SearchCatalogItemsRequestStockLevel.Raw, diff --git a/src/serialization/types/SearchCatalogItemsResponse.ts b/src/serialization/types/SearchCatalogItemsResponse.ts index 159714d35..eb531493e 100644 --- a/src/serialization/types/SearchCatalogItemsResponse.ts +++ b/src/serialization/types/SearchCatalogItemsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { Error_ } from "./Error_"; export const SearchCatalogItemsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchCatalogObjectsResponse.ts b/src/serialization/types/SearchCatalogObjectsResponse.ts index 44f718830..0c38d1dbd 100644 --- a/src/serialization/types/SearchCatalogObjectsResponse.ts +++ b/src/serialization/types/SearchCatalogObjectsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import * as serializers from "../index"; import { Error_ } from "./Error_"; export const SearchCatalogObjectsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchCustomersResponse.ts b/src/serialization/types/SearchCustomersResponse.ts index 75a06ffd6..ccee237d2 100644 --- a/src/serialization/types/SearchCustomersResponse.ts +++ b/src/serialization/types/SearchCustomersResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Customer } from "./Customer"; +import { Error_ } from "./Error_"; export const SearchCustomersResponse: core.serialization.ObjectSchema< serializers.SearchCustomersResponse.Raw, diff --git a/src/serialization/types/SearchEventsFilter.ts b/src/serialization/types/SearchEventsFilter.ts index d146b9ba2..477733d92 100644 --- a/src/serialization/types/SearchEventsFilter.ts +++ b/src/serialization/types/SearchEventsFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TimeRange } from "./TimeRange"; export const SearchEventsFilter: core.serialization.ObjectSchema< @@ -28,9 +26,9 @@ export const SearchEventsFilter: core.serialization.ObjectSchema< export declare namespace SearchEventsFilter { export interface Raw { - event_types?: (string[] | null) | null; - merchant_ids?: (string[] | null) | null; - location_ids?: (string[] | null) | null; + event_types?: (string[] | null | undefined) | null; + merchant_ids?: (string[] | null | undefined) | null; + location_ids?: (string[] | null | undefined) | null; created_at?: TimeRange.Raw | null; } } diff --git a/src/serialization/types/SearchEventsQuery.ts b/src/serialization/types/SearchEventsQuery.ts index b0bfbfc25..064e93c0c 100644 --- a/src/serialization/types/SearchEventsQuery.ts +++ b/src/serialization/types/SearchEventsQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SearchEventsFilter } from "./SearchEventsFilter"; import { SearchEventsSort } from "./SearchEventsSort"; diff --git a/src/serialization/types/SearchEventsResponse.ts b/src/serialization/types/SearchEventsResponse.ts index 1d600deda..07a6c07fb 100644 --- a/src/serialization/types/SearchEventsResponse.ts +++ b/src/serialization/types/SearchEventsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Event } from "./Event"; import { EventMetadata } from "./EventMetadata"; diff --git a/src/serialization/types/SearchEventsSort.ts b/src/serialization/types/SearchEventsSort.ts index 65685abf8..261b3dfc3 100644 --- a/src/serialization/types/SearchEventsSort.ts +++ b/src/serialization/types/SearchEventsSort.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SearchEventsSortField } from "./SearchEventsSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/SearchEventsSortField.ts b/src/serialization/types/SearchEventsSortField.ts index 4ec6be9fb..b1a465fd6 100644 --- a/src/serialization/types/SearchEventsSortField.ts +++ b/src/serialization/types/SearchEventsSortField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SearchEventsSortField: core.serialization.Schema< serializers.SearchEventsSortField.Raw, diff --git a/src/serialization/types/SearchInvoicesResponse.ts b/src/serialization/types/SearchInvoicesResponse.ts index e0a13eeb9..62deb22c2 100644 --- a/src/serialization/types/SearchInvoicesResponse.ts +++ b/src/serialization/types/SearchInvoicesResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Invoice } from "./Invoice"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Invoice } from "./Invoice"; export const SearchInvoicesResponse: core.serialization.ObjectSchema< serializers.SearchInvoicesResponse.Raw, diff --git a/src/serialization/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts b/src/serialization/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts index 3c4301a0c..a9615b615 100644 --- a/src/serialization/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts +++ b/src/serialization/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyAccountMapping } from "./LoyaltyAccountMapping"; export const SearchLoyaltyAccountsRequestLoyaltyAccountQuery: core.serialization.ObjectSchema< @@ -20,7 +18,7 @@ export const SearchLoyaltyAccountsRequestLoyaltyAccountQuery: core.serialization export declare namespace SearchLoyaltyAccountsRequestLoyaltyAccountQuery { export interface Raw { - mappings?: (LoyaltyAccountMapping.Raw[] | null) | null; - customer_ids?: (string[] | null) | null; + mappings?: (LoyaltyAccountMapping.Raw[] | null | undefined) | null; + customer_ids?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/SearchLoyaltyAccountsResponse.ts b/src/serialization/types/SearchLoyaltyAccountsResponse.ts index 17f71231b..5fcec48ba 100644 --- a/src/serialization/types/SearchLoyaltyAccountsResponse.ts +++ b/src/serialization/types/SearchLoyaltyAccountsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyAccount } from "./LoyaltyAccount"; diff --git a/src/serialization/types/SearchLoyaltyEventsResponse.ts b/src/serialization/types/SearchLoyaltyEventsResponse.ts index 918c6f772..ffbd49cbf 100644 --- a/src/serialization/types/SearchLoyaltyEventsResponse.ts +++ b/src/serialization/types/SearchLoyaltyEventsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyEvent } from "./LoyaltyEvent"; diff --git a/src/serialization/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts b/src/serialization/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts index 209f11035..9a7fc2dcd 100644 --- a/src/serialization/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts +++ b/src/serialization/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { LoyaltyRewardStatus } from "./LoyaltyRewardStatus"; export const SearchLoyaltyRewardsRequestLoyaltyRewardQuery: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchLoyaltyRewardsResponse.ts b/src/serialization/types/SearchLoyaltyRewardsResponse.ts index e0533042c..128d8a07e 100644 --- a/src/serialization/types/SearchLoyaltyRewardsResponse.ts +++ b/src/serialization/types/SearchLoyaltyRewardsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyReward } from "./LoyaltyReward"; diff --git a/src/serialization/types/SearchOrdersCustomerFilter.ts b/src/serialization/types/SearchOrdersCustomerFilter.ts index d66b8fd5c..dfea65cf3 100644 --- a/src/serialization/types/SearchOrdersCustomerFilter.ts +++ b/src/serialization/types/SearchOrdersCustomerFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SearchOrdersCustomerFilter: core.serialization.ObjectSchema< serializers.SearchOrdersCustomerFilter.Raw, @@ -18,6 +16,6 @@ export const SearchOrdersCustomerFilter: core.serialization.ObjectSchema< export declare namespace SearchOrdersCustomerFilter { export interface Raw { - customer_ids?: (string[] | null) | null; + customer_ids?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/SearchOrdersDateTimeFilter.ts b/src/serialization/types/SearchOrdersDateTimeFilter.ts index e84e1ab47..a1dee39f4 100644 --- a/src/serialization/types/SearchOrdersDateTimeFilter.ts +++ b/src/serialization/types/SearchOrdersDateTimeFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TimeRange } from "./TimeRange"; export const SearchOrdersDateTimeFilter: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchOrdersFilter.ts b/src/serialization/types/SearchOrdersFilter.ts index dd1ee309e..adb707766 100644 --- a/src/serialization/types/SearchOrdersFilter.ts +++ b/src/serialization/types/SearchOrdersFilter.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { SearchOrdersStateFilter } from "./SearchOrdersStateFilter"; +import type * as serializers from "../index"; +import { SearchOrdersCustomerFilter } from "./SearchOrdersCustomerFilter"; import { SearchOrdersDateTimeFilter } from "./SearchOrdersDateTimeFilter"; import { SearchOrdersFulfillmentFilter } from "./SearchOrdersFulfillmentFilter"; import { SearchOrdersSourceFilter } from "./SearchOrdersSourceFilter"; -import { SearchOrdersCustomerFilter } from "./SearchOrdersCustomerFilter"; +import { SearchOrdersStateFilter } from "./SearchOrdersStateFilter"; export const SearchOrdersFilter: core.serialization.ObjectSchema< serializers.SearchOrdersFilter.Raw, diff --git a/src/serialization/types/SearchOrdersFulfillmentFilter.ts b/src/serialization/types/SearchOrdersFulfillmentFilter.ts index 4fe610b63..d88fd8528 100644 --- a/src/serialization/types/SearchOrdersFulfillmentFilter.ts +++ b/src/serialization/types/SearchOrdersFulfillmentFilter.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { FulfillmentType } from "./FulfillmentType"; +import type * as serializers from "../index"; import { FulfillmentState } from "./FulfillmentState"; +import { FulfillmentType } from "./FulfillmentType"; export const SearchOrdersFulfillmentFilter: core.serialization.ObjectSchema< serializers.SearchOrdersFulfillmentFilter.Raw, @@ -24,7 +22,7 @@ export const SearchOrdersFulfillmentFilter: core.serialization.ObjectSchema< export declare namespace SearchOrdersFulfillmentFilter { export interface Raw { - fulfillment_types?: (FulfillmentType.Raw[] | null) | null; - fulfillment_states?: (FulfillmentState.Raw[] | null) | null; + fulfillment_types?: (FulfillmentType.Raw[] | null | undefined) | null; + fulfillment_states?: (FulfillmentState.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/SearchOrdersQuery.ts b/src/serialization/types/SearchOrdersQuery.ts index 633eb35ff..958006013 100644 --- a/src/serialization/types/SearchOrdersQuery.ts +++ b/src/serialization/types/SearchOrdersQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SearchOrdersFilter } from "./SearchOrdersFilter"; import { SearchOrdersSort } from "./SearchOrdersSort"; diff --git a/src/serialization/types/SearchOrdersResponse.ts b/src/serialization/types/SearchOrdersResponse.ts index 87a447147..f56a8652d 100644 --- a/src/serialization/types/SearchOrdersResponse.ts +++ b/src/serialization/types/SearchOrdersResponse.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { OrderEntry } from "./OrderEntry"; -import { Order } from "./Order"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Order } from "./Order"; +import { OrderEntry } from "./OrderEntry"; export const SearchOrdersResponse: core.serialization.ObjectSchema< serializers.SearchOrdersResponse.Raw, diff --git a/src/serialization/types/SearchOrdersSort.ts b/src/serialization/types/SearchOrdersSort.ts index d8a7509d8..90da3ac9b 100644 --- a/src/serialization/types/SearchOrdersSort.ts +++ b/src/serialization/types/SearchOrdersSort.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SearchOrdersSortField } from "./SearchOrdersSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/SearchOrdersSortField.ts b/src/serialization/types/SearchOrdersSortField.ts index d8e9d878f..12b21e8d8 100644 --- a/src/serialization/types/SearchOrdersSortField.ts +++ b/src/serialization/types/SearchOrdersSortField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SearchOrdersSortField: core.serialization.Schema< serializers.SearchOrdersSortField.Raw, diff --git a/src/serialization/types/SearchOrdersSourceFilter.ts b/src/serialization/types/SearchOrdersSourceFilter.ts index ea863d6ca..d8d2a89ca 100644 --- a/src/serialization/types/SearchOrdersSourceFilter.ts +++ b/src/serialization/types/SearchOrdersSourceFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SearchOrdersSourceFilter: core.serialization.ObjectSchema< serializers.SearchOrdersSourceFilter.Raw, @@ -18,6 +16,6 @@ export const SearchOrdersSourceFilter: core.serialization.ObjectSchema< export declare namespace SearchOrdersSourceFilter { export interface Raw { - source_names?: (string[] | null) | null; + source_names?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/SearchOrdersStateFilter.ts b/src/serialization/types/SearchOrdersStateFilter.ts index 351210688..eb98c47f8 100644 --- a/src/serialization/types/SearchOrdersStateFilter.ts +++ b/src/serialization/types/SearchOrdersStateFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { OrderState } from "./OrderState"; export const SearchOrdersStateFilter: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchScheduledShiftsResponse.ts b/src/serialization/types/SearchScheduledShiftsResponse.ts index 423bf4333..efeb051cc 100644 --- a/src/serialization/types/SearchScheduledShiftsResponse.ts +++ b/src/serialization/types/SearchScheduledShiftsResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { ScheduledShift } from "./ScheduledShift"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { ScheduledShift } from "./ScheduledShift"; export const SearchScheduledShiftsResponse: core.serialization.ObjectSchema< serializers.SearchScheduledShiftsResponse.Raw, diff --git a/src/serialization/types/SearchShiftsResponse.ts b/src/serialization/types/SearchShiftsResponse.ts index dfa97e639..054e8554f 100644 --- a/src/serialization/types/SearchShiftsResponse.ts +++ b/src/serialization/types/SearchShiftsResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Shift } from "./Shift"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Shift } from "./Shift"; export const SearchShiftsResponse: core.serialization.ObjectSchema< serializers.SearchShiftsResponse.Raw, diff --git a/src/serialization/types/SearchSubscriptionsFilter.ts b/src/serialization/types/SearchSubscriptionsFilter.ts index aaae83cad..d0b763f3c 100644 --- a/src/serialization/types/SearchSubscriptionsFilter.ts +++ b/src/serialization/types/SearchSubscriptionsFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SearchSubscriptionsFilter: core.serialization.ObjectSchema< serializers.SearchSubscriptionsFilter.Raw, @@ -26,8 +24,8 @@ export const SearchSubscriptionsFilter: core.serialization.ObjectSchema< export declare namespace SearchSubscriptionsFilter { export interface Raw { - customer_ids?: (string[] | null) | null; - location_ids?: (string[] | null) | null; - source_names?: (string[] | null) | null; + customer_ids?: (string[] | null | undefined) | null; + location_ids?: (string[] | null | undefined) | null; + source_names?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/SearchSubscriptionsQuery.ts b/src/serialization/types/SearchSubscriptionsQuery.ts index 4a85e5009..4a8ac5f9f 100644 --- a/src/serialization/types/SearchSubscriptionsQuery.ts +++ b/src/serialization/types/SearchSubscriptionsQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SearchSubscriptionsFilter } from "./SearchSubscriptionsFilter"; export const SearchSubscriptionsQuery: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchSubscriptionsResponse.ts b/src/serialization/types/SearchSubscriptionsResponse.ts index d223f1998..5688cf1c3 100644 --- a/src/serialization/types/SearchSubscriptionsResponse.ts +++ b/src/serialization/types/SearchSubscriptionsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; diff --git a/src/serialization/types/SearchTeamMembersFilter.ts b/src/serialization/types/SearchTeamMembersFilter.ts index d69ba09d6..c568a96a6 100644 --- a/src/serialization/types/SearchTeamMembersFilter.ts +++ b/src/serialization/types/SearchTeamMembersFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TeamMemberStatus } from "./TeamMemberStatus"; export const SearchTeamMembersFilter: core.serialization.ObjectSchema< @@ -21,8 +19,8 @@ export const SearchTeamMembersFilter: core.serialization.ObjectSchema< export declare namespace SearchTeamMembersFilter { export interface Raw { - location_ids?: (string[] | null) | null; + location_ids?: (string[] | null | undefined) | null; status?: TeamMemberStatus.Raw | null; - is_owner?: (boolean | null) | null; + is_owner?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/SearchTeamMembersQuery.ts b/src/serialization/types/SearchTeamMembersQuery.ts index 742fe9f15..b420286cd 100644 --- a/src/serialization/types/SearchTeamMembersQuery.ts +++ b/src/serialization/types/SearchTeamMembersQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SearchTeamMembersFilter } from "./SearchTeamMembersFilter"; export const SearchTeamMembersQuery: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchTeamMembersResponse.ts b/src/serialization/types/SearchTeamMembersResponse.ts index e0f67291f..663160d5f 100644 --- a/src/serialization/types/SearchTeamMembersResponse.ts +++ b/src/serialization/types/SearchTeamMembersResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TeamMember } from "./TeamMember"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { TeamMember } from "./TeamMember"; export const SearchTeamMembersResponse: core.serialization.ObjectSchema< serializers.SearchTeamMembersResponse.Raw, diff --git a/src/serialization/types/SearchTerminalActionsResponse.ts b/src/serialization/types/SearchTerminalActionsResponse.ts index 3ee9cea3c..952a64fbd 100644 --- a/src/serialization/types/SearchTerminalActionsResponse.ts +++ b/src/serialization/types/SearchTerminalActionsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalAction } from "./TerminalAction"; diff --git a/src/serialization/types/SearchTerminalCheckoutsResponse.ts b/src/serialization/types/SearchTerminalCheckoutsResponse.ts index 47691c7c8..ad8945bc5 100644 --- a/src/serialization/types/SearchTerminalCheckoutsResponse.ts +++ b/src/serialization/types/SearchTerminalCheckoutsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalCheckout } from "./TerminalCheckout"; diff --git a/src/serialization/types/SearchTerminalRefundsResponse.ts b/src/serialization/types/SearchTerminalRefundsResponse.ts index cb7ed1e47..040e56e35 100644 --- a/src/serialization/types/SearchTerminalRefundsResponse.ts +++ b/src/serialization/types/SearchTerminalRefundsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalRefund } from "./TerminalRefund"; diff --git a/src/serialization/types/SearchTimecardsResponse.ts b/src/serialization/types/SearchTimecardsResponse.ts index 85bf7cdef..405c2a0ee 100644 --- a/src/serialization/types/SearchTimecardsResponse.ts +++ b/src/serialization/types/SearchTimecardsResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Timecard } from "./Timecard"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { Timecard } from "./Timecard"; export const SearchTimecardsResponse: core.serialization.ObjectSchema< serializers.SearchTimecardsResponse.Raw, diff --git a/src/serialization/types/SearchTransferOrdersResponse.ts b/src/serialization/types/SearchTransferOrdersResponse.ts index 36fd4ef47..1a7b36a48 100644 --- a/src/serialization/types/SearchTransferOrdersResponse.ts +++ b/src/serialization/types/SearchTransferOrdersResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TransferOrder } from "./TransferOrder"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { TransferOrder } from "./TransferOrder"; export const SearchTransferOrdersResponse: core.serialization.ObjectSchema< serializers.SearchTransferOrdersResponse.Raw, diff --git a/src/serialization/types/SearchVendorsRequestFilter.ts b/src/serialization/types/SearchVendorsRequestFilter.ts index 1c68be2e6..2904139ff 100644 --- a/src/serialization/types/SearchVendorsRequestFilter.ts +++ b/src/serialization/types/SearchVendorsRequestFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { VendorStatus } from "./VendorStatus"; export const SearchVendorsRequestFilter: core.serialization.ObjectSchema< @@ -17,7 +15,7 @@ export const SearchVendorsRequestFilter: core.serialization.ObjectSchema< export declare namespace SearchVendorsRequestFilter { export interface Raw { - name?: (string[] | null) | null; - status?: (VendorStatus.Raw[] | null) | null; + name?: (string[] | null | undefined) | null; + status?: (VendorStatus.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/SearchVendorsRequestSort.ts b/src/serialization/types/SearchVendorsRequestSort.ts index ced89af2d..6e90880ee 100644 --- a/src/serialization/types/SearchVendorsRequestSort.ts +++ b/src/serialization/types/SearchVendorsRequestSort.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SearchVendorsRequestSortField } from "./SearchVendorsRequestSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/SearchVendorsRequestSortField.ts b/src/serialization/types/SearchVendorsRequestSortField.ts index 123d35513..5f3eb2bb3 100644 --- a/src/serialization/types/SearchVendorsRequestSortField.ts +++ b/src/serialization/types/SearchVendorsRequestSortField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SearchVendorsRequestSortField: core.serialization.Schema< serializers.SearchVendorsRequestSortField.Raw, diff --git a/src/serialization/types/SearchVendorsResponse.ts b/src/serialization/types/SearchVendorsResponse.ts index 520e5eb14..aa9abef99 100644 --- a/src/serialization/types/SearchVendorsResponse.ts +++ b/src/serialization/types/SearchVendorsResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Vendor } from "./Vendor"; diff --git a/src/serialization/types/SegmentFilter.ts b/src/serialization/types/SegmentFilter.ts index 2b990803b..cf1457c2e 100644 --- a/src/serialization/types/SegmentFilter.ts +++ b/src/serialization/types/SegmentFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { FilterValue } from "./FilterValue"; export const SegmentFilter: core.serialization.ObjectSchema = diff --git a/src/serialization/types/SelectOption.ts b/src/serialization/types/SelectOption.ts index eba451cac..50bec4350 100644 --- a/src/serialization/types/SelectOption.ts +++ b/src/serialization/types/SelectOption.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SelectOption: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SelectOptions.ts b/src/serialization/types/SelectOptions.ts index 077fa48ec..fd23c51cd 100644 --- a/src/serialization/types/SelectOptions.ts +++ b/src/serialization/types/SelectOptions.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SelectOption } from "./SelectOption"; export const SelectOptions: core.serialization.ObjectSchema = diff --git a/src/serialization/types/Shift.ts b/src/serialization/types/Shift.ts index 57b048af6..f7a6c2bd5 100644 --- a/src/serialization/types/Shift.ts +++ b/src/serialization/types/Shift.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { ShiftWage } from "./ShiftWage"; +import type * as serializers from "../index"; import { Break } from "./Break"; -import { ShiftStatus } from "./ShiftStatus"; import { Money } from "./Money"; +import { ShiftStatus } from "./ShiftStatus"; +import { ShiftWage } from "./ShiftWage"; export const Shift: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -30,18 +28,18 @@ export const Shift: core.serialization.ObjectSchema = core.serialization.object({ @@ -31,12 +29,12 @@ export const ShiftFilter: core.serialization.ObjectSchema = core.serialization.enum_(["OPEN", "CLOSED"]); diff --git a/src/serialization/types/ShiftQuery.ts b/src/serialization/types/ShiftQuery.ts index 28823f111..4c3a2ccf2 100644 --- a/src/serialization/types/ShiftQuery.ts +++ b/src/serialization/types/ShiftQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ShiftFilter } from "./ShiftFilter"; import { ShiftSort } from "./ShiftSort"; diff --git a/src/serialization/types/ShiftSort.ts b/src/serialization/types/ShiftSort.ts index 60d726363..20215f151 100644 --- a/src/serialization/types/ShiftSort.ts +++ b/src/serialization/types/ShiftSort.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ShiftSortField } from "./ShiftSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/ShiftSortField.ts b/src/serialization/types/ShiftSortField.ts index 096579bad..b1c81e31f 100644 --- a/src/serialization/types/ShiftSortField.ts +++ b/src/serialization/types/ShiftSortField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ShiftSortField: core.serialization.Schema = core.serialization.enum_(["START_AT", "END_AT", "CREATED_AT", "UPDATED_AT"]); diff --git a/src/serialization/types/ShiftStatus.ts b/src/serialization/types/ShiftStatus.ts index 4cc8e7274..efd5135f9 100644 --- a/src/serialization/types/ShiftStatus.ts +++ b/src/serialization/types/ShiftStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const ShiftStatus: core.serialization.Schema = core.serialization.enum_(["OPEN", "CLOSED"]); diff --git a/src/serialization/types/ShiftWage.ts b/src/serialization/types/ShiftWage.ts index 71fc0893e..f87a10ba5 100644 --- a/src/serialization/types/ShiftWage.ts +++ b/src/serialization/types/ShiftWage.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const ShiftWage: core.serialization.ObjectSchema = @@ -17,9 +15,9 @@ export const ShiftWage: core.serialization.ObjectSchema = @@ -15,7 +13,7 @@ export const ShippingFee: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SignatureOptions.ts b/src/serialization/types/SignatureOptions.ts index 4c6e23be4..6eafb1bf3 100644 --- a/src/serialization/types/SignatureOptions.ts +++ b/src/serialization/types/SignatureOptions.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SignatureImage } from "./SignatureImage"; export const SignatureOptions: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Site.ts b/src/serialization/types/Site.ts index e464ae935..83330eb39 100644 --- a/src/serialization/types/Site.ts +++ b/src/serialization/types/Site.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const Site: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -18,9 +16,9 @@ export const Site: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SortOrder.ts b/src/serialization/types/SortOrder.ts index 4e735a24e..baed04696 100644 --- a/src/serialization/types/SortOrder.ts +++ b/src/serialization/types/SortOrder.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SortOrder: core.serialization.Schema = core.serialization.enum_(["DESC", "ASC"]); diff --git a/src/serialization/types/SourceApplication.ts b/src/serialization/types/SourceApplication.ts index ae209bc91..d362f9e5e 100644 --- a/src/serialization/types/SourceApplication.ts +++ b/src/serialization/types/SourceApplication.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Product } from "./Product"; export const SourceApplication: core.serialization.ObjectSchema< @@ -19,7 +17,7 @@ export const SourceApplication: core.serialization.ObjectSchema< export declare namespace SourceApplication { export interface Raw { product?: Product.Raw | null; - application_id?: (string | null) | null; - name?: (string | null) | null; + application_id?: (string | null | undefined) | null; + name?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SquareAccountDetails.ts b/src/serialization/types/SquareAccountDetails.ts index 0fe060eb8..ff0799f1a 100644 --- a/src/serialization/types/SquareAccountDetails.ts +++ b/src/serialization/types/SquareAccountDetails.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const SquareAccountDetails: core.serialization.ObjectSchema< @@ -20,7 +18,7 @@ export const SquareAccountDetails: core.serialization.ObjectSchema< export declare namespace SquareAccountDetails { export interface Raw { - payment_source_token?: (string | null) | null; - errors?: (Error_.Raw[] | null) | null; + payment_source_token?: (string | null | undefined) | null; + errors?: (Error_.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/StandardUnitDescription.ts b/src/serialization/types/StandardUnitDescription.ts index 6a1bf19a5..668e65314 100644 --- a/src/serialization/types/StandardUnitDescription.ts +++ b/src/serialization/types/StandardUnitDescription.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { MeasurementUnit } from "./MeasurementUnit"; export const StandardUnitDescription: core.serialization.ObjectSchema< @@ -19,7 +17,7 @@ export const StandardUnitDescription: core.serialization.ObjectSchema< export declare namespace StandardUnitDescription { export interface Raw { unit?: MeasurementUnit.Raw | null; - name?: (string | null) | null; - abbreviation?: (string | null) | null; + name?: (string | null | undefined) | null; + abbreviation?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/StandardUnitDescriptionGroup.ts b/src/serialization/types/StandardUnitDescriptionGroup.ts index 583900eff..ba236d08b 100644 --- a/src/serialization/types/StandardUnitDescriptionGroup.ts +++ b/src/serialization/types/StandardUnitDescriptionGroup.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { StandardUnitDescription } from "./StandardUnitDescription"; export const StandardUnitDescriptionGroup: core.serialization.ObjectSchema< @@ -20,7 +18,7 @@ export const StandardUnitDescriptionGroup: core.serialization.ObjectSchema< export declare namespace StandardUnitDescriptionGroup { export interface Raw { - standard_unit_descriptions?: (StandardUnitDescription.Raw[] | null) | null; - language_code?: (string | null) | null; + standard_unit_descriptions?: (StandardUnitDescription.Raw[] | null | undefined) | null; + language_code?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/StartTransferOrderResponse.ts b/src/serialization/types/StartTransferOrderResponse.ts index 08684f95e..6d98d6adf 100644 --- a/src/serialization/types/StartTransferOrderResponse.ts +++ b/src/serialization/types/StartTransferOrderResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TransferOrder } from "./TransferOrder"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; +import { TransferOrder } from "./TransferOrder"; export const StartTransferOrderResponse: core.serialization.ObjectSchema< serializers.StartTransferOrderResponse.Raw, diff --git a/src/serialization/types/SubmitEvidenceResponse.ts b/src/serialization/types/SubmitEvidenceResponse.ts index 424f1d059..6aaf4b963 100644 --- a/src/serialization/types/SubmitEvidenceResponse.ts +++ b/src/serialization/types/SubmitEvidenceResponse.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { Error_ } from "./Error_"; +import type * as serializers from "../index"; import { Dispute } from "./Dispute"; +import { Error_ } from "./Error_"; export const SubmitEvidenceResponse: core.serialization.ObjectSchema< serializers.SubmitEvidenceResponse.Raw, diff --git a/src/serialization/types/Subscription.ts b/src/serialization/types/Subscription.ts index f1ba430ad..09404f94e 100644 --- a/src/serialization/types/Subscription.ts +++ b/src/serialization/types/Subscription.ts @@ -1,15 +1,13 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { SubscriptionStatus } from "./SubscriptionStatus"; +import type * as serializers from "../index"; import { Money } from "./Money"; -import { SubscriptionSource } from "./SubscriptionSource"; -import { SubscriptionAction } from "./SubscriptionAction"; import { Phase } from "./Phase"; +import { SubscriptionAction } from "./SubscriptionAction"; +import { SubscriptionSource } from "./SubscriptionSource"; +import { SubscriptionStatus } from "./SubscriptionStatus"; export const Subscription: core.serialization.ObjectSchema = core.serialization.object({ @@ -48,20 +46,20 @@ export declare namespace Subscription { plan_variation_id?: string | null; customer_id?: string | null; start_date?: string | null; - canceled_date?: (string | null) | null; + canceled_date?: (string | null | undefined) | null; charged_through_date?: string | null; status?: SubscriptionStatus.Raw | null; - tax_percentage?: (string | null) | null; + tax_percentage?: (string | null | undefined) | null; invoice_ids?: string[] | null; price_override_money?: Money.Raw | null; version?: (bigint | number) | null; created_at?: string | null; - card_id?: (string | null) | null; + card_id?: (string | null | undefined) | null; timezone?: string | null; source?: SubscriptionSource.Raw | null; - actions?: (SubscriptionAction.Raw[] | null) | null; + actions?: (SubscriptionAction.Raw[] | null | undefined) | null; monthly_billing_anchor_date?: number | null; phases?: Phase.Raw[] | null; - completed_date?: (string | null) | null; + completed_date?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SubscriptionAction.ts b/src/serialization/types/SubscriptionAction.ts index 82deb1d64..5232a33b2 100644 --- a/src/serialization/types/SubscriptionAction.ts +++ b/src/serialization/types/SubscriptionAction.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { SubscriptionActionType } from "./SubscriptionActionType"; +import type * as serializers from "../index"; import { Phase } from "./Phase"; +import { SubscriptionActionType } from "./SubscriptionActionType"; export const SubscriptionAction: core.serialization.ObjectSchema< serializers.SubscriptionAction.Raw, @@ -30,9 +28,9 @@ export declare namespace SubscriptionAction { export interface Raw { id?: string | null; type?: SubscriptionActionType.Raw | null; - effective_date?: (string | null) | null; - monthly_billing_anchor_date?: (number | null) | null; - phases?: (Phase.Raw[] | null) | null; - new_plan_variation_id?: (string | null) | null; + effective_date?: (string | null | undefined) | null; + monthly_billing_anchor_date?: (number | null | undefined) | null; + phases?: (Phase.Raw[] | null | undefined) | null; + new_plan_variation_id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SubscriptionActionType.ts b/src/serialization/types/SubscriptionActionType.ts index 8dcc8226f..4fea730cd 100644 --- a/src/serialization/types/SubscriptionActionType.ts +++ b/src/serialization/types/SubscriptionActionType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SubscriptionActionType: core.serialization.Schema< serializers.SubscriptionActionType.Raw, diff --git a/src/serialization/types/SubscriptionCadence.ts b/src/serialization/types/SubscriptionCadence.ts index 3554022c0..026bed2a6 100644 --- a/src/serialization/types/SubscriptionCadence.ts +++ b/src/serialization/types/SubscriptionCadence.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SubscriptionCadence: core.serialization.Schema< serializers.SubscriptionCadence.Raw, diff --git a/src/serialization/types/SubscriptionCreatedEvent.ts b/src/serialization/types/SubscriptionCreatedEvent.ts index 2dac5674e..695ae78e9 100644 --- a/src/serialization/types/SubscriptionCreatedEvent.ts +++ b/src/serialization/types/SubscriptionCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SubscriptionCreatedEventData } from "./SubscriptionCreatedEventData"; export const SubscriptionCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const SubscriptionCreatedEvent: core.serialization.ObjectSchema< export declare namespace SubscriptionCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: SubscriptionCreatedEventData.Raw | null; } diff --git a/src/serialization/types/SubscriptionCreatedEventData.ts b/src/serialization/types/SubscriptionCreatedEventData.ts index c382b55f0..0a5e601f7 100644 --- a/src/serialization/types/SubscriptionCreatedEventData.ts +++ b/src/serialization/types/SubscriptionCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SubscriptionCreatedEventObject } from "./SubscriptionCreatedEventObject"; export const SubscriptionCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const SubscriptionCreatedEventData: core.serialization.ObjectSchema< export declare namespace SubscriptionCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: SubscriptionCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/SubscriptionCreatedEventObject.ts b/src/serialization/types/SubscriptionCreatedEventObject.ts index a1e2eed63..71169c184 100644 --- a/src/serialization/types/SubscriptionCreatedEventObject.ts +++ b/src/serialization/types/SubscriptionCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Subscription } from "./Subscription"; export const SubscriptionCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SubscriptionEvent.ts b/src/serialization/types/SubscriptionEvent.ts index 94071625b..a497c44d6 100644 --- a/src/serialization/types/SubscriptionEvent.ts +++ b/src/serialization/types/SubscriptionEvent.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { SubscriptionEventSubscriptionEventType } from "./SubscriptionEventSubscriptionEventType"; -import { SubscriptionEventInfo } from "./SubscriptionEventInfo"; +import type * as serializers from "../index"; import { Phase } from "./Phase"; +import { SubscriptionEventInfo } from "./SubscriptionEventInfo"; +import { SubscriptionEventSubscriptionEventType } from "./SubscriptionEventSubscriptionEventType"; export const SubscriptionEvent: core.serialization.ObjectSchema< serializers.SubscriptionEvent.Raw, @@ -35,7 +33,7 @@ export declare namespace SubscriptionEvent { effective_date: string; monthly_billing_anchor_date?: number | null; info?: SubscriptionEventInfo.Raw | null; - phases?: (Phase.Raw[] | null) | null; + phases?: (Phase.Raw[] | null | undefined) | null; plan_variation_id: string; } } diff --git a/src/serialization/types/SubscriptionEventInfo.ts b/src/serialization/types/SubscriptionEventInfo.ts index 1213901c6..d48ea37c6 100644 --- a/src/serialization/types/SubscriptionEventInfo.ts +++ b/src/serialization/types/SubscriptionEventInfo.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SubscriptionEventInfoCode } from "./SubscriptionEventInfoCode"; export const SubscriptionEventInfo: core.serialization.ObjectSchema< @@ -17,7 +15,7 @@ export const SubscriptionEventInfo: core.serialization.ObjectSchema< export declare namespace SubscriptionEventInfo { export interface Raw { - detail?: (string | null) | null; + detail?: (string | null | undefined) | null; code?: SubscriptionEventInfoCode.Raw | null; } } diff --git a/src/serialization/types/SubscriptionEventInfoCode.ts b/src/serialization/types/SubscriptionEventInfoCode.ts index e435d9eb3..28fa5ef8f 100644 --- a/src/serialization/types/SubscriptionEventInfoCode.ts +++ b/src/serialization/types/SubscriptionEventInfoCode.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SubscriptionEventInfoCode: core.serialization.Schema< serializers.SubscriptionEventInfoCode.Raw, diff --git a/src/serialization/types/SubscriptionEventSubscriptionEventType.ts b/src/serialization/types/SubscriptionEventSubscriptionEventType.ts index 62b7fc660..d78d51b7e 100644 --- a/src/serialization/types/SubscriptionEventSubscriptionEventType.ts +++ b/src/serialization/types/SubscriptionEventSubscriptionEventType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SubscriptionEventSubscriptionEventType: core.serialization.Schema< serializers.SubscriptionEventSubscriptionEventType.Raw, diff --git a/src/serialization/types/SubscriptionPhase.ts b/src/serialization/types/SubscriptionPhase.ts index 3bb6e311f..2d6f14573 100644 --- a/src/serialization/types/SubscriptionPhase.ts +++ b/src/serialization/types/SubscriptionPhase.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { SubscriptionCadence } from "./SubscriptionCadence"; +import type * as serializers from "../index"; import { Money } from "./Money"; +import { SubscriptionCadence } from "./SubscriptionCadence"; import { SubscriptionPricing } from "./SubscriptionPricing"; export const SubscriptionPhase: core.serialization.ObjectSchema< @@ -23,11 +21,11 @@ export const SubscriptionPhase: core.serialization.ObjectSchema< export declare namespace SubscriptionPhase { export interface Raw { - uid?: (string | null) | null; + uid?: (string | null | undefined) | null; cadence: SubscriptionCadence.Raw; - periods?: (number | null) | null; + periods?: (number | null | undefined) | null; recurring_price_money?: Money.Raw | null; - ordinal?: ((bigint | number) | null) | null; + ordinal?: ((bigint | number) | null | undefined) | null; pricing?: SubscriptionPricing.Raw | null; } } diff --git a/src/serialization/types/SubscriptionPricing.ts b/src/serialization/types/SubscriptionPricing.ts index 6fa511e8c..a26c83b2e 100644 --- a/src/serialization/types/SubscriptionPricing.ts +++ b/src/serialization/types/SubscriptionPricing.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { SubscriptionPricingType } from "./SubscriptionPricingType"; +import type * as serializers from "../index"; import { Money } from "./Money"; +import { SubscriptionPricingType } from "./SubscriptionPricingType"; export const SubscriptionPricing: core.serialization.ObjectSchema< serializers.SubscriptionPricing.Raw, @@ -23,7 +21,7 @@ export const SubscriptionPricing: core.serialization.ObjectSchema< export declare namespace SubscriptionPricing { export interface Raw { type?: SubscriptionPricingType.Raw | null; - discount_ids?: (string[] | null) | null; + discount_ids?: (string[] | null | undefined) | null; price_money?: Money.Raw | null; } } diff --git a/src/serialization/types/SubscriptionPricingType.ts b/src/serialization/types/SubscriptionPricingType.ts index e9f81a66d..289334525 100644 --- a/src/serialization/types/SubscriptionPricingType.ts +++ b/src/serialization/types/SubscriptionPricingType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SubscriptionPricingType: core.serialization.Schema< serializers.SubscriptionPricingType.Raw, diff --git a/src/serialization/types/SubscriptionSource.ts b/src/serialization/types/SubscriptionSource.ts index 9024e0fb7..300e8c0cb 100644 --- a/src/serialization/types/SubscriptionSource.ts +++ b/src/serialization/types/SubscriptionSource.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SubscriptionSource: core.serialization.ObjectSchema< serializers.SubscriptionSource.Raw, @@ -15,6 +13,6 @@ export const SubscriptionSource: core.serialization.ObjectSchema< export declare namespace SubscriptionSource { export interface Raw { - name?: (string | null) | null; + name?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SubscriptionStatus.ts b/src/serialization/types/SubscriptionStatus.ts index c95b07830..ad6edd02e 100644 --- a/src/serialization/types/SubscriptionStatus.ts +++ b/src/serialization/types/SubscriptionStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SubscriptionStatus: core.serialization.Schema< serializers.SubscriptionStatus.Raw, diff --git a/src/serialization/types/SubscriptionTestResult.ts b/src/serialization/types/SubscriptionTestResult.ts index 48676804e..9cf4847ad 100644 --- a/src/serialization/types/SubscriptionTestResult.ts +++ b/src/serialization/types/SubscriptionTestResult.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const SubscriptionTestResult: core.serialization.ObjectSchema< serializers.SubscriptionTestResult.Raw, @@ -20,8 +18,8 @@ export const SubscriptionTestResult: core.serialization.ObjectSchema< export declare namespace SubscriptionTestResult { export interface Raw { id?: string | null; - status_code?: (number | null) | null; - payload?: (string | null) | null; + status_code?: (number | null | undefined) | null; + payload?: (string | null | undefined) | null; created_at?: string | null; updated_at?: string | null; } diff --git a/src/serialization/types/SubscriptionUpdatedEvent.ts b/src/serialization/types/SubscriptionUpdatedEvent.ts index 2a83a0412..0625cbae7 100644 --- a/src/serialization/types/SubscriptionUpdatedEvent.ts +++ b/src/serialization/types/SubscriptionUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SubscriptionUpdatedEventData } from "./SubscriptionUpdatedEventData"; export const SubscriptionUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const SubscriptionUpdatedEvent: core.serialization.ObjectSchema< export declare namespace SubscriptionUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: SubscriptionUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/SubscriptionUpdatedEventData.ts b/src/serialization/types/SubscriptionUpdatedEventData.ts index cfef2da95..cc9ae1900 100644 --- a/src/serialization/types/SubscriptionUpdatedEventData.ts +++ b/src/serialization/types/SubscriptionUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { SubscriptionUpdatedEventObject } from "./SubscriptionUpdatedEventObject"; export const SubscriptionUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const SubscriptionUpdatedEventData: core.serialization.ObjectSchema< export declare namespace SubscriptionUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: SubscriptionUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/SubscriptionUpdatedEventObject.ts b/src/serialization/types/SubscriptionUpdatedEventObject.ts index 54055b67a..bcab5f610 100644 --- a/src/serialization/types/SubscriptionUpdatedEventObject.ts +++ b/src/serialization/types/SubscriptionUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Subscription } from "./Subscription"; export const SubscriptionUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SwapPlanResponse.ts b/src/serialization/types/SwapPlanResponse.ts index dd9d5c3e6..2de5150ae 100644 --- a/src/serialization/types/SwapPlanResponse.ts +++ b/src/serialization/types/SwapPlanResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; import { SubscriptionAction } from "./SubscriptionAction"; diff --git a/src/serialization/types/TaxCalculationPhase.ts b/src/serialization/types/TaxCalculationPhase.ts index 5f58c7c01..d86b31848 100644 --- a/src/serialization/types/TaxCalculationPhase.ts +++ b/src/serialization/types/TaxCalculationPhase.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TaxCalculationPhase: core.serialization.Schema< serializers.TaxCalculationPhase.Raw, diff --git a/src/serialization/types/TaxIds.ts b/src/serialization/types/TaxIds.ts index 6ac0e13c6..805438fcc 100644 --- a/src/serialization/types/TaxIds.ts +++ b/src/serialization/types/TaxIds.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TaxIds: core.serialization.ObjectSchema = core.serialization.object( { diff --git a/src/serialization/types/TaxInclusionType.ts b/src/serialization/types/TaxInclusionType.ts index b48dcfa51..33ce309d9 100644 --- a/src/serialization/types/TaxInclusionType.ts +++ b/src/serialization/types/TaxInclusionType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TaxInclusionType: core.serialization.Schema = core.serialization.enum_(["ADDITIVE", "INCLUSIVE"]); diff --git a/src/serialization/types/TeamMember.ts b/src/serialization/types/TeamMember.ts index e3f666d99..00577f47e 100644 --- a/src/serialization/types/TeamMember.ts +++ b/src/serialization/types/TeamMember.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TeamMemberStatus } from "./TeamMemberStatus"; +import type * as serializers from "../index"; import { TeamMemberAssignedLocations } from "./TeamMemberAssignedLocations"; +import { TeamMemberStatus } from "./TeamMemberStatus"; import { WageSetting } from "./WageSetting"; export const TeamMember: core.serialization.ObjectSchema = @@ -28,13 +26,13 @@ export const TeamMember: core.serialization.ObjectSchema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/TeamMemberUpdatedEvent.ts b/src/serialization/types/TeamMemberUpdatedEvent.ts index e3b71a51d..ca31a3b61 100644 --- a/src/serialization/types/TeamMemberUpdatedEvent.ts +++ b/src/serialization/types/TeamMemberUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TeamMemberUpdatedEventData } from "./TeamMemberUpdatedEventData"; export const TeamMemberUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const TeamMemberUpdatedEvent: core.serialization.ObjectSchema< export declare namespace TeamMemberUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: TeamMemberUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/TeamMemberUpdatedEventData.ts b/src/serialization/types/TeamMemberUpdatedEventData.ts index fa9441cbf..20107dbda 100644 --- a/src/serialization/types/TeamMemberUpdatedEventData.ts +++ b/src/serialization/types/TeamMemberUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TeamMemberUpdatedEventObject } from "./TeamMemberUpdatedEventObject"; export const TeamMemberUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const TeamMemberUpdatedEventData: core.serialization.ObjectSchema< export declare namespace TeamMemberUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: TeamMemberUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/TeamMemberUpdatedEventObject.ts b/src/serialization/types/TeamMemberUpdatedEventObject.ts index 3f32f568d..81776a4bc 100644 --- a/src/serialization/types/TeamMemberUpdatedEventObject.ts +++ b/src/serialization/types/TeamMemberUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TeamMember } from "./TeamMember"; export const TeamMemberUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/TeamMemberWage.ts b/src/serialization/types/TeamMemberWage.ts index c79f7fa98..fec32a380 100644 --- a/src/serialization/types/TeamMemberWage.ts +++ b/src/serialization/types/TeamMemberWage.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const TeamMemberWage: core.serialization.ObjectSchema = @@ -20,10 +18,10 @@ export const TeamMemberWage: core.serialization.ObjectSchema = core.serialization.object( { @@ -48,21 +46,21 @@ export const Tender: core.serialization.ObjectSchema = core.serialization.enum_([ diff --git a/src/serialization/types/TerminalAction.ts b/src/serialization/types/TerminalAction.ts index cd94a74c5..34b432c41 100644 --- a/src/serialization/types/TerminalAction.ts +++ b/src/serialization/types/TerminalAction.ts @@ -1,20 +1,18 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { ActionCancelReason } from "./ActionCancelReason"; -import { TerminalActionActionType } from "./TerminalActionActionType"; -import { QrCodeOptions } from "./QrCodeOptions"; -import { SaveCardOptions } from "./SaveCardOptions"; -import { SignatureOptions } from "./SignatureOptions"; import { ConfirmationOptions } from "./ConfirmationOptions"; -import { ReceiptOptions } from "./ReceiptOptions"; import { DataCollectionOptions } from "./DataCollectionOptions"; -import { SelectOptions } from "./SelectOptions"; import { DeviceMetadata } from "./DeviceMetadata"; +import { QrCodeOptions } from "./QrCodeOptions"; +import { ReceiptOptions } from "./ReceiptOptions"; +import { SaveCardOptions } from "./SaveCardOptions"; +import { SelectOptions } from "./SelectOptions"; +import { SignatureOptions } from "./SignatureOptions"; +import { TerminalActionActionType } from "./TerminalActionActionType"; export const TerminalAction: core.serialization.ObjectSchema = core.serialization.object({ @@ -52,8 +50,8 @@ export const TerminalAction: core.serialization.ObjectSchema = core.serialization.object({ @@ -38,7 +36,7 @@ export declare namespace TerminalRefund { amount_money: Money.Raw; reason: string; device_id: string; - deadline_duration?: (string | null) | null; + deadline_duration?: (string | null | undefined) | null; status?: string | null; cancel_reason?: ActionCancelReason.Raw | null; created_at?: string | null; diff --git a/src/serialization/types/TerminalRefundCreatedEvent.ts b/src/serialization/types/TerminalRefundCreatedEvent.ts index ab2cd1d99..6b27d12ac 100644 --- a/src/serialization/types/TerminalRefundCreatedEvent.ts +++ b/src/serialization/types/TerminalRefundCreatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TerminalRefundCreatedEventData } from "./TerminalRefundCreatedEventData"; export const TerminalRefundCreatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const TerminalRefundCreatedEvent: core.serialization.ObjectSchema< export declare namespace TerminalRefundCreatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: TerminalRefundCreatedEventData.Raw | null; } diff --git a/src/serialization/types/TerminalRefundCreatedEventData.ts b/src/serialization/types/TerminalRefundCreatedEventData.ts index be8fdfc75..094071f74 100644 --- a/src/serialization/types/TerminalRefundCreatedEventData.ts +++ b/src/serialization/types/TerminalRefundCreatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TerminalRefundCreatedEventObject } from "./TerminalRefundCreatedEventObject"; export const TerminalRefundCreatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const TerminalRefundCreatedEventData: core.serialization.ObjectSchema< export declare namespace TerminalRefundCreatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: TerminalRefundCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/TerminalRefundCreatedEventObject.ts b/src/serialization/types/TerminalRefundCreatedEventObject.ts index 02e35f1fa..19d9c1074 100644 --- a/src/serialization/types/TerminalRefundCreatedEventObject.ts +++ b/src/serialization/types/TerminalRefundCreatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TerminalRefund } from "./TerminalRefund"; export const TerminalRefundCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/TerminalRefundQuery.ts b/src/serialization/types/TerminalRefundQuery.ts index 40119b8ed..218228edd 100644 --- a/src/serialization/types/TerminalRefundQuery.ts +++ b/src/serialization/types/TerminalRefundQuery.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TerminalRefundQueryFilter } from "./TerminalRefundQueryFilter"; import { TerminalRefundQuerySort } from "./TerminalRefundQuerySort"; diff --git a/src/serialization/types/TerminalRefundQueryFilter.ts b/src/serialization/types/TerminalRefundQueryFilter.ts index c8ff1d3a9..0136679e2 100644 --- a/src/serialization/types/TerminalRefundQueryFilter.ts +++ b/src/serialization/types/TerminalRefundQueryFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TimeRange } from "./TimeRange"; export const TerminalRefundQueryFilter: core.serialization.ObjectSchema< @@ -18,8 +16,8 @@ export const TerminalRefundQueryFilter: core.serialization.ObjectSchema< export declare namespace TerminalRefundQueryFilter { export interface Raw { - device_id?: (string | null) | null; + device_id?: (string | null | undefined) | null; created_at?: TimeRange.Raw | null; - status?: (string | null) | null; + status?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/TerminalRefundQuerySort.ts b/src/serialization/types/TerminalRefundQuerySort.ts index 5a9eacc0b..181d96859 100644 --- a/src/serialization/types/TerminalRefundQuerySort.ts +++ b/src/serialization/types/TerminalRefundQuerySort.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TerminalRefundQuerySort: core.serialization.ObjectSchema< serializers.TerminalRefundQuerySort.Raw, @@ -15,6 +13,6 @@ export const TerminalRefundQuerySort: core.serialization.ObjectSchema< export declare namespace TerminalRefundQuerySort { export interface Raw { - sort_order?: (string | null) | null; + sort_order?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/TerminalRefundUpdatedEvent.ts b/src/serialization/types/TerminalRefundUpdatedEvent.ts index cc5994403..f61978d27 100644 --- a/src/serialization/types/TerminalRefundUpdatedEvent.ts +++ b/src/serialization/types/TerminalRefundUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TerminalRefundUpdatedEventData } from "./TerminalRefundUpdatedEventData"; export const TerminalRefundUpdatedEvent: core.serialization.ObjectSchema< @@ -20,9 +18,9 @@ export const TerminalRefundUpdatedEvent: core.serialization.ObjectSchema< export declare namespace TerminalRefundUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: TerminalRefundUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/TerminalRefundUpdatedEventData.ts b/src/serialization/types/TerminalRefundUpdatedEventData.ts index 86349c240..5823e24ed 100644 --- a/src/serialization/types/TerminalRefundUpdatedEventData.ts +++ b/src/serialization/types/TerminalRefundUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TerminalRefundUpdatedEventObject } from "./TerminalRefundUpdatedEventObject"; export const TerminalRefundUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const TerminalRefundUpdatedEventData: core.serialization.ObjectSchema< export declare namespace TerminalRefundUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: TerminalRefundUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/TerminalRefundUpdatedEventObject.ts b/src/serialization/types/TerminalRefundUpdatedEventObject.ts index 955dbdb16..47efbf4af 100644 --- a/src/serialization/types/TerminalRefundUpdatedEventObject.ts +++ b/src/serialization/types/TerminalRefundUpdatedEventObject.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TerminalRefund } from "./TerminalRefund"; export const TerminalRefundUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/TestWebhookSubscriptionResponse.ts b/src/serialization/types/TestWebhookSubscriptionResponse.ts index d768ff030..dc084ae54 100644 --- a/src/serialization/types/TestWebhookSubscriptionResponse.ts +++ b/src/serialization/types/TestWebhookSubscriptionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { SubscriptionTestResult } from "./SubscriptionTestResult"; diff --git a/src/serialization/types/TimeRange.ts b/src/serialization/types/TimeRange.ts index 28845f302..1e4a022f7 100644 --- a/src/serialization/types/TimeRange.ts +++ b/src/serialization/types/TimeRange.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TimeRange: core.serialization.ObjectSchema = core.serialization.object({ @@ -14,7 +12,7 @@ export const TimeRange: core.serialization.ObjectSchema = core.serialization.object({ @@ -31,11 +29,11 @@ export declare namespace Timecard { export interface Raw { id?: string | null; location_id: string; - timezone?: (string | null) | null; + timezone?: (string | null | undefined) | null; start_at: string; - end_at?: (string | null) | null; + end_at?: (string | null | undefined) | null; wage?: TimecardWage.Raw | null; - breaks?: (Break.Raw[] | null) | null; + breaks?: (Break.Raw[] | null | undefined) | null; status?: TimecardStatus.Raw | null; version?: number | null; created_at?: string | null; diff --git a/src/serialization/types/TimecardFilter.ts b/src/serialization/types/TimecardFilter.ts index f2b671f08..ed815612b 100644 --- a/src/serialization/types/TimecardFilter.ts +++ b/src/serialization/types/TimecardFilter.ts @@ -1,13 +1,11 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { TimecardFilterStatus } from "./TimecardFilterStatus"; -import { TimeRange } from "./TimeRange"; import { TimecardWorkday } from "./TimecardWorkday"; +import { TimeRange } from "./TimeRange"; export const TimecardFilter: core.serialization.ObjectSchema = core.serialization.object({ @@ -27,11 +25,11 @@ export const TimecardFilter: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/TimecardSortField.ts b/src/serialization/types/TimecardSortField.ts index 44306fb9e..50d8064c8 100644 --- a/src/serialization/types/TimecardSortField.ts +++ b/src/serialization/types/TimecardSortField.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TimecardSortField: core.serialization.Schema = core.serialization.enum_(["START_AT", "END_AT", "CREATED_AT", "UPDATED_AT"]); diff --git a/src/serialization/types/TimecardStatus.ts b/src/serialization/types/TimecardStatus.ts index 4dc25427d..34e0848b2 100644 --- a/src/serialization/types/TimecardStatus.ts +++ b/src/serialization/types/TimecardStatus.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const TimecardStatus: core.serialization.Schema = core.serialization.enum_(["OPEN", "CLOSED"]); diff --git a/src/serialization/types/TimecardWage.ts b/src/serialization/types/TimecardWage.ts index cd525d907..46f04433d 100644 --- a/src/serialization/types/TimecardWage.ts +++ b/src/serialization/types/TimecardWage.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Money } from "./Money"; export const TimecardWage: core.serialization.ObjectSchema = @@ -17,9 +15,9 @@ export const TimecardWage: core.serialization.ObjectSchema = core.serialization.object({ @@ -26,10 +24,10 @@ export const TipSettings: core.serialization.ObjectSchema = core.serialization.object({ @@ -27,14 +25,14 @@ export const Transaction: core.serialization.ObjectSchema = core.serialization.enum_(["DEBIT", "CREDIT"]); diff --git a/src/serialization/types/TransferOrder.ts b/src/serialization/types/TransferOrder.ts index c7e4695ce..3fd6348c8 100644 --- a/src/serialization/types/TransferOrder.ts +++ b/src/serialization/types/TransferOrder.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { TransferOrderStatus } from "./TransferOrderStatus"; +import type * as serializers from "../index"; import { TransferOrderLine } from "./TransferOrderLine"; +import { TransferOrderStatus } from "./TransferOrderStatus"; export const TransferOrder: core.serialization.ObjectSchema = core.serialization.object({ @@ -40,17 +38,17 @@ export const TransferOrder: core.serialization.ObjectSchema = @@ -15,7 +13,7 @@ export const V1Money: core.serialization.ObjectSchema = core.serialization.object({ @@ -55,11 +53,11 @@ export const V1Order: core.serialization.ObjectSchema = core.serialization.enum_(["PENDING", "OPEN", "COMPLETED", "CANCELED", "REFUNDED", "REJECTED"]); diff --git a/src/serialization/types/V1Tender.ts b/src/serialization/types/V1Tender.ts index ad0144d56..16aad3e21 100644 --- a/src/serialization/types/V1Tender.ts +++ b/src/serialization/types/V1Tender.ts @@ -1,14 +1,12 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { V1TenderType } from "./V1TenderType"; +import type * as serializers from "../index"; +import { V1Money } from "./V1Money"; import { V1TenderCardBrand } from "./V1TenderCardBrand"; import { V1TenderEntryMethod } from "./V1TenderEntryMethod"; -import { V1Money } from "./V1Money"; +import { V1TenderType } from "./V1TenderType"; export const V1Tender: core.serialization.ObjectSchema = core.serialization.object({ @@ -34,19 +32,19 @@ export declare namespace V1Tender { export interface Raw { id?: string | null; type?: V1TenderType.Raw | null; - name?: (string | null) | null; - employee_id?: (string | null) | null; - receipt_url?: (string | null) | null; + name?: (string | null | undefined) | null; + employee_id?: (string | null | undefined) | null; + receipt_url?: (string | null | undefined) | null; card_brand?: V1TenderCardBrand.Raw | null; - pan_suffix?: (string | null) | null; + pan_suffix?: (string | null | undefined) | null; entry_method?: V1TenderEntryMethod.Raw | null; - payment_note?: (string | null) | null; + payment_note?: (string | null | undefined) | null; total_money?: V1Money.Raw | null; tendered_money?: V1Money.Raw | null; - tendered_at?: (string | null) | null; - settled_at?: (string | null) | null; + tendered_at?: (string | null | undefined) | null; + settled_at?: (string | null | undefined) | null; change_back_money?: V1Money.Raw | null; refunded_money?: V1Money.Raw | null; - is_exchange?: (boolean | null) | null; + is_exchange?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/V1TenderCardBrand.ts b/src/serialization/types/V1TenderCardBrand.ts index d66f19db3..1b82e4c06 100644 --- a/src/serialization/types/V1TenderCardBrand.ts +++ b/src/serialization/types/V1TenderCardBrand.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const V1TenderCardBrand: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/V1TenderEntryMethod.ts b/src/serialization/types/V1TenderEntryMethod.ts index 86ee07d8e..34973d7a1 100644 --- a/src/serialization/types/V1TenderEntryMethod.ts +++ b/src/serialization/types/V1TenderEntryMethod.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const V1TenderEntryMethod: core.serialization.Schema< serializers.V1TenderEntryMethod.Raw, diff --git a/src/serialization/types/V1TenderType.ts b/src/serialization/types/V1TenderType.ts index 838d697b5..9cd13caee 100644 --- a/src/serialization/types/V1TenderType.ts +++ b/src/serialization/types/V1TenderType.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const V1TenderType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/V1UpdateOrderRequestAction.ts b/src/serialization/types/V1UpdateOrderRequestAction.ts index 34636e4f1..99b834d8d 100644 --- a/src/serialization/types/V1UpdateOrderRequestAction.ts +++ b/src/serialization/types/V1UpdateOrderRequestAction.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const V1UpdateOrderRequestAction: core.serialization.Schema< serializers.V1UpdateOrderRequestAction.Raw, diff --git a/src/serialization/types/Vendor.ts b/src/serialization/types/Vendor.ts index bc4e3d0ae..9d9bbde08 100644 --- a/src/serialization/types/Vendor.ts +++ b/src/serialization/types/Vendor.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Address } from "./Address"; import { VendorContact } from "./VendorContact"; import { VendorStatus } from "./VendorStatus"; @@ -29,11 +27,11 @@ export declare namespace Vendor { id?: string | null; created_at?: string | null; updated_at?: string | null; - name?: (string | null) | null; + name?: (string | null | undefined) | null; address?: Address.Raw | null; - contacts?: (VendorContact.Raw[] | null) | null; - account_number?: (string | null) | null; - note?: (string | null) | null; + contacts?: (VendorContact.Raw[] | null | undefined) | null; + account_number?: (string | null | undefined) | null; + note?: (string | null | undefined) | null; version?: number | null; status?: VendorStatus.Raw | null; } diff --git a/src/serialization/types/VendorContact.ts b/src/serialization/types/VendorContact.ts index 3ff4ff0e3..a3073fe4a 100644 --- a/src/serialization/types/VendorContact.ts +++ b/src/serialization/types/VendorContact.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const VendorContact: core.serialization.ObjectSchema = core.serialization.object({ @@ -19,10 +17,10 @@ export const VendorContact: core.serialization.ObjectSchema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/VendorUpdatedEvent.ts b/src/serialization/types/VendorUpdatedEvent.ts index ad39c7951..535d3173d 100644 --- a/src/serialization/types/VendorUpdatedEvent.ts +++ b/src/serialization/types/VendorUpdatedEvent.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { VendorUpdatedEventData } from "./VendorUpdatedEventData"; export const VendorUpdatedEvent: core.serialization.ObjectSchema< @@ -21,10 +19,10 @@ export const VendorUpdatedEvent: core.serialization.ObjectSchema< export declare namespace VendorUpdatedEvent { export interface Raw { - merchant_id?: (string | null) | null; - location_id?: (string | null) | null; - type?: (string | null) | null; - event_id?: (string | null) | null; + merchant_id?: (string | null | undefined) | null; + location_id?: (string | null | undefined) | null; + type?: (string | null | undefined) | null; + event_id?: (string | null | undefined) | null; created_at?: string | null; data?: VendorUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/VendorUpdatedEventData.ts b/src/serialization/types/VendorUpdatedEventData.ts index 708e7f3eb..2462b9176 100644 --- a/src/serialization/types/VendorUpdatedEventData.ts +++ b/src/serialization/types/VendorUpdatedEventData.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { VendorUpdatedEventObject } from "./VendorUpdatedEventObject"; export const VendorUpdatedEventData: core.serialization.ObjectSchema< @@ -18,7 +16,7 @@ export const VendorUpdatedEventData: core.serialization.ObjectSchema< export declare namespace VendorUpdatedEventData { export interface Raw { - type?: (string | null) | null; + type?: (string | null | undefined) | null; id?: string | null; object?: VendorUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/VendorUpdatedEventObject.ts b/src/serialization/types/VendorUpdatedEventObject.ts index f3df0ba59..e815750c3 100644 --- a/src/serialization/types/VendorUpdatedEventObject.ts +++ b/src/serialization/types/VendorUpdatedEventObject.ts @@ -1,12 +1,10 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; -import { VendorUpdatedEventObjectOperation } from "./VendorUpdatedEventObjectOperation"; +import type * as serializers from "../index"; import { Vendor } from "./Vendor"; +import { VendorUpdatedEventObjectOperation } from "./VendorUpdatedEventObjectOperation"; export const VendorUpdatedEventObject: core.serialization.ObjectSchema< serializers.VendorUpdatedEventObject.Raw, diff --git a/src/serialization/types/VendorUpdatedEventObjectOperation.ts b/src/serialization/types/VendorUpdatedEventObjectOperation.ts index cbe3a8cae..a3cd4881e 100644 --- a/src/serialization/types/VendorUpdatedEventObjectOperation.ts +++ b/src/serialization/types/VendorUpdatedEventObjectOperation.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const VendorUpdatedEventObjectOperation: core.serialization.Schema< serializers.VendorUpdatedEventObjectOperation.Raw, diff --git a/src/serialization/types/VisibilityFilter.ts b/src/serialization/types/VisibilityFilter.ts index c0ff5cf9e..41409c8fe 100644 --- a/src/serialization/types/VisibilityFilter.ts +++ b/src/serialization/types/VisibilityFilter.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; export const VisibilityFilter: core.serialization.Schema = core.serialization.enum_(["ALL", "READ", "READ_WRITE"]); diff --git a/src/serialization/types/VoidTransactionResponse.ts b/src/serialization/types/VoidTransactionResponse.ts index 963f7b427..e9b2df70b 100644 --- a/src/serialization/types/VoidTransactionResponse.ts +++ b/src/serialization/types/VoidTransactionResponse.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const VoidTransactionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/WageSetting.ts b/src/serialization/types/WageSetting.ts index cc5b4dcd4..65f284441 100644 --- a/src/serialization/types/WageSetting.ts +++ b/src/serialization/types/WageSetting.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { JobAssignment } from "./JobAssignment"; export const WageSetting: core.serialization.ObjectSchema = @@ -25,9 +23,9 @@ export const WageSetting: core.serialization.ObjectSchema = core.serialization.enum_([ "MON", diff --git a/src/serialization/types/WorkweekConfig.ts b/src/serialization/types/WorkweekConfig.ts index e566ce1c1..ceca08c05 100644 --- a/src/serialization/types/WorkweekConfig.ts +++ b/src/serialization/types/WorkweekConfig.ts @@ -1,10 +1,8 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import * as serializers from "../index"; -import * as Square from "../../api/index"; +import type * as Square from "../../api/index"; import * as core from "../../core"; +import type * as serializers from "../index"; import { Weekday } from "./Weekday"; export const WorkweekConfig: core.serialization.ObjectSchema = diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index a6114f07f..7b318b1af 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,7 +1,7 @@ -export * from "./AchDetails"; export * from "./AcceptDisputeResponse"; export * from "./AcceptedPaymentMethods"; export * from "./AccumulateLoyaltyPointsResponse"; +export * from "./AchDetails"; export * from "./ActionCancelReason"; export * from "./ActivityType"; export * from "./AddGroupToCustomerResponse"; @@ -30,14 +30,22 @@ export * from "./BankAccountVerifiedEventData"; export * from "./BankAccountVerifiedEventObject"; export * from "./BatchChangeInventoryRequest"; export * from "./BatchChangeInventoryResponse"; +export * from "./BatchCreateTeamMembersResponse"; +export * from "./BatchCreateVendorsResponse"; export * from "./BatchDeleteCatalogObjectsResponse"; export * from "./BatchGetCatalogObjectsResponse"; -export * from "./BatchRetrieveInventoryChangesRequest"; export * from "./BatchGetInventoryChangesResponse"; export * from "./BatchGetInventoryCountsRequest"; export * from "./BatchGetInventoryCountsResponse"; export * from "./BatchGetOrdersResponse"; +export * from "./BatchGetVendorsResponse"; +export * from "./BatchRetrieveInventoryChangesRequest"; +export * from "./BatchUpdateTeamMembersResponse"; +export * from "./BatchUpdateVendorsResponse"; export * from "./BatchUpsertCatalogObjectsResponse"; +export * from "./BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest"; +export * from "./BatchUpsertCustomerCustomAttributesResponse"; +export * from "./BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse"; export * from "./Booking"; export * from "./BookingBookingSource"; export * from "./BookingCreatedEvent"; @@ -67,8 +75,6 @@ export * from "./Break"; export * from "./BreakType"; export * from "./BulkCreateCustomerData"; export * from "./BulkCreateCustomersResponse"; -export * from "./BatchCreateTeamMembersResponse"; -export * from "./BatchCreateVendorsResponse"; export * from "./BulkDeleteBookingCustomAttributesResponse"; export * from "./BulkDeleteCustomersResponse"; export * from "./BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest"; @@ -86,16 +92,10 @@ export * from "./BulkRetrieveChannelsRequestConstants"; export * from "./BulkRetrieveChannelsResponse"; export * from "./BulkRetrieveCustomersResponse"; export * from "./BulkRetrieveTeamMemberBookingProfilesResponse"; -export * from "./BatchGetVendorsResponse"; export * from "./BulkSwapPlanResponse"; export * from "./BulkUpdateCustomerData"; export * from "./BulkUpdateCustomersResponse"; -export * from "./BatchUpdateTeamMembersResponse"; -export * from "./BatchUpdateVendorsResponse"; export * from "./BulkUpsertBookingCustomAttributesResponse"; -export * from "./BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest"; -export * from "./BatchUpsertCustomerCustomAttributesResponse"; -export * from "./BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse"; export * from "./BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest"; export * from "./BulkUpsertLocationCustomAttributesResponse"; export * from "./BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse"; @@ -201,29 +201,47 @@ export * from "./CatalogModifierListModifierType"; export * from "./CatalogModifierListSelectionType"; export * from "./CatalogModifierOverride"; export * from "./CatalogObject"; +export * from "./CatalogObjectAvailabilityPeriod"; +export * from "./CatalogObjectBase"; export * from "./CatalogObjectBatch"; export * from "./CatalogObjectCategory"; -export * from "./CatalogObjectBase"; +export * from "./CatalogObjectCustomAttributeDefinition"; +export * from "./CatalogObjectDiscount"; +export * from "./CatalogObjectImage"; +export * from "./CatalogObjectItem"; +export * from "./CatalogObjectItemOption"; +export * from "./CatalogObjectItemOptionValue"; +export * from "./CatalogObjectItemVariation"; +export * from "./CatalogObjectMeasurementUnit"; +export * from "./CatalogObjectModifier"; +export * from "./CatalogObjectModifierList"; +export * from "./CatalogObjectPricingRule"; +export * from "./CatalogObjectProductSet"; +export * from "./CatalogObjectQuickAmountsSettings"; export * from "./CatalogObjectReference"; +export * from "./CatalogObjectSubscriptionPlan"; +export * from "./CatalogObjectSubscriptionPlanVariation"; +export * from "./CatalogObjectTax"; +export * from "./CatalogObjectTimePeriod"; export * from "./CatalogObjectType"; export * from "./CatalogPricingRule"; export * from "./CatalogPricingType"; export * from "./CatalogProductSet"; export * from "./CatalogQuery"; export * from "./CatalogQueryExact"; -export * from "./CatalogQueryItemVariationsForItemOptionValues"; export * from "./CatalogQueryItemsForItemOptions"; export * from "./CatalogQueryItemsForModifierList"; export * from "./CatalogQueryItemsForTax"; +export * from "./CatalogQueryItemVariationsForItemOptionValues"; export * from "./CatalogQueryPrefix"; export * from "./CatalogQueryRange"; export * from "./CatalogQuerySet"; export * from "./CatalogQuerySortedAttribute"; export * from "./CatalogQueryText"; export * from "./CatalogQuickAmount"; -export * from "./CatalogQuickAmountType"; export * from "./CatalogQuickAmountsSettings"; export * from "./CatalogQuickAmountsSettingsOption"; +export * from "./CatalogQuickAmountType"; export * from "./CatalogStockConversion"; export * from "./CatalogSubscriptionPlan"; export * from "./CatalogSubscriptionPlanVariation"; @@ -321,7 +339,6 @@ export * from "./CustomAttributeDefinitionVisibility"; export * from "./CustomAttributeEventData"; export * from "./CustomAttributeEventDataObject"; export * from "./CustomAttributeFilter"; -export * from "./CustomField"; export * from "./Customer"; export * from "./CustomerAddressFilter"; export * from "./CustomerCreatedEvent"; @@ -346,8 +363,8 @@ export * from "./CustomerCustomAttributeDefinitionVisibleUpdatedEvent"; export * from "./CustomerCustomAttributeDeletedEvent"; export * from "./CustomerCustomAttributeDeletedPublicEvent"; export * from "./CustomerCustomAttributeFilter"; -export * from "./CustomerCustomAttributeFilterValue"; export * from "./CustomerCustomAttributeFilters"; +export * from "./CustomerCustomAttributeFilterValue"; export * from "./CustomerCustomAttributeOwnedDeletedEvent"; export * from "./CustomerCustomAttributeOwnedUpdatedEvent"; export * from "./CustomerCustomAttributeUpdatedEvent"; @@ -373,6 +390,7 @@ export * from "./CustomerTextFilter"; export * from "./CustomerUpdatedEvent"; export * from "./CustomerUpdatedEventData"; export * from "./CustomerUpdatedEventObject"; +export * from "./CustomField"; export * from "./DataCollectionOptions"; export * from "./DataCollectionOptionsInputType"; export * from "./DateRange"; @@ -442,6 +460,7 @@ export * from "./Dispute"; export * from "./DisputeCreatedEvent"; export * from "./DisputeCreatedEventData"; export * from "./DisputeCreatedEventObject"; +export * from "./DisputedPayment"; export * from "./DisputeEvidence"; export * from "./DisputeEvidenceAddedEvent"; export * from "./DisputeEvidenceAddedEventData"; @@ -465,7 +484,6 @@ export * from "./DisputeStateChangedEventObject"; export * from "./DisputeStateUpdatedEvent"; export * from "./DisputeStateUpdatedEventData"; export * from "./DisputeStateUpdatedEventObject"; -export * from "./DisputedPayment"; export * from "./EcomVisibility"; export * from "./Employee"; export * from "./EmployeeStatus"; @@ -496,19 +514,84 @@ export * from "./FulfillmentState"; export * from "./FulfillmentType"; export * from "./GetBankAccountByV1IdResponse"; export * from "./GetBankAccountResponse"; +export * from "./GetBookingRequest"; +export * from "./GetBookingResponse"; export * from "./GetBreakTypeResponse"; +export * from "./GetBusinessBookingProfileRequest"; +export * from "./GetBusinessBookingProfileResponse"; +export * from "./GetCardRequest"; +export * from "./GetCardResponse"; +export * from "./GetCashDrawerShiftResponse"; +export * from "./GetCatalogObjectResponse"; +export * from "./GetCustomerCustomAttributeDefinitionResponse"; +export * from "./GetCustomerCustomAttributeResponse"; +export * from "./GetCustomerGroupRequest"; +export * from "./GetCustomerGroupResponse"; +export * from "./GetCustomerRequest"; +export * from "./GetCustomerResponse"; +export * from "./GetCustomerSegmentRequest"; +export * from "./GetCustomerSegmentResponse"; export * from "./GetDeviceCodeResponse"; export * from "./GetDeviceResponse"; +export * from "./GetDisputeEvidenceRequest"; +export * from "./GetDisputeEvidenceResponse"; +export * from "./GetDisputeRequest"; +export * from "./GetDisputeResponse"; +export * from "./GetEmployeeRequest"; +export * from "./GetEmployeeResponse"; export * from "./GetEmployeeWageResponse"; +export * from "./GetGiftCardFromGanResponse"; +export * from "./GetGiftCardFromNonceResponse"; +export * from "./GetGiftCardRequest"; +export * from "./GetGiftCardResponse"; +export * from "./GetInventoryAdjustmentRequest"; +export * from "./GetInventoryAdjustmentResponse"; +export * from "./GetInventoryChangesResponse"; +export * from "./GetInventoryCountResponse"; +export * from "./GetInventoryPhysicalCountRequest"; +export * from "./GetInventoryPhysicalCountResponse"; +export * from "./GetInventoryTransferRequest"; +export * from "./GetInventoryTransferResponse"; export * from "./GetInvoiceResponse"; +export * from "./GetLocationRequest"; +export * from "./GetLocationResponse"; +export * from "./GetLoyaltyAccountRequest"; +export * from "./GetLoyaltyAccountResponse"; +export * from "./GetLoyaltyProgramRequest"; +export * from "./GetLoyaltyProgramResponse"; +export * from "./GetLoyaltyPromotionRequest"; +export * from "./GetLoyaltyPromotionResponse"; +export * from "./GetLoyaltyRewardRequest"; +export * from "./GetLoyaltyRewardResponse"; +export * from "./GetMerchantRequest"; +export * from "./GetMerchantResponse"; +export * from "./GetOrderRequest"; +export * from "./GetOrderResponse"; +export * from "./GetPaymentLinkRequest"; +export * from "./GetPaymentLinkResponse"; export * from "./GetPaymentRefundResponse"; export * from "./GetPaymentResponse"; export * from "./GetPayoutResponse"; export * from "./GetShiftResponse"; +export * from "./GetSnippetRequest"; +export * from "./GetSnippetResponse"; +export * from "./GetSubscriptionResponse"; +export * from "./GetTeamMemberBookingProfileRequest"; +export * from "./GetTeamMemberBookingProfileResponse"; +export * from "./GetTeamMemberRequest"; +export * from "./GetTeamMemberResponse"; export * from "./GetTeamMemberWageResponse"; export * from "./GetTerminalActionResponse"; export * from "./GetTerminalCheckoutResponse"; export * from "./GetTerminalRefundResponse"; +export * from "./GetTransactionRequest"; +export * from "./GetTransactionResponse"; +export * from "./GetVendorRequest"; +export * from "./GetVendorResponse"; +export * from "./GetWageSettingRequest"; +export * from "./GetWageSettingResponse"; +export * from "./GetWebhookSubscriptionRequest"; +export * from "./GetWebhookSubscriptionResponse"; export * from "./GiftCard"; export * from "./GiftCardActivity"; export * from "./GiftCardActivityActivate"; @@ -667,8 +750,8 @@ export * from "./ListDeviceCodesResponse"; export * from "./ListDevicesResponse"; export * from "./ListDisputeEvidenceResponse"; export * from "./ListDisputesResponse"; -export * from "./ListEmployeeWagesResponse"; export * from "./ListEmployeesResponse"; +export * from "./ListEmployeeWagesResponse"; export * from "./ListEventTypesResponse"; export * from "./ListGiftCardActivitiesResponse"; export * from "./ListGiftCardsResponse"; @@ -739,10 +822,10 @@ export * from "./LoyaltyEvent"; export * from "./LoyaltyEventAccumulatePoints"; export * from "./LoyaltyEventAccumulatePromotionPoints"; export * from "./LoyaltyEventAdjustPoints"; -export * from "./LoyaltyEventCreateReward"; export * from "./LoyaltyEventCreatedEvent"; export * from "./LoyaltyEventCreatedEventData"; export * from "./LoyaltyEventCreatedEventObject"; +export * from "./LoyaltyEventCreateReward"; export * from "./LoyaltyEventDateTimeFilter"; export * from "./LoyaltyEventDeleteReward"; export * from "./LoyaltyEventExpirePoints"; @@ -889,7 +972,6 @@ export * from "./OrderUpdatedEvent"; export * from "./OrderUpdatedEventData"; export * from "./OrderUpdatedObject"; export * from "./PauseSubscriptionResponse"; -export * from "./PayOrderResponse"; export * from "./Payment"; export * from "./PaymentBalanceActivityAppFeeRefundDetail"; export * from "./PaymentBalanceActivityAppFeeRevenueDetail"; @@ -927,6 +1009,7 @@ export * from "./PaymentRefund"; export * from "./PaymentUpdatedEvent"; export * from "./PaymentUpdatedEventData"; export * from "./PaymentUpdatedEventObject"; +export * from "./PayOrderResponse"; export * from "./Payout"; export * from "./PayoutEntry"; export * from "./PayoutFailedEvent"; @@ -973,58 +1056,21 @@ export * from "./RemoveGroupFromCustomerResponse"; export * from "./ResumeSubscriptionResponse"; export * from "./RetrieveBookingCustomAttributeDefinitionResponse"; export * from "./RetrieveBookingCustomAttributeResponse"; -export * from "./GetBookingResponse"; -export * from "./GetBusinessBookingProfileResponse"; -export * from "./GetCardResponse"; -export * from "./GetCashDrawerShiftResponse"; -export * from "./GetCatalogObjectResponse"; export * from "./RetrieveChannelResponse"; -export * from "./GetCustomerCustomAttributeDefinitionResponse"; -export * from "./GetCustomerCustomAttributeResponse"; -export * from "./GetCustomerGroupResponse"; -export * from "./GetCustomerResponse"; -export * from "./GetCustomerSegmentResponse"; -export * from "./GetDisputeEvidenceResponse"; -export * from "./GetDisputeResponse"; -export * from "./GetEmployeeResponse"; -export * from "./GetGiftCardFromGanResponse"; -export * from "./GetGiftCardFromNonceResponse"; -export * from "./GetGiftCardResponse"; -export * from "./GetInventoryAdjustmentResponse"; -export * from "./GetInventoryChangesResponse"; -export * from "./GetInventoryCountResponse"; -export * from "./GetInventoryPhysicalCountResponse"; -export * from "./GetInventoryTransferResponse"; export * from "./RetrieveJobResponse"; export * from "./RetrieveLocationBookingProfileResponse"; export * from "./RetrieveLocationCustomAttributeDefinitionResponse"; export * from "./RetrieveLocationCustomAttributeResponse"; -export * from "./GetLocationResponse"; export * from "./RetrieveLocationSettingsResponse"; -export * from "./GetLoyaltyAccountResponse"; -export * from "./GetLoyaltyProgramResponse"; -export * from "./GetLoyaltyPromotionResponse"; -export * from "./GetLoyaltyRewardResponse"; export * from "./RetrieveMerchantCustomAttributeDefinitionResponse"; export * from "./RetrieveMerchantCustomAttributeResponse"; -export * from "./GetMerchantResponse"; export * from "./RetrieveMerchantSettingsResponse"; export * from "./RetrieveOrderCustomAttributeDefinitionResponse"; export * from "./RetrieveOrderCustomAttributeResponse"; -export * from "./GetOrderResponse"; -export * from "./GetPaymentLinkResponse"; export * from "./RetrieveScheduledShiftResponse"; -export * from "./GetSnippetResponse"; -export * from "./GetSubscriptionResponse"; -export * from "./GetTeamMemberBookingProfileResponse"; -export * from "./GetTeamMemberResponse"; export * from "./RetrieveTimecardResponse"; export * from "./RetrieveTokenStatusResponse"; -export * from "./GetTransactionResponse"; export * from "./RetrieveTransferOrderResponse"; -export * from "./GetVendorResponse"; -export * from "./GetWageSettingResponse"; -export * from "./GetWebhookSubscriptionResponse"; export * from "./RevokeTokenResponse"; export * from "./RiskEvaluation"; export * from "./RiskEvaluationRiskLevel"; @@ -1195,7 +1241,6 @@ export * from "./TerminalRefundUpdatedEvent"; export * from "./TerminalRefundUpdatedEventData"; export * from "./TerminalRefundUpdatedEventObject"; export * from "./TestWebhookSubscriptionResponse"; -export * from "./TimeRange"; export * from "./Timecard"; export * from "./TimecardFilter"; export * from "./TimecardFilterStatus"; @@ -1206,6 +1251,7 @@ export * from "./TimecardStatus"; export * from "./TimecardWage"; export * from "./TimecardWorkday"; export * from "./TimecardWorkdayMatcher"; +export * from "./TimeRange"; export * from "./TipSettings"; export * from "./Transaction"; export * from "./TransactionProduct"; @@ -1271,6 +1317,8 @@ export * from "./UpsertLocationCustomAttributeResponse"; export * from "./UpsertMerchantCustomAttributeResponse"; export * from "./UpsertOrderCustomAttributeResponse"; export * from "./UpsertSnippetResponse"; +export * from "./V1GetPaymentRequest"; +export * from "./V1GetSettlementRequest"; export * from "./V1Money"; export * from "./V1Order"; export * from "./V1OrderHistoryEntry"; @@ -1298,51 +1346,3 @@ export * from "./WageSetting"; export * from "./WebhookSubscription"; export * from "./Weekday"; export * from "./WorkweekConfig"; -export * from "./CatalogObjectItem"; -export * from "./CatalogObjectImage"; -export * from "./CatalogObjectItemVariation"; -export * from "./CatalogObjectTax"; -export * from "./CatalogObjectDiscount"; -export * from "./CatalogObjectModifierList"; -export * from "./CatalogObjectModifier"; -export * from "./CatalogObjectPricingRule"; -export * from "./CatalogObjectProductSet"; -export * from "./CatalogObjectTimePeriod"; -export * from "./CatalogObjectMeasurementUnit"; -export * from "./CatalogObjectSubscriptionPlanVariation"; -export * from "./CatalogObjectItemOption"; -export * from "./CatalogObjectItemOptionValue"; -export * from "./CatalogObjectCustomAttributeDefinition"; -export * from "./CatalogObjectQuickAmountsSettings"; -export * from "./CatalogObjectSubscriptionPlan"; -export * from "./CatalogObjectAvailabilityPeriod"; -export * from "./GetLoyaltyAccountRequest"; -export * from "./GetLoyaltyProgramRequest"; -export * from "./GetLoyaltyPromotionRequest"; -export * from "./GetLoyaltyRewardRequest"; -export * from "./GetCardRequest"; -export * from "./GetDisputeEvidenceRequest"; -export * from "./GetDisputeRequest"; -export * from "./V1GetPaymentRequest"; -export * from "./V1GetSettlementRequest"; -export * from "./GetCustomerGroupRequest"; -export * from "./GetCustomerRequest"; -export * from "./GetCustomerSegmentRequest"; -export * from "./GetTransactionRequest"; -export * from "./GetBookingRequest"; -export * from "./GetBusinessBookingProfileRequest"; -export * from "./GetTeamMemberBookingProfileRequest"; -export * from "./GetSnippetRequest"; -export * from "./GetInventoryAdjustmentRequest"; -export * from "./GetInventoryPhysicalCountRequest"; -export * from "./GetInventoryTransferRequest"; -export * from "./GetVendorRequest"; -export * from "./GetPaymentLinkRequest"; -export * from "./GetGiftCardRequest"; -export * from "./GetOrderRequest"; -export * from "./GetEmployeeRequest"; -export * from "./GetLocationRequest"; -export * from "./GetMerchantRequest"; -export * from "./GetTeamMemberRequest"; -export * from "./GetWageSettingRequest"; -export * from "./GetWebhookSubscriptionRequest"; diff --git a/src/version.ts b/src/version.ts index 7854a9712..842485807 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "43.1.0"; +export const SDK_VERSION = "43.1.2"; diff --git a/src/wrapper/WebhooksHelper.ts b/src/wrapper/WebhooksHelper.ts index 3c0966c6f..93ab977b3 100644 --- a/src/wrapper/WebhooksHelper.ts +++ b/src/wrapper/WebhooksHelper.ts @@ -1,5 +1,5 @@ -import { createHmacOverride } from '../core/crypto/createHmacOverride'; -import { SquareError } from '../errors'; +import { createHmacOverride } from "../core/crypto/createHmacOverride"; +import { SquareError } from "../errors"; /** * Utility to help with {@link https://developer.squareup.com/docs/webhooks/overview Square Webhooks } @@ -19,24 +19,24 @@ export class WebhooksHelper { requestBody, signatureHeader, signatureKey, - notificationUrl + notificationUrl, }: { - requestBody: string, - signatureHeader: string, - signatureKey: string, - notificationUrl: string + requestBody: string; + signatureHeader: string; + signatureKey: string; + notificationUrl: string; }): Promise { if (requestBody == null) { return false; } - if (signatureKey == null || signatureKey.length == 0) { + if (signatureKey == null || signatureKey.length === 0) { throw new SquareError({ - message: 'signatureKey is null or empty' + message: "signatureKey is null or empty", }); } - if (notificationUrl == null || notificationUrl.length == 0) { + if (notificationUrl == null || notificationUrl.length === 0) { throw new SquareError({ - message: 'notificationUrl is null or empty' + message: "notificationUrl is null or empty", }); } try { @@ -45,8 +45,8 @@ export class WebhooksHelper { return hashBase64 === signatureHeader; } catch (error) { throw new SquareError({ - message: `Failed to validate webhook signature: ${error instanceof Error ? error.message : String(error)}` + message: `Failed to validate webhook signature: ${error instanceof Error ? error.message : String(error)}`, }); } } -} \ No newline at end of file +} diff --git a/tests/BrowserTestEnvironment.ts b/tests/BrowserTestEnvironment.ts deleted file mode 100644 index 0f32bf7b0..000000000 --- a/tests/BrowserTestEnvironment.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { TestEnvironment } from "jest-environment-jsdom"; - -class BrowserTestEnvironment extends TestEnvironment { - async setup() { - await super.setup(); - this.global.Request = Request; - this.global.Response = Response; - this.global.ReadableStream = ReadableStream; - this.global.TextEncoder = TextEncoder; - this.global.TextDecoder = TextDecoder; - this.global.FormData = FormData; - this.global.File = File; - this.global.Blob = Blob; - } -} - -export default BrowserTestEnvironment; diff --git a/tests/bigint.setup.ts b/tests/bigint.setup.ts index d03d34f21..abdfd3eda 100644 --- a/tests/bigint.setup.ts +++ b/tests/bigint.setup.ts @@ -9,5 +9,3 @@ expect.addEqualityTesters([ return undefined; }, ]); - -export {}; diff --git a/tests/integration/catalog.serial.test.ts b/tests/integration/catalog.serial.test.ts index 6bdbc0ec8..9d8d26c0e 100644 --- a/tests/integration/catalog.serial.test.ts +++ b/tests/integration/catalog.serial.test.ts @@ -1,14 +1,15 @@ +import type { Square, SquareClient } from "../../src"; import { createClient, createTestCatalogItem, getTestFile, newTestSquareTempId, newTestUuid } from "./helpers"; -import { Square, SquareClient } from "../../src"; const MAX_CATALOG_PAGE_SIZE = 100; const MAX_RETRIES_CATALOG = 5; const MAX_TIMEOUT = 120; -const sleep = (ms: number) => new Promise((resolve) => { - const timer = setTimeout(resolve, ms); - timer.unref(); -}); +const sleep = (ms: number) => + new Promise((resolve) => { + const timer = setTimeout(resolve, ms); + timer.unref(); + }); async function deleteAllCatalogObjects(client: SquareClient): Promise { const catalogObjectsResp = await client.catalog.list(); @@ -59,7 +60,7 @@ describe("Catalog API", () => { timer.unref(); }); } catch (error) { - console.warn('Cleanup failed:', error); + console.warn("Cleanup failed:", error); } }, 240_000); @@ -114,29 +115,29 @@ describe("Catalog API", () => { // Add retry logic for the image upload const maxRetries = 5; // Increased from 3 to 5 let lastError = null; - + for (let attempt = 0; attempt < maxRetries; attempt++) { try { // If this isn't the first attempt, wait before retrying if (attempt > 0) { console.log(`Attempt ${attempt + 1} for image upload...`); // Increase wait time between retries exponentially - await sleep(Math.pow(2, attempt) * 5000); + await sleep(2 ** attempt * 5000); } console.log(`Starting image upload attempt ${attempt + 1}`); // Setup: Load a test image file const imageFile = await getTestFile(); - console.log('Test file loaded'); + console.log("Test file loaded"); // Setup: Create a catalog object to associate the image with const catalogObject = createTestCatalogItem(); - + // Add delay before catalog creation await sleep(3000); - console.log('Creating catalog object...'); - + console.log("Creating catalog object..."); + const createCatalogResp = await client.catalog.batchUpsert( { idempotencyKey: newTestUuid(), @@ -152,14 +153,14 @@ describe("Catalog API", () => { }, ); - console.log('Catalog object created'); + console.log("Catalog object created"); expect(createCatalogResp.objects).toHaveLength(1); const createdCatalogObject = createCatalogResp.objects?.[0]; expect(createdCatalogObject).toBeDefined(); // Add delay before image upload await sleep(5000); - console.log('Uploading image...'); + console.log("Uploading image..."); // Create a new catalog image const imageName = `Test Image ${newTestUuid()}`; @@ -168,7 +169,7 @@ describe("Catalog API", () => { imageFile, request: { idempotencyKey: newTestUuid(), - objectId: createdCatalogObject!.id, + objectId: createdCatalogObject?.id, image: { type: "IMAGE", id: newTestSquareTempId(), @@ -184,17 +185,17 @@ describe("Catalog API", () => { }, ); - console.log('Image uploaded successfully'); + console.log("Image uploaded successfully"); expect(createCatalogImageResp.image).toBeDefined(); // Add delay before cleanup await sleep(3000); - console.log('Starting cleanup...'); + console.log("Starting cleanup..."); // Cleanup: Delete the created catalog object and image await client.catalog.batchDelete( { - objectIds: [createdCatalogObject!.id!, createCatalogImageResp.image!.id!], + objectIds: [createdCatalogObject?.id!, createCatalogImageResp.image?.id!], }, { maxRetries: MAX_RETRIES_CATALOG, @@ -202,10 +203,9 @@ describe("Catalog API", () => { }, ); - console.log('Cleanup completed'); + console.log("Cleanup completed"); // If we get here, the test succeeded, so break out of retry loop return; - } catch (error) { lastError = error; console.log(`Attempt ${attempt + 1} failed with error:`, error); @@ -214,9 +214,9 @@ describe("Catalog API", () => { } // If we get here, all retries failed - console.log('All image upload attempts failed'); + console.log("All image upload attempts failed"); throw lastError; - }, 240_000); + }, 360_000); it("should test upsert catalog object", async () => { const coffee = createTestCatalogItem({ @@ -248,7 +248,7 @@ describe("Catalog API", () => { const variation = catalogObject.itemData?.variations?.[0] as Square.CatalogObject.ItemVariation; expect(variation.itemVariationData?.name).toBe("Colombian Fair Trade"); - }); + }, 240_000); it("should test catalog info", async () => { await sleep(2000); // Wait before info request @@ -342,7 +342,7 @@ describe("Catalog API", () => { }, 240_000); it("should test retrieve catalog object", async () => { - await sleep(2000); // Wait before test start + await sleep(5000); // Wait before test start to avoid rate limiting // First create a catalog object const coffee = createTestCatalogItem(); @@ -357,21 +357,21 @@ describe("Catalog API", () => { }, ); - await sleep(2000); // Wait before retrieve + await sleep(3000); // Wait before retrieve // Then retrieve it const response = await client.catalog.object.get({ - objectId: createResp.catalogObject!.id!, + objectId: createResp.catalogObject?.id!, }); expect(response.object).toBeDefined(); - expect(response.object!.id).toBe(createResp.catalogObject!.id); + expect(response.object?.id).toBe(createResp.catalogObject?.id); - await sleep(2000); // Wait before cleanup + await sleep(3000); // Wait before cleanup // Cleanup await client.catalog.object.delete( { - objectId: createResp.catalogObject!.id!, + objectId: createResp.catalogObject?.id!, }, { maxRetries: MAX_RETRIES_CATALOG, @@ -381,7 +381,7 @@ describe("Catalog API", () => { }, 240_000); it("should test batch retrieve catalog objects", async () => { - await sleep(2000); // Wait before batch retrieve + await sleep(5000); // Wait before batch retrieve // Use the IDs created in the batch upsert test const response = await client.catalog.batchGet({ @@ -390,13 +390,13 @@ describe("Catalog API", () => { expect(response.objects).toBeDefined(); expect(response.objects).toHaveLength(3); - expect(response.objects!.map((obj) => obj.id)).toEqual( + expect(response.objects?.map((obj) => obj.id)).toEqual( expect.arrayContaining([catalogModifierId, catalogModifierListId, catalogTaxId]), ); }, 240_000); it("should test update item taxes", async () => { - await sleep(2000); // Wait before test start + await sleep(5000); // Wait before test start // First create a test item const item = createTestCatalogItem(); @@ -411,11 +411,11 @@ describe("Catalog API", () => { }, ); - await sleep(2000); // Wait before update + await sleep(3000); // Wait before update const response = await client.catalog.updateItemTaxes( { - itemIds: [createResp.catalogObject!.id!], + itemIds: [createResp.catalogObject?.id!], taxesToEnable: [catalogTaxId], }, { @@ -426,12 +426,12 @@ describe("Catalog API", () => { expect(response.updatedAt).toBeDefined(); - await sleep(2000); // Wait before cleanup + await sleep(3000); // Wait before cleanup // Cleanup await client.catalog.object.delete( { - objectId: createResp.catalogObject!.id!, + objectId: createResp.catalogObject?.id!, }, { maxRetries: MAX_RETRIES_CATALOG, @@ -441,7 +441,7 @@ describe("Catalog API", () => { }, 240_000); it("should test update item modifier lists", async () => { - await sleep(2000); // Wait before test start + await sleep(5000); // Wait before test start // First create a test item const item = createTestCatalogItem(); @@ -456,11 +456,11 @@ describe("Catalog API", () => { }, ); - await sleep(2000); // Wait before update + await sleep(3000); // Wait before update const response = await client.catalog.updateItemModifierLists( { - itemIds: [createResp.catalogObject!.id!], + itemIds: [createResp.catalogObject?.id!], modifierListsToEnable: [catalogModifierListId], }, { @@ -471,12 +471,12 @@ describe("Catalog API", () => { expect(response.updatedAt).toBeDefined(); - await sleep(2000); // Wait before cleanup + await sleep(3000); // Wait before cleanup // Cleanup await client.catalog.object.delete( { - objectId: createResp.catalogObject!.id!, + objectId: createResp.catalogObject?.id!, }, { maxRetries: MAX_RETRIES_CATALOG, @@ -484,4 +484,4 @@ describe("Catalog API", () => { }, ); }, 240_000); -}); \ No newline at end of file +}); diff --git a/tests/integration/clientUtils.test.ts b/tests/integration/clientUtils.test.ts index eff419231..760226974 100644 --- a/tests/integration/clientUtils.test.ts +++ b/tests/integration/clientUtils.test.ts @@ -1,8 +1,8 @@ -import { SquareClient } from "../../src"; -import { createClient, newTestUuid, newTestSquareTempId, newTestMoney, getDefaultLocationId } from "./helpers"; +import type { SquareClient } from "../../src"; +import { createClient, getDefaultLocationId, newTestMoney, newTestSquareTempId, newTestUuid } from "./helpers"; describe("Square Client Utils", () => { - let client: SquareClient = createClient(); + const client: SquareClient = createClient(); test("should generate a new UUID", () => { const uuid = newTestUuid(); diff --git a/tests/integration/customerGroups.test.ts b/tests/integration/customerGroups.test.ts index 14c14be88..fc4ffe719 100644 --- a/tests/integration/customerGroups.test.ts +++ b/tests/integration/customerGroups.test.ts @@ -1,4 +1,4 @@ -import { Square, SquareClient, SquareError } from "../../src"; +import { type Square, type SquareClient, SquareError } from "../../src"; import { createClient, newTestUuid } from "./helpers"; async function createTestCustomerGroup(client: SquareClient): Promise { diff --git a/tests/integration/customerSegments.test.ts b/tests/integration/customerSegments.test.ts index f73f7fe08..4e6a71965 100644 --- a/tests/integration/customerSegments.test.ts +++ b/tests/integration/customerSegments.test.ts @@ -1,4 +1,4 @@ -import { SquareClient } from "../../src"; +import type { SquareClient } from "../../src"; import { createClient } from "./helpers"; describe("CustomerSegments API", () => { diff --git a/tests/integration/customers.test.ts b/tests/integration/customers.test.ts index a79d90c22..17fb2e262 100644 --- a/tests/integration/customers.test.ts +++ b/tests/integration/customers.test.ts @@ -1,5 +1,5 @@ +import type { SquareClient } from "../../src"; import { createClient, createTestCustomer, newTestUuid } from "./helpers"; -import { Square, SquareClient } from "../../src"; describe("Customers API", () => { const client: SquareClient = createClient(); @@ -14,7 +14,7 @@ describe("Customers API", () => { name: `Test Group ${newTestUuid()}`, }, }); - customerGroupId = createGroupResponse.group!.id!; + customerGroupId = createGroupResponse.group?.id!; // Create custom attribute definition customAttributeKey = `favorite-drink-${newTestUuid()}`; @@ -72,7 +72,7 @@ describe("Customers API", () => { }); expect(createCardResponse.card).toBeDefined(); - const customerCardId = createCardResponse.card!.id!; + const customerCardId = createCardResponse.card?.id!; const deleteCardResponse = await client.customers.cards.delete({ customerId, diff --git a/tests/integration/devices.test.ts b/tests/integration/devices.test.ts index e4fe4a9fe..1ca634297 100644 --- a/tests/integration/devices.test.ts +++ b/tests/integration/devices.test.ts @@ -1,5 +1,5 @@ +import type { SquareClient } from "../../src"; import { createClient, newTestUuid } from "./helpers"; -import { Square, SquareClient } from "../../src"; describe("Devices API", () => { const client: SquareClient = createClient(); @@ -12,7 +12,7 @@ describe("Devices API", () => { productType: "TERMINAL_API", }, }); - deviceCodeId = createResponse.deviceCode!.id!; + deviceCodeId = createResponse.deviceCode?.id!; }); it("should list device codes", async () => { diff --git a/tests/integration/disputes.test.ts b/tests/integration/disputes.test.ts index 35944330b..10b8075ff 100644 --- a/tests/integration/disputes.test.ts +++ b/tests/integration/disputes.test.ts @@ -1,5 +1,5 @@ +import type { SquareClient } from "../../src"; import { createClient, getTestFile, newTestUuid } from "./helpers"; -import { SquareClient } from "../../src"; describe("Disputes API", () => { const client: SquareClient = createClient(); @@ -8,7 +8,7 @@ describe("Disputes API", () => { beforeAll(async () => { // Create a payment that will generate a dispute - const paymentsResp = await client.payments.create({ + const _paymentsResp = await client.payments.create({ idempotencyKey: newTestUuid(), autocomplete: true, sourceId: "cnon:card-nonce-ok", @@ -44,7 +44,7 @@ describe("Disputes API", () => { evidenceType: "GENERIC_EVIDENCE", evidenceText: "This is not a duplicate", }); - textEvidenceId = evidenceResponse.evidence!.id!; + textEvidenceId = evidenceResponse.evidence?.id!; }, 200_000); afterAll(async () => { @@ -54,7 +54,7 @@ describe("Disputes API", () => { disputeId, evidenceId: textEvidenceId, }); - } catch (error) { + } catch (_error) { // Evidence might already be deleted by test } }); diff --git a/tests/integration/helpers.ts b/tests/integration/helpers.ts index c343fbd4a..2e93f3ee7 100644 --- a/tests/integration/helpers.ts +++ b/tests/integration/helpers.ts @@ -59,7 +59,7 @@ export async function createLocation(client: SquareClient): Promise { name: `Test Location ${newTestUuid()}`, }, }); - return locationsResponse.location!.id!; + return locationsResponse.location?.id!; } export interface TestCatalogItemOptions { @@ -74,7 +74,7 @@ export interface TestCatalogItemOptions { export function createTestCatalogItem(opts: TestCatalogItemOptions = {}): Square.CatalogObject { const variation: Square.CatalogObject = { type: "ITEM_VARIATION", - id: "#" + newTestUuid(), + id: `#${newTestUuid()}`, presentAtAllLocations: true, itemVariationData: { name: opts.variationName || `Variation ${newTestUuid()}`, @@ -89,7 +89,7 @@ export function createTestCatalogItem(opts: TestCatalogItemOptions = {}): Square return { type: "ITEM", - id: "#" + newTestUuid(), + id: `#${newTestUuid()}`, presentAtAllLocations: true, itemData: { name: opts.name || `Item ${newTestUuid()}`, @@ -125,5 +125,5 @@ export async function createTestCustomer(client: SquareClient): Promise maxRetries: 5, timeoutInSeconds: 60, }); - return response.customer!.id!; + return response.customer?.id!; } diff --git a/tests/integration/inventory.serial.test.ts b/tests/integration/inventory.serial.test.ts index a636b5e6f..6cffae124 100644 --- a/tests/integration/inventory.serial.test.ts +++ b/tests/integration/inventory.serial.test.ts @@ -1,4 +1,4 @@ -import { Square, SquareClient } from "../../src"; +import type { Square, SquareClient } from "../../src"; import { createClient, newTestUuid } from "./helpers"; describe("Inventory API", () => { @@ -11,7 +11,7 @@ describe("Inventory API", () => { beforeAll(async () => { // Get the first location const locationResponse = await client.locations.list(); - locationId = locationResponse.locations![0].id!; + locationId = locationResponse.locations?.[0].id!; // Create catalog item with variation const catalogResponse = await client.catalog.object.upsert({ @@ -43,11 +43,11 @@ describe("Inventory API", () => { }, }, }); - itemVariationId = (catalogResponse.catalogObject as Square.CatalogObject.Item).itemData!.variations![0].id!; + itemVariationId = (catalogResponse.catalogObject as Square.CatalogObject.Item).itemData?.variations?.[0].id!; // Create initial inventory adjustment const eightHours = 1000 * 60 * 60 * 8; - const inventoryResponse = await client.inventory.batchCreateChanges({ + const _inventoryResponse = await client.inventory.batchCreateChanges({ idempotencyKey: newTestUuid(), changes: [ { @@ -70,10 +70,10 @@ describe("Inventory API", () => { catalogObjectIds: [itemVariationId], locationIds: [locationId], }); - inventoryAdjustId = changesResponse.data![0].adjustment!.id!; + inventoryAdjustId = changesResponse.data?.[0].adjustment?.id!; // Create physical count - const physicalCountResponse = await client.inventory.batchCreateChanges({ + const _physicalCountResponse = await client.inventory.batchCreateChanges({ idempotencyKey: newTestUuid(), changes: [ { @@ -94,7 +94,7 @@ describe("Inventory API", () => { catalogObjectIds: [itemVariationId], locationIds: [locationId], }); - physicalCountId = physicalChangesResponse.data![0].physicalCount!.id!; + physicalCountId = physicalChangesResponse.data?.[0].physicalCount?.id!; }, 30000); // Set a hook timeout of 30 seconds it("should retrieve inventory changes", async () => { diff --git a/tests/integration/invoices.test.ts b/tests/integration/invoices.test.ts index e27aa1e8b..8a43e7724 100644 --- a/tests/integration/invoices.test.ts +++ b/tests/integration/invoices.test.ts @@ -1,5 +1,5 @@ +import type { SquareClient } from "../../src"; import { createClient, newTestUuid } from "./helpers"; -import { Square, SquareClient } from "../../src"; describe("Invoices API", () => { const client: SquareClient = createClient(); @@ -12,7 +12,7 @@ describe("Invoices API", () => { beforeAll(async () => { // Get first location const locationResponse = await client.locations.list(); - locationId = locationResponse.locations![0].id!; + locationId = locationResponse.locations?.[0].id!; // Create test order const orderResponse = await client.orders.create({ @@ -31,7 +31,7 @@ describe("Invoices API", () => { ], }, }); - orderId = orderResponse.order!.id!; + orderId = orderResponse.order?.id!; // Create test customer const customerResponse = await client.customers.create({ @@ -49,7 +49,7 @@ describe("Invoices API", () => { country: "US", }, }); - customerId = customerResponse.customer!.id!; + customerId = customerResponse.customer?.id!; // Create test invoice const invoiceResponse = await client.invoices.create({ @@ -77,8 +77,8 @@ describe("Invoices API", () => { }, }, }); - invoiceId = invoiceResponse.invoice!.id!; - paymentRequestUid = invoiceResponse.invoice!.paymentRequests![0].uid!; + invoiceId = invoiceResponse.invoice?.id!; + paymentRequestUid = invoiceResponse.invoice?.paymentRequests?.[0].uid!; expect(invoiceResponse.invoice).toEqual( expect.objectContaining({ @@ -219,7 +219,7 @@ describe("Invoices API", () => { title: "Brand New Invoice", description: "A Blank Invoice", locationId: locationId, - orderId: orderResponse.order!.id!, + orderId: orderResponse.order?.id!, paymentRequests: [ { requestMethod: "SHARE_MANUALLY", @@ -236,7 +236,7 @@ describe("Invoices API", () => { }); const response = await client.invoices.delete({ - invoiceId: invoiceResponse.invoice!.id!, + invoiceId: invoiceResponse.invoice?.id!, version: 0, }); diff --git a/tests/integration/labor.test.ts b/tests/integration/labor.test.ts index 825353101..736e45a19 100644 --- a/tests/integration/labor.test.ts +++ b/tests/integration/labor.test.ts @@ -1,8 +1,8 @@ +import type { SquareClient } from "../../src"; import { createClient } from "./helpers"; -import { SquareClient } from "../../src"; function formatDateString(date: Date): string { - return date.toISOString().slice(0, 19) + "Z"; + return `${date.toISOString().slice(0, 19)}Z`; } describe("Labor API", () => { @@ -70,7 +70,7 @@ describe("Labor API", () => { await client.labor.shifts.delete({ id: shiftId, }); - } catch (e) { + } catch (_e) { // Test may have already deleted the shift } @@ -78,7 +78,7 @@ describe("Labor API", () => { await client.labor.breakTypes.delete({ id: breakId, }); - } catch (e) { + } catch (_e) { // Test may have already deleted the break } }); @@ -198,7 +198,7 @@ describe("Labor API", () => { } // Add a small delay to ensure the shift is fully created - await new Promise(resolve => setTimeout(resolve, 1000)); + await new Promise((resolve) => setTimeout(resolve, 1000)); const response = await client.labor.shifts.delete({ id: shiftResponse.shift.id, @@ -230,4 +230,4 @@ describe("Labor API", () => { expect(response.data).toBeDefined(); expect(response.data?.length).toBeGreaterThan(0); }); -}); \ No newline at end of file +}); diff --git a/tests/integration/legacy.test.ts b/tests/integration/legacy.test.ts index 1fd18e65d..30e076156 100644 --- a/tests/integration/legacy.test.ts +++ b/tests/integration/legacy.test.ts @@ -1,4 +1,4 @@ -import { Client } from "../../legacy/exports"; +import type { Client } from "../../legacy/exports"; import { createLegacyClient } from "./helpers"; describe("Legacy SDK", () => { diff --git a/tests/integration/merchants.test.ts b/tests/integration/merchants.test.ts index 9fb9f67f5..716e74eae 100644 --- a/tests/integration/merchants.test.ts +++ b/tests/integration/merchants.test.ts @@ -1,5 +1,5 @@ +import type { SquareClient } from "../../src"; import { createClient } from "./helpers"; -import { SquareClient } from "../../src"; describe("Merchants API", () => { const client: SquareClient = createClient(); @@ -8,7 +8,7 @@ describe("Merchants API", () => { beforeAll(async () => { // Get first merchant ID const merchantResponse = await client.merchants.list(); - merchantId = merchantResponse.data![0].id!; + merchantId = merchantResponse.data?.[0].id!; }); it("should list merchants", async () => { diff --git a/tests/integration/mobileAuthorization.test.ts b/tests/integration/mobileAuthorization.test.ts index a65f969f0..5b1814813 100644 --- a/tests/integration/mobileAuthorization.test.ts +++ b/tests/integration/mobileAuthorization.test.ts @@ -1,5 +1,5 @@ +import type { SquareClient } from "../../src"; import { createClient, getDefaultLocationId } from "./helpers"; -import { SquareClient } from "../../src"; describe("MobileAuthorization API", () => { const client: SquareClient = createClient(); diff --git a/tests/integration/orders.test.ts b/tests/integration/orders.test.ts index 02bef8eb3..62af1edc8 100644 --- a/tests/integration/orders.test.ts +++ b/tests/integration/orders.test.ts @@ -1,4 +1,4 @@ -import { SquareClient } from "../../src"; +import type { SquareClient } from "../../src"; import { createClient, getDefaultLocationId, newTestUuid } from "./helpers"; describe("Orders API", () => { @@ -28,8 +28,8 @@ describe("Orders API", () => { }, }); - orderId = orderResponse.order!.id!; - lineItemUid = orderResponse.order!.lineItems![0].uid!; + orderId = orderResponse.order?.id!; + lineItemUid = orderResponse.order?.lineItems?.[0].uid!; }); it("should create order", async () => { diff --git a/tests/integration/pagination.serial.test.ts b/tests/integration/pagination.serial.test.ts index ea99a3e55..4138f853e 100644 --- a/tests/integration/pagination.serial.test.ts +++ b/tests/integration/pagination.serial.test.ts @@ -1,14 +1,9 @@ -import { Customers } from "../../src/api/resources/customers/client/Client"; -import { Catalog } from "../../src/api/resources/catalog/client/Client"; -import { - createClient, - createTestCatalogItem, - createTestCustomer, - newTestUuid, -} from "./helpers"; +import type { Catalog } from "../../src/api/resources/catalog/client/Client"; +import type { Customers } from "../../src/api/resources/customers/client/Client"; +import { createClient, createTestCatalogItem, createTestCustomer, newTestUuid } from "./helpers"; // Add a sleep helper function -const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); +const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); type TestClient = Customers | Catalog; @@ -127,27 +122,23 @@ describe("Pagination", () => { } testCases.forEach(({ name, client, limit, perPage, greaterThan, setup }) => { - it( - name, - async () => { - let params: Record = { limit: perPage }; - if (setup) { - await setup(); - } + it(name, async () => { + const params: Record = { limit: perPage }; + if (setup) { + await setup(); + } - // Add delay between iterator and pager tests - const iteratorCount = await testIterator({ client, limit, params: { ...params } }); - await sleep(2000); // Wait 2 seconds between major operations - const pagerCount = await testPager({ client, limit, params: { ...params } }); + // Add delay between iterator and pager tests + const iteratorCount = await testIterator({ client, limit, params: { ...params } }); + await sleep(2000); // Wait 2 seconds between major operations + const pagerCount = await testPager({ client, limit, params: { ...params } }); - expect(iteratorCount).toBeGreaterThan(greaterThan); - expect(pagerCount).toBeGreaterThan(greaterThan); + expect(iteratorCount).toBeGreaterThan(greaterThan); + expect(pagerCount).toBeGreaterThan(greaterThan); - if (perPage != null) { - expect(pagerCount).toEqual(iteratorCount); - } - }, - 60_000, - ); + if (perPage != null) { + expect(pagerCount).toEqual(iteratorCount); + } + }, 120_000); }); -}); \ No newline at end of file +}); diff --git a/tests/integration/payments.test.ts b/tests/integration/payments.test.ts index 864392c56..01f7515ba 100644 --- a/tests/integration/payments.test.ts +++ b/tests/integration/payments.test.ts @@ -1,13 +1,13 @@ +import type { SquareClient } from "../../src"; import { createClient, getDefaultLocationId, newTestUuid } from "./helpers"; -import { SquareClient } from "../../src"; describe("Payments API", () => { const client: SquareClient = createClient(); let paymentId: string; - let locationId: string; + let _locationId: string; beforeAll(async () => { - locationId = await getDefaultLocationId(client); + _locationId = await getDefaultLocationId(client); // Create initial payment for testing const paymentResponse = await client.payments.create({ @@ -23,7 +23,7 @@ describe("Payments API", () => { }, autocomplete: false, }); - paymentId = paymentResponse.payment!.id!; + paymentId = paymentResponse.payment?.id!; }); it("should list payments", async () => { @@ -116,7 +116,7 @@ describe("Payments API", () => { }); const response = await client.payments.complete({ - paymentId: createResponse.payment!.id!, + paymentId: createResponse.payment?.id!, }); expect(response.payment).toBeDefined(); diff --git a/tests/integration/refunds.test.ts b/tests/integration/refunds.test.ts index c140197cc..686365cb3 100644 --- a/tests/integration/refunds.test.ts +++ b/tests/integration/refunds.test.ts @@ -1,5 +1,5 @@ +import { type SquareClient, SquareError } from "../../src"; import { createClient, newTestUuid } from "./helpers"; -import { SquareClient, SquareError } from "../../src"; describe("Refunds API", () => { const client: SquareClient = createClient(); @@ -21,7 +21,7 @@ describe("Refunds API", () => { }, autocomplete: true, }); - paymentId = paymentResponse.payment!.id!; + paymentId = paymentResponse.payment?.id!; // Create initial refund for testing const refundResponse = await client.refunds.refundPayment({ @@ -32,7 +32,7 @@ describe("Refunds API", () => { currency: "USD", }, }); - refundId = refundResponse.refund!.id!; + refundId = refundResponse.refund?.id!; }); it("should list payment refunds", async () => { @@ -60,7 +60,7 @@ describe("Refunds API", () => { const response = await client.refunds.refundPayment({ idempotencyKey: newTestUuid(), - paymentId: paymentResponse.payment!.id!, + paymentId: paymentResponse.payment?.id!, amountMoney: { amount: BigInt(200), currency: "USD", @@ -68,7 +68,7 @@ describe("Refunds API", () => { }); expect(response.refund).toBeDefined(); - expect(response.refund?.paymentId).toBe(paymentResponse.payment!.id); + expect(response.refund?.paymentId).toBe(paymentResponse.payment?.id); }); it("should get payment refund", async () => { diff --git a/tests/integration/teamMembers.test.ts b/tests/integration/teamMembers.test.ts index 476e352cc..38a2f47d9 100644 --- a/tests/integration/teamMembers.test.ts +++ b/tests/integration/teamMembers.test.ts @@ -1,5 +1,5 @@ +import type { SquareClient } from "../../src"; import { createClient, newTestUuid } from "./helpers"; -import { SquareClient } from "../../src"; describe("Team members API", () => { const client: SquareClient = createClient(); @@ -15,7 +15,7 @@ describe("Team members API", () => { familyName: "Holmes", }, }); - memberId = memberResponse.teamMember!.id!; + memberId = memberResponse.teamMember?.id!; // Create bulk team members for testing const bulkResponse = await client.teamMembers.batchCreate({ @@ -35,7 +35,7 @@ describe("Team members API", () => { }, }); - bulkMemberIds = Object.values(bulkResponse.teamMembers!).map((result) => result.teamMember!.id!); + bulkMemberIds = Object.values(bulkResponse.teamMembers!).map((result) => result.teamMember?.id!); }); it("should search team members", async () => { @@ -80,7 +80,7 @@ describe("Team members API", () => { }); it("should update team member", async () => { - const response = await client.teamMembers.update({ + const _response = await client.teamMembers.update({ teamMemberId: memberId, // TODO: check if we can flatter this body: { diff --git a/tests/integration/teams.test.ts b/tests/integration/teams.test.ts index a5c47293f..f5c8c063a 100644 --- a/tests/integration/teams.test.ts +++ b/tests/integration/teams.test.ts @@ -1,5 +1,5 @@ +import type { Square, SquareClient } from "../../src"; import { createClient, newTestUuid } from "./helpers"; -import { Square, SquareClient } from "../../src"; describe("Teams API", () => { const client: SquareClient = createClient(); @@ -62,8 +62,8 @@ describe("Teams API", () => { expect(member1Errors).toBeUndefined(); expect(member2Errors).toBeUndefined(); expect(member3Errors).toBeDefined(); - expect(member3Errors![0].code).toBe("INVALID_VALUE"); - expect(member3Errors![0].detail).toBe("Expected the assigned_locations.location_ids to be valid"); + expect(member3Errors?.[0].code).toBe("INVALID_VALUE"); + expect(member3Errors?.[0].detail).toBe("Expected the assigned_locations.location_ids to be valid"); }); }); diff --git a/tests/integration/terminal.test.ts b/tests/integration/terminal.test.ts index 536b97af6..e121fa2b1 100644 --- a/tests/integration/terminal.test.ts +++ b/tests/integration/terminal.test.ts @@ -1,5 +1,5 @@ +import type { SquareClient } from "../../src"; import { createClient, newTestUuid } from "./helpers"; -import { SquareClient } from "../../src"; describe("Terminal API", () => { const client: SquareClient = createClient(); @@ -20,7 +20,7 @@ describe("Terminal API", () => { }, }, }); - checkoutId = checkoutResponse.checkout!.id!; + checkoutId = checkoutResponse.checkout?.id!; }); it("should create terminal checkout", async () => { diff --git a/tests/integration/webhooks.test.ts b/tests/integration/webhooks.test.ts index f4bf82852..07952e831 100644 --- a/tests/integration/webhooks.test.ts +++ b/tests/integration/webhooks.test.ts @@ -1,129 +1,136 @@ import { WebhooksHelper } from "../../src"; -describe('Test webhooks signature validation', () => { - const requestBody = '{"merchant_id":"MLEFBHHSJGVHD","type":"webhooks.test_notification","event_id":"ac3ac95b-f97d-458c-a6e6-18981597e05f","created_at":"2022-07-13T20:30:59.037339943Z","data":{"type":"webhooks","id":"bc368e64-01aa-407e-b46e-3231809b1129"}}'; +describe("Test webhooks signature validation", () => { + const requestBody = + '{"merchant_id":"MLEFBHHSJGVHD","type":"webhooks.test_notification","event_id":"ac3ac95b-f97d-458c-a6e6-18981597e05f","created_at":"2022-07-13T20:30:59.037339943Z","data":{"type":"webhooks","id":"bc368e64-01aa-407e-b46e-3231809b1129"}}'; - const signatureHeader = 'GF4YkrJgGBDZ9NIYbNXBnMzqb2HoL4RW/S6vkZ9/2N4='; + const signatureHeader = "GF4YkrJgGBDZ9NIYbNXBnMzqb2HoL4RW/S6vkZ9/2N4="; - const signatureKey = 'Ibxx_5AKakO-3qeNVR61Dw'; + const signatureKey = "Ibxx_5AKakO-3qeNVR61Dw"; - const notificationUrl = 'https://webhook.site/679a4f3a-dcfa-49ee-bac5-9d0edad886b9'; + const notificationUrl = "https://webhook.site/679a4f3a-dcfa-49ee-bac5-9d0edad886b9"; - test('test signature validation pass', async () => { + test("test signature validation pass", async () => { const isValid = await WebhooksHelper.verifySignature({ requestBody, signatureHeader, signatureKey, - notificationUrl + notificationUrl, }); expect(isValid).toBe(true); }); - test('test signature unescaped chars validation pass', async () => { - const url = "https://webhook.site/webhooks" - const sigKey = 'signature-key'; + test("test signature unescaped chars validation pass", async () => { + const url = "https://webhook.site/webhooks"; + const sigKey = "signature-key"; const specialCharacterBody = '{"data":{"type":"webhooks","id":"fake_id"}}'; - const expectedSignatureHeader = 'W3FlCNk5IA3ZQ2LHTWoajvzfaDu/OwY2tNHIHC3IUOA='; + const expectedSignatureHeader = "W3FlCNk5IA3ZQ2LHTWoajvzfaDu/OwY2tNHIHC3IUOA="; const isValid = await WebhooksHelper.verifySignature({ requestBody: specialCharacterBody, signatureHeader: expectedSignatureHeader, signatureKey: sigKey, - notificationUrl: url + notificationUrl: url, }); expect(isValid).toBe(true); }); - test('test signature with escaped characters', async () => { - const url = "https://webhook.site/webhooks" - const sigKey = 'signature-key'; + test("test signature with escaped characters", async () => { + const url = "https://webhook.site/webhooks"; + const sigKey = "signature-key"; const specialCharacterBody = '{"data":{"type":"webhooks","id":">id<"}}'; - const expectedSignatureHeader = 'Cxt7+aTi4rKgcA0bC4g9EHdVtLSDWdqccmL5MvihU4U='; + const expectedSignatureHeader = "Cxt7+aTi4rKgcA0bC4g9EHdVtLSDWdqccmL5MvihU4U="; const isValid = await WebhooksHelper.verifySignature({ requestBody: specialCharacterBody, signatureHeader: expectedSignatureHeader, signatureKey: sigKey, - notificationUrl: url + notificationUrl: url, }); expect(isValid).toBe(true); }); - test('test signature validation fails on notification url mismatch', async () => { + test("test signature validation fails on notification url mismatch", async () => { const isValid = await WebhooksHelper.verifySignature({ requestBody, signatureHeader, signatureKey, - notificationUrl: 'https://webhook.site/79a4f3a-dcfa-49ee-bac5-9d0edad886b9' + notificationUrl: "https://webhook.site/79a4f3a-dcfa-49ee-bac5-9d0edad886b9", }); expect(isValid).toBe(false); }); - test('test signature validation fails on invalid signature key', async () => { + test("test signature validation fails on invalid signature key", async () => { const isValid = await WebhooksHelper.verifySignature({ requestBody, signatureHeader, - signatureKey: 'MCmhFRxGX82xMwg5FsaoQA', - notificationUrl + signatureKey: "MCmhFRxGX82xMwg5FsaoQA", + notificationUrl, }); expect(isValid).toBe(false); }); - test('test signature validation fails on invalida signature header', async () => { + test("test signature validation fails on invalida signature header", async () => { const isValid = await WebhooksHelper.verifySignature({ requestBody, - signatureHeader: '1z2n3DEJJiUPKcPzQo1ftvbxGdw=', + signatureHeader: "1z2n3DEJJiUPKcPzQo1ftvbxGdw=", signatureKey, - notificationUrl + notificationUrl, }); expect(isValid).toBe(false); }); - test('test signature validation fails on request body mismatch', async () => { + test("test signature validation fails on request body mismatch", async () => { const isValid = await WebhooksHelper.verifySignature({ - requestBody: '{"merchant_id":"MLEFBHHSJGVHD","type":"webhooks.test_notification","event_id":"ac3ac95b-f97d-458c-a6e6-18981597e05f","created_at":"2022-06-13T20:30:59.037339943Z","data":{"type":"webhooks","id":"bc368e64-01aa-407e-b46e-3231809b1129"}}', + requestBody: + '{"merchant_id":"MLEFBHHSJGVHD","type":"webhooks.test_notification","event_id":"ac3ac95b-f97d-458c-a6e6-18981597e05f","created_at":"2022-06-13T20:30:59.037339943Z","data":{"type":"webhooks","id":"bc368e64-01aa-407e-b46e-3231809b1129"}}', signatureHeader, signatureKey, - notificationUrl + notificationUrl, }); expect(isValid).toBe(false); }); - test('test signature validation fails on request body formatted', async () => { - let requestBody = '{\n' - + ' "merchant_id": "MLEFBHHSJGVHD",\n' - + ' "type": "webhooks.test_notification",\n' - + ' "event_id": "ac3ac95b-f97d-458c-a6e6-18981597e05f",\n' - + ' "created_at": "2022-07-13T20:30:59.037339943Z",\n' - + ' "data": {\n' - + ' "type": "webhooks",\n' - + ' "id": "bc368e64-01aa-407e-b46e-3231809b1129"\n' - + ' }\n' - + '}'; + test("test signature validation fails on request body formatted", async () => { + const requestBody = + "{\n" + + ' "merchant_id": "MLEFBHHSJGVHD",\n' + + ' "type": "webhooks.test_notification",\n' + + ' "event_id": "ac3ac95b-f97d-458c-a6e6-18981597e05f",\n' + + ' "created_at": "2022-07-13T20:30:59.037339943Z",\n' + + ' "data": {\n' + + ' "type": "webhooks",\n' + + ' "id": "bc368e64-01aa-407e-b46e-3231809b1129"\n' + + " }\n" + + "}"; const isValid = await WebhooksHelper.verifySignature({ requestBody, signatureHeader, signatureKey, - notificationUrl + notificationUrl, }); expect(isValid).toBe(false); }); - it('throws an error on empty signature key', () => { - return expect(WebhooksHelper.verifySignature({ - requestBody, - signatureHeader, - signatureKey: '', - notificationUrl - })).rejects.toThrow('signatureKey is null or empty'); + it("throws an error on empty signature key", () => { + return expect( + WebhooksHelper.verifySignature({ + requestBody, + signatureHeader, + signatureKey: "", + notificationUrl, + }), + ).rejects.toThrow("signatureKey is null or empty"); }); - it('throws error on empty notification url', () => { - return expect(WebhooksHelper.verifySignature({ - requestBody, - signatureHeader, - signatureKey, - notificationUrl: '' - })).rejects.toThrow('notificationUrl is null or empty'); + it("throws error on empty notification url", () => { + return expect( + WebhooksHelper.verifySignature({ + requestBody, + signatureHeader, + signatureKey, + notificationUrl: "", + }), + ).rejects.toThrow("notificationUrl is null or empty"); }); -}); \ No newline at end of file +}); diff --git a/tests/mock-server/MockServer.ts b/tests/mock-server/MockServer.ts index 6e258f172..5b30fe7cc 100644 --- a/tests/mock-server/MockServer.ts +++ b/tests/mock-server/MockServer.ts @@ -1,4 +1,4 @@ -import { RequestHandlerOptions } from "msw"; +import type { RequestHandlerOptions } from "msw"; import type { SetupServer } from "msw/node"; import { mockEndpointBuilder } from "./mockEndpointBuilder"; diff --git a/tests/mock-server/MockServerPool.ts b/tests/mock-server/MockServerPool.ts index 81608069e..e1a90f7fb 100644 --- a/tests/mock-server/MockServerPool.ts +++ b/tests/mock-server/MockServerPool.ts @@ -22,7 +22,7 @@ async function formatHttpRequest(request: Request, id?: string): Promise } else if (clone.body) { body = await clone.text(); } - } catch (e) { + } catch (_e) { body = "(unable to parse body)"; } @@ -48,7 +48,7 @@ async function formatHttpResponse(response: Response, id?: string): Promise { const formattedRequest = await formatHttpRequest(request, requestId); - console.debug("request:start\n" + formattedRequest); + console.debug(`request:start\n${formattedRequest}`); }); mswServer.events.on("request:unhandled", async ({ request, requestId }) => { const formattedRequest = await formatHttpRequest(request, requestId); - console.debug("request:unhandled\n" + formattedRequest); + console.debug(`request:unhandled\n${formattedRequest}`); }); mswServer.events.on("response:mocked", async ({ request, response, requestId }) => { const formattedResponse = await formatHttpResponse(response, requestId); - console.debug("response:mocked\n" + formattedResponse); + console.debug(`response:mocked\n${formattedResponse}`); }); } } diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts index 390b22568..18557ec14 100644 --- a/tests/mock-server/mockEndpointBuilder.ts +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -1,5 +1,6 @@ -import { DefaultBodyType, HttpHandler, HttpResponse, HttpResponseResolver, http } from "msw"; +import { type DefaultBodyType, type HttpHandler, HttpResponse, type HttpResponseResolver, http } from "msw"; +import { url } from "../../src/core"; import { toJson } from "../../src/core/json"; import { withHeaders } from "./withHeaders"; import { withJson } from "./withJson"; @@ -127,28 +128,25 @@ class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodySta } jsonBody(body: unknown): ResponseStage { + if (body === undefined) { + throw new Error("Undefined is not valid JSON. Do not call jsonBody if you want an empty body."); + } this.predicates.push((resolver) => withJson(body, resolver)); return this; } respondWith(): ResponseStatusStage { - return new ResponseBuilder(this.method, this.buildPath(), this.predicates, this.handlerOptions); + return new ResponseBuilder(this.method, this.buildUrl(), this.predicates, this.handlerOptions); } - private buildPath(): string { - if (this._baseUrl.endsWith("/") && this.path.startsWith("/")) { - return this._baseUrl + this.path.slice(1); - } - if (!this._baseUrl.endsWith("/") && !this.path.startsWith("/")) { - return this._baseUrl + "/" + this.path; - } - return this._baseUrl + this.path; + private buildUrl(): string { + return url.join(this._baseUrl, this.path); } } class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, ResponseBodyStage, BuildStage { private readonly method: HttpMethod; - private readonly path: string; + private readonly url: string; private readonly requestPredicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[]; private readonly handlerOptions?: HttpHandlerBuilderOptions; @@ -158,12 +156,12 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo constructor( method: HttpMethod, - path: string, + url: string, requestPredicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[], options?: HttpHandlerBuilderOptions, ) { this.method = method; - this.path = path; + this.url = url; this.requestPredicates = requestPredicates; this.handlerOptions = options; } @@ -184,21 +182,29 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo } public jsonBody(body: unknown): BuildStage { + if (body === undefined) { + throw new Error("Undefined is not valid JSON. Do not call jsonBody if you expect an empty body."); + } this.responseBody = toJson(body); return this; } public build(): HttpHandler { const responseResolver: HttpResponseResolver = () => { - return new HttpResponse(this.responseBody, { + const response = new HttpResponse(this.responseBody, { status: this.responseStatusCode, headers: this.responseHeaders, }); + // if no Content-Type header is set, delete the default text content type that is set + if (Object.keys(this.responseHeaders).some((key) => key.toLowerCase() === "content-type") === false) { + response.headers.delete("Content-Type"); + } + return response; }; const finalResolver = this.requestPredicates.reduceRight((acc, predicate) => predicate(acc), responseResolver); - const handler = http[this.method](this.path, finalResolver, this.handlerOptions); + const handler = http[this.method](this.url, finalResolver, this.handlerOptions); this.handlerOptions?.onBuild?.(handler); return handler; } diff --git a/tests/mock-server/withHeaders.ts b/tests/mock-server/withHeaders.ts index e77c837d9..6599d2b4a 100644 --- a/tests/mock-server/withHeaders.ts +++ b/tests/mock-server/withHeaders.ts @@ -1,4 +1,4 @@ -import { HttpResponseResolver, passthrough } from "msw"; +import { type HttpResponseResolver, passthrough } from "msw"; /** * Creates a request matcher that validates if request headers match specified criteria diff --git a/tests/mock-server/withJson.ts b/tests/mock-server/withJson.ts index 44e3eb832..b627638b0 100644 --- a/tests/mock-server/withJson.ts +++ b/tests/mock-server/withJson.ts @@ -1,4 +1,4 @@ -import { HttpResponseResolver, passthrough } from "msw"; +import { type HttpResponseResolver, passthrough } from "msw"; import { fromJson, toJson } from "../../src/core/json"; @@ -12,17 +12,23 @@ export function withJson(expectedBody: unknown, resolver: HttpResponseResolver): const { request } = args; let clonedRequest: Request; + let bodyText: string | undefined; let actualBody: unknown; try { clonedRequest = request.clone(); - actualBody = fromJson(await clonedRequest.text()); + bodyText = await clonedRequest.text(); + if (bodyText === "") { + console.error("Request body is empty, expected a JSON object."); + return passthrough(); + } + actualBody = fromJson(bodyText); } catch (error) { - console.error("Error processing request body:", error); + console.error(`Error processing request body:\n\tError: ${error}\n\tBody: ${bodyText}`); return passthrough(); } const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).length > 0) { + if (Object.keys(mismatches).filter((key) => !key.startsWith("pagination.")).length > 0) { console.error("JSON body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } @@ -61,7 +67,7 @@ function findMismatches(actual: any, expected: any): Record 0) { for (const [mismatchKey, mismatchValue] of Object.entries(itemMismatches)) { - arrayMismatches[`[${i}]${mismatchKey === "value" ? "" : "." + mismatchKey}`] = mismatchValue; + arrayMismatches[`[${i}]${mismatchKey === "value" ? "" : `.${mismatchKey}`}`] = mismatchValue; } } } @@ -93,7 +99,7 @@ function findMismatches(actual: any, expected: any): Record 0) { for (const [nestedKey, nestedValue] of Object.entries(nestedMismatches)) { - mismatches[`${key}${nestedKey === "value" ? "" : "." + nestedKey}`] = nestedValue; + mismatches[`${key}${nestedKey === "value" ? "" : `.${nestedKey}`}`] = nestedValue; } } } else if (actual[key] !== expected[key]) { diff --git a/tests/tsconfig.json b/tests/tsconfig.json index 10185ed2e..fe83070d2 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.base.json", + "extends": "../tsconfig.json", "compilerOptions": { "outDir": null, "rootDir": "..", diff --git a/tests/unit/auth/BasicAuth.test.ts b/tests/unit/auth/BasicAuth.test.ts index 79ef97993..90bbc7ee9 100644 --- a/tests/unit/auth/BasicAuth.test.ts +++ b/tests/unit/auth/BasicAuth.test.ts @@ -18,5 +18,41 @@ describe("BasicAuth", () => { password: "password", }); }); + + it("handles password with colons", () => { + expect(BasicAuth.fromAuthorizationHeader("Basic dXNlcjpwYXNzOndvcmQ=")).toEqual({ + username: "user", + password: "pass:word", + }); + }); + + it("handles empty username and password (just colon)", () => { + expect(BasicAuth.fromAuthorizationHeader("Basic Og==")).toEqual({ + username: "", + password: "", + }); + }); + + it("handles empty username", () => { + expect(BasicAuth.fromAuthorizationHeader("Basic OnBhc3N3b3Jk")).toEqual({ + username: "", + password: "password", + }); + }); + + it("handles empty password", () => { + expect(BasicAuth.fromAuthorizationHeader("Basic dXNlcm5hbWU6")).toEqual({ + username: "username", + password: "", + }); + }); + + it("throws error for completely empty credentials", () => { + expect(() => BasicAuth.fromAuthorizationHeader("Basic ")).toThrow("Invalid basic auth"); + }); + + it("throws error for credentials without colon", () => { + expect(() => BasicAuth.fromAuthorizationHeader("Basic dXNlcm5hbWU=")).toThrow("Invalid basic auth"); + }); }); }); diff --git a/tests/unit/error.test.ts b/tests/unit/error.test.ts index 5af64cc9f..f94225da2 100644 --- a/tests/unit/error.test.ts +++ b/tests/unit/error.test.ts @@ -1,82 +1,84 @@ import { SquareError } from "../../src/errors/SquareError"; describe("SquareError", () => { - it("creates error with message only", () => { - const error = new SquareError({ message: "Test error" }); - expect(error.message).toBe("Test error"); - expect(error.statusCode).toBeUndefined(); - expect(error.body).toBeUndefined(); - expect(error.errors).toHaveLength(1); - expect(error.errors[0].code).toBe(SquareError.ErrorCode.Unknown); - }); + it("creates error with message only", () => { + const error = new SquareError({ message: "Test error" }); + expect(error.message).toBe("Test error"); + expect(error.statusCode).toBeUndefined(); + expect(error.body).toBeUndefined(); + expect(error.errors).toHaveLength(1); + expect(error.errors[0].code).toBe(SquareError.ErrorCode.Unknown); + }); - it("creates error with status code", () => { - const error = new SquareError({ message: "Test error", statusCode: 400 }); - expect(error.message).toContain("Test error"); - expect(error.message).toContain("Status code: 400"); - expect(error.statusCode).toBe(400); - }); + it("creates error with status code", () => { + const error = new SquareError({ message: "Test error", statusCode: 400 }); + expect(error.message).toContain("Test error"); + expect(error.message).toContain("Status code: 400"); + expect(error.statusCode).toBe(400); + }); - it("creates error with body", () => { - const body = { foo: "bar" }; - const error = new SquareError({ body }); - expect(error.message).toContain('{\n "foo": "bar"\n}'); - expect(error.body).toEqual(body); - }); + it("creates error with body", () => { + const body = { foo: "bar" }; + const error = new SquareError({ body }); + expect(error.message).toContain('{\n "foo": "bar"\n}'); + expect(error.body).toEqual(body); + }); - it("handles Square API v2 errors", () => { - const body = { - errors: [{ - category: SquareError.ErrorCategory.ApiError, - code: SquareError.ErrorCode.BadRequest, - detail: "Invalid input", - field: "email" - }] - }; + it("handles Square API v2 errors", () => { + const body = { + errors: [ + { + category: SquareError.ErrorCategory.ApiError, + code: SquareError.ErrorCode.BadRequest, + detail: "Invalid input", + field: "email", + }, + ], + }; - const error = new SquareError({ body }); - expect(error.errors).toEqual(body.errors); - expect(error.errors[0].category).toBe(SquareError.ErrorCategory.ApiError); - expect(error.errors[0].code).toBe(SquareError.ErrorCode.BadRequest); - }); + const error = new SquareError({ body }); + expect(error.errors).toEqual(body.errors); + expect(error.errors[0].category).toBe(SquareError.ErrorCategory.ApiError); + expect(error.errors[0].code).toBe(SquareError.ErrorCode.BadRequest); + }); - it("handles Square API v1 errors", () => { - const body = { - type: "INVALID_REQUEST", - message: "Invalid field value", - field: "customer_id" - }; + it("handles Square API v1 errors", () => { + const body = { + type: "INVALID_REQUEST", + message: "Invalid field value", + field: "customer_id", + }; - const error = new SquareError({ body }); - expect(error.errors).toHaveLength(1); - expect(error.errors[0]).toEqual({ - category: SquareError.ErrorCategory.V1Error, - code: "INVALID_REQUEST", - detail: "Invalid field value", - field: "customer_id" + const error = new SquareError({ body }); + expect(error.errors).toHaveLength(1); + expect(error.errors[0]).toEqual({ + category: SquareError.ErrorCategory.V1Error, + code: "INVALID_REQUEST", + detail: "Invalid field value", + field: "customer_id", + }); }); - }); - it("handles v1 errors with missing type", () => { - const body = { - message: "Invalid field value", - field: "customer_id" - }; + it("handles v1 errors with missing type", () => { + const body = { + message: "Invalid field value", + field: "customer_id", + }; - const error = new SquareError({ body }); - expect(error.errors).toHaveLength(1); - expect(error.errors[0].code).toBe(SquareError.ErrorCode.Unknown); - }); - - it("combines all information in message", () => { - const error = new SquareError({ - message: "API Error", - statusCode: 400, - body: { errors: [{ detail: "Invalid input" }] } + const error = new SquareError({ body }); + expect(error.errors).toHaveLength(1); + expect(error.errors[0].code).toBe(SquareError.ErrorCode.Unknown); }); - expect(error.message).toContain("API Error"); - expect(error.message).toContain("Status code: 400"); - expect(error.message).toContain("Invalid input"); - }); + it("combines all information in message", () => { + const error = new SquareError({ + message: "API Error", + statusCode: 400, + body: { errors: [{ detail: "Invalid input" }] }, + }); + + expect(error.message).toContain("API Error"); + expect(error.message).toContain("Status code: 400"); + expect(error.message).toContain("Invalid input"); + }); }); diff --git a/tests/unit/fetcher/Fetcher.test.ts b/tests/unit/fetcher/Fetcher.test.ts index 847c018bc..ae608ac14 100644 --- a/tests/unit/fetcher/Fetcher.test.ts +++ b/tests/unit/fetcher/Fetcher.test.ts @@ -1,9 +1,6 @@ import fs from "fs"; -import stream from "stream"; import { join } from "path"; - -import { Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; -import { BinaryResponse } from "../../../src/core"; +import { type Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; describe("Test fetcherImpl", () => { it("should handle successful request", async () => { diff --git a/tests/unit/fetcher/HttpResponsePromise.test.ts b/tests/unit/fetcher/HttpResponsePromise.test.ts index 2216a33e1..c063b079b 100644 --- a/tests/unit/fetcher/HttpResponsePromise.test.ts +++ b/tests/unit/fetcher/HttpResponsePromise.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, jest } from "@jest/globals"; import { HttpResponsePromise } from "../../../src/core/fetcher/HttpResponsePromise"; -import { RawResponse, WithRawResponse } from "../../../src/core/fetcher/RawResponse"; +import type { RawResponse, WithRawResponse } from "../../../src/core/fetcher/RawResponse"; describe("HttpResponsePromise", () => { const mockRawResponse: RawResponse = { diff --git a/tests/unit/fetcher/getFetchFn.test.ts b/tests/unit/fetcher/getFetchFn.test.ts index b55dbbc35..ac05ab2fb 100644 --- a/tests/unit/fetcher/getFetchFn.test.ts +++ b/tests/unit/fetcher/getFetchFn.test.ts @@ -3,7 +3,7 @@ import { RUNTIME } from "../../../src/core/runtime"; describe("Test for getFetchFn", () => { it("should get node-fetch function", async () => { - if (RUNTIME.type == "node") { + if (RUNTIME.type === "node") { if (RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { expect(await getFetchFn()).toBe(fetch); } else { @@ -13,7 +13,7 @@ describe("Test for getFetchFn", () => { }); it("should get fetch function", async () => { - if (RUNTIME.type == "browser") { + if (RUNTIME.type === "browser") { const fetchFn = await getFetchFn(); expect(typeof fetchFn).toBe("function"); expect(fetchFn.name).toBe("fetch"); diff --git a/tests/unit/fetcher/getResponseBody.test.ts b/tests/unit/fetcher/getResponseBody.test.ts index 17ef223c1..ad6bc5bea 100644 --- a/tests/unit/fetcher/getResponseBody.test.ts +++ b/tests/unit/fetcher/getResponseBody.test.ts @@ -1,7 +1,6 @@ -import { RUNTIME } from "../../../src/core/runtime"; import { getResponseBody } from "../../../src/core/fetcher/getResponseBody"; - import { chooseStreamWrapper } from "../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; +import { RUNTIME } from "../../../src/core/runtime"; describe("Test getResponseBody", () => { it("should handle blob response type", async () => { diff --git a/tests/unit/fetcher/requestWithRetries.test.ts b/tests/unit/fetcher/requestWithRetries.test.ts index 3cdaa40a5..6f9426fcb 100644 --- a/tests/unit/fetcher/requestWithRetries.test.ts +++ b/tests/unit/fetcher/requestWithRetries.test.ts @@ -129,4 +129,107 @@ describe("requestWithRetries", () => { expect(response1.status).toBe(200); expect(response2.status).toBe(200); }); + + it("should respect retry-after header with seconds value", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce( + new Response("", { + status: 429, + headers: new Headers({ "retry-after": "5" }), + }), + ) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 1); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 5000); // 5 seconds = 5000ms + expect(response.status).toBe(200); + }); + + it("should respect retry-after header with HTTP date value", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + const futureDate = new Date(Date.now() + 3000); // 3 seconds from now + mockFetch + .mockResolvedValueOnce( + new Response("", { + status: 429, + headers: new Headers({ "retry-after": futureDate.toUTCString() }), + }), + ) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 1); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + // Should use the date-based delay (approximately 3000ms, but with jitter) + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), expect.any(Number)); + const actualDelay = setTimeoutSpy.mock.calls[0][1]; + expect(actualDelay).toBeGreaterThan(2000); + expect(actualDelay).toBeLessThan(4000); + expect(response.status).toBe(200); + }); + + it("should respect x-ratelimit-reset header", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + const resetTime = Math.floor((Date.now() + 4000) / 1000); // 4 seconds from now in Unix timestamp + mockFetch + .mockResolvedValueOnce( + new Response("", { + status: 429, + headers: new Headers({ "x-ratelimit-reset": resetTime.toString() }), + }), + ) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 1); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + // Should use the x-ratelimit-reset delay (approximately 4000ms, but with positive jitter) + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), expect.any(Number)); + const actualDelay = setTimeoutSpy.mock.calls[0][1]; + expect(actualDelay).toBeGreaterThan(3000); + expect(actualDelay).toBeLessThan(6000); + expect(response.status).toBe(200); + }); + + it("should cap delay at MAX_RETRY_DELAY for large header values", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce( + new Response("", { + status: 429, + headers: new Headers({ "retry-after": "120" }), // 120 seconds = 120000ms > MAX_RETRY_DELAY (60000ms) + }), + ) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 1); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + // Should be capped at MAX_RETRY_DELAY (60000ms) with jitter applied + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 60000); // Exactly MAX_RETRY_DELAY since jitter with 0.5 random keeps it at 60000 + expect(response.status).toBe(200); + }); }); diff --git a/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts index 172c1c26b..57892e4d9 100644 --- a/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts @@ -61,7 +61,7 @@ describe("Node18UniversalStreamWrapper", () => { }); const stream = new Node18UniversalStreamWrapper(rawStream); const dest = new (await import("readable-stream")).Writable({ - write(chunk, encoding, callback) { + write(chunk, _encoding, callback) { expect(chunk.toString()).toEqual("test"); callback(); }, diff --git a/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts index 19c26668e..f47b166c2 100644 --- a/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts @@ -37,7 +37,7 @@ describe("NodePre18StreamWrapper", () => { const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const dest = new (await import("readable-stream")).Writable({ - write(chunk, encoding, callback) { + write(chunk, _encoding, callback) { expect(chunk.toString()).toEqual("test"); callback(); }, @@ -51,7 +51,7 @@ describe("NodePre18StreamWrapper", () => { const stream = new NodePre18StreamWrapper(rawStream); const buffer: Uint8Array[] = []; const dest = new (await import("readable-stream")).Writable({ - write(chunk, encoding, callback) { + write(chunk, _encoding, callback) { buffer.push(chunk); callback(); }, diff --git a/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts index 5752c8af5..56cba3462 100644 --- a/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts @@ -1,7 +1,7 @@ +import { chooseStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; import { Node18UniversalStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper"; import { NodePre18StreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/NodePre18StreamWrapper"; import { UndiciStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/UndiciStreamWrapper"; -import { chooseStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; import { RUNTIME } from "../../../../src/core/runtime"; describe("chooseStreamWrapper", () => { diff --git a/tests/unit/file/file.test.ts b/tests/unit/file/file.test.ts new file mode 100644 index 000000000..51a8bc463 --- /dev/null +++ b/tests/unit/file/file.test.ts @@ -0,0 +1,498 @@ +import fs from "fs"; +import { join } from "path"; +import { Readable } from "stream"; +import { toBinaryUploadRequest, type Uploadable } from "../../../src/core/file/index"; + +describe("toBinaryUploadRequest", () => { + const TEST_FILE_PATH = join(__dirname, "..", "test-file.txt"); + + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe("Buffer input", () => { + it("should handle Buffer with all metadata", async () => { + const buffer = Buffer.from("test data"); + const input: Uploadable.WithMetadata = { + data: buffer, + filename: "test.txt", + contentType: "text/plain", + contentLength: 42, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="test.txt"', + "Content-Type": "text/plain", + "Content-Length": "42", + }); + }); + + it("should handle Buffer without metadata", async () => { + const buffer = Buffer.from("test data"); + const input: Uploadable.WithMetadata = { + data: buffer, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Length": "9", // buffer.length + }); + }); + + it("should handle Buffer passed directly", async () => { + const buffer = Buffer.from("test data"); + + const result = await toBinaryUploadRequest(buffer); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Length": "9", // buffer.length + }); + }); + }); + + describe("ArrayBuffer input", () => { + it("should handle ArrayBuffer with metadata", async () => { + const arrayBuffer = new ArrayBuffer(10); + const input: Uploadable.WithMetadata = { + data: arrayBuffer, + filename: "data.bin", + contentType: "application/octet-stream", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(arrayBuffer); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="data.bin"', + "Content-Type": "application/octet-stream", + "Content-Length": "10", // arrayBuffer.byteLength + }); + }); + + it("should handle ArrayBuffer passed directly", async () => { + const arrayBuffer = new ArrayBuffer(10); + + const result = await toBinaryUploadRequest(arrayBuffer); + + expect(result.body).toBe(arrayBuffer); + expect(result.headers).toEqual({ + "Content-Length": "10", // arrayBuffer.byteLength + }); + }); + }); + + describe("Uint8Array input", () => { + it("should handle Uint8Array with metadata", async () => { + const uint8Array = new Uint8Array([1, 2, 3, 4, 5]); + const input: Uploadable.WithMetadata = { + data: uint8Array, + filename: "bytes.bin", + contentType: "application/octet-stream", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(uint8Array); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="bytes.bin"', + "Content-Type": "application/octet-stream", + "Content-Length": "5", // uint8Array.byteLength + }); + }); + + it("should handle Uint8Array passed directly", async () => { + const uint8Array = new Uint8Array([1, 2, 3, 4, 5]); + + const result = await toBinaryUploadRequest(uint8Array); + + expect(result.body).toBe(uint8Array); + expect(result.headers).toEqual({ + "Content-Length": "5", // uint8Array.byteLength + }); + }); + }); + + describe("Blob input", () => { + it("should handle Blob with metadata", async () => { + const blob = new Blob(["test content"], { type: "text/plain" }); + const input: Uploadable.WithMetadata = { + data: blob, + filename: "override.txt", + contentType: "text/html", // Override blob's type + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(blob); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="override.txt"', + "Content-Type": "text/html", // Should use provided contentType + "Content-Length": "12", // blob.size + }); + }); + + it("should handle Blob with intrinsic type", async () => { + const blob = new Blob(["test content"], { type: "application/json" }); + const input: Uploadable.WithMetadata = { + data: blob, + filename: "data.json", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(blob); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="data.json"', + "Content-Type": "application/json", // Should use blob's type + "Content-Length": "12", // blob.size + }); + }); + + it("should handle Blob passed directly", async () => { + const blob = new Blob(["test content"], { type: "text/plain" }); + + const result = await toBinaryUploadRequest(blob); + + expect(result.body).toBe(blob); + expect(result.headers).toEqual({ + "Content-Type": "text/plain", // Should use blob's type + "Content-Length": "12", // blob.size + }); + }); + }); + + describe("File input", () => { + it("should handle File with metadata", async () => { + const file = new File(["file content"], "original.txt", { type: "text/plain" }); + const input: Uploadable.WithMetadata = { + data: file, + filename: "renamed.txt", + contentType: "text/html", // Override file's type + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(file); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="renamed.txt"', + "Content-Type": "text/html", // Should use provided contentType + "Content-Length": "12", // file.size + }); + }); + + it("should handle File with intrinsic properties", async () => { + const file = new File(["file content"], "test.json", { type: "application/json" }); + const input: Uploadable.WithMetadata = { + data: file, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(file); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="test.json"', // Should use file's name + "Content-Type": "application/json", // Should use file's type + "Content-Length": "12", // file.size + }); + }); + + it("should handle File passed directly", async () => { + const file = new File(["file content"], "direct.txt", { type: "text/plain" }); + + const result = await toBinaryUploadRequest(file); + + expect(result.body).toBe(file); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="direct.txt"', + "Content-Type": "text/plain", + "Content-Length": "12", // file.size + }); + }); + }); + + describe("ReadableStream input", () => { + it("should handle ReadableStream with metadata", async () => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode("stream data")); + controller.close(); + }, + }); + const input: Uploadable.WithMetadata = { + data: stream, + filename: "stream.txt", + contentType: "text/plain", + contentLength: 100, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(stream); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="stream.txt"', + "Content-Type": "text/plain", + "Content-Length": "100", // Should use provided contentLength + }); + }); + + it("should handle ReadableStream without size", async () => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode("stream data")); + controller.close(); + }, + }); + const input: Uploadable.WithMetadata = { + data: stream, + filename: "stream.txt", + contentType: "text/plain", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(stream); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="stream.txt"', + "Content-Type": "text/plain", + // No Content-Length header since it cannot be determined from ReadableStream + }); + }); + + it("should handle ReadableStream passed directly", async () => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode("stream data")); + controller.close(); + }, + }); + + const result = await toBinaryUploadRequest(stream); + + expect(result.body).toBe(stream); + expect(result.headers).toEqual({ + // No headers since no metadata provided and cannot be determined + }); + }); + }); + + describe("Node.js Readable stream input", () => { + it("should handle Readable stream with metadata", async () => { + const readable = new Readable({ + read() { + this.push("readable data"); + this.push(null); + }, + }); + const input: Uploadable.WithMetadata = { + data: readable, + filename: "readable.txt", + contentType: "text/plain", + contentLength: 50, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(readable); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="readable.txt"', + "Content-Type": "text/plain", + "Content-Length": "50", // Should use provided contentLength + }); + }); + + it("should handle Readable stream without size", async () => { + const readable = new Readable({ + read() { + this.push("readable data"); + this.push(null); + }, + }); + const input: Uploadable.WithMetadata = { + data: readable, + filename: "readable.txt", + contentType: "text/plain", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(readable); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="readable.txt"', + "Content-Type": "text/plain", + // No Content-Length header since it cannot be determined from Readable + }); + }); + + it("should handle Readable stream passed directly", async () => { + const readable = new Readable({ + read() { + this.push("readable data"); + this.push(null); + }, + }); + + const result = await toBinaryUploadRequest(readable); + + expect(result.body).toBe(readable); + expect(result.headers).toEqual({ + // No headers since no metadata provided and cannot be determined + }); + }); + }); + + describe("File path input (FromPath type)", () => { + it("should handle file path with all metadata", async () => { + const input: Uploadable.FromPath = { + path: TEST_FILE_PATH, + filename: "custom.txt", + contentType: "text/html", + contentLength: 42, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBeInstanceOf(fs.ReadStream); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="custom.txt"', + "Content-Type": "text/html", + "Content-Length": "42", // Should use provided contentLength + }); + }); + + it("should handle file path with minimal metadata", async () => { + const input: Uploadable.FromPath = { + path: TEST_FILE_PATH, + contentType: "text/plain", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBeInstanceOf(fs.ReadStream); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path + "Content-Type": "text/plain", + "Content-Length": "21", // Should determine from file system (test file is 21 bytes) + }); + }); + + it("should handle file path with no metadata", async () => { + const input: Uploadable.FromPath = { + path: TEST_FILE_PATH, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBeInstanceOf(fs.ReadStream); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path + "Content-Length": "21", // Should determine from file system (test file is 21 bytes) + }); + }); + }); + + describe("ArrayBufferView input", () => { + it("should handle ArrayBufferView with metadata", async () => { + const arrayBuffer = new ArrayBuffer(10); + const arrayBufferView = new Int8Array(arrayBuffer); + const input: Uploadable.WithMetadata = { + data: arrayBufferView, + filename: "view.bin", + contentType: "application/octet-stream", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(arrayBufferView); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="view.bin"', + "Content-Type": "application/octet-stream", + "Content-Length": "10", // arrayBufferView.byteLength + }); + }); + + it("should handle ArrayBufferView passed directly", async () => { + const arrayBuffer = new ArrayBuffer(10); + const arrayBufferView = new Int8Array(arrayBuffer); + + const result = await toBinaryUploadRequest(arrayBufferView); + + expect(result.body).toBe(arrayBufferView); + expect(result.headers).toEqual({ + "Content-Length": "10", // arrayBufferView.byteLength + }); + }); + }); + + describe("Edge cases", () => { + it("should handle empty headers when no metadata is available", async () => { + const buffer = Buffer.from(""); + const input: Uploadable.WithMetadata = { + data: buffer, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Length": "0", + }); + }); + + it("should handle zero contentLength", async () => { + const buffer = Buffer.from("test"); + const input: Uploadable.WithMetadata = { + data: buffer, + contentLength: 0, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Length": "0", // Should use provided 0 + }); + }); + + it("should handle null filename", async () => { + const buffer = Buffer.from("test"); + const input: Uploadable.WithMetadata = { + data: buffer, + filename: undefined, + contentType: "text/plain", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Type": "text/plain", + "Content-Length": "4", + // No Content-Disposition since filename is undefined + }); + }); + + it("should handle null contentType", async () => { + const buffer = Buffer.from("test"); + const input: Uploadable.WithMetadata = { + data: buffer, + filename: "test.txt", + contentType: undefined, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="test.txt"', + "Content-Length": "4", + // No Content-Type since contentType is undefined + }); + }); + }); +}); diff --git a/tests/unit/form-data-utils/formDataWrapper.test.ts b/tests/unit/form-data-utils/formDataWrapper.test.ts index 095a1055b..28c9f9bba 100644 --- a/tests/unit/form-data-utils/formDataWrapper.test.ts +++ b/tests/unit/form-data-utils/formDataWrapper.test.ts @@ -14,7 +14,10 @@ describe("CrossPlatformFormData", () => { const value = (await import("stream")).Readable.from(["file content"]); const filename = "testfile.txt"; - await formData.appendFile("file", value, filename); + await formData.appendFile("file", { + data: value, + filename, + }); const request = await formData.getRequest(); const decoder = new TextDecoder("utf-8"); @@ -29,7 +32,10 @@ describe("CrossPlatformFormData", () => { const value = new Blob(["file content"], { type: "text/plain" }); const filename = "testfile.txt"; - await formData.appendFile("file", value, filename); + await formData.appendFile("file", { + data: value, + filename, + }); const request = await formData.getRequest(); const decoder = new TextDecoder("utf-8"); @@ -44,7 +50,10 @@ describe("CrossPlatformFormData", () => { const filename = "testfile.txt"; const value = new (await import("buffer")).File(["file content"], filename); - await formData.appendFile("file", value); + await formData.appendFile("file", { + data: value, + filename, + }); const request = await formData.getRequest(); const decoder = new TextDecoder("utf-8"); @@ -59,7 +68,7 @@ describe("CrossPlatformFormData", () => { const filename = "testfile.txt"; const value = new (await import("buffer")).File(["file content"], filename); - await formData.appendFile("file", value, "test.txt"); + await formData.appendFile("file", { data: value, filename: "test.txt" }); const request = await formData.getRequest(); const decoder = new TextDecoder("utf-8"); @@ -83,7 +92,7 @@ describe("CrossPlatformFormData", () => { for await (const chunk of request.body) { data += decoder.decode(chunk); } - expect(data).toContain('Content-Disposition: form-data; name="file"; filename="' + expectedFileName + '"'); + expect(data).toContain(`Content-Disposition: form-data; name=\"file\"; filename=\"${expectedFileName}\"`); }); }); @@ -99,7 +108,10 @@ describe("CrossPlatformFormData", () => { const value = (await import("stream")).Readable.from(["file content"]); const filename = "testfile.txt"; - await formData.appendFile("file", value, filename); + await formData.appendFile("file", { + data: value, + filename, + }); const request = formData.getRequest(); expect(request.body.get("file").name).toBe(filename); @@ -109,7 +121,10 @@ describe("CrossPlatformFormData", () => { const value = new Blob(["file content"], { type: "text/plain" }); const filename = "testfile.txt"; - await formData.appendFile("file", value, filename); + await formData.appendFile("file", { + data: value, + filename, + }); const request = formData.getRequest(); @@ -130,7 +145,10 @@ describe("CrossPlatformFormData", () => { const filename = "testfile.txt"; const value = new (await import("buffer")).File(["file content"], filename); - await formData.appendFile("file", value, "test.txt"); + await formData.appendFile("file", { + data: value, + filename: "test.txt", + }); const request = formData.getRequest(); expect(request.body.get("file").name).toBe("test.txt"); diff --git a/tests/unit/schemas/lazy/lazy.test.ts b/tests/unit/schemas/lazy/lazy.test.ts index 3a5a338d6..57a76df27 100644 --- a/tests/unit/schemas/lazy/lazy.test.ts +++ b/tests/unit/schemas/lazy/lazy.test.ts @@ -1,5 +1,5 @@ -import { Schema } from "../../../../src/core/schemas/Schema"; import { lazy, list, object, string } from "../../../../src/core/schemas/builders"; +import type { Schema } from "../../../../src/core/schemas/Schema"; import { itSchemaIdentity } from "../utils/itSchema"; describe("lazy", () => { diff --git a/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts b/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts index 09d594d07..822c3ca4e 100644 --- a/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts +++ b/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts @@ -18,7 +18,7 @@ describe("getSchemaUtils", () => { itSchema( "transform and untransform run correctly", string().transform({ - transform: (x) => x + "X", + transform: (x) => `${x}X`, untransform: (x) => (x as string).slice(0, -1), }), { @@ -36,7 +36,7 @@ describe("getSchemaUtils", () => { it("throws on invalid value", async () => { const value = () => object({ a: string(), b: string() }).parseOrThrow({ a: 24 }); - expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); + expect(value).toThrowError('a: Expected string. Received 24.; Missing required key "b"'); }); }); @@ -48,7 +48,7 @@ describe("getSchemaUtils", () => { it("throws on invalid value", async () => { const value = () => object({ a: string(), b: string() }).jsonOrThrow({ a: 24 }); - expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); + expect(value).toThrowError('a: Expected string. Received 24.; Missing required key "b"'); }); }); diff --git a/tests/unit/schemas/utils/itSchema.ts b/tests/unit/schemas/utils/itSchema.ts index 82a538878..a1e1cae92 100644 --- a/tests/unit/schemas/utils/itSchema.ts +++ b/tests/unit/schemas/utils/itSchema.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/no-export */ -import { Schema, SchemaOptions } from "../../../../src/core/schemas/Schema"; +import type { Schema, SchemaOptions } from "../../../../src/core/schemas/Schema"; export function itSchemaIdentity( schema: Schema, @@ -48,7 +48,7 @@ export function itParse( it(title, () => { const maybeValid = schema.parse(raw, opts); if (!maybeValid.ok) { - throw new Error("Failed to parse() " + JSON.stringify(maybeValid.errors, undefined, 4)); + throw new Error(`Failed to parse() ${JSON.stringify(maybeValid.errors, undefined, 4)}`); } expect(maybeValid.value).toStrictEqual(parsed); }); @@ -71,7 +71,7 @@ export function itJson( it(title, () => { const maybeValid = schema.json(parsed, opts); if (!maybeValid.ok) { - throw new Error("Failed to json() " + JSON.stringify(maybeValid.errors, undefined, 4)); + throw new Error(`Failed to json() ${JSON.stringify(maybeValid.errors, undefined, 4)}`); } expect(maybeValid.value).toStrictEqual(raw); }); diff --git a/tests/unit/schemas/utils/itValidate.ts b/tests/unit/schemas/utils/itValidate.ts index ead1ca70b..ffe40cef9 100644 --- a/tests/unit/schemas/utils/itValidate.ts +++ b/tests/unit/schemas/utils/itValidate.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/no-export */ -import { Schema, SchemaOptions, ValidationError } from "../../../../src/core/schemas/Schema"; +import type { Schema, SchemaOptions, ValidationError } from "../../../../src/core/schemas/Schema"; export function itValidate( title: string, diff --git a/tests/unit/test-file.txt b/tests/unit/test-file.txt new file mode 100644 index 000000000..c66d471e3 --- /dev/null +++ b/tests/unit/test-file.txt @@ -0,0 +1 @@ +This is a test file! diff --git a/tests/unit/url/join.test.ts b/tests/unit/url/join.test.ts index 394628995..1956a8c07 100644 --- a/tests/unit/url/join.test.ts +++ b/tests/unit/url/join.test.ts @@ -16,14 +16,14 @@ describe("join", () => { it("should handle multiple segments", () => { expect(join("base", "path1", "path2", "path3")).toBe("base/path1/path2/path3"); - expect(join("base/", "/path1/", "/path2/", "/path3/")).toBe("base/path1/path2/path3"); + expect(join("base/", "/path1/", "/path2/", "/path3/")).toBe("base/path1/path2/path3/"); }); }); describe("URL handling", () => { it("should handle absolute URLs", () => { expect(join("https://example.com", "api", "v1")).toBe("https://example.com/api/v1"); - expect(join("https://example.com/", "/api/", "/v1/")).toBe("https://example.com/api/v1"); + expect(join("https://example.com/", "/api/", "/v1/")).toBe("https://example.com/api/v1/"); expect(join("https://example.com/base", "api", "v1")).toBe("https://example.com/base/api/v1"); }); @@ -90,7 +90,7 @@ describe("join", () => { it("should handle many segments efficiently", () => { const segments = Array(100).fill("segment"); const result = join("base", ...segments); - expect(result).toBe("base/" + segments.join("/")); + expect(result).toBe(`base/${segments.join("/")}`); }); it("should handle long URLs", () => { @@ -98,4 +98,23 @@ describe("join", () => { expect(join("https://example.com", longPath)).toBe(`https://example.com/${longPath}`); }); }); + + describe("trailing slash preservation", () => { + it("should preserve trailing slash on final result when base has trailing slash and no segments", () => { + expect(join("https://api.example.com/")).toBe("https://api.example.com/"); + expect(join("https://api.example.com/v1/")).toBe("https://api.example.com/v1/"); + }); + + it("should preserve trailing slash when last segment has trailing slash", () => { + expect(join("https://api.example.com", "users/")).toBe("https://api.example.com/users/"); + expect(join("api/v1", "users/")).toBe("api/v1/users/"); + }); + + it("should preserve trailing slash with multiple segments where last has trailing slash", () => { + expect(join("https://api.example.com", "v1", "collections/")).toBe( + "https://api.example.com/v1/collections/", + ); + expect(join("base", "path1", "path2/")).toBe("base/path1/path2/"); + }); + }); }); diff --git a/tests/wire/applePay.test.ts b/tests/wire/applePay.test.ts index 3db07c812..94ee62f35 100644 --- a/tests/wire/applePay.test.ts +++ b/tests/wire/applePay.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("ApplePay", () => { test("RegisterDomain", async () => { diff --git a/tests/wire/bankAccounts.test.ts b/tests/wire/bankAccounts.test.ts index 61e810ada..577761dac 100644 --- a/tests/wire/bankAccounts.test.ts +++ b/tests/wire/bankAccounts.test.ts @@ -1,11 +1,122 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("BankAccounts", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + bank_accounts: [ + { + id: "ao6iaQ9vhDiaQD7n3GB", + account_number_suffix: "971", + country: "US", + currency: "USD", + account_type: "CHECKING", + holder_name: "Jane Doe", + primary_bank_identification_number: "112200303", + secondary_bank_identification_number: "secondary_bank_identification_number", + debit_mandate_reference_id: "debit_mandate_reference_id", + reference_id: "reference_id", + location_id: "S8GWD5example", + status: "VERIFICATION_IN_PROGRESS", + creditable: false, + debitable: false, + fingerprint: "fingerprint", + version: 5, + bank_name: "Bank Name", + }, + { + id: "4x7WXuaxrkQkVlka3GB", + account_number_suffix: "972", + country: "US", + currency: "USD", + account_type: "CHECKING", + holder_name: "Jane Doe", + primary_bank_identification_number: "112200303", + secondary_bank_identification_number: "secondary_bank_identification_number", + debit_mandate_reference_id: "debit_mandate_reference_id", + reference_id: "reference_id", + location_id: "S8GWD5example", + status: "VERIFICATION_IN_PROGRESS", + creditable: false, + debitable: false, + fingerprint: "fingerprint", + version: 5, + bank_name: "Bank Name", + }, + ], + cursor: "cursor", + }; + server.mockEndpoint().get("/v2/bank-accounts").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + bankAccounts: [ + { + id: "ao6iaQ9vhDiaQD7n3GB", + accountNumberSuffix: "971", + country: "US", + currency: "USD", + accountType: "CHECKING", + holderName: "Jane Doe", + primaryBankIdentificationNumber: "112200303", + secondaryBankIdentificationNumber: "secondary_bank_identification_number", + debitMandateReferenceId: "debit_mandate_reference_id", + referenceId: "reference_id", + locationId: "S8GWD5example", + status: "VERIFICATION_IN_PROGRESS", + creditable: false, + debitable: false, + fingerprint: "fingerprint", + version: 5, + bankName: "Bank Name", + }, + { + id: "4x7WXuaxrkQkVlka3GB", + accountNumberSuffix: "972", + country: "US", + currency: "USD", + accountType: "CHECKING", + holderName: "Jane Doe", + primaryBankIdentificationNumber: "112200303", + secondaryBankIdentificationNumber: "secondary_bank_identification_number", + debitMandateReferenceId: "debit_mandate_reference_id", + referenceId: "reference_id", + locationId: "S8GWD5example", + status: "VERIFICATION_IN_PROGRESS", + creditable: false, + debitable: false, + fingerprint: "fingerprint", + version: 5, + bankName: "Bank Name", + }, + ], + cursor: "cursor", + }; + const page = await client.bankAccounts.list({ + cursor: "cursor", + limit: 1, + locationId: "location_id", + }); + + expect(expected.bankAccounts).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.bankAccounts).toEqual(nextPage.data); + }); + test("GetByV1Id", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/bookings.test.ts b/tests/wire/bookings.test.ts index 8c702a91e..e4149cea5 100644 --- a/tests/wire/bookings.test.ts +++ b/tests/wire/bookings.test.ts @@ -1,11 +1,96 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Bookings", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + bookings: [ + { + id: "zkras0xv0xwswx", + version: 1, + status: "ACCEPTED", + created_at: "2020-10-28T15:47:41Z", + updated_at: "2020-10-28T15:49:25Z", + start_at: "2020-11-26T13:00:00Z", + location_id: "LEQHH0YY8B42M", + customer_id: "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + customer_note: "", + seller_note: "", + appointment_segments: [ + { + duration_minutes: 60, + service_variation_id: "RU3PBTZTK7DXZDQFCJHOK2MC", + team_member_id: "TMXUrsBWWcHTt79t", + service_variation_version: BigInt(1599775456731), + }, + ], + transition_time_minutes: 1, + all_day: true, + location_type: "BUSINESS_LOCATION", + source: "FIRST_PARTY_MERCHANT", + }, + ], + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server.mockEndpoint().get("/v2/bookings").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + bookings: [ + { + id: "zkras0xv0xwswx", + version: 1, + status: "ACCEPTED", + createdAt: "2020-10-28T15:47:41Z", + updatedAt: "2020-10-28T15:49:25Z", + startAt: "2020-11-26T13:00:00Z", + locationId: "LEQHH0YY8B42M", + customerId: "EX2QSVGTZN4K1E5QE1CBFNVQ8M", + customerNote: "", + sellerNote: "", + appointmentSegments: [ + { + durationMinutes: 60, + serviceVariationId: "RU3PBTZTK7DXZDQFCJHOK2MC", + teamMemberId: "TMXUrsBWWcHTt79t", + serviceVariationVersion: BigInt("1599775456731"), + }, + ], + transitionTimeMinutes: 1, + allDay: true, + locationType: "BUSINESS_LOCATION", + source: "FIRST_PARTY_MERCHANT", + }, + ], + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.bookings.list({ + limit: 1, + cursor: "cursor", + customerId: "customer_id", + teamMemberId: "team_member_id", + locationId: "location_id", + startAtMin: "start_at_min", + startAtMax: "start_at_max", + }); + + expect(expected.bookings).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.bookings).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/bookings/customAttributeDefinitions.test.ts b/tests/wire/bookings/customAttributeDefinitions.test.ts index 97cadf0b2..f59a6bcd3 100644 --- a/tests/wire/bookings/customAttributeDefinitions.test.ts +++ b/tests/wire/bookings/customAttributeDefinitions.test.ts @@ -1,11 +1,99 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("CustomAttributeDefinitions", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + custom_attribute_definitions: [ + { + key: "favoriteShampoo", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + }, + name: "Favorite shampoo", + description: "Update the description as desired.", + visibility: "VISIBILITY_READ_ONLY", + version: 3, + updated_at: "2022-11-16T15:39:38Z", + created_at: "2022-11-16T15:27:30Z", + }, + { + key: "partySize", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", + }, + name: "Party size", + description: "Number of people in the party for dine-in", + visibility: "VISIBILITY_HIDDEN", + version: 1, + updated_at: "2022-11-16T15:49:05Z", + created_at: "2022-11-16T15:49:05Z", + }, + ], + cursor: "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/bookings/custom-attribute-definitions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + customAttributeDefinitions: [ + { + key: "favoriteShampoo", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + }, + name: "Favorite shampoo", + description: "Update the description as desired.", + visibility: "VISIBILITY_READ_ONLY", + version: 3, + updatedAt: "2022-11-16T15:39:38Z", + createdAt: "2022-11-16T15:27:30Z", + }, + { + key: "partySize", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", + }, + name: "Party size", + description: "Number of people in the party for dine-in", + visibility: "VISIBILITY_HIDDEN", + version: 1, + updatedAt: "2022-11-16T15:49:05Z", + createdAt: "2022-11-16T15:49:05Z", + }, + ], + cursor: "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.bookings.customAttributeDefinitions.list({ + limit: 1, + cursor: "cursor", + }); + + expect(expected.customAttributeDefinitions).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customAttributeDefinitions).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/bookings/customAttributes.test.ts b/tests/wire/bookings/customAttributes.test.ts index 602533cfe..bbcb06f2d 100644 --- a/tests/wire/bookings/customAttributes.test.ts +++ b/tests/wire/bookings/customAttributes.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("CustomAttributes", () => { test("batchDelete", async () => { @@ -270,6 +268,82 @@ describe("CustomAttributes", () => { }); }); + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + custom_attributes: [ + { + key: "favoriteShampoo", + value: "Hydro-Cool", + version: 1, + visibility: "VISIBILITY_READ_ONLY", + updated_at: "2022-11-16T15:50:27Z", + created_at: "2022-11-16T15:50:27Z", + }, + { + key: "hasShoes", + value: false, + version: 1, + visibility: "VISIBILITY_HIDDEN", + updated_at: "2022-11-16T15:51:53Z", + created_at: "2022-11-16T15:51:53Z", + }, + ], + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/bookings/booking_id/custom-attributes") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + customAttributes: [ + { + key: "favoriteShampoo", + value: "Hydro-Cool", + version: 1, + visibility: "VISIBILITY_READ_ONLY", + updatedAt: "2022-11-16T15:50:27Z", + createdAt: "2022-11-16T15:50:27Z", + }, + { + key: "hasShoes", + value: false, + version: 1, + visibility: "VISIBILITY_HIDDEN", + updatedAt: "2022-11-16T15:51:53Z", + createdAt: "2022-11-16T15:51:53Z", + }, + ], + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.bookings.customAttributes.list({ + bookingId: "booking_id", + limit: 1, + cursor: "cursor", + withDefinitions: true, + }); + + expect(expected.customAttributes).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customAttributes).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/bookings/locationProfiles.test.ts b/tests/wire/bookings/locationProfiles.test.ts new file mode 100644 index 000000000..889a8cf02 --- /dev/null +++ b/tests/wire/bookings/locationProfiles.test.ts @@ -0,0 +1,64 @@ +// This file was auto-generated by Fern from our API Definition. + +import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; + +describe("LocationProfiles", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + location_booking_profiles: [ + { + location_id: "LY6WNBPVM6VGV", + booking_site_url: "https://squareup.com/book/LY6WNBPVM6VGV/testbusiness", + online_booking_enabled: true, + }, + { location_id: "PYTRNBPVMJUPV", booking_site_url: "booking_site_url", online_booking_enabled: false }, + ], + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/bookings/location-booking-profiles") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + locationBookingProfiles: [ + { + locationId: "LY6WNBPVM6VGV", + bookingSiteUrl: "https://squareup.com/book/LY6WNBPVM6VGV/testbusiness", + onlineBookingEnabled: true, + }, + { + locationId: "PYTRNBPVMJUPV", + bookingSiteUrl: "booking_site_url", + onlineBookingEnabled: false, + }, + ], + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.bookings.locationProfiles.list({ + limit: 1, + cursor: "cursor", + }); + + expect(expected.locationBookingProfiles).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.locationBookingProfiles).toEqual(nextPage.data); + }); +}); diff --git a/tests/wire/bookings/teamMemberProfiles.test.ts b/tests/wire/bookings/teamMemberProfiles.test.ts index cb71bc88d..c9c482789 100644 --- a/tests/wire/bookings/teamMemberProfiles.test.ts +++ b/tests/wire/bookings/teamMemberProfiles.test.ts @@ -1,11 +1,81 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("TeamMemberProfiles", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + team_member_booking_profiles: [ + { + team_member_id: "TMXUrsBWWcHTt79t", + description: "description", + display_name: "Sandbox Seller", + is_bookable: true, + profile_image_url: "profile_image_url", + }, + { + team_member_id: "TMaJcbiRqPIGZuS9", + description: "description", + display_name: "Sandbox Staff", + is_bookable: true, + profile_image_url: "profile_image_url", + }, + ], + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/bookings/team-member-booking-profiles") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + teamMemberBookingProfiles: [ + { + teamMemberId: "TMXUrsBWWcHTt79t", + description: "description", + displayName: "Sandbox Seller", + isBookable: true, + profileImageUrl: "profile_image_url", + }, + { + teamMemberId: "TMaJcbiRqPIGZuS9", + description: "description", + displayName: "Sandbox Staff", + isBookable: true, + profileImageUrl: "profile_image_url", + }, + ], + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.bookings.teamMemberProfiles.list({ + bookableOnly: true, + limit: 1, + cursor: "cursor", + locationId: "location_id", + }); + + expect(expected.teamMemberBookingProfiles).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.teamMemberBookingProfiles).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/cards.test.ts b/tests/wire/cards.test.ts index 42ac023e4..91eb99a07 100644 --- a/tests/wire/cards.test.ts +++ b/tests/wire/cards.test.ts @@ -1,11 +1,106 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Cards", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + cards: [ + { + id: "ccof:uIbfJXhXETSP197M3GB", + card_brand: "VISA", + last_4: "1111", + exp_month: BigInt(11), + exp_year: BigInt(2022), + cardholder_name: "Amelia Earhart", + billing_address: { + address_line_1: "500 Electric Ave", + address_line_2: "Suite 600", + locality: "New York", + administrative_district_level_1: "NY", + postal_code: "10003", + country: "US", + }, + fingerprint: "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + customer_id: "VDKXEEKPJN48QDG3BGGFAK05P8", + merchant_id: "6SSW7HV8K2ST5", + reference_id: "user-id-1", + enabled: true, + card_type: "CREDIT", + prepaid_type: "NOT_PREPAID", + bin: "411111", + version: BigInt(1), + card_co_brand: "UNKNOWN", + issuer_alert: "ISSUER_ALERT_CARD_CLOSED", + issuer_alert_at: "issuer_alert_at", + hsa_fsa: false, + }, + ], + cursor: "cursor", + }; + server.mockEndpoint().get("/v2/cards").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + cards: [ + { + id: "ccof:uIbfJXhXETSP197M3GB", + cardBrand: "VISA", + last4: "1111", + expMonth: BigInt("11"), + expYear: BigInt("2022"), + cardholderName: "Amelia Earhart", + billingAddress: { + addressLine1: "500 Electric Ave", + addressLine2: "Suite 600", + locality: "New York", + administrativeDistrictLevel1: "NY", + postalCode: "10003", + country: "US", + }, + fingerprint: "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", + customerId: "VDKXEEKPJN48QDG3BGGFAK05P8", + merchantId: "6SSW7HV8K2ST5", + referenceId: "user-id-1", + enabled: true, + cardType: "CREDIT", + prepaidType: "NOT_PREPAID", + bin: "411111", + version: BigInt("1"), + cardCoBrand: "UNKNOWN", + issuerAlert: "ISSUER_ALERT_CARD_CLOSED", + issuerAlertAt: "issuer_alert_at", + hsaFsa: false, + }, + ], + cursor: "cursor", + }; + const page = await client.cards.list({ + cursor: "cursor", + customerId: "customer_id", + includeDisabled: true, + referenceId: "reference_id", + sortOrder: "DESC", + }); + + expect(expected.cards).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.cards).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/cashDrawers/shifts.test.ts b/tests/wire/cashDrawers/shifts.test.ts index fed14a578..99211ac11 100644 --- a/tests/wire/cashDrawers/shifts.test.ts +++ b/tests/wire/cashDrawers/shifts.test.ts @@ -1,11 +1,92 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Shifts", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + cash_drawer_shifts: [ + { + id: "DCC99978-09A6-4926-849F-300BE9C5793A", + state: "CLOSED", + opened_at: "2019-11-22T00:42:54.000Z", + ended_at: "2019-11-22T00:44:49.000Z", + closed_at: "2019-11-22T00:44:49.000Z", + description: "Misplaced some change", + opened_cash_money: { amount: BigInt(10000), currency: "USD" }, + expected_cash_money: { amount: BigInt(10000), currency: "USD" }, + closed_cash_money: { amount: BigInt(9970), currency: "USD" }, + created_at: "created_at", + updated_at: "updated_at", + location_id: "location_id", + }, + ], + }; + server + .mockEndpoint() + .get("/v2/cash-drawers/shifts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + cashDrawerShifts: [ + { + id: "DCC99978-09A6-4926-849F-300BE9C5793A", + state: "CLOSED", + openedAt: "2019-11-22T00:42:54.000Z", + endedAt: "2019-11-22T00:44:49.000Z", + closedAt: "2019-11-22T00:44:49.000Z", + description: "Misplaced some change", + openedCashMoney: { + amount: BigInt("10000"), + currency: "USD", + }, + expectedCashMoney: { + amount: BigInt("10000"), + currency: "USD", + }, + closedCashMoney: { + amount: BigInt("9970"), + currency: "USD", + }, + createdAt: "created_at", + updatedAt: "updated_at", + locationId: "location_id", + }, + ], + }; + const page = await client.cashDrawers.shifts.list({ + locationId: "location_id", + sortOrder: "DESC", + beginTime: "begin_time", + endTime: "end_time", + limit: 1, + cursor: "cursor", + }); + + expect(expected.cashDrawerShifts).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.cashDrawerShifts).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); @@ -106,4 +187,162 @@ describe("Shifts", () => { ], }); }); + + test("listEvents", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + cash_drawer_shift_events: [ + { + id: "9F07DB01-D85A-4B77-88C3-D5C64CEB5155", + event_type: "CASH_TENDER_PAYMENT", + event_money: { amount: BigInt(100), currency: "USD" }, + created_at: "2019-11-22T00:43:02.000Z", + description: "", + team_member_id: "", + }, + { + id: "B2854CEA-A781-49B3-8F31-C64558231F48", + event_type: "CASH_TENDER_PAYMENT", + event_money: { amount: BigInt(250), currency: "USD" }, + created_at: "2019-11-22T00:43:12.000Z", + description: "", + team_member_id: "", + }, + { + id: "B5FB7F72-95CD-44A3-974D-26C41064D042", + event_type: "CASH_TENDER_CANCELLED_PAYMENT", + event_money: { amount: BigInt(250), currency: "USD" }, + created_at: "2019-11-22T00:43:23.000Z", + description: "", + team_member_id: "", + }, + { + id: "0B425480-8504-40B4-A867-37B23543931B", + event_type: "CASH_TENDER_REFUND", + event_money: { amount: BigInt(100), currency: "USD" }, + created_at: "2019-11-22T00:43:46.000Z", + description: "", + team_member_id: "", + }, + { + id: "8C66E60E-FDCF-4EEF-A98D-3B14B7ED5CBE", + event_type: "PAID_IN", + event_money: { amount: BigInt(10000), currency: "USD" }, + created_at: "2019-11-22T00:44:18.000Z", + description: "Transfer from another drawer", + team_member_id: "", + }, + { + id: "D5ACA7FE-C64D-4ADA-8BC8-82118A2DAE4F", + event_type: "PAID_OUT", + event_money: { amount: BigInt(10000), currency: "USD" }, + created_at: "2019-11-22T00:44:29.000Z", + description: "Transfer out to another drawer", + team_member_id: "", + }, + ], + }; + server + .mockEndpoint() + .get("/v2/cash-drawers/shifts/shift_id/events") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + cashDrawerShiftEvents: [ + { + id: "9F07DB01-D85A-4B77-88C3-D5C64CEB5155", + eventType: "CASH_TENDER_PAYMENT", + eventMoney: { + amount: BigInt("100"), + currency: "USD", + }, + createdAt: "2019-11-22T00:43:02.000Z", + description: "", + teamMemberId: "", + }, + { + id: "B2854CEA-A781-49B3-8F31-C64558231F48", + eventType: "CASH_TENDER_PAYMENT", + eventMoney: { + amount: BigInt("250"), + currency: "USD", + }, + createdAt: "2019-11-22T00:43:12.000Z", + description: "", + teamMemberId: "", + }, + { + id: "B5FB7F72-95CD-44A3-974D-26C41064D042", + eventType: "CASH_TENDER_CANCELLED_PAYMENT", + eventMoney: { + amount: BigInt("250"), + currency: "USD", + }, + createdAt: "2019-11-22T00:43:23.000Z", + description: "", + teamMemberId: "", + }, + { + id: "0B425480-8504-40B4-A867-37B23543931B", + eventType: "CASH_TENDER_REFUND", + eventMoney: { + amount: BigInt("100"), + currency: "USD", + }, + createdAt: "2019-11-22T00:43:46.000Z", + description: "", + teamMemberId: "", + }, + { + id: "8C66E60E-FDCF-4EEF-A98D-3B14B7ED5CBE", + eventType: "PAID_IN", + eventMoney: { + amount: BigInt("10000"), + currency: "USD", + }, + createdAt: "2019-11-22T00:44:18.000Z", + description: "Transfer from another drawer", + teamMemberId: "", + }, + { + id: "D5ACA7FE-C64D-4ADA-8BC8-82118A2DAE4F", + eventType: "PAID_OUT", + eventMoney: { + amount: BigInt("10000"), + currency: "USD", + }, + createdAt: "2019-11-22T00:44:29.000Z", + description: "Transfer out to another drawer", + teamMemberId: "", + }, + ], + }; + const page = await client.cashDrawers.shifts.listEvents({ + shiftId: "shift_id", + locationId: "location_id", + limit: 1, + cursor: "cursor", + }); + + expect(expected.cashDrawerShiftEvents).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.cashDrawerShiftEvents).toEqual(nextPage.data); + }); }); diff --git a/tests/wire/catalog.test.ts b/tests/wire/catalog.test.ts index 1e3a5e102..f6c858091 100644 --- a/tests/wire/catalog.test.ts +++ b/tests/wire/catalog.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Catalog", () => { test("batchDelete", async () => { @@ -52,9 +50,10 @@ describe("Catalog", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], objects: [ { + type: "ITEM", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -62,12 +61,12 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "ITEM", }, { + type: "ITEM", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -75,14 +74,14 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "ITEM", }, ], related_objects: [ { + type: "CATEGORY", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -90,13 +89,13 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - ordinal: 1000000, - type: "CATEGORY", + ordinal: BigInt(1000000), }, { + type: "TAX", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -104,7 +103,6 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "TAX", }, ], }; @@ -206,10 +204,10 @@ describe("Catalog", () => { batches: [ { objects: [ - { id: "id", type: "ITEM" }, - { id: "id", type: "ITEM" }, - { id: "id", type: "ITEM" }, - { id: "id", type: "TAX" }, + { type: "ITEM", id: "id" }, + { type: "ITEM", id: "id" }, + { type: "ITEM", id: "id" }, + { type: "TAX", id: "id" }, ], }, ], @@ -218,9 +216,10 @@ describe("Catalog", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], objects: [ { + type: "ITEM", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -228,12 +227,12 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "ITEM", }, { + type: "ITEM", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -241,12 +240,12 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "ITEM", }, { + type: "CATEGORY", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -254,13 +253,13 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - ordinal: 1000000, - type: "CATEGORY", + ordinal: BigInt(1000000), }, { + type: "TAX", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -268,7 +267,6 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "TAX", }, ], updated_at: "updated_at", @@ -475,6 +473,101 @@ describe("Catalog", () => { }); }); + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + cursor: "cursor", + objects: [ + { + type: "CATEGORY", + id: "id", + updated_at: "updated_at", + version: BigInt(1000000), + is_deleted: true, + custom_attribute_values: { key: {} }, + catalog_v1_ids: [{}], + present_at_all_locations: true, + present_at_location_ids: ["present_at_location_ids"], + absent_at_location_ids: ["absent_at_location_ids"], + image_id: "image_id", + ordinal: BigInt(1000000), + }, + { + type: "TAX", + id: "id", + updated_at: "updated_at", + version: BigInt(1000000), + is_deleted: true, + custom_attribute_values: { key: {} }, + catalog_v1_ids: [{}], + present_at_all_locations: true, + present_at_location_ids: ["present_at_location_ids"], + absent_at_location_ids: ["absent_at_location_ids"], + image_id: "image_id", + }, + ], + }; + server.mockEndpoint().get("/v2/catalog/list").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + cursor: "cursor", + objects: [ + { + type: "CATEGORY", + id: "id", + updatedAt: "updated_at", + version: BigInt("1000000"), + isDeleted: true, + customAttributeValues: { + key: {}, + }, + catalogV1Ids: [{}], + presentAtAllLocations: true, + presentAtLocationIds: ["present_at_location_ids"], + absentAtLocationIds: ["absent_at_location_ids"], + imageId: "image_id", + ordinal: BigInt("1000000"), + }, + { + type: "TAX", + id: "id", + updatedAt: "updated_at", + version: BigInt("1000000"), + isDeleted: true, + customAttributeValues: { + key: {}, + }, + catalogV1Ids: [{}], + presentAtAllLocations: true, + presentAtLocationIds: ["present_at_location_ids"], + absentAtLocationIds: ["absent_at_location_ids"], + imageId: "image_id", + }, + ], + }; + const page = await client.catalog.list({ + cursor: "cursor", + types: "types", + catalogVersion: BigInt("1000000"), + }); + + expect(expected.objects).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.objects).toEqual(nextPage.data); + }); + test("search", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); @@ -488,9 +581,10 @@ describe("Catalog", () => { cursor: "cursor", objects: [ { + type: "ITEM", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -498,12 +592,12 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "ITEM", }, { + type: "ITEM", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -511,14 +605,14 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "ITEM", }, ], related_objects: [ { + type: "ITEM", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -526,7 +620,6 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "ITEM", }, ], latest_time: "latest_time", @@ -635,9 +728,10 @@ describe("Catalog", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], items: [ { + type: "ITEM", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -645,7 +739,6 @@ describe("Catalog", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "ITEM", }, ], cursor: "cursor", diff --git a/tests/wire/catalog/object.test.ts b/tests/wire/catalog/object.test.ts index 65945541d..90d0ccd9e 100644 --- a/tests/wire/catalog/object.test.ts +++ b/tests/wire/catalog/object.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Object_", () => { test("upsert", async () => { @@ -11,14 +9,15 @@ describe("Object_", () => { const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "af3d1afc-7212-4300-b463-0bfc5314a5ae", - object: { id: "id", type: "ITEM" }, + object: { type: "ITEM", id: "id" }, }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], catalog_object: { + type: "ITEM", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -48,7 +47,6 @@ describe("Object_", () => { is_archived: true, is_alcoholic: true, }, - type: "ITEM", }, id_mappings: [ { client_object_id: "#Cocoa", object_id: "R2TA2FOBUGCJZNIWJSOSNAI4" }, @@ -146,9 +144,10 @@ describe("Object_", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], object: { + type: "ITEM", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -178,13 +177,13 @@ describe("Object_", () => { is_archived: true, is_alcoholic: true, }, - type: "ITEM", }, related_objects: [ { + type: "CATEGORY", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -192,13 +191,13 @@ describe("Object_", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - ordinal: 1000000, - type: "CATEGORY", + ordinal: BigInt(1000000), }, { + type: "TAX", id: "id", updated_at: "updated_at", - version: 1000000, + version: BigInt(1000000), is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -206,7 +205,6 @@ describe("Object_", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - type: "TAX", }, ], }; diff --git a/tests/wire/channels.test.ts b/tests/wire/channels.test.ts index 0f46d1c35..95cf2b644 100644 --- a/tests/wire/channels.test.ts +++ b/tests/wire/channels.test.ts @@ -1,11 +1,71 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Channels", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + channels: [ + { + id: "CH_9C03D0B59", + merchant_id: "ML64FACEA", + name: "Contoso Fulfillment Application", + version: 1, + reference: { type: "OAUTH_APPLICATION", id: "OA_9C03D0444" }, + status: "ACTIVE", + created_at: "2022-10-25T16:27:00Z", + updated_at: "2022-10-25T16:48:00Z", + }, + ], + cursor: "cursor", + }; + server.mockEndpoint().get("/v2/channels").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + channels: [ + { + id: "CH_9C03D0B59", + merchantId: "ML64FACEA", + name: "Contoso Fulfillment Application", + version: 1, + reference: { + type: "OAUTH_APPLICATION", + id: "OA_9C03D0444", + }, + status: "ACTIVE", + createdAt: "2022-10-25T16:27:00Z", + updatedAt: "2022-10-25T16:48:00Z", + }, + ], + cursor: "cursor", + }; + const page = await client.channels.list({ + referenceType: "UNKNOWN_TYPE", + referenceId: "reference_id", + status: "ACTIVE", + cursor: "cursor", + limit: 1, + }); + + expect(expected.channels).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.channels).toEqual(nextPage.data); + }); + test("bulkRetrieve", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/checkout.test.ts b/tests/wire/checkout.test.ts index cc8b24538..66dc655c1 100644 --- a/tests/wire/checkout.test.ts +++ b/tests/wire/checkout.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Checkout", () => { test("RetrieveLocationSettings", async () => { diff --git a/tests/wire/checkout/paymentLinks.test.ts b/tests/wire/checkout/paymentLinks.test.ts index 8710b2721..39c788bc4 100644 --- a/tests/wire/checkout/paymentLinks.test.ts +++ b/tests/wire/checkout/paymentLinks.test.ts @@ -1,11 +1,99 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("PaymentLinks", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + payment_links: [ + { + id: "TN4BWEDJ9AI5MBIV", + version: 2, + description: "description", + order_id: "Qqc6yppGvxVwc46Cch4zHTaJqc4F", + checkout_options: { ask_for_shipping_address: true }, + url: "https://square.link/u/EXAMPLE", + long_url: "long_url", + created_at: "2022-04-26T00:15:15Z", + updated_at: "2022-04-26T00:18:24Z", + payment_note: "test", + }, + { + id: "RY5UNCUMPJN5XKCT", + version: 1, + description: "", + order_id: "EmBmGt3zJD15QeO1dxzBTxMxtwfZY", + url: "https://square.link/u/EXAMPLE", + long_url: "long_url", + created_at: "2022-04-11T23:14:59Z", + updated_at: "updated_at", + payment_note: "payment_note", + }, + ], + cursor: "MTY1NQ==", + }; + server + .mockEndpoint() + .get("/v2/online-checkout/payment-links") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + paymentLinks: [ + { + id: "TN4BWEDJ9AI5MBIV", + version: 2, + description: "description", + orderId: "Qqc6yppGvxVwc46Cch4zHTaJqc4F", + checkoutOptions: { + askForShippingAddress: true, + }, + url: "https://square.link/u/EXAMPLE", + longUrl: "long_url", + createdAt: "2022-04-26T00:15:15Z", + updatedAt: "2022-04-26T00:18:24Z", + paymentNote: "test", + }, + { + id: "RY5UNCUMPJN5XKCT", + version: 1, + description: "", + orderId: "EmBmGt3zJD15QeO1dxzBTxMxtwfZY", + url: "https://square.link/u/EXAMPLE", + longUrl: "long_url", + createdAt: "2022-04-11T23:14:59Z", + updatedAt: "updated_at", + paymentNote: "payment_note", + }, + ], + cursor: "MTY1NQ==", + }; + const page = await client.checkout.paymentLinks.list({ + cursor: "cursor", + limit: 1, + }); + + expect(expected.paymentLinks).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.paymentLinks).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); @@ -81,7 +169,7 @@ describe("PaymentLinks", () => { total_service_charge_money: { amount: BigInt(0), currency: "USD" }, }, ], - subscription_plans: [{ id: "id", type: "ITEM" }], + subscription_plans: [{ type: "ITEM", id: "id" }], }, }; server diff --git a/tests/wire/customers.test.ts b/tests/wire/customers.test.ts index ecd022c26..e54ed867f 100644 --- a/tests/wire/customers.test.ts +++ b/tests/wire/customers.test.ts @@ -1,11 +1,106 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Customers", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + customers: [ + { + id: "JDKYHBWT1D4F8MFH63DBMEN8Y4", + created_at: "2016-03-23T20:21:54.859Z", + updated_at: "2016-03-23T20:21:55Z", + given_name: "Amelia", + family_name: "Earhart", + nickname: "nickname", + company_name: "company_name", + email_address: "Amelia.Earhart@example.com", + address: { + address_line_1: "500 Electric Ave", + address_line_2: "Suite 600", + locality: "New York", + administrative_district_level_1: "NY", + postal_code: "10003", + country: "US", + }, + phone_number: "+1-212-555-4240", + birthday: "birthday", + reference_id: "YOUR_REFERENCE_ID", + note: "a customer", + preferences: { email_unsubscribed: false }, + creation_source: "THIRD_PARTY", + group_ids: ["545AXB44B4XXWMVQ4W8SBT3HHF"], + segment_ids: ["1KB9JE5EGJXCW.REACHABLE"], + version: BigInt(1), + }, + ], + cursor: "cursor", + count: BigInt(1000000), + }; + server.mockEndpoint().get("/v2/customers").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + customers: [ + { + id: "JDKYHBWT1D4F8MFH63DBMEN8Y4", + createdAt: "2016-03-23T20:21:54.859Z", + updatedAt: "2016-03-23T20:21:55Z", + givenName: "Amelia", + familyName: "Earhart", + nickname: "nickname", + companyName: "company_name", + emailAddress: "Amelia.Earhart@example.com", + address: { + addressLine1: "500 Electric Ave", + addressLine2: "Suite 600", + locality: "New York", + administrativeDistrictLevel1: "NY", + postalCode: "10003", + country: "US", + }, + phoneNumber: "+1-212-555-4240", + birthday: "birthday", + referenceId: "YOUR_REFERENCE_ID", + note: "a customer", + preferences: { + emailUnsubscribed: false, + }, + creationSource: "THIRD_PARTY", + groupIds: ["545AXB44B4XXWMVQ4W8SBT3HHF"], + segmentIds: ["1KB9JE5EGJXCW.REACHABLE"], + version: BigInt("1"), + }, + ], + cursor: "cursor", + count: BigInt("1000000"), + }; + const page = await client.customers.list({ + cursor: "cursor", + limit: 1, + sortField: "DEFAULT", + sortOrder: "DESC", + count: true, + }); + + expect(expected.customers).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customers).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/customers/cards.test.ts b/tests/wire/customers/cards.test.ts index 0f8e33d61..bb2581147 100644 --- a/tests/wire/customers/cards.test.ts +++ b/tests/wire/customers/cards.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Cards", () => { test("create", async () => { diff --git a/tests/wire/customers/customAttributeDefinitions.test.ts b/tests/wire/customers/customAttributeDefinitions.test.ts index d6a45aafd..9784876a9 100644 --- a/tests/wire/customers/customAttributeDefinitions.test.ts +++ b/tests/wire/customers/customAttributeDefinitions.test.ts @@ -1,11 +1,99 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("CustomAttributeDefinitions", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + custom_attribute_definitions: [ + { + key: "favoritemovie", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + }, + name: "Favorite Movie", + description: "Update the description as desired.", + visibility: "VISIBILITY_READ_ONLY", + version: 3, + updated_at: "2022-04-26T15:39:38Z", + created_at: "2022-04-26T15:27:30Z", + }, + { + key: "ownsmovie", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean", + }, + name: "Owns Movie", + description: "Customer owns movie.", + visibility: "VISIBILITY_HIDDEN", + version: 1, + updated_at: "2022-04-26T15:49:05Z", + created_at: "2022-04-26T15:49:05Z", + }, + ], + cursor: "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/customers/custom-attribute-definitions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + customAttributeDefinitions: [ + { + key: "favoritemovie", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + }, + name: "Favorite Movie", + description: "Update the description as desired.", + visibility: "VISIBILITY_READ_ONLY", + version: 3, + updatedAt: "2022-04-26T15:39:38Z", + createdAt: "2022-04-26T15:27:30Z", + }, + { + key: "ownsmovie", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean", + }, + name: "Owns Movie", + description: "Customer owns movie.", + visibility: "VISIBILITY_HIDDEN", + version: 1, + updatedAt: "2022-04-26T15:49:05Z", + createdAt: "2022-04-26T15:49:05Z", + }, + ], + cursor: "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.customers.customAttributeDefinitions.list({ + limit: 1, + cursor: "cursor", + }); + + expect(expected.customAttributeDefinitions).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customAttributeDefinitions).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/customers/customAttributes.test.ts b/tests/wire/customers/customAttributes.test.ts index d54d1bde3..3015232b3 100644 --- a/tests/wire/customers/customAttributes.test.ts +++ b/tests/wire/customers/customAttributes.test.ts @@ -1,11 +1,85 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("CustomAttributes", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + custom_attributes: [ + { + key: "favoritemovie", + value: "Dune", + version: 1, + visibility: "VISIBILITY_READ_ONLY", + updated_at: "2022-04-26T15:50:27Z", + created_at: "2022-04-26T15:50:27Z", + }, + { + key: "ownsmovie", + value: false, + version: 1, + visibility: "VISIBILITY_HIDDEN", + updated_at: "2022-04-26T15:51:53Z", + created_at: "2022-04-26T15:51:53Z", + }, + ], + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/customers/customer_id/custom-attributes") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + customAttributes: [ + { + key: "favoritemovie", + value: "Dune", + version: 1, + visibility: "VISIBILITY_READ_ONLY", + updatedAt: "2022-04-26T15:50:27Z", + createdAt: "2022-04-26T15:50:27Z", + }, + { + key: "ownsmovie", + value: false, + version: 1, + visibility: "VISIBILITY_HIDDEN", + updatedAt: "2022-04-26T15:51:53Z", + createdAt: "2022-04-26T15:51:53Z", + }, + ], + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.customers.customAttributes.list({ + customerId: "customer_id", + limit: 1, + cursor: "cursor", + withDefinitions: true, + }); + + expect(expected.customAttributes).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customAttributes).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/customers/groups.test.ts b/tests/wire/customers/groups.test.ts index 80a92ceff..52c3c8a64 100644 --- a/tests/wire/customers/groups.test.ts +++ b/tests/wire/customers/groups.test.ts @@ -1,11 +1,75 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Groups", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + groups: [ + { + id: "2TAT3CMH4Q0A9M87XJZED0WMR3", + name: "Loyal Customers", + created_at: "2020-04-13T21:54:57.863Z", + updated_at: "2020-04-13T21:54:58Z", + }, + { + id: "4XMEHESXJBNE9S9JAKZD2FGB14", + name: "Super Loyal Customers", + created_at: "2020-04-13T21:55:18.795Z", + updated_at: "2020-04-13T21:55:19Z", + }, + ], + cursor: "cursor", + }; + server + .mockEndpoint() + .get("/v2/customers/groups") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + groups: [ + { + id: "2TAT3CMH4Q0A9M87XJZED0WMR3", + name: "Loyal Customers", + createdAt: "2020-04-13T21:54:57.863Z", + updatedAt: "2020-04-13T21:54:58Z", + }, + { + id: "4XMEHESXJBNE9S9JAKZD2FGB14", + name: "Super Loyal Customers", + createdAt: "2020-04-13T21:55:18.795Z", + updatedAt: "2020-04-13T21:55:19Z", + }, + ], + cursor: "cursor", + }; + const page = await client.customers.groups.list({ + cursor: "cursor", + limit: 1, + }); + + expect(expected.groups).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.groups).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/customers/segments.test.ts b/tests/wire/customers/segments.test.ts index e891d9cb7..452e77795 100644 --- a/tests/wire/customers/segments.test.ts +++ b/tests/wire/customers/segments.test.ts @@ -1,11 +1,99 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Segments", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + segments: [ + { + id: "GMNXRZVEXNQDF.CHURN_RISK", + name: "Lapsed", + created_at: "2020-01-09T19:33:24.469Z", + updated_at: "2020-04-13T21:47:04Z", + }, + { + id: "GMNXRZVEXNQDF.LOYAL", + name: "Regulars", + created_at: "2020-01-09T19:33:24.486Z", + updated_at: "2020-04-13T21:47:04Z", + }, + { + id: "GMNXRZVEXNQDF.REACHABLE", + name: "Reachable", + created_at: "2020-01-09T19:33:21.813Z", + updated_at: "2020-04-13T21:47:04Z", + }, + { + id: "gv2:KF92J19VXN5FK30GX2E8HSGQ20", + name: "Instant Profile", + created_at: "2020-01-09T19:33:25Z", + updated_at: "2020-04-13T23:01:03Z", + }, + ], + cursor: "cursor", + }; + server + .mockEndpoint() + .get("/v2/customers/segments") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + segments: [ + { + id: "GMNXRZVEXNQDF.CHURN_RISK", + name: "Lapsed", + createdAt: "2020-01-09T19:33:24.469Z", + updatedAt: "2020-04-13T21:47:04Z", + }, + { + id: "GMNXRZVEXNQDF.LOYAL", + name: "Regulars", + createdAt: "2020-01-09T19:33:24.486Z", + updatedAt: "2020-04-13T21:47:04Z", + }, + { + id: "GMNXRZVEXNQDF.REACHABLE", + name: "Reachable", + createdAt: "2020-01-09T19:33:21.813Z", + updatedAt: "2020-04-13T21:47:04Z", + }, + { + id: "gv2:KF92J19VXN5FK30GX2E8HSGQ20", + name: "Instant Profile", + createdAt: "2020-01-09T19:33:25Z", + updatedAt: "2020-04-13T23:01:03Z", + }, + ], + cursor: "cursor", + }; + const page = await client.customers.segments.list({ + cursor: "cursor", + limit: 1, + }); + + expect(expected.segments).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.segments).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/devices.test.ts b/tests/wire/devices.test.ts index 02e86f2dd..0bc76e9fe 100644 --- a/tests/wire/devices.test.ts +++ b/tests/wire/devices.test.ts @@ -1,11 +1,241 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Devices", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + devices: [ + { + id: "device:995CS397A6475287", + attributes: { + type: "TERMINAL", + manufacturer: "Square", + model: "Square Terminal (1st Gen, v2)", + name: "Square Terminal 5287", + manufacturers_id: "995CS397A6475287", + updated_at: "2025-08-19T13:04:56.335762883Z", + version: "5.57.0067", + merchant_token: "MLCHNZCBWFDZB", + }, + components: [ + { + type: "APPLICATION", + application_details: { + application_type: "TERMINAL_API", + version: "6.77", + session_location: "LMN2K7S3RTOU3", + }, + }, + { type: "CARD_READER", card_reader_details: { version: "4.1.51" } }, + { + type: "BATTERY", + battery_details: { visible_percent: 77, external_power: "AVAILABLE_CHARGING" }, + }, + { + type: "WIFI", + wifi_details: { + active: true, + ssid: "Staff Network", + ip_address_v4: "10.0.0.7", + secure_connection: "WPA/WPA2 PSK", + signal_strength: { value: 2 }, + }, + }, + { type: "ETHERNET", ethernet_details: { active: false } }, + ], + status: { category: "AVAILABLE" }, + }, + { + id: "device:998WS21803L03559", + attributes: { + type: "HANDHELD", + manufacturer: "Square", + model: "Square Handheld (1st Gen, v1)", + name: "Square Terminal 3559", + manufacturers_id: "998WS21803L03559", + updated_at: "2025-08-19T12:39:56.335742073Z", + version: "7.21.0017", + merchant_token: "MLCHXZCBWFGDW", + }, + components: [ + { + type: "APPLICATION", + application_details: { + application_type: "TERMINAL_API", + version: "6.77", + session_location: "LMN2K7S3RTOU3", + }, + }, + { type: "CARD_READER", card_reader_details: { version: "4.5.58" } }, + { + type: "BATTERY", + battery_details: { visible_percent: 22, external_power: "AVAILABLE_CHARGING" }, + }, + { + type: "WIFI", + wifi_details: { + active: true, + ssid: "Staff Network", + ip_address_v4: "10.0.0.7", + secure_connection: "WPA/WPA2 PSK", + signal_strength: { value: 2 }, + }, + }, + { type: "ETHERNET", ethernet_details: { active: false } }, + ], + status: { category: "NEEDS_ATTENTION" }, + }, + ], + cursor: "GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM", + }; + server.mockEndpoint().get("/v2/devices").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + devices: [ + { + id: "device:995CS397A6475287", + attributes: { + type: "TERMINAL", + manufacturer: "Square", + model: "Square Terminal (1st Gen, v2)", + name: "Square Terminal 5287", + manufacturersId: "995CS397A6475287", + updatedAt: "2025-08-19T13:04:56.335762883Z", + version: "5.57.0067", + merchantToken: "MLCHNZCBWFDZB", + }, + components: [ + { + type: "APPLICATION", + applicationDetails: { + applicationType: "TERMINAL_API", + version: "6.77", + sessionLocation: "LMN2K7S3RTOU3", + }, + }, + { + type: "CARD_READER", + cardReaderDetails: { + version: "4.1.51", + }, + }, + { + type: "BATTERY", + batteryDetails: { + visiblePercent: 77, + externalPower: "AVAILABLE_CHARGING", + }, + }, + { + type: "WIFI", + wifiDetails: { + active: true, + ssid: "Staff Network", + ipAddressV4: "10.0.0.7", + secureConnection: "WPA/WPA2 PSK", + signalStrength: { + value: 2, + }, + }, + }, + { + type: "ETHERNET", + ethernetDetails: { + active: false, + }, + }, + ], + status: { + category: "AVAILABLE", + }, + }, + { + id: "device:998WS21803L03559", + attributes: { + type: "HANDHELD", + manufacturer: "Square", + model: "Square Handheld (1st Gen, v1)", + name: "Square Terminal 3559", + manufacturersId: "998WS21803L03559", + updatedAt: "2025-08-19T12:39:56.335742073Z", + version: "7.21.0017", + merchantToken: "MLCHXZCBWFGDW", + }, + components: [ + { + type: "APPLICATION", + applicationDetails: { + applicationType: "TERMINAL_API", + version: "6.77", + sessionLocation: "LMN2K7S3RTOU3", + }, + }, + { + type: "CARD_READER", + cardReaderDetails: { + version: "4.5.58", + }, + }, + { + type: "BATTERY", + batteryDetails: { + visiblePercent: 22, + externalPower: "AVAILABLE_CHARGING", + }, + }, + { + type: "WIFI", + wifiDetails: { + active: true, + ssid: "Staff Network", + ipAddressV4: "10.0.0.7", + secureConnection: "WPA/WPA2 PSK", + signalStrength: { + value: 2, + }, + }, + }, + { + type: "ETHERNET", + ethernetDetails: { + active: false, + }, + }, + ], + status: { + category: "NEEDS_ATTENTION", + }, + }, + ], + cursor: "GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM", + }; + const page = await client.devices.list({ + cursor: "cursor", + sortOrder: "DESC", + limit: 1, + locationId: "location_id", + }); + + expect(expected.devices).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.devices).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/devices/codes.test.ts b/tests/wire/devices/codes.test.ts index 489f9ed99..44382162d 100644 --- a/tests/wire/devices/codes.test.ts +++ b/tests/wire/devices/codes.test.ts @@ -1,11 +1,99 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Codes", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + device_codes: [ + { + id: "B3Z6NAMYQSMTM", + name: "Counter 1", + code: "EBCARJ", + device_id: "907CS13101300122", + product_type: "TERMINAL_API", + location_id: "B5E4484SHHNYH", + status: "PAIRED", + pair_by: "2020-02-06T18:49:33.000Z", + created_at: "2020-02-06T18:44:33.000Z", + status_changed_at: "2020-02-06T18:47:28.000Z", + paired_at: "paired_at", + }, + { + id: "YKGMJMYK8H4PQ", + name: "Unused device code", + code: "GVXNYN", + device_id: "device_id", + product_type: "TERMINAL_API", + location_id: "A6SYFRSV4WAFW", + status: "UNPAIRED", + pair_by: "2020-02-07T20:00:04.000Z", + created_at: "2020-02-07T19:55:04.000Z", + status_changed_at: "2020-02-07T19:55:04.000Z", + paired_at: "paired_at", + }, + ], + cursor: "cursor", + }; + server.mockEndpoint().get("/v2/devices/codes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + deviceCodes: [ + { + id: "B3Z6NAMYQSMTM", + name: "Counter 1", + code: "EBCARJ", + deviceId: "907CS13101300122", + productType: "TERMINAL_API", + locationId: "B5E4484SHHNYH", + status: "PAIRED", + pairBy: "2020-02-06T18:49:33.000Z", + createdAt: "2020-02-06T18:44:33.000Z", + statusChangedAt: "2020-02-06T18:47:28.000Z", + pairedAt: "paired_at", + }, + { + id: "YKGMJMYK8H4PQ", + name: "Unused device code", + code: "GVXNYN", + deviceId: "device_id", + productType: "TERMINAL_API", + locationId: "A6SYFRSV4WAFW", + status: "UNPAIRED", + pairBy: "2020-02-07T20:00:04.000Z", + createdAt: "2020-02-07T19:55:04.000Z", + statusChangedAt: "2020-02-07T19:55:04.000Z", + pairedAt: "paired_at", + }, + ], + cursor: "cursor", + }; + const page = await client.devices.codes.list({ + cursor: "cursor", + locationId: "location_id", + productType: "TERMINAL_API", + status: "UNKNOWN", + }); + + expect(expected.deviceCodes).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.deviceCodes).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/disputes.test.ts b/tests/wire/disputes.test.ts index 334677ebc..c1c27f7dc 100644 --- a/tests/wire/disputes.test.ts +++ b/tests/wire/disputes.test.ts @@ -1,11 +1,128 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Disputes", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + disputes: [ + { + dispute_id: "dispute_id", + id: "XDgyFu7yo1E2S5lQGGpYn", + amount_money: { amount: BigInt(2500), currency: "USD" }, + reason: "NO_KNOWLEDGE", + state: "ACCEPTED", + due_at: "2022-07-13T00:00:00.000Z", + disputed_payment: { payment_id: "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" }, + evidence_ids: ["evidence_ids"], + card_brand: "VISA", + created_at: "2022-06-29T18:45:22.265Z", + updated_at: "2022-07-07T19:14:42.650Z", + brand_dispute_id: "100000809947", + reported_date: "reported_date", + reported_at: "2022-06-29T00:00:00.000Z", + version: 2, + location_id: "L1HN3ZMQK64X9", + }, + { + dispute_id: "dispute_id", + id: "jLGg7aXC7lvKPr9PISt0T", + amount_money: { amount: BigInt(2209), currency: "USD" }, + reason: "NOT_AS_DESCRIBED", + state: "EVIDENCE_REQUIRED", + due_at: "2022-05-13T00:00:00.000Z", + disputed_payment: { payment_id: "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" }, + evidence_ids: ["evidence_ids"], + card_brand: "VISA", + created_at: "2022-04-29T18:45:22.265Z", + updated_at: "2022-04-29T18:45:22.265Z", + brand_dispute_id: "r5Of6YaGT7AdeRaVoAGCJw", + reported_date: "reported_date", + reported_at: "2022-04-29T00:00:00.000Z", + version: 1, + location_id: "18YC4JDH91E1H", + }, + ], + cursor: "G1aSTRm48CLjJsg6Sg3hQN1b1OMaoVuG", + }; + server.mockEndpoint().get("/v2/disputes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + disputes: [ + { + disputeId: "dispute_id", + id: "XDgyFu7yo1E2S5lQGGpYn", + amountMoney: { + amount: BigInt("2500"), + currency: "USD", + }, + reason: "NO_KNOWLEDGE", + state: "ACCEPTED", + dueAt: "2022-07-13T00:00:00.000Z", + disputedPayment: { + paymentId: "zhyh1ch64kRBrrlfVhwjCEjZWzNZY", + }, + evidenceIds: ["evidence_ids"], + cardBrand: "VISA", + createdAt: "2022-06-29T18:45:22.265Z", + updatedAt: "2022-07-07T19:14:42.650Z", + brandDisputeId: "100000809947", + reportedDate: "reported_date", + reportedAt: "2022-06-29T00:00:00.000Z", + version: 2, + locationId: "L1HN3ZMQK64X9", + }, + { + disputeId: "dispute_id", + id: "jLGg7aXC7lvKPr9PISt0T", + amountMoney: { + amount: BigInt("2209"), + currency: "USD", + }, + reason: "NOT_AS_DESCRIBED", + state: "EVIDENCE_REQUIRED", + dueAt: "2022-05-13T00:00:00.000Z", + disputedPayment: { + paymentId: "zhyh1ch64kRBrrlfVhwjCEjZWzNZY", + }, + evidenceIds: ["evidence_ids"], + cardBrand: "VISA", + createdAt: "2022-04-29T18:45:22.265Z", + updatedAt: "2022-04-29T18:45:22.265Z", + brandDisputeId: "r5Of6YaGT7AdeRaVoAGCJw", + reportedDate: "reported_date", + reportedAt: "2022-04-29T00:00:00.000Z", + version: 1, + locationId: "18YC4JDH91E1H", + }, + ], + cursor: "G1aSTRm48CLjJsg6Sg3hQN1b1OMaoVuG", + }; + const page = await client.disputes.list({ + cursor: "cursor", + states: "INQUIRY_EVIDENCE_REQUIRED", + locationId: "location_id", + }); + + expect(expected.disputes).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.disputes).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/disputes/evidence.test.ts b/tests/wire/disputes/evidence.test.ts index e0496da11..1c93c71c2 100644 --- a/tests/wire/disputes/evidence.test.ts +++ b/tests/wire/disputes/evidence.test.ts @@ -1,11 +1,93 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Evidence", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + evidence: [ + { + evidence_id: "evidence_id", + id: "CpfnkwGselCwS8QFvxN6", + dispute_id: "bVTprrwk0gygTLZ96VX1oB", + evidence_file: { filename: "customer-interaction", filetype: "JPG" }, + evidence_text: "evidence_text", + uploaded_at: "2022-05-10T15:57:13.802Z", + evidence_type: "CARDHOLDER_COMMUNICATION", + }, + { + evidence_id: "evidence_id", + id: "TOomLInj6iWmP3N8qfCXrB", + dispute_id: "bVTprrwk0gygTLZ96VX1oB", + evidence_file: { filename: "", filetype: "" }, + evidence_text: "evidence_text", + uploaded_at: "2022-05-18T16:01:10.000Z", + evidence_type: "REBUTTAL_EXPLANATION", + }, + ], + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + cursor: "cursor", + }; + server + .mockEndpoint() + .get("/v2/disputes/dispute_id/evidence") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + evidence: [ + { + evidenceId: "evidence_id", + id: "CpfnkwGselCwS8QFvxN6", + disputeId: "bVTprrwk0gygTLZ96VX1oB", + evidenceFile: { + filename: "customer-interaction", + filetype: "JPG", + }, + evidenceText: "evidence_text", + uploadedAt: "2022-05-10T15:57:13.802Z", + evidenceType: "CARDHOLDER_COMMUNICATION", + }, + { + evidenceId: "evidence_id", + id: "TOomLInj6iWmP3N8qfCXrB", + disputeId: "bVTprrwk0gygTLZ96VX1oB", + evidenceFile: { + filename: "", + filetype: "", + }, + evidenceText: "evidence_text", + uploadedAt: "2022-05-18T16:01:10.000Z", + evidenceType: "REBUTTAL_EXPLANATION", + }, + ], + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + cursor: "cursor", + }; + const page = await client.disputes.evidence.list({ + disputeId: "dispute_id", + cursor: "cursor", + }); + + expect(expected.evidence).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.evidence).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/employees.test.ts b/tests/wire/employees.test.ts index 1e270b2bb..879f665bc 100644 --- a/tests/wire/employees.test.ts +++ b/tests/wire/employees.test.ts @@ -1,11 +1,71 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Employees", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + employees: [ + { + id: "id", + first_name: "first_name", + last_name: "last_name", + email: "email", + phone_number: "phone_number", + location_ids: ["location_ids"], + status: "ACTIVE", + is_owner: true, + created_at: "created_at", + updated_at: "updated_at", + }, + ], + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server.mockEndpoint().get("/v2/employees").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + employees: [ + { + id: "id", + firstName: "first_name", + lastName: "last_name", + email: "email", + phoneNumber: "phone_number", + locationIds: ["location_ids"], + status: "ACTIVE", + isOwner: true, + createdAt: "created_at", + updatedAt: "updated_at", + }, + ], + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.employees.list({ + locationId: "location_id", + status: "ACTIVE", + limit: 1, + cursor: "cursor", + }); + + expect(expected.employees).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.employees).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/events.test.ts b/tests/wire/events.test.ts index 4a20f754d..2adbadd5d 100644 --- a/tests/wire/events.test.ts +++ b/tests/wire/events.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Events", () => { test("SearchEvents", async () => { diff --git a/tests/wire/giftCards.test.ts b/tests/wire/giftCards.test.ts index ed74f1206..989a40db8 100644 --- a/tests/wire/giftCards.test.ts +++ b/tests/wire/giftCards.test.ts @@ -1,11 +1,94 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("GiftCards", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + gift_cards: [ + { + id: "gftc:00113070ba5745f0b2377c1b9570cb03", + type: "DIGITAL", + gan_source: "SQUARE", + state: "ACTIVE", + balance_money: { amount: BigInt(3900), currency: "USD" }, + gan: "7783320008524605", + created_at: "2021-06-09T22:26:54.000Z", + customer_ids: ["customer_ids"], + }, + { + id: "gftc:00128a12725b41e58e0de1d20497a9dd", + type: "DIGITAL", + gan_source: "SQUARE", + state: "ACTIVE", + balance_money: { amount: BigInt(2000), currency: "USD" }, + gan: "7783320002692465", + created_at: "2021-05-20T22:26:54.000Z", + customer_ids: ["customer_ids"], + }, + ], + cursor: "JbFmyvUpaNKsfC1hoLSA4WlqkgkZXTWeKuStajR5BkP7OE0ETAbeWSi6U6u7sH", + }; + server.mockEndpoint().get("/v2/gift-cards").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + giftCards: [ + { + id: "gftc:00113070ba5745f0b2377c1b9570cb03", + type: "DIGITAL", + ganSource: "SQUARE", + state: "ACTIVE", + balanceMoney: { + amount: BigInt("3900"), + currency: "USD", + }, + gan: "7783320008524605", + createdAt: "2021-06-09T22:26:54.000Z", + customerIds: ["customer_ids"], + }, + { + id: "gftc:00128a12725b41e58e0de1d20497a9dd", + type: "DIGITAL", + ganSource: "SQUARE", + state: "ACTIVE", + balanceMoney: { + amount: BigInt("2000"), + currency: "USD", + }, + gan: "7783320002692465", + createdAt: "2021-05-20T22:26:54.000Z", + customerIds: ["customer_ids"], + }, + ], + cursor: "JbFmyvUpaNKsfC1hoLSA4WlqkgkZXTWeKuStajR5BkP7OE0ETAbeWSi6U6u7sH", + }; + const page = await client.giftCards.list({ + type: "type", + state: "state", + limit: 1, + cursor: "cursor", + customerId: "customer_id", + }); + + expect(expected.giftCards).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.giftCards).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/giftCards/activities.test.ts b/tests/wire/giftCards/activities.test.ts index fd98a1564..5899f040e 100644 --- a/tests/wire/giftCards/activities.test.ts +++ b/tests/wire/giftCards/activities.test.ts @@ -1,11 +1,231 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Activities", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + gift_card_activities: [ + { + id: "gcact_897698f894b44b3db46c6147e26a0e19", + type: "REDEEM", + location_id: "81FN9BNFZTKS4", + created_at: "2021-06-02T22:26:38.000Z", + gift_card_id: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + gift_card_gan: "7783320002929081", + gift_card_balance_money: { amount: BigInt(700), currency: "USD" }, + redeem_activity_details: { amount_money: { amount: BigInt(300), currency: "USD" } }, + clear_balance_activity_details: { reason: "SUSPICIOUS_ACTIVITY" }, + deactivate_activity_details: { reason: "SUSPICIOUS_ACTIVITY" }, + adjust_increment_activity_details: { amount_money: {}, reason: "COMPLIMENTARY" }, + adjust_decrement_activity_details: { amount_money: {}, reason: "SUSPICIOUS_ACTIVITY" }, + unlinked_activity_refund_activity_details: { amount_money: {} }, + import_activity_details: { amount_money: {} }, + block_activity_details: { reason: "CHARGEBACK_BLOCK" }, + unblock_activity_details: { reason: "CHARGEBACK_UNBLOCK" }, + import_reversal_activity_details: { amount_money: {} }, + transfer_balance_to_activity_details: { + transfer_from_gift_card_id: "transfer_from_gift_card_id", + amount_money: {}, + }, + transfer_balance_from_activity_details: { + transfer_to_gift_card_id: "transfer_to_gift_card_id", + amount_money: {}, + }, + }, + { + id: "gcact_b968ebfc7d46437b945be7b9e09123b4", + type: "ACTIVATE", + location_id: "81FN9BNFZTKS4", + created_at: "2021-05-20T22:26:54.000Z", + gift_card_id: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + gift_card_gan: "7783320002929081", + gift_card_balance_money: { amount: BigInt(1000), currency: "USD" }, + activate_activity_details: { + amount_money: { amount: BigInt(1000), currency: "USD" }, + order_id: "jJNGHm4gLI6XkFbwtiSLqK72KkAZY", + line_item_uid: "eIWl7X0nMuO9Ewbh0ChIx", + }, + redeem_activity_details: { amount_money: {} }, + clear_balance_activity_details: { reason: "SUSPICIOUS_ACTIVITY" }, + deactivate_activity_details: { reason: "SUSPICIOUS_ACTIVITY" }, + adjust_increment_activity_details: { amount_money: {}, reason: "COMPLIMENTARY" }, + adjust_decrement_activity_details: { amount_money: {}, reason: "SUSPICIOUS_ACTIVITY" }, + unlinked_activity_refund_activity_details: { amount_money: {} }, + import_activity_details: { amount_money: {} }, + block_activity_details: { reason: "CHARGEBACK_BLOCK" }, + unblock_activity_details: { reason: "CHARGEBACK_UNBLOCK" }, + import_reversal_activity_details: { amount_money: {} }, + transfer_balance_to_activity_details: { + transfer_from_gift_card_id: "transfer_from_gift_card_id", + amount_money: {}, + }, + transfer_balance_from_activity_details: { + transfer_to_gift_card_id: "transfer_to_gift_card_id", + amount_money: {}, + }, + }, + ], + cursor: "cursor", + }; + server + .mockEndpoint() + .get("/v2/gift-cards/activities") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + giftCardActivities: [ + { + id: "gcact_897698f894b44b3db46c6147e26a0e19", + type: "REDEEM", + locationId: "81FN9BNFZTKS4", + createdAt: "2021-06-02T22:26:38.000Z", + giftCardId: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + giftCardGan: "7783320002929081", + giftCardBalanceMoney: { + amount: BigInt("700"), + currency: "USD", + }, + redeemActivityDetails: { + amountMoney: { + amount: BigInt("300"), + currency: "USD", + }, + }, + clearBalanceActivityDetails: { + reason: "SUSPICIOUS_ACTIVITY", + }, + deactivateActivityDetails: { + reason: "SUSPICIOUS_ACTIVITY", + }, + adjustIncrementActivityDetails: { + amountMoney: {}, + reason: "COMPLIMENTARY", + }, + adjustDecrementActivityDetails: { + amountMoney: {}, + reason: "SUSPICIOUS_ACTIVITY", + }, + unlinkedActivityRefundActivityDetails: { + amountMoney: {}, + }, + importActivityDetails: { + amountMoney: {}, + }, + blockActivityDetails: { + reason: "CHARGEBACK_BLOCK", + }, + unblockActivityDetails: { + reason: "CHARGEBACK_UNBLOCK", + }, + importReversalActivityDetails: { + amountMoney: {}, + }, + transferBalanceToActivityDetails: { + transferFromGiftCardId: "transfer_from_gift_card_id", + amountMoney: {}, + }, + transferBalanceFromActivityDetails: { + transferToGiftCardId: "transfer_to_gift_card_id", + amountMoney: {}, + }, + }, + { + id: "gcact_b968ebfc7d46437b945be7b9e09123b4", + type: "ACTIVATE", + locationId: "81FN9BNFZTKS4", + createdAt: "2021-05-20T22:26:54.000Z", + giftCardId: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + giftCardGan: "7783320002929081", + giftCardBalanceMoney: { + amount: BigInt("1000"), + currency: "USD", + }, + activateActivityDetails: { + amountMoney: { + amount: BigInt("1000"), + currency: "USD", + }, + orderId: "jJNGHm4gLI6XkFbwtiSLqK72KkAZY", + lineItemUid: "eIWl7X0nMuO9Ewbh0ChIx", + }, + redeemActivityDetails: { + amountMoney: {}, + }, + clearBalanceActivityDetails: { + reason: "SUSPICIOUS_ACTIVITY", + }, + deactivateActivityDetails: { + reason: "SUSPICIOUS_ACTIVITY", + }, + adjustIncrementActivityDetails: { + amountMoney: {}, + reason: "COMPLIMENTARY", + }, + adjustDecrementActivityDetails: { + amountMoney: {}, + reason: "SUSPICIOUS_ACTIVITY", + }, + unlinkedActivityRefundActivityDetails: { + amountMoney: {}, + }, + importActivityDetails: { + amountMoney: {}, + }, + blockActivityDetails: { + reason: "CHARGEBACK_BLOCK", + }, + unblockActivityDetails: { + reason: "CHARGEBACK_UNBLOCK", + }, + importReversalActivityDetails: { + amountMoney: {}, + }, + transferBalanceToActivityDetails: { + transferFromGiftCardId: "transfer_from_gift_card_id", + amountMoney: {}, + }, + transferBalanceFromActivityDetails: { + transferToGiftCardId: "transfer_to_gift_card_id", + amountMoney: {}, + }, + }, + ], + cursor: "cursor", + }; + const page = await client.giftCards.activities.list({ + giftCardId: "gift_card_id", + type: "type", + locationId: "location_id", + beginTime: "begin_time", + endTime: "end_time", + limit: 1, + cursor: "cursor", + sortOrder: "sort_order", + }); + + expect(expected.giftCardActivities).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.giftCardActivities).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/inventory.test.ts b/tests/wire/inventory.test.ts index cf796a8b6..64045cc23 100644 --- a/tests/wire/inventory.test.ts +++ b/tests/wire/inventory.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Inventory", () => { test("DeprecatedGetAdjustment", async () => { @@ -528,6 +526,168 @@ describe("Inventory", () => { }); }); + test("BatchGetChanges", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + const rawRequestBody = { + catalog_object_ids: ["W62UWFY35CWMYGVWK6TWJDNI"], + location_ids: ["C6W5YS5QM06F5"], + types: ["PHYSICAL_COUNT"], + states: ["IN_STOCK"], + updated_after: "2016-11-01T00:00:00.000Z", + updated_before: "2016-12-01T00:00:00.000Z", + }; + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + changes: [ + { + type: "PHYSICAL_COUNT", + physical_count: { + id: "46YDTW253DWGGK9HMAE6XCAO", + reference_id: "22c07cf4-5626-4224-89f9-691112019399", + catalog_object_id: "W62UWFY35CWMYGVWK6TWJDNI", + catalog_object_type: "ITEM_VARIATION", + state: "IN_STOCK", + location_id: "C6W5YS5QM06F5", + quantity: "86", + source: { + product: "SQUARE_POS", + application_id: "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + name: "Square Point of Sale 4.37", + }, + team_member_id: "LRK57NSQ5X7PUD05", + occurred_at: "2016-11-16T22:24:49.028Z", + created_at: "2016-11-16T22:25:24.878Z", + }, + measurement_unit_id: "measurement_unit_id", + }, + ], + cursor: "cursor", + }; + server + .mockEndpoint() + .post("/v2/inventory/changes/batch-retrieve") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + changes: [ + { + type: "PHYSICAL_COUNT", + physicalCount: { + id: "46YDTW253DWGGK9HMAE6XCAO", + referenceId: "22c07cf4-5626-4224-89f9-691112019399", + catalogObjectId: "W62UWFY35CWMYGVWK6TWJDNI", + catalogObjectType: "ITEM_VARIATION", + state: "IN_STOCK", + locationId: "C6W5YS5QM06F5", + quantity: "86", + source: { + product: "SQUARE_POS", + applicationId: "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + name: "Square Point of Sale 4.37", + }, + teamMemberId: "LRK57NSQ5X7PUD05", + occurredAt: "2016-11-16T22:24:49.028Z", + createdAt: "2016-11-16T22:25:24.878Z", + }, + measurementUnitId: "measurement_unit_id", + }, + ], + cursor: "cursor", + }; + const page = await client.inventory.batchGetChanges({ + catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], + locationIds: ["C6W5YS5QM06F5"], + types: ["PHYSICAL_COUNT"], + states: ["IN_STOCK"], + updatedAfter: "2016-11-01T00:00:00.000Z", + updatedBefore: "2016-12-01T00:00:00.000Z", + }); + + expect(expected.changes).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.changes).toEqual(nextPage.data); + }); + + test("BatchGetCounts", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + const rawRequestBody = { + catalog_object_ids: ["W62UWFY35CWMYGVWK6TWJDNI"], + location_ids: ["59TNP9SA8VGDA"], + updated_after: "2016-11-16T00:00:00.000Z", + }; + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + counts: [ + { + catalog_object_id: "W62UWFY35CWMYGVWK6TWJDNI", + catalog_object_type: "ITEM_VARIATION", + state: "IN_STOCK", + location_id: "59TNP9SA8VGDA", + quantity: "79", + calculated_at: "2016-11-16T22:28:01.223Z", + is_estimated: true, + }, + ], + cursor: "cursor", + }; + server + .mockEndpoint() + .post("/v2/inventory/counts/batch-retrieve") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + counts: [ + { + catalogObjectId: "W62UWFY35CWMYGVWK6TWJDNI", + catalogObjectType: "ITEM_VARIATION", + state: "IN_STOCK", + locationId: "59TNP9SA8VGDA", + quantity: "79", + calculatedAt: "2016-11-16T22:28:01.223Z", + isEstimated: true, + }, + ], + cursor: "cursor", + }; + const page = await client.inventory.batchGetCounts({ + catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], + locationIds: ["59TNP9SA8VGDA"], + updatedAfter: "2016-11-16T00:00:00.000Z", + }); + + expect(expected.counts).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.counts).toEqual(nextPage.data); + }); + test("deprecatedGetPhysicalCount", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); @@ -727,4 +887,159 @@ describe("Inventory", () => { }, }); }); + + test("get", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + counts: [ + { + catalog_object_id: "W62UWFY35CWMYGVWK6TWJDNI", + catalog_object_type: "ITEM_VARIATION", + state: "IN_STOCK", + location_id: "C6W5YS5QM06F5", + quantity: "22", + calculated_at: "2016-11-16T22:28:01.223Z", + is_estimated: true, + }, + ], + cursor: "cursor", + }; + server + .mockEndpoint() + .get("/v2/inventory/catalog_object_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + counts: [ + { + catalogObjectId: "W62UWFY35CWMYGVWK6TWJDNI", + catalogObjectType: "ITEM_VARIATION", + state: "IN_STOCK", + locationId: "C6W5YS5QM06F5", + quantity: "22", + calculatedAt: "2016-11-16T22:28:01.223Z", + isEstimated: true, + }, + ], + cursor: "cursor", + }; + const page = await client.inventory.get({ + catalogObjectId: "catalog_object_id", + locationIds: "location_ids", + cursor: "cursor", + }); + + expect(expected.counts).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.counts).toEqual(nextPage.data); + }); + + test("changes", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + changes: [ + { + type: "ADJUSTMENT", + adjustment: { + id: "OJKJIUANKLMLQANZADNPLKAD", + reference_id: "d8207693-168f-4b44-a2fd-a7ff533ddd26", + from_state: "IN_STOCK", + to_state: "SOLD", + location_id: "C6W5YS5QM06F5", + catalog_object_id: "W62UWFY35CWMYGVWK6TWJDNI", + catalog_object_type: "ITEM_VARIATION", + quantity: "3", + total_price_money: { amount: BigInt(5000), currency: "USD" }, + occurred_at: "2016-11-16T22:25:24.878Z", + created_at: "2016-11-16T22:25:24.878Z", + source: { + product: "SQUARE_POS", + application_id: "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + name: "Square Point of Sale 4.37", + }, + team_member_id: "AV7YRCGI2H1J5NQ8E1XIZCNA", + transaction_id: "5APV6JYK1SNCZD11AND2RX1Z", + }, + measurement_unit_id: "measurement_unit_id", + }, + ], + cursor: "cursor", + }; + server + .mockEndpoint() + .get("/v2/inventory/catalog_object_id/changes") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + changes: [ + { + type: "ADJUSTMENT", + adjustment: { + id: "OJKJIUANKLMLQANZADNPLKAD", + referenceId: "d8207693-168f-4b44-a2fd-a7ff533ddd26", + fromState: "IN_STOCK", + toState: "SOLD", + locationId: "C6W5YS5QM06F5", + catalogObjectId: "W62UWFY35CWMYGVWK6TWJDNI", + catalogObjectType: "ITEM_VARIATION", + quantity: "3", + totalPriceMoney: { + amount: BigInt("5000"), + currency: "USD", + }, + occurredAt: "2016-11-16T22:25:24.878Z", + createdAt: "2016-11-16T22:25:24.878Z", + source: { + product: "SQUARE_POS", + applicationId: "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + name: "Square Point of Sale 4.37", + }, + teamMemberId: "AV7YRCGI2H1J5NQ8E1XIZCNA", + transactionId: "5APV6JYK1SNCZD11AND2RX1Z", + }, + measurementUnitId: "measurement_unit_id", + }, + ], + cursor: "cursor", + }; + const page = await client.inventory.changes({ + catalogObjectId: "catalog_object_id", + locationIds: "location_ids", + cursor: "cursor", + }); + + expect(expected.changes).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.changes).toEqual(nextPage.data); + }); }); diff --git a/tests/wire/invoices.test.ts b/tests/wire/invoices.test.ts index 656882160..e1439d364 100644 --- a/tests/wire/invoices.test.ts +++ b/tests/wire/invoices.test.ts @@ -1,11 +1,339 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Invoices", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + invoices: [ + { + id: "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + version: 1, + location_id: "ES0RJRZYEC39A", + order_id: "CAISENgvlJ6jLWAzERDzjyHVybY", + primary_recipient: { + customer_id: "JDKYHBWT1D4F8MFH63DBMEN8Y4", + given_name: "Amelia", + family_name: "Earhart", + email_address: "Amelia.Earhart@example.com", + phone_number: "1-212-555-4240", + }, + payment_requests: [ + { + uid: "2da7964f-f3d2-4f43-81e8-5aa220bf3355", + request_type: "BALANCE", + due_date: "2030-01-24", + tipping_enabled: true, + automatic_payment_source: "NONE", + reminders: [ + { + uid: "beebd363-e47f-4075-8785-c235aaa7df11", + relative_scheduled_days: -1, + message: "Your invoice is due tomorrow", + status: "PENDING", + }, + ], + computed_amount_money: { amount: BigInt(10000), currency: "USD" }, + total_completed_amount_money: { amount: BigInt(0), currency: "USD" }, + }, + ], + delivery_method: "EMAIL", + invoice_number: "inv-100", + title: "Event Planning Services", + description: "We appreciate your business!", + scheduled_at: "2030-01-13T10:00:00Z", + public_url: "public_url", + status: "DRAFT", + timezone: "America/Los_Angeles", + created_at: "2030-01-13T17:45:13Z", + updated_at: "2030-01-13T21:24:10Z", + accepted_payment_methods: { + card: true, + square_gift_card: false, + bank_account: false, + buy_now_pay_later: false, + cash_app_pay: false, + }, + custom_fields: [ + { label: "Event Reference Number", value: "Ref. #1234", placement: "ABOVE_LINE_ITEMS" }, + { + label: "Terms of Service", + value: "The terms of service are...", + placement: "BELOW_LINE_ITEMS", + }, + ], + subscription_id: "subscription_id", + sale_or_service_date: "2030-01-24", + payment_conditions: "payment_conditions", + store_payment_method_enabled: false, + attachments: [ + { + id: "inva:0-3bB9ZuDHiziThQhuC4fwWt", + filename: "file.jpg", + description: "Service contract", + filesize: 102705, + hash: "273ee02cb6f5f8a3a8ca23604930dd53", + mime_type: "image/jpeg", + uploaded_at: "2030-01-13T21:24:10Z", + }, + ], + creator_team_member_id: "creator_team_member_id", + }, + { + id: "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", + version: 3, + location_id: "ES0RJRZYEC39A", + order_id: "a65jnS8NXbfprvGJzY9F4fQTuaB", + primary_recipient: { + customer_id: "JDKYHBWT1D4F8MFH63DBMEN8Y4", + given_name: "Amelia", + family_name: "Earhart", + email_address: "Amelia.Earhart@example.com", + phone_number: "1-212-555-4240", + }, + payment_requests: [ + { + uid: "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176", + request_type: "DEPOSIT", + due_date: "2021-01-23", + percentage_requested: "25", + tipping_enabled: false, + automatic_payment_source: "CARD_ON_FILE", + card_id: "ccof:IkWfpLj4tNHMyFii3GB", + computed_amount_money: { amount: BigInt(1000), currency: "USD" }, + total_completed_amount_money: { amount: BigInt(1000), currency: "USD" }, + }, + { + uid: "120c5e18-4f80-4f6b-b159-774cb9bf8f99", + request_type: "BALANCE", + due_date: "2021-06-15", + tipping_enabled: false, + automatic_payment_source: "CARD_ON_FILE", + card_id: "ccof:IkWfpLj4tNHMyFii3GB", + computed_amount_money: { amount: BigInt(3000), currency: "USD" }, + total_completed_amount_money: { amount: BigInt(0), currency: "USD" }, + }, + ], + delivery_method: "EMAIL", + invoice_number: "inv-455", + title: "title", + description: "description", + scheduled_at: "scheduled_at", + public_url: "https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9", + next_payment_amount_money: { amount: BigInt(3000), currency: "USD" }, + status: "PARTIALLY_PAID", + timezone: "America/Los_Angeles", + created_at: "2021-01-23T15:29:12Z", + updated_at: "2021-01-23T15:29:56Z", + accepted_payment_methods: { + card: true, + square_gift_card: true, + bank_account: false, + buy_now_pay_later: false, + cash_app_pay: false, + }, + custom_fields: [{}], + subscription_id: "subscription_id", + sale_or_service_date: "2030-01-24", + payment_conditions: "payment_conditions", + store_payment_method_enabled: false, + attachments: [{}], + creator_team_member_id: "creator_team_member_id", + }, + ], + cursor: "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server.mockEndpoint().get("/v2/invoices").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + invoices: [ + { + id: "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + version: 1, + locationId: "ES0RJRZYEC39A", + orderId: "CAISENgvlJ6jLWAzERDzjyHVybY", + primaryRecipient: { + customerId: "JDKYHBWT1D4F8MFH63DBMEN8Y4", + givenName: "Amelia", + familyName: "Earhart", + emailAddress: "Amelia.Earhart@example.com", + phoneNumber: "1-212-555-4240", + }, + paymentRequests: [ + { + uid: "2da7964f-f3d2-4f43-81e8-5aa220bf3355", + requestType: "BALANCE", + dueDate: "2030-01-24", + tippingEnabled: true, + automaticPaymentSource: "NONE", + reminders: [ + { + uid: "beebd363-e47f-4075-8785-c235aaa7df11", + relativeScheduledDays: -1, + message: "Your invoice is due tomorrow", + status: "PENDING", + }, + ], + computedAmountMoney: { + amount: BigInt("10000"), + currency: "USD", + }, + totalCompletedAmountMoney: { + amount: BigInt("0"), + currency: "USD", + }, + }, + ], + deliveryMethod: "EMAIL", + invoiceNumber: "inv-100", + title: "Event Planning Services", + description: "We appreciate your business!", + scheduledAt: "2030-01-13T10:00:00Z", + publicUrl: "public_url", + status: "DRAFT", + timezone: "America/Los_Angeles", + createdAt: "2030-01-13T17:45:13Z", + updatedAt: "2030-01-13T21:24:10Z", + acceptedPaymentMethods: { + card: true, + squareGiftCard: false, + bankAccount: false, + buyNowPayLater: false, + cashAppPay: false, + }, + customFields: [ + { + label: "Event Reference Number", + value: "Ref. #1234", + placement: "ABOVE_LINE_ITEMS", + }, + { + label: "Terms of Service", + value: "The terms of service are...", + placement: "BELOW_LINE_ITEMS", + }, + ], + subscriptionId: "subscription_id", + saleOrServiceDate: "2030-01-24", + paymentConditions: "payment_conditions", + storePaymentMethodEnabled: false, + attachments: [ + { + id: "inva:0-3bB9ZuDHiziThQhuC4fwWt", + filename: "file.jpg", + description: "Service contract", + filesize: 102705, + hash: "273ee02cb6f5f8a3a8ca23604930dd53", + mimeType: "image/jpeg", + uploadedAt: "2030-01-13T21:24:10Z", + }, + ], + creatorTeamMemberId: "creator_team_member_id", + }, + { + id: "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", + version: 3, + locationId: "ES0RJRZYEC39A", + orderId: "a65jnS8NXbfprvGJzY9F4fQTuaB", + primaryRecipient: { + customerId: "JDKYHBWT1D4F8MFH63DBMEN8Y4", + givenName: "Amelia", + familyName: "Earhart", + emailAddress: "Amelia.Earhart@example.com", + phoneNumber: "1-212-555-4240", + }, + paymentRequests: [ + { + uid: "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176", + requestType: "DEPOSIT", + dueDate: "2021-01-23", + percentageRequested: "25", + tippingEnabled: false, + automaticPaymentSource: "CARD_ON_FILE", + cardId: "ccof:IkWfpLj4tNHMyFii3GB", + computedAmountMoney: { + amount: BigInt("1000"), + currency: "USD", + }, + totalCompletedAmountMoney: { + amount: BigInt("1000"), + currency: "USD", + }, + }, + { + uid: "120c5e18-4f80-4f6b-b159-774cb9bf8f99", + requestType: "BALANCE", + dueDate: "2021-06-15", + tippingEnabled: false, + automaticPaymentSource: "CARD_ON_FILE", + cardId: "ccof:IkWfpLj4tNHMyFii3GB", + computedAmountMoney: { + amount: BigInt("3000"), + currency: "USD", + }, + totalCompletedAmountMoney: { + amount: BigInt("0"), + currency: "USD", + }, + }, + ], + deliveryMethod: "EMAIL", + invoiceNumber: "inv-455", + title: "title", + description: "description", + scheduledAt: "scheduled_at", + publicUrl: "https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9", + nextPaymentAmountMoney: { + amount: BigInt("3000"), + currency: "USD", + }, + status: "PARTIALLY_PAID", + timezone: "America/Los_Angeles", + createdAt: "2021-01-23T15:29:12Z", + updatedAt: "2021-01-23T15:29:56Z", + acceptedPaymentMethods: { + card: true, + squareGiftCard: true, + bankAccount: false, + buyNowPayLater: false, + cashAppPay: false, + }, + customFields: [{}], + subscriptionId: "subscription_id", + saleOrServiceDate: "2030-01-24", + paymentConditions: "payment_conditions", + storePaymentMethodEnabled: false, + attachments: [{}], + creatorTeamMemberId: "creator_team_member_id", + }, + ], + cursor: "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.invoices.list({ + locationId: "location_id", + cursor: "cursor", + limit: 1, + }); + + expect(expected.invoices).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.invoices).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/labor.test.ts b/tests/wire/labor.test.ts index 5429ecddd..d849cec06 100644 --- a/tests/wire/labor.test.ts +++ b/tests/wire/labor.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Labor", () => { test("CreateScheduledShift", async () => { diff --git a/tests/wire/labor/breakTypes.test.ts b/tests/wire/labor/breakTypes.test.ts index 6f5e31b29..5f7f8b7fa 100644 --- a/tests/wire/labor/breakTypes.test.ts +++ b/tests/wire/labor/breakTypes.test.ts @@ -1,11 +1,92 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("BreakTypes", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + break_types: [ + { + id: "REGS1EQR1TPZ5", + location_id: "PAA1RJZZKXBFG", + break_name: "Coffee Break", + expected_duration: "PT5M", + is_paid: false, + version: 1, + created_at: "2019-01-22T20:47:37Z", + updated_at: "2019-01-22T20:47:37Z", + }, + { + id: "92EPDRQKJ5088", + location_id: "PAA1RJZZKXBFG", + break_name: "Lunch Break", + expected_duration: "PT1H", + is_paid: true, + version: 3, + created_at: "2019-01-25T19:26:30Z", + updated_at: "2019-01-25T19:26:30Z", + }, + ], + cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/labor/break-types") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + breakTypes: [ + { + id: "REGS1EQR1TPZ5", + locationId: "PAA1RJZZKXBFG", + breakName: "Coffee Break", + expectedDuration: "PT5M", + isPaid: false, + version: 1, + createdAt: "2019-01-22T20:47:37Z", + updatedAt: "2019-01-22T20:47:37Z", + }, + { + id: "92EPDRQKJ5088", + locationId: "PAA1RJZZKXBFG", + breakName: "Lunch Break", + expectedDuration: "PT1H", + isPaid: true, + version: 3, + createdAt: "2019-01-25T19:26:30Z", + updatedAt: "2019-01-25T19:26:30Z", + }, + ], + cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.labor.breakTypes.list({ + locationId: "location_id", + limit: 1, + cursor: "cursor", + }); + + expect(expected.breakTypes).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.breakTypes).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/labor/employeeWages.test.ts b/tests/wire/labor/employeeWages.test.ts index 84b376a06..4fbf92747 100644 --- a/tests/wire/labor/employeeWages.test.ts +++ b/tests/wire/labor/employeeWages.test.ts @@ -1,11 +1,112 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("EmployeeWages", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + employee_wages: [ + { + id: "pXS3qCv7BERPnEGedM4S8mhm", + employee_id: "33fJchumvVdJwxV0H6L9", + title: "Manager", + hourly_rate: { amount: BigInt(3250), currency: "USD" }, + }, + { + id: "rZduCkzYDUVL3ovh1sQgbue6", + employee_id: "33fJchumvVdJwxV0H6L9", + title: "Cook", + hourly_rate: { amount: BigInt(2600), currency: "USD" }, + }, + { + id: "FxLbs5KpPUHa8wyt5ctjubDX", + employee_id: "33fJchumvVdJwxV0H6L9", + title: "Barista", + hourly_rate: { amount: BigInt(1600), currency: "USD" }, + }, + { + id: "vD1wCgijMDR3cX5TPnu7VXto", + employee_id: "33fJchumvVdJwxV0H6L9", + title: "Cashier", + hourly_rate: { amount: BigInt(1700), currency: "USD" }, + }, + ], + cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/labor/employee-wages") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + employeeWages: [ + { + id: "pXS3qCv7BERPnEGedM4S8mhm", + employeeId: "33fJchumvVdJwxV0H6L9", + title: "Manager", + hourlyRate: { + amount: BigInt("3250"), + currency: "USD", + }, + }, + { + id: "rZduCkzYDUVL3ovh1sQgbue6", + employeeId: "33fJchumvVdJwxV0H6L9", + title: "Cook", + hourlyRate: { + amount: BigInt("2600"), + currency: "USD", + }, + }, + { + id: "FxLbs5KpPUHa8wyt5ctjubDX", + employeeId: "33fJchumvVdJwxV0H6L9", + title: "Barista", + hourlyRate: { + amount: BigInt("1600"), + currency: "USD", + }, + }, + { + id: "vD1wCgijMDR3cX5TPnu7VXto", + employeeId: "33fJchumvVdJwxV0H6L9", + title: "Cashier", + hourlyRate: { + amount: BigInt("1700"), + currency: "USD", + }, + }, + ], + cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.labor.employeeWages.list({ + employeeId: "employee_id", + limit: 1, + cursor: "cursor", + }); + + expect(expected.employeeWages).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.employeeWages).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/labor/shifts.test.ts b/tests/wire/labor/shifts.test.ts index e614b9e17..0a3290537 100644 --- a/tests/wire/labor/shifts.test.ts +++ b/tests/wire/labor/shifts.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Shifts", () => { test("create", async () => { diff --git a/tests/wire/labor/teamMemberWages.test.ts b/tests/wire/labor/teamMemberWages.test.ts index b1ccd8bd5..0af002ab3 100644 --- a/tests/wire/labor/teamMemberWages.test.ts +++ b/tests/wire/labor/teamMemberWages.test.ts @@ -1,11 +1,128 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("TeamMemberWages", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + team_member_wages: [ + { + id: "pXS3qCv7BERPnEGedM4S8mhm", + team_member_id: "33fJchumvVdJwxV0H6L9", + title: "Manager", + hourly_rate: { amount: BigInt(3250), currency: "USD" }, + job_id: "jxJNN6eCJsLrhg5UFJrDWDGE", + tip_eligible: false, + }, + { + id: "rZduCkzYDUVL3ovh1sQgbue6", + team_member_id: "33fJchumvVdJwxV0H6L9", + title: "Cook", + hourly_rate: { amount: BigInt(2600), currency: "USD" }, + job_id: "gcbz15vKGnMKmaWJJ152kjim", + tip_eligible: true, + }, + { + id: "FxLbs5KpPUHa8wyt5ctjubDX", + team_member_id: "33fJchumvVdJwxV0H6L9", + title: "Barista", + hourly_rate: { amount: BigInt(1600), currency: "USD" }, + job_id: "FzbJAtt9qEWncK1BWgVCxQ6M", + tip_eligible: true, + }, + { + id: "vD1wCgijMDR3cX5TPnu7VXto", + team_member_id: "33fJchumvVdJwxV0H6L9", + title: "Cashier", + hourly_rate: { amount: BigInt(1700), currency: "USD" }, + job_id: "N4YKVLzFj3oGtNocqoYHYpW3", + tip_eligible: true, + }, + ], + cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/labor/team-member-wages") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + teamMemberWages: [ + { + id: "pXS3qCv7BERPnEGedM4S8mhm", + teamMemberId: "33fJchumvVdJwxV0H6L9", + title: "Manager", + hourlyRate: { + amount: BigInt("3250"), + currency: "USD", + }, + jobId: "jxJNN6eCJsLrhg5UFJrDWDGE", + tipEligible: false, + }, + { + id: "rZduCkzYDUVL3ovh1sQgbue6", + teamMemberId: "33fJchumvVdJwxV0H6L9", + title: "Cook", + hourlyRate: { + amount: BigInt("2600"), + currency: "USD", + }, + jobId: "gcbz15vKGnMKmaWJJ152kjim", + tipEligible: true, + }, + { + id: "FxLbs5KpPUHa8wyt5ctjubDX", + teamMemberId: "33fJchumvVdJwxV0H6L9", + title: "Barista", + hourlyRate: { + amount: BigInt("1600"), + currency: "USD", + }, + jobId: "FzbJAtt9qEWncK1BWgVCxQ6M", + tipEligible: true, + }, + { + id: "vD1wCgijMDR3cX5TPnu7VXto", + teamMemberId: "33fJchumvVdJwxV0H6L9", + title: "Cashier", + hourlyRate: { + amount: BigInt("1700"), + currency: "USD", + }, + jobId: "N4YKVLzFj3oGtNocqoYHYpW3", + tipEligible: true, + }, + ], + cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.labor.teamMemberWages.list({ + teamMemberId: "team_member_id", + limit: 1, + cursor: "cursor", + }); + + expect(expected.teamMemberWages).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.teamMemberWages).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/labor/workweekConfigs.test.ts b/tests/wire/labor/workweekConfigs.test.ts index 05e8a06e0..9a7ea5345 100644 --- a/tests/wire/labor/workweekConfigs.test.ts +++ b/tests/wire/labor/workweekConfigs.test.ts @@ -1,11 +1,67 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("WorkweekConfigs", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + workweek_configs: [ + { + id: "FY4VCAQN700GM", + start_of_week: "MON", + start_of_day_local_time: "10:00", + version: 11, + created_at: "2016-02-04T00:58:24Z", + updated_at: "2019-02-28T01:04:35Z", + }, + ], + cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/labor/workweek-configs") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + workweekConfigs: [ + { + id: "FY4VCAQN700GM", + startOfWeek: "MON", + startOfDayLocalTime: "10:00", + version: 11, + createdAt: "2016-02-04T00:58:24Z", + updatedAt: "2019-02-28T01:04:35Z", + }, + ], + cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.labor.workweekConfigs.list({ + limit: 1, + cursor: "cursor", + }); + + expect(expected.workweekConfigs).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.workweekConfigs).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/locations.test.ts b/tests/wire/locations.test.ts index 2cde675ff..214d44247 100644 --- a/tests/wire/locations.test.ts +++ b/tests/wire/locations.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Locations", () => { test("list", async () => { diff --git a/tests/wire/locations/customAttributeDefinitions.test.ts b/tests/wire/locations/customAttributeDefinitions.test.ts index 9981e7c1c..568ff1024 100644 --- a/tests/wire/locations/customAttributeDefinitions.test.ts +++ b/tests/wire/locations/customAttributeDefinitions.test.ts @@ -1,11 +1,100 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("CustomAttributeDefinitions", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + custom_attribute_definitions: [ + { + key: "phone-number", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.PhoneNumber", + }, + name: "phone number", + description: "Location's phone number", + visibility: "VISIBILITY_READ_ONLY", + version: 1, + updated_at: "2022-12-02T19:50:21.832Z", + created_at: "2022-12-02T19:50:21.832Z", + }, + { + key: "bestseller", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + }, + name: "Bestseller", + description: "Bestselling item at location", + visibility: "VISIBILITY_READ_WRITE_VALUES", + version: 4, + updated_at: "2022-12-03T10:17:52.341Z", + created_at: "2022-12-02T19:06:36.559Z", + }, + ], + cursor: "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/locations/custom-attribute-definitions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + customAttributeDefinitions: [ + { + key: "phone-number", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.PhoneNumber", + }, + name: "phone number", + description: "Location's phone number", + visibility: "VISIBILITY_READ_ONLY", + version: 1, + updatedAt: "2022-12-02T19:50:21.832Z", + createdAt: "2022-12-02T19:50:21.832Z", + }, + { + key: "bestseller", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + }, + name: "Bestseller", + description: "Bestselling item at location", + visibility: "VISIBILITY_READ_WRITE_VALUES", + version: 4, + updatedAt: "2022-12-03T10:17:52.341Z", + createdAt: "2022-12-02T19:06:36.559Z", + }, + ], + cursor: "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.locations.customAttributeDefinitions.list({ + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", + }); + + expect(expected.customAttributeDefinitions).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customAttributeDefinitions).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/locations/customAttributes.test.ts b/tests/wire/locations/customAttributes.test.ts index 97be77755..3b3cb90f4 100644 --- a/tests/wire/locations/customAttributes.test.ts +++ b/tests/wire/locations/customAttributes.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("CustomAttributes", () => { test("batchDelete", async () => { @@ -242,6 +240,83 @@ describe("CustomAttributes", () => { }); }); + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + custom_attributes: [ + { + key: "phone-number", + value: "+12223334444", + version: 1, + visibility: "VISIBILITY_READ_WRITE_VALUES", + updated_at: "2022-12-12T18:13:03.745Z", + created_at: "2022-12-12T18:13:03.745Z", + }, + { + key: "bestseller", + value: "hot cocoa", + version: 1, + visibility: "VISIBILITY_READ_WRITE_VALUES", + updated_at: "2022-12-12T19:27:57.975Z", + created_at: "2022-12-12T19:27:57.975Z", + }, + ], + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/locations/location_id/custom-attributes") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + customAttributes: [ + { + key: "phone-number", + value: "+12223334444", + version: 1, + visibility: "VISIBILITY_READ_WRITE_VALUES", + updatedAt: "2022-12-12T18:13:03.745Z", + createdAt: "2022-12-12T18:13:03.745Z", + }, + { + key: "bestseller", + value: "hot cocoa", + version: 1, + visibility: "VISIBILITY_READ_WRITE_VALUES", + updatedAt: "2022-12-12T19:27:57.975Z", + createdAt: "2022-12-12T19:27:57.975Z", + }, + ], + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.locations.customAttributes.list({ + locationId: "location_id", + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", + withDefinitions: true, + }); + + expect(expected.customAttributes).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customAttributes).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/locations/transactions.test.ts b/tests/wire/locations/transactions.test.ts index 1c73f947a..2397366f4 100644 --- a/tests/wire/locations/transactions.test.ts +++ b/tests/wire/locations/transactions.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Transactions", () => { test("list", async () => { diff --git a/tests/wire/loyalty.test.ts b/tests/wire/loyalty.test.ts index 95b8cbc48..3eff13547 100644 --- a/tests/wire/loyalty.test.ts +++ b/tests/wire/loyalty.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Loyalty", () => { test("searchEvents", async () => { diff --git a/tests/wire/loyalty/accounts.test.ts b/tests/wire/loyalty/accounts.test.ts index ff92ebe22..426f3524d 100644 --- a/tests/wire/loyalty/accounts.test.ts +++ b/tests/wire/loyalty/accounts.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Accounts", () => { test("create", async () => { diff --git a/tests/wire/loyalty/programs.test.ts b/tests/wire/loyalty/programs.test.ts index dbe16eb4d..0f4a1c4be 100644 --- a/tests/wire/loyalty/programs.test.ts +++ b/tests/wire/loyalty/programs.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Programs", () => { test("list", async () => { diff --git a/tests/wire/loyalty/programs/promotions.test.ts b/tests/wire/loyalty/programs/promotions.test.ts index 66a5a1ede..f47ccce93 100644 --- a/tests/wire/loyalty/programs/promotions.test.ts +++ b/tests/wire/loyalty/programs/promotions.test.ts @@ -1,11 +1,168 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../../mock-server/MockServerPool"; import { SquareClient } from "../../../../src/Client"; +import { mockServerPool } from "../../../mock-server/MockServerPool"; describe("Promotions", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + loyalty_promotions: [ + { + id: "loypromo_f0f9b849-725e-378d-b810-511237e07b67", + name: "Tuesday Happy Hour Promo", + incentive: { + type: "POINTS_MULTIPLIER", + points_multiplier_data: { points_multiplier: 3, multiplier: "3.000" }, + }, + available_time: { + start_date: "2022-08-16", + time_periods: [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT", + ], + }, + trigger_limit: { times: 1, interval: "DAY" }, + status: "ACTIVE", + created_at: "2022-08-16T08:38:54Z", + canceled_at: "canceled_at", + updated_at: "2022-08-16T08:38:54Z", + loyalty_program_id: "d619f755-2d17-41f3-990d-c04ecedd64dd", + qualifying_item_variation_ids: ["CJ3RYL56ITAKMD4VRCM7XERS", "AT3RYLR3TUA9C34VRCB7X5RR"], + qualifying_category_ids: ["qualifying_category_ids"], + }, + { + id: "loypromo_e696f057-2286-35ff-8108-132241328106", + name: "July Special", + incentive: { + type: "POINTS_MULTIPLIER", + points_multiplier_data: { points_multiplier: 2, multiplier: "2.000" }, + }, + available_time: { + start_date: "2022-07-01", + end_date: "2022-08-01", + time_periods: [ + "BEGIN:VEVENT\nDTSTART:20220704T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=MO\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220705T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220706T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=WE\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220707T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TH\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220701T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=FR\nEND:VEVENT", + ], + }, + trigger_limit: { times: 5, interval: "ALL_TIME" }, + status: "ENDED", + created_at: "2022-06-27T15:37:38Z", + canceled_at: "canceled_at", + updated_at: "2022-06-27T15:37:38Z", + loyalty_program_id: "d619f755-2d17-41f3-990d-c04ecedd64dd", + minimum_spend_amount_money: { amount: BigInt(2000), currency: "USD" }, + qualifying_item_variation_ids: ["qualifying_item_variation_ids"], + qualifying_category_ids: ["XTQPYLR3IIU9C44VRCB3XD12"], + }, + ], + cursor: "cursor", + }; + server + .mockEndpoint() + .get("/v2/loyalty/programs/program_id/promotions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + loyaltyPromotions: [ + { + id: "loypromo_f0f9b849-725e-378d-b810-511237e07b67", + name: "Tuesday Happy Hour Promo", + incentive: { + type: "POINTS_MULTIPLIER", + pointsMultiplierData: { + pointsMultiplier: 3, + multiplier: "3.000", + }, + }, + availableTime: { + startDate: "2022-08-16", + timePeriods: [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT", + ], + }, + triggerLimit: { + times: 1, + interval: "DAY", + }, + status: "ACTIVE", + createdAt: "2022-08-16T08:38:54Z", + canceledAt: "canceled_at", + updatedAt: "2022-08-16T08:38:54Z", + loyaltyProgramId: "d619f755-2d17-41f3-990d-c04ecedd64dd", + qualifyingItemVariationIds: ["CJ3RYL56ITAKMD4VRCM7XERS", "AT3RYLR3TUA9C34VRCB7X5RR"], + qualifyingCategoryIds: ["qualifying_category_ids"], + }, + { + id: "loypromo_e696f057-2286-35ff-8108-132241328106", + name: "July Special", + incentive: { + type: "POINTS_MULTIPLIER", + pointsMultiplierData: { + pointsMultiplier: 2, + multiplier: "2.000", + }, + }, + availableTime: { + startDate: "2022-07-01", + endDate: "2022-08-01", + timePeriods: [ + "BEGIN:VEVENT\nDTSTART:20220704T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=MO\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220705T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TU\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220706T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=WE\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220707T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TH\nEND:VEVENT", + "BEGIN:VEVENT\nDTSTART:20220701T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=FR\nEND:VEVENT", + ], + }, + triggerLimit: { + times: 5, + interval: "ALL_TIME", + }, + status: "ENDED", + createdAt: "2022-06-27T15:37:38Z", + canceledAt: "canceled_at", + updatedAt: "2022-06-27T15:37:38Z", + loyaltyProgramId: "d619f755-2d17-41f3-990d-c04ecedd64dd", + minimumSpendAmountMoney: { + amount: BigInt("2000"), + currency: "USD", + }, + qualifyingItemVariationIds: ["qualifying_item_variation_ids"], + qualifyingCategoryIds: ["XTQPYLR3IIU9C44VRCB3XD12"], + }, + ], + cursor: "cursor", + }; + const page = await client.loyalty.programs.promotions.list({ + programId: "program_id", + status: "ACTIVE", + cursor: "cursor", + limit: 1, + }); + + expect(expected.loyaltyPromotions).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.loyaltyPromotions).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/loyalty/rewards.test.ts b/tests/wire/loyalty/rewards.test.ts index b67d8c73b..e90ce4f6d 100644 --- a/tests/wire/loyalty/rewards.test.ts +++ b/tests/wire/loyalty/rewards.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Rewards", () => { test("create", async () => { diff --git a/tests/wire/merchants.test.ts b/tests/wire/merchants.test.ts index e7926916c..0df539b20 100644 --- a/tests/wire/merchants.test.ts +++ b/tests/wire/merchants.test.ts @@ -1,11 +1,64 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Merchants", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + merchant: [ + { + id: "DM7VKY8Q63GNP", + business_name: "Apple A Day", + country: "US", + language_code: "en-US", + currency: "USD", + status: "ACTIVE", + main_location_id: "9A65CGC72ZQG1", + created_at: "2021-12-10T19:25:52.484Z", + }, + ], + cursor: 1, + }; + server.mockEndpoint().get("/v2/merchants").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + merchant: [ + { + id: "DM7VKY8Q63GNP", + businessName: "Apple A Day", + country: "US", + languageCode: "en-US", + currency: "USD", + status: "ACTIVE", + mainLocationId: "9A65CGC72ZQG1", + createdAt: "2021-12-10T19:25:52.484Z", + }, + ], + cursor: 1, + }; + const page = await client.merchants.list({ + cursor: 1, + }); + + expect(expected.merchant).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.merchant).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/merchants/customAttributeDefinitions.test.ts b/tests/wire/merchants/customAttributeDefinitions.test.ts index 5123e9514..103a8d6e7 100644 --- a/tests/wire/merchants/customAttributeDefinitions.test.ts +++ b/tests/wire/merchants/customAttributeDefinitions.test.ts @@ -1,11 +1,100 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("CustomAttributeDefinitions", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + custom_attribute_definitions: [ + { + key: "has_seen_tutorial", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean", + }, + name: "NAME", + description: "Whether the merchant has seen the tutorial screen for using the app.", + visibility: "VISIBILITY_READ_WRITE_VALUES", + version: 1, + updated_at: "2023-05-05T16:50:21.832Z", + created_at: "2023-05-05T16:50:21.832Z", + }, + { + key: "alternative_seller_name", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + }, + name: "Alternative Merchant Name", + description: "This is the other name this merchant goes by.", + visibility: "VISIBILITY_READ_ONLY", + version: 4, + updated_at: "2023-05-05T10:17:52.341Z", + created_at: "2023-05-05T19:06:36.559Z", + }, + ], + cursor: "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/merchants/custom-attribute-definitions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + customAttributeDefinitions: [ + { + key: "has_seen_tutorial", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean", + }, + name: "NAME", + description: "Whether the merchant has seen the tutorial screen for using the app.", + visibility: "VISIBILITY_READ_WRITE_VALUES", + version: 1, + updatedAt: "2023-05-05T16:50:21.832Z", + createdAt: "2023-05-05T16:50:21.832Z", + }, + { + key: "alternative_seller_name", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", + }, + name: "Alternative Merchant Name", + description: "This is the other name this merchant goes by.", + visibility: "VISIBILITY_READ_ONLY", + version: 4, + updatedAt: "2023-05-05T10:17:52.341Z", + createdAt: "2023-05-05T19:06:36.559Z", + }, + ], + cursor: "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.merchants.customAttributeDefinitions.list({ + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", + }); + + expect(expected.customAttributeDefinitions).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customAttributeDefinitions).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/merchants/customAttributes.test.ts b/tests/wire/merchants/customAttributes.test.ts index d95f40c4c..4aa4982f3 100644 --- a/tests/wire/merchants/customAttributes.test.ts +++ b/tests/wire/merchants/customAttributes.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("CustomAttributes", () => { test("batchDelete", async () => { @@ -184,6 +182,83 @@ describe("CustomAttributes", () => { }); }); + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + custom_attributes: [ + { + key: "has_seen_tutorial", + value: true, + version: 1, + visibility: "VISIBILITY_READ_WRITE_VALUES", + updated_at: "2023-05-05T18:13:03.745Z", + created_at: "2023-05-05T18:13:03.745Z", + }, + { + key: "alternative_seller_name", + value: "Ultimate Sneaker Store", + version: 1, + visibility: "VISIBILITY_READ_ONLY", + updated_at: "2023-05-05T19:27:57.975Z", + created_at: "2023-05-05T19:27:57.975Z", + }, + ], + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/merchants/merchant_id/custom-attributes") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + customAttributes: [ + { + key: "has_seen_tutorial", + value: true, + version: 1, + visibility: "VISIBILITY_READ_WRITE_VALUES", + updatedAt: "2023-05-05T18:13:03.745Z", + createdAt: "2023-05-05T18:13:03.745Z", + }, + { + key: "alternative_seller_name", + value: "Ultimate Sneaker Store", + version: 1, + visibility: "VISIBILITY_READ_ONLY", + updatedAt: "2023-05-05T19:27:57.975Z", + createdAt: "2023-05-05T19:27:57.975Z", + }, + ], + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.merchants.customAttributes.list({ + merchantId: "merchant_id", + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", + withDefinitions: true, + }); + + expect(expected.customAttributes).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customAttributes).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/mobile.test.ts b/tests/wire/mobile.test.ts index 81f6b19d8..e16f166ee 100644 --- a/tests/wire/mobile.test.ts +++ b/tests/wire/mobile.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Mobile", () => { test("authorizationCode", async () => { diff --git a/tests/wire/oAuth.test.ts b/tests/wire/oAuth.test.ts index 3f2c98074..03f2838e8 100644 --- a/tests/wire/oAuth.test.ts +++ b/tests/wire/oAuth.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("OAuth", () => { test("revokeToken", async () => { diff --git a/tests/wire/orders.test.ts b/tests/wire/orders.test.ts index b1e897e29..5e106b783 100644 --- a/tests/wire/orders.test.ts +++ b/tests/wire/orders.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Orders", () => { test("create", async () => { diff --git a/tests/wire/orders/customAttributeDefinitions.test.ts b/tests/wire/orders/customAttributeDefinitions.test.ts index 0e45e7484..a96378111 100644 --- a/tests/wire/orders/customAttributeDefinitions.test.ts +++ b/tests/wire/orders/customAttributeDefinitions.test.ts @@ -1,11 +1,124 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("CustomAttributeDefinitions", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + custom_attribute_definitions: [ + { + key: "cover-count", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", + }, + name: "Cover count", + description: "The number of people seated at a table", + visibility: "VISIBILITY_READ_WRITE_VALUES", + version: 1, + updated_at: "2022-11-16T18:03:44.051Z", + created_at: "2022-11-16T18:03:44.051Z", + }, + { + key: "seat-number", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", + }, + name: "Seat number", + description: "The identifier for a particular seat", + visibility: "VISIBILITY_READ_WRITE_VALUES", + version: 1, + updated_at: "2022-11-16T18:04:32.059Z", + created_at: "2022-11-16T18:04:32.059Z", + }, + { + key: "table-number", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", + }, + name: "Table number", + description: "The identifier for a particular table", + visibility: "VISIBILITY_READ_WRITE_VALUES", + version: 1, + updated_at: "2022-11-16T18:04:21.912Z", + created_at: "2022-11-16T18:04:21.912Z", + }, + ], + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/orders/custom-attribute-definitions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + customAttributeDefinitions: [ + { + key: "cover-count", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", + }, + name: "Cover count", + description: "The number of people seated at a table", + visibility: "VISIBILITY_READ_WRITE_VALUES", + version: 1, + updatedAt: "2022-11-16T18:03:44.051Z", + createdAt: "2022-11-16T18:03:44.051Z", + }, + { + key: "seat-number", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", + }, + name: "Seat number", + description: "The identifier for a particular seat", + visibility: "VISIBILITY_READ_WRITE_VALUES", + version: 1, + updatedAt: "2022-11-16T18:04:32.059Z", + createdAt: "2022-11-16T18:04:32.059Z", + }, + { + key: "table-number", + schema: { + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", + }, + name: "Table number", + description: "The identifier for a particular table", + visibility: "VISIBILITY_READ_WRITE_VALUES", + version: 1, + updatedAt: "2022-11-16T18:04:21.912Z", + createdAt: "2022-11-16T18:04:21.912Z", + }, + ], + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.orders.customAttributeDefinitions.list({ + visibilityFilter: "ALL", + cursor: "cursor", + limit: 1, + }); + + expect(expected.customAttributeDefinitions).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customAttributeDefinitions).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/orders/customAttributes.test.ts b/tests/wire/orders/customAttributes.test.ts index 01c098e70..64efd26ec 100644 --- a/tests/wire/orders/customAttributes.test.ts +++ b/tests/wire/orders/customAttributes.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("CustomAttributes", () => { test("batchDelete", async () => { @@ -186,6 +184,67 @@ describe("CustomAttributes", () => { }); }); + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + custom_attributes: [ + { + key: "wayne-test-15", + value: "TEST", + version: 1, + visibility: "VISIBILITY_READ_WRITE_VALUES", + updated_at: "2022-11-10T17:31:36.111Z", + created_at: "2022-11-10T17:31:36.111Z", + }, + ], + cursor: "cursor", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/orders/order_id/custom-attributes") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + customAttributes: [ + { + key: "wayne-test-15", + value: "TEST", + version: 1, + visibility: "VISIBILITY_READ_WRITE_VALUES", + updatedAt: "2022-11-10T17:31:36.111Z", + createdAt: "2022-11-10T17:31:36.111Z", + }, + ], + cursor: "cursor", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.orders.customAttributes.list({ + orderId: "order_id", + visibilityFilter: "ALL", + cursor: "cursor", + limit: 1, + withDefinitions: true, + }); + + expect(expected.customAttributes).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.customAttributes).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/payments.test.ts b/tests/wire/payments.test.ts index 093a49de0..70013d4f6 100644 --- a/tests/wire/payments.test.ts +++ b/tests/wire/payments.test.ts @@ -1,11 +1,203 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Payments", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + payments: [ + { + id: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + created_at: "2021-10-13T19:34:33.524Z", + updated_at: "2021-10-13T19:34:37.261Z", + amount_money: { amount: BigInt(555), currency: "USD" }, + total_money: { amount: BigInt(555), currency: "USD" }, + approved_money: { amount: BigInt(555), currency: "USD" }, + processing_fee: [ + { + effective_at: "2021-10-13T21:34:35.000Z", + type: "INITIAL", + amount_money: { amount: BigInt(34), currency: "USD" }, + }, + ], + status: "COMPLETED", + delay_duration: "PT168H", + delay_action: "CANCEL", + delayed_until: "2021-10-20T19:34:33.524Z", + source_type: "CARD", + card_details: { + status: "CAPTURED", + card: { + card_brand: "VISA", + last_4: "1111", + exp_month: BigInt(11), + exp_year: BigInt(2022), + fingerprint: "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + card_type: "DEBIT", + prepaid_type: "NOT_PREPAID", + bin: "411111", + }, + entry_method: "KEYED", + cvv_status: "CVV_ACCEPTED", + avs_status: "AVS_ACCEPTED", + auth_result_code: "2Nkw7q", + statement_description: "SQ *EXAMPLE TEST GOSQ.C", + card_payment_timeline: { + authorized_at: "2021-10-13T19:34:33.680Z", + captured_at: "2021-10-13T19:34:34.340Z", + }, + }, + cash_details: { buyer_supplied_money: {} }, + external_details: { type: "type", source: "source" }, + location_id: "L88917AVBK2S5", + order_id: "d7eKah653Z579f3gVtjlxpSlmUcZY", + reference_id: "reference_id", + customer_id: "customer_id", + employee_id: "TMoK_ogh6rH1o4dV", + team_member_id: "TMoK_ogh6rH1o4dV", + refund_ids: ["refund_ids"], + terminal_checkout_id: "terminal_checkout_id", + buyer_email_address: "buyer_email_address", + note: "Test Note", + statement_description_identifier: "statement_description_identifier", + capabilities: ["capabilities"], + receipt_number: "bP9m", + receipt_url: "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + application_details: { + square_product: "VIRTUAL_TERMINAL", + application_id: "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", + }, + is_offline_payment: true, + version_token: "vguW2km0KpVCdAXZcNTZ438qg5LlVPTP4HO5OpiHNfa6o", + }, + ], + cursor: "cursor", + }; + server.mockEndpoint().get("/v2/payments").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + payments: [ + { + id: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + createdAt: "2021-10-13T19:34:33.524Z", + updatedAt: "2021-10-13T19:34:37.261Z", + amountMoney: { + amount: BigInt("555"), + currency: "USD", + }, + totalMoney: { + amount: BigInt("555"), + currency: "USD", + }, + approvedMoney: { + amount: BigInt("555"), + currency: "USD", + }, + processingFee: [ + { + effectiveAt: "2021-10-13T21:34:35.000Z", + type: "INITIAL", + amountMoney: { + amount: BigInt("34"), + currency: "USD", + }, + }, + ], + status: "COMPLETED", + delayDuration: "PT168H", + delayAction: "CANCEL", + delayedUntil: "2021-10-20T19:34:33.524Z", + sourceType: "CARD", + cardDetails: { + status: "CAPTURED", + card: { + cardBrand: "VISA", + last4: "1111", + expMonth: BigInt("11"), + expYear: BigInt("2022"), + fingerprint: "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", + cardType: "DEBIT", + prepaidType: "NOT_PREPAID", + bin: "411111", + }, + entryMethod: "KEYED", + cvvStatus: "CVV_ACCEPTED", + avsStatus: "AVS_ACCEPTED", + authResultCode: "2Nkw7q", + statementDescription: "SQ *EXAMPLE TEST GOSQ.C", + cardPaymentTimeline: { + authorizedAt: "2021-10-13T19:34:33.680Z", + capturedAt: "2021-10-13T19:34:34.340Z", + }, + }, + cashDetails: { + buyerSuppliedMoney: {}, + }, + externalDetails: { + type: "type", + source: "source", + }, + locationId: "L88917AVBK2S5", + orderId: "d7eKah653Z579f3gVtjlxpSlmUcZY", + referenceId: "reference_id", + customerId: "customer_id", + employeeId: "TMoK_ogh6rH1o4dV", + teamMemberId: "TMoK_ogh6rH1o4dV", + refundIds: ["refund_ids"], + terminalCheckoutId: "terminal_checkout_id", + buyerEmailAddress: "buyer_email_address", + note: "Test Note", + statementDescriptionIdentifier: "statement_description_identifier", + capabilities: ["capabilities"], + receiptNumber: "bP9m", + receiptUrl: "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + applicationDetails: { + squareProduct: "VIRTUAL_TERMINAL", + applicationId: "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", + }, + isOfflinePayment: true, + versionToken: "vguW2km0KpVCdAXZcNTZ438qg5LlVPTP4HO5OpiHNfa6o", + }, + ], + cursor: "cursor", + }; + const page = await client.payments.list({ + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "sort_order", + cursor: "cursor", + locationId: "location_id", + total: BigInt("1000000"), + last4: "last_4", + cardBrand: "card_brand", + limit: 1, + isOfflinePayment: true, + offlineBeginTime: "offline_begin_time", + offlineEndTime: "offline_end_time", + updatedAtBeginTime: "updated_at_begin_time", + updatedAtEndTime: "updated_at_end_time", + sortField: "CREATED_AT", + }); + + expect(expected.payments).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.payments).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/payouts.test.ts b/tests/wire/payouts.test.ts index 56332359f..044bf0ec6 100644 --- a/tests/wire/payouts.test.ts +++ b/tests/wire/payouts.test.ts @@ -1,11 +1,130 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Payouts", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + payouts: [ + { + id: "po_b345d2c7-90b3-4f0b-a2aa-df1def7f8afc", + status: "PAID", + location_id: "L88917AVBK2S5", + created_at: "2022-03-29T16:12:31Z", + updated_at: "2022-03-30T01:07:22.875Z", + amount_money: { amount: BigInt(6259) }, + destination: { type: "CARD", id: "ccof:ZPp3oedR3AeEUNd3z7" }, + version: 2, + type: "BATCH", + payout_fee: [ + { + amount_money: { amount: BigInt(95) }, + effective_at: "2022-03-29T16:12:31Z", + type: "TRANSFER_FEE", + }, + ], + arrival_date: "2022-03-29", + end_to_end_id: "L2100000005", + }, + { + id: "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", + status: "PAID", + location_id: "L88917AVBK2S5", + created_at: "2022-03-24T03:07:09Z", + updated_at: "2022-03-24T03:07:09Z", + amount_money: { amount: BigInt(-103) }, + destination: { type: "BANK_ACCOUNT", id: "bact:ZPp3oedR3AeEUNd3z7" }, + version: 1, + type: "BATCH", + payout_fee: [{}], + arrival_date: "2022-03-24", + end_to_end_id: "L2100000006", + }, + ], + cursor: "EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server.mockEndpoint().get("/v2/payouts").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + payouts: [ + { + id: "po_b345d2c7-90b3-4f0b-a2aa-df1def7f8afc", + status: "PAID", + locationId: "L88917AVBK2S5", + createdAt: "2022-03-29T16:12:31Z", + updatedAt: "2022-03-30T01:07:22.875Z", + amountMoney: { + amount: BigInt("6259"), + }, + destination: { + type: "CARD", + id: "ccof:ZPp3oedR3AeEUNd3z7", + }, + version: 2, + type: "BATCH", + payoutFee: [ + { + amountMoney: { + amount: BigInt("95"), + }, + effectiveAt: "2022-03-29T16:12:31Z", + type: "TRANSFER_FEE", + }, + ], + arrivalDate: "2022-03-29", + endToEndId: "L2100000005", + }, + { + id: "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", + status: "PAID", + locationId: "L88917AVBK2S5", + createdAt: "2022-03-24T03:07:09Z", + updatedAt: "2022-03-24T03:07:09Z", + amountMoney: { + amount: BigInt("-103"), + }, + destination: { + type: "BANK_ACCOUNT", + id: "bact:ZPp3oedR3AeEUNd3z7", + }, + version: 1, + type: "BATCH", + payoutFee: [{}], + arrivalDate: "2022-03-24", + endToEndId: "L2100000006", + }, + ], + cursor: "EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.payouts.list({ + locationId: "location_id", + status: "SENT", + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "DESC", + cursor: "cursor", + limit: 1, + }); + + expect(expected.payouts).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.payouts).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); @@ -69,4 +188,108 @@ describe("Payouts", () => { ], }); }); + + test("ListEntries", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + payout_entries: [ + { + id: "poe_ZQWcw41d0SGJS6IWd4cSi8mKHk", + payout_id: "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", + effective_at: "2021-12-14T23:31:49Z", + type: "REFUND", + gross_amount_money: { amount: BigInt(-50) }, + fee_amount_money: { amount: BigInt(-2) }, + net_amount_money: { amount: BigInt(-48) }, + type_refund_details: { + payment_id: "HVdG62HeMlti8YYf94oxrN", + refund_id: "HVdG62HeMlti8YYf94oxrN_dR8Nztxg7umf94oxrN12Ji5r2KW14FAY", + }, + }, + { + id: "poe_EibbY9Ob1d0SGJS6IWd4cSiSi6wkaPk", + payout_id: "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", + effective_at: "2021-12-14T23:31:49Z", + type: "CHARGE", + gross_amount_money: { amount: BigInt(100) }, + fee_amount_money: { amount: BigInt(19) }, + net_amount_money: { amount: BigInt(81) }, + type_charge_details: { payment_id: "HVdG62H5K3291d0SGJS6IWd4cSi8YY" }, + }, + ], + cursor: "TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/payouts/payout_id/payout-entries") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + payoutEntries: [ + { + id: "poe_ZQWcw41d0SGJS6IWd4cSi8mKHk", + payoutId: "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", + effectiveAt: "2021-12-14T23:31:49Z", + type: "REFUND", + grossAmountMoney: { + amount: BigInt("-50"), + }, + feeAmountMoney: { + amount: BigInt("-2"), + }, + netAmountMoney: { + amount: BigInt("-48"), + }, + typeRefundDetails: { + paymentId: "HVdG62HeMlti8YYf94oxrN", + refundId: "HVdG62HeMlti8YYf94oxrN_dR8Nztxg7umf94oxrN12Ji5r2KW14FAY", + }, + }, + { + id: "poe_EibbY9Ob1d0SGJS6IWd4cSiSi6wkaPk", + payoutId: "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", + effectiveAt: "2021-12-14T23:31:49Z", + type: "CHARGE", + grossAmountMoney: { + amount: BigInt("100"), + }, + feeAmountMoney: { + amount: BigInt("19"), + }, + netAmountMoney: { + amount: BigInt("81"), + }, + typeChargeDetails: { + paymentId: "HVdG62H5K3291d0SGJS6IWd4cSi8YY", + }, + }, + ], + cursor: "TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.payouts.listEntries({ + payoutId: "payout_id", + sortOrder: "DESC", + cursor: "cursor", + limit: 1, + }); + + expect(expected.payoutEntries).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.payoutEntries).toEqual(nextPage.data); + }); }); diff --git a/tests/wire/refunds.test.ts b/tests/wire/refunds.test.ts index 74800ac51..120f650db 100644 --- a/tests/wire/refunds.test.ts +++ b/tests/wire/refunds.test.ts @@ -1,11 +1,104 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Refunds", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + refunds: [ + { + id: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", + status: "COMPLETED", + location_id: "L88917AVBK2S5", + unlinked: true, + destination_type: "destination_type", + amount_money: { amount: BigInt(555), currency: "USD" }, + processing_fee: [ + { + effective_at: "2021-10-13T21:34:35.000Z", + type: "INITIAL", + amount_money: { amount: BigInt(-34), currency: "USD" }, + }, + ], + payment_id: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + order_id: "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", + reason: "Example Refund", + created_at: "2021-10-13T19:59:05.342Z", + updated_at: "2021-10-13T20:00:03.497Z", + team_member_id: "team_member_id", + terminal_refund_id: "terminal_refund_id", + }, + ], + cursor: "5evquW1YswHoT4EoyUhzMmTsCnsSXBU9U0WJ4FU4623nrMQcocH0RGU6Up1YkwfiMcF59ood58EBTEGgzMTGHQJpocic7ExOL0NtrTXCeWcv0UJIJNk8eXb", + }; + server.mockEndpoint().get("/v2/refunds").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + refunds: [ + { + id: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", + status: "COMPLETED", + locationId: "L88917AVBK2S5", + unlinked: true, + destinationType: "destination_type", + amountMoney: { + amount: BigInt("555"), + currency: "USD", + }, + processingFee: [ + { + effectiveAt: "2021-10-13T21:34:35.000Z", + type: "INITIAL", + amountMoney: { + amount: BigInt("-34"), + currency: "USD", + }, + }, + ], + paymentId: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", + orderId: "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", + reason: "Example Refund", + createdAt: "2021-10-13T19:59:05.342Z", + updatedAt: "2021-10-13T20:00:03.497Z", + teamMemberId: "team_member_id", + terminalRefundId: "terminal_refund_id", + }, + ], + cursor: "5evquW1YswHoT4EoyUhzMmTsCnsSXBU9U0WJ4FU4623nrMQcocH0RGU6Up1YkwfiMcF59ood58EBTEGgzMTGHQJpocic7ExOL0NtrTXCeWcv0UJIJNk8eXb", + }; + const page = await client.refunds.list({ + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "sort_order", + cursor: "cursor", + locationId: "location_id", + status: "status", + sourceType: "source_type", + limit: 1, + updatedAtBeginTime: "updated_at_begin_time", + updatedAtEndTime: "updated_at_end_time", + sortField: "CREATED_AT", + }); + + expect(expected.refunds).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.refunds).toEqual(nextPage.data); + }); + test("RefundPayment", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/sites.test.ts b/tests/wire/sites.test.ts index 0a668f8a9..02d6fd0b8 100644 --- a/tests/wire/sites.test.ts +++ b/tests/wire/sites.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Sites", () => { test("list", async () => { diff --git a/tests/wire/snippets.test.ts b/tests/wire/snippets.test.ts index d901571c6..576e1c9e0 100644 --- a/tests/wire/snippets.test.ts +++ b/tests/wire/snippets.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Snippets", () => { test("get", async () => { diff --git a/tests/wire/subscriptions.test.ts b/tests/wire/subscriptions.test.ts index 6672eff5d..30cef823e 100644 --- a/tests/wire/subscriptions.test.ts +++ b/tests/wire/subscriptions.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Subscriptions", () => { test("create", async () => { @@ -823,6 +821,169 @@ describe("Subscriptions", () => { }); }); + test("listEvents", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + subscription_events: [ + { + id: "06809161-3867-4598-8269-8aea5be4f9de", + subscription_event_type: "START_SUBSCRIPTION", + effective_date: "2020-04-24", + monthly_billing_anchor_date: 1, + phases: [{}], + plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", + }, + { + id: "f2736603-cd2e-47ec-8675-f815fff54f88", + subscription_event_type: "DEACTIVATE_SUBSCRIPTION", + effective_date: "2020-05-01", + monthly_billing_anchor_date: 1, + info: { + detail: "The customer with ID `V74BMG0GPS2KNCWJE1BTYJ37Y0` does not have a name on record.", + code: "CUSTOMER_NO_NAME", + }, + phases: [{}], + plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", + }, + { + id: "b426fc85-6859-450b-b0d0-fe3a5d1b565f", + subscription_event_type: "RESUME_SUBSCRIPTION", + effective_date: "2022-05-01", + monthly_billing_anchor_date: 1, + phases: [{}], + plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", + }, + { + id: "09f14de1-2f53-4dae-9091-49aa53f83d01", + subscription_event_type: "PAUSE_SUBSCRIPTION", + effective_date: "2022-09-01", + monthly_billing_anchor_date: 1, + phases: [{}], + plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", + }, + { + id: "f28a73ac-1a1b-4b0f-8eeb-709a72945776", + subscription_event_type: "RESUME_SUBSCRIPTION", + effective_date: "2022-12-01", + monthly_billing_anchor_date: 1, + phases: [{}], + plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", + }, + { + id: "1eee8790-472d-4efe-8c69-8ad84e9cefe0", + subscription_event_type: "PLAN_CHANGE", + effective_date: "2023-04-01", + monthly_billing_anchor_date: 1, + phases: [{}], + plan_variation_id: "02CD53CFA4d1498AFAD42", + }, + { + id: "a0c08083-5db0-4800-85c7-d398de4fbb6e", + subscription_event_type: "STOP_SUBSCRIPTION", + effective_date: "2023-06-21", + monthly_billing_anchor_date: 1, + phases: [{}], + plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", + }, + ], + cursor: "cursor", + }; + server + .mockEndpoint() + .get("/v2/subscriptions/subscription_id/events") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + subscriptionEvents: [ + { + id: "06809161-3867-4598-8269-8aea5be4f9de", + subscriptionEventType: "START_SUBSCRIPTION", + effectiveDate: "2020-04-24", + monthlyBillingAnchorDate: 1, + phases: [{}], + planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", + }, + { + id: "f2736603-cd2e-47ec-8675-f815fff54f88", + subscriptionEventType: "DEACTIVATE_SUBSCRIPTION", + effectiveDate: "2020-05-01", + monthlyBillingAnchorDate: 1, + info: { + detail: "The customer with ID `V74BMG0GPS2KNCWJE1BTYJ37Y0` does not have a name on record.", + code: "CUSTOMER_NO_NAME", + }, + phases: [{}], + planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", + }, + { + id: "b426fc85-6859-450b-b0d0-fe3a5d1b565f", + subscriptionEventType: "RESUME_SUBSCRIPTION", + effectiveDate: "2022-05-01", + monthlyBillingAnchorDate: 1, + phases: [{}], + planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", + }, + { + id: "09f14de1-2f53-4dae-9091-49aa53f83d01", + subscriptionEventType: "PAUSE_SUBSCRIPTION", + effectiveDate: "2022-09-01", + monthlyBillingAnchorDate: 1, + phases: [{}], + planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", + }, + { + id: "f28a73ac-1a1b-4b0f-8eeb-709a72945776", + subscriptionEventType: "RESUME_SUBSCRIPTION", + effectiveDate: "2022-12-01", + monthlyBillingAnchorDate: 1, + phases: [{}], + planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", + }, + { + id: "1eee8790-472d-4efe-8c69-8ad84e9cefe0", + subscriptionEventType: "PLAN_CHANGE", + effectiveDate: "2023-04-01", + monthlyBillingAnchorDate: 1, + phases: [{}], + planVariationId: "02CD53CFA4d1498AFAD42", + }, + { + id: "a0c08083-5db0-4800-85c7-d398de4fbb6e", + subscriptionEventType: "STOP_SUBSCRIPTION", + effectiveDate: "2023-06-21", + monthlyBillingAnchorDate: 1, + phases: [{}], + planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", + }, + ], + cursor: "cursor", + }; + const page = await client.subscriptions.listEvents({ + subscriptionId: "subscription_id", + cursor: "cursor", + limit: 1, + }); + + expect(expected.subscriptionEvents).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.subscriptionEvents).toEqual(nextPage.data); + }); + test("pause", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/team.test.ts b/tests/wire/team.test.ts index 284fee613..6ef2337a7 100644 --- a/tests/wire/team.test.ts +++ b/tests/wire/team.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Team", () => { test("ListJobs", async () => { diff --git a/tests/wire/teamMembers.test.ts b/tests/wire/teamMembers.test.ts index 8133f3ebb..1f26a7751 100644 --- a/tests/wire/teamMembers.test.ts +++ b/tests/wire/teamMembers.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("TeamMembers", () => { test("create", async () => { diff --git a/tests/wire/teamMembers/wageSetting.test.ts b/tests/wire/teamMembers/wageSetting.test.ts index 84d31a474..3e48575b5 100644 --- a/tests/wire/teamMembers/wageSetting.test.ts +++ b/tests/wire/teamMembers/wageSetting.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("WageSetting", () => { test("get", async () => { diff --git a/tests/wire/terminal.test.ts b/tests/wire/terminal.test.ts index 1b051a6c9..2d355b2b8 100644 --- a/tests/wire/terminal.test.ts +++ b/tests/wire/terminal.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Terminal", () => { test("DismissTerminalAction", async () => { diff --git a/tests/wire/terminal/actions.test.ts b/tests/wire/terminal/actions.test.ts index 13989967a..6a02dfc05 100644 --- a/tests/wire/terminal/actions.test.ts +++ b/tests/wire/terminal/actions.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Actions", () => { test("create", async () => { diff --git a/tests/wire/terminal/checkouts.test.ts b/tests/wire/terminal/checkouts.test.ts index 39ba81c5b..de6006046 100644 --- a/tests/wire/terminal/checkouts.test.ts +++ b/tests/wire/terminal/checkouts.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Checkouts", () => { test("create", async () => { diff --git a/tests/wire/terminal/refunds.test.ts b/tests/wire/terminal/refunds.test.ts index c21c4f0fe..fee64419b 100644 --- a/tests/wire/terminal/refunds.test.ts +++ b/tests/wire/terminal/refunds.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Refunds", () => { test("create", async () => { diff --git a/tests/wire/transferOrders.test.ts b/tests/wire/transferOrders.test.ts index c0bfc35d0..6c62b531e 100644 --- a/tests/wire/transferOrders.test.ts +++ b/tests/wire/transferOrders.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("TransferOrders", () => { test("create", async () => { @@ -137,6 +135,171 @@ describe("TransferOrders", () => { }); }); + test("search", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + const rawRequestBody = { + query: { + filter: { + source_location_ids: ["EXAMPLE_SOURCE_LOCATION_ID_123"], + destination_location_ids: ["EXAMPLE_DEST_LOCATION_ID_456"], + statuses: ["STARTED", "PARTIALLY_RECEIVED"], + }, + sort: { field: "UPDATED_AT", order: "DESC" }, + }, + cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", + limit: 10, + }; + const rawResponseBody = { + transfer_orders: [ + { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", + destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", + status: "STARTED", + created_at: "2025-01-15T10:30:00Z", + updated_at: "2025-01-15T10:32:00Z", + expected_at: "2025-11-09T05:00:00Z", + completed_at: "completed_at", + notes: "Inventory rebalance between stores", + tracking_number: "TRACK123456789", + created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", + line_items: [ + { + uid: "1", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", + quantity_ordered: "5", + quantity_pending: "5", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "0", + }, + ], + version: BigInt(1753118664873), + }, + { + id: "EXAMPLE_TRANSFER_ORDER_ID_456", + source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", + destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", + status: "PARTIALLY_RECEIVED", + created_at: "2025-01-14T14:20:00Z", + updated_at: "2025-01-15T09:45:00Z", + expected_at: "2025-11-08T12:00:00Z", + completed_at: "completed_at", + notes: "Seasonal stock transfer", + tracking_number: "tracking_number", + created_by_team_member_id: "created_by_team_member_id", + line_items: [ + { + uid: "1", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", + quantity_ordered: "10", + quantity_pending: "3", + quantity_received: "7", + quantity_damaged: "0", + quantity_canceled: "0", + }, + ], + version: BigInt(1753115540123), + }, + ], + cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTU1NDBfMTIzfQ==", + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .post("/v2/transfer-orders/search") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + transferOrders: [ + { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + status: "STARTED", + createdAt: "2025-01-15T10:30:00Z", + updatedAt: "2025-01-15T10:32:00Z", + expectedAt: "2025-11-09T05:00:00Z", + completedAt: "completed_at", + notes: "Inventory rebalance between stores", + trackingNumber: "TRACK123456789", + createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + lineItems: [ + { + uid: "1", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + quantityOrdered: "5", + quantityPending: "5", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "0", + }, + ], + version: BigInt("1753118664873"), + }, + { + id: "EXAMPLE_TRANSFER_ORDER_ID_456", + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + status: "PARTIALLY_RECEIVED", + createdAt: "2025-01-14T14:20:00Z", + updatedAt: "2025-01-15T09:45:00Z", + expectedAt: "2025-11-08T12:00:00Z", + completedAt: "completed_at", + notes: "Seasonal stock transfer", + trackingNumber: "tracking_number", + createdByTeamMemberId: "created_by_team_member_id", + lineItems: [ + { + uid: "1", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", + quantityOrdered: "10", + quantityPending: "3", + quantityReceived: "7", + quantityDamaged: "0", + quantityCanceled: "0", + }, + ], + version: BigInt("1753115540123"), + }, + ], + cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTU1NDBfMTIzfQ==", + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }; + const page = await client.transferOrders.search({ + query: { + filter: { + sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], + destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], + statuses: ["STARTED", "PARTIALLY_RECEIVED"], + }, + sort: { + field: "UPDATED_AT", + order: "DESC", + }, + }, + cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", + limit: 10, + }); + + expect(expected.transferOrders).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.transferOrders).toEqual(nextPage.data); + }); + test("get", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tests/wire/v1Transactions.test.ts b/tests/wire/v1Transactions.test.ts index 0c9a2b361..9e42f96ba 100644 --- a/tests/wire/v1Transactions.test.ts +++ b/tests/wire/v1Transactions.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("V1Transactions", () => { test("V1ListOrders", async () => { diff --git a/tests/wire/vendors.test.ts b/tests/wire/vendors.test.ts index 13f6fcd36..cac94094b 100644 --- a/tests/wire/vendors.test.ts +++ b/tests/wire/vendors.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../mock-server/MockServerPool"; import { SquareClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; describe("Vendors", () => { test("batchCreate", async () => { diff --git a/tests/wire/webhooks/eventTypes.test.ts b/tests/wire/webhooks/eventTypes.test.ts index 440ec0805..c86e97f01 100644 --- a/tests/wire/webhooks/eventTypes.test.ts +++ b/tests/wire/webhooks/eventTypes.test.ts @@ -1,9 +1,7 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("EventTypes", () => { test("list", async () => { diff --git a/tests/wire/webhooks/subscriptions.test.ts b/tests/wire/webhooks/subscriptions.test.ts index 79f019eab..5dfc58b19 100644 --- a/tests/wire/webhooks/subscriptions.test.ts +++ b/tests/wire/webhooks/subscriptions.test.ts @@ -1,11 +1,75 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ +// This file was auto-generated by Fern from our API Definition. -import { mockServerPool } from "../../mock-server/MockServerPool"; import { SquareClient } from "../../../src/Client"; +import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Subscriptions", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + subscriptions: [ + { + id: "wbhk_b35f6b3145074cf9ad513610786c19d5", + name: "Example Webhook Subscription", + enabled: true, + event_types: ["payment.created", "payment.updated"], + notification_url: "https://example-webhook-url.com", + api_version: "2021-12-15", + signature_key: "signature_key", + created_at: "2022-01-10 23:29:48 +0000 UTC", + updated_at: "2022-01-10 23:29:48 +0000 UTC", + }, + ], + cursor: "cursor", + }; + server + .mockEndpoint() + .get("/v2/webhooks/subscriptions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + subscriptions: [ + { + id: "wbhk_b35f6b3145074cf9ad513610786c19d5", + name: "Example Webhook Subscription", + enabled: true, + eventTypes: ["payment.created", "payment.updated"], + notificationUrl: "https://example-webhook-url.com", + apiVersion: "2021-12-15", + signatureKey: "signature_key", + createdAt: "2022-01-10 23:29:48 +0000 UTC", + updatedAt: "2022-01-10 23:29:48 +0000 UTC", + }, + ], + cursor: "cursor", + }; + const page = await client.webhooks.subscriptions.list({ + cursor: "cursor", + includeDisabled: true, + sortOrder: "DESC", + limit: 1, + }); + + expect(expected.subscriptions).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.subscriptions).toEqual(nextPage.data); + }); + test("create", async () => { const server = mockServerPool.createServer(); const client = new SquareClient({ token: "test", environment: server.baseUrl }); diff --git a/tsconfig.json b/tsconfig.json index 1ec87dd77..0140f4117 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,8 @@ "outDir": "dist", "rootDir": "src", "baseUrl": "src", + "isolatedModules": true, + "isolatedDeclarations": true, "module": "CommonJS" }, "include": ["src"], diff --git a/yarn.lock b/yarn.lock index 4a151b83a..75c84789a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -377,6 +377,74 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@biomejs/biome@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-2.2.5.tgz#291df1137404843537dd50eaa0174c12c0681d82" + integrity sha512-zcIi+163Rc3HtyHbEO7CjeHq8DjQRs40HsGbW6vx2WI0tg8mYQOPouhvHSyEnCBAorfYNnKdR64/IxO7xQ5faw== + optionalDependencies: + "@biomejs/cli-darwin-arm64" "2.2.5" + "@biomejs/cli-darwin-x64" "2.2.5" + "@biomejs/cli-linux-arm64" "2.2.5" + "@biomejs/cli-linux-arm64-musl" "2.2.5" + "@biomejs/cli-linux-x64" "2.2.5" + "@biomejs/cli-linux-x64-musl" "2.2.5" + "@biomejs/cli-win32-arm64" "2.2.5" + "@biomejs/cli-win32-x64" "2.2.5" + +"@biomejs/cli-darwin-arm64@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.2.5.tgz#2a181f4b0daef11e24b96eaac9dd7866125b2524" + integrity sha512-MYT+nZ38wEIWVcL5xLyOhYQQ7nlWD0b/4mgATW2c8dvq7R4OQjt/XGXFkXrmtWmQofaIM14L7V8qIz/M+bx5QQ== + +"@biomejs/cli-darwin-x64@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.2.5.tgz#0ecfa984d8b76dda4771b95cf1d796d79c257a18" + integrity sha512-FLIEl73fv0R7dI10EnEiZLw+IMz3mWLnF95ASDI0kbx6DDLJjWxE5JxxBfmG+udz1hIDd3fr5wsuP7nwuTRdAg== + +"@biomejs/cli-linux-arm64-musl@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.5.tgz#264e632302e61c0b34c13d3d92b6f9b8fb5e1e97" + integrity sha512-5Ov2wgAFwqDvQiESnu7b9ufD1faRa+40uwrohgBopeY84El2TnBDoMNXx6iuQdreoFGjwW8vH6k68G21EpNERw== + +"@biomejs/cli-linux-arm64@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.2.5.tgz#acc71fb62fb6d022766042fb004da47439bd1b24" + integrity sha512-5DjiiDfHqGgR2MS9D+AZ8kOfrzTGqLKywn8hoXpXXlJXIECGQ32t+gt/uiS2XyGBM2XQhR6ztUvbjZWeccFMoQ== + +"@biomejs/cli-linux-x64-musl@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.5.tgz#03df0646ed4e26631ef3e1fcb4fc527e45345b86" + integrity sha512-AVqLCDb/6K7aPNIcxHaTQj01sl1m989CJIQFQEaiQkGr2EQwyOpaATJ473h+nXDUuAcREhccfRpe/tu+0wu0eQ== + +"@biomejs/cli-linux-x64@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-2.2.5.tgz#2740f260da9518554219ed07729ec0fdd8104135" + integrity sha512-fq9meKm1AEXeAWan3uCg6XSP5ObA6F/Ovm89TwaMiy1DNIwdgxPkNwxlXJX8iM6oRbFysYeGnT0OG8diCWb9ew== + +"@biomejs/cli-win32-arm64@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.2.5.tgz#75db880f3bb6c481435f0f602093b1ced9b2327e" + integrity sha512-xaOIad4wBambwJa6mdp1FigYSIF9i7PCqRbvBqtIi9y29QtPVQ13sDGtUnsRoe6SjL10auMzQ6YAe+B3RpZXVg== + +"@biomejs/cli-win32-x64@2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-2.2.5.tgz#f0f3a85c5fb7954661fe454ef2df998205df1570" + integrity sha512-F/jhuXCssPFAuciMhHKk00xnCAxJRS/pUzVfXYmOMUp//XW7mO6QeCjsjvnm8L4AO/dG2VOB0O+fJPiJ2uXtIw== + +"@bundled-es-modules/cookie@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz#b41376af6a06b3e32a15241d927b840a9b4de507" + integrity sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw== + dependencies: + cookie "^0.7.2" + +"@bundled-es-modules/statuses@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz#761d10f44e51a94902c4da48675b71a76cc98872" + integrity sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg== + dependencies: + statuses "^2.0.1" + "@inquirer/ansi@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@inquirer/ansi/-/ansi-1.0.1.tgz#994f7dd16a00c547a7b110e04bf4f4eca1857929" @@ -689,7 +757,7 @@ is-node-process "^1.2.0" outvariant "^1.4.0" -"@open-draft/until@^2.0.0": +"@open-draft/until@^2.0.0", "@open-draft/until@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-2.1.0.tgz#0acf32f470af2ceaf47f095cdecd40d68666efda" integrity sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg== @@ -751,6 +819,11 @@ dependencies: "@babel/types" "^7.28.2" +"@types/cookie@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5" + integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA== + "@types/eslint-scope@^3.7.7": version "3.7.7" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" @@ -829,9 +902,9 @@ form-data "^4.0.4" "@types/node@*": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-24.8.0.tgz#a98a689a687c31d9c553f603961230333e4b5230" - integrity sha512-5x08bUtU8hfboMTrJ7mEO4CpepS9yBwAqcL52y86SWNmbPX8LVbNs3EP4cNrIZgdjk2NAlP2ahNihozpoZIxSg== + version "24.8.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.8.1.tgz#74c8ae00b045a0a351f2837ec00f25dfed0053be" + integrity sha512-alv65KGRadQVfVcG69MuB4IzdYVpRwMG/mq8KWOaoOdyY617P5ivaDiMCGOFDWD2sAn5Q0mR3mRtUOgm99hL9Q== dependencies: undici-types "~7.14.0" @@ -1383,10 +1456,10 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -cookie@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-1.0.2.tgz#27360701532116bd3f1f9416929d176afe1e4610" - integrity sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA== +cookie@^0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" + integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== create-jest@^29.7.0: version "29.7.0" @@ -2612,16 +2685,19 @@ ms@^2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -msw@^2.8.4: - version "2.11.5" - resolved "https://registry.yarnpkg.com/msw/-/msw-2.11.5.tgz#69572ab70a60b5d72c8b6aed344595a7604241c0" - integrity sha512-atFI4GjKSJComxcigz273honh8h4j5zzpk5kwG4tGm0TPcYne6bqmVrufeRll6auBeouIkXqZYXxVbWSWxM3RA== +msw@2.11.2: + version "2.11.2" + resolved "https://registry.yarnpkg.com/msw/-/msw-2.11.2.tgz#622d83855f456a5f93b1528f6eb6f4c0114623c3" + integrity sha512-MI54hLCsrMwiflkcqlgYYNJJddY5/+S0SnONvhv1owOplvqohKSQyGejpNdUGyCwgs4IH7PqaNbPw/sKOEze9Q== dependencies: + "@bundled-es-modules/cookie" "^2.0.1" + "@bundled-es-modules/statuses" "^1.0.1" "@inquirer/confirm" "^5.0.0" "@mswjs/interceptors" "^0.39.1" "@open-draft/deferred-promise" "^2.2.0" + "@open-draft/until" "^2.1.0" + "@types/cookie" "^0.6.0" "@types/statuses" "^2.0.4" - cookie "^1.0.2" graphql "^16.8.1" headers-polyfill "^4.0.2" is-node-process "^1.2.0" @@ -2629,11 +2705,9 @@ msw@^2.8.4: path-to-regexp "^6.3.0" picocolors "^1.1.1" rettime "^0.7.0" - statuses "^2.0.2" strict-event-emitter "^0.5.1" tough-cookie "^6.0.0" type-fest "^4.26.1" - until-async "^3.0.2" yargs "^17.7.2" mute-stream@^2.0.0: @@ -2794,11 +2868,6 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -prettier@^3.4.2: - version "3.6.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393" - integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ== - pretty-format@^29.0.0, pretty-format@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" @@ -3043,7 +3112,7 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -statuses@^2.0.2: +statuses@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.2.tgz#8f75eecef765b5e1cfcdc080da59409ed424e382" integrity sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw== @@ -3287,11 +3356,6 @@ universalify@^0.2.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -until-async@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/until-async/-/until-async-3.0.2.tgz#447f1531fdd7bb2b4c7a98869bdb1a4c2a23865f" - integrity sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw== - update-browserslist-db@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz#348377dd245216f9e7060ff50b15a1b740b75420"